-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix build on nix 2.17 #94
Conversation
@@ -98,6 +110,11 @@ impl CommandExt for Command { | |||
} | |||
} | |||
|
|||
#[derive(Debug, Deserialize)] | |||
struct DumpLanguage { | |||
builtins: DumpBuiltins, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new CLI splits all builtins into builtins
for functions and constants
for values, and they have different structures. We should parse both of them with their kind information to replace the hard-coded names here.
I think we can move the Command
call to dump*
and the parsing code into a individual function. So the huge map_or_else
above can also be refactored into an early return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm honestly not sure what you mean.
I've compared the old __dump-builtins
to __dump-language
's builtins
property, and there's two differences - the new CLI has 4 more builtins - findFile
, fromTOML
, getContext
, hasContext
, and every value has an experimental-feature
key under it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constants like true
and storeDir
are documented under the new constants
property, not builtins
property, while they are not documented before. They should also be included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. I'm not that proficient in Rust, so I might need some help with that...
Co-authored-by: oxalica <[email protected]>
I merged this now since it should have no regression. I'll handle the new |
Closes #93
Should be fully backwards compatible.
Tested both on nix master 2.17 prerelease and nix 2.16 - builds fine on both!