Skip to content
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

Merged
merged 2 commits into from
Jul 6, 2023
Merged

fix: fix build on nix 2.17 #94

merged 2 commits into from
Jul 6, 2023

Conversation

n3oney
Copy link
Contributor

@n3oney n3oney commented Jul 1, 2023

Closes #93

Should be fully backwards compatible.

Tested both on nix master 2.17 prerelease and nix 2.16 - builds fine on both!

crates/builtin/build.rs Outdated Show resolved Hide resolved
crates/builtin/build.rs Outdated Show resolved Hide resolved
@@ -98,6 +110,11 @@ impl CommandExt for Command {
}
}

#[derive(Debug, Deserialize)]
struct DumpLanguage {
builtins: DumpBuiltins,
Copy link
Owner

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.

Copy link
Contributor Author

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.

Copy link
Owner

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.

Copy link
Contributor Author

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...

@n3oney n3oney changed the title fix: fix build on nix 2.7 fix: fix build on nix 2.17 Jul 2, 2023
@oxalica oxalica merged commit a5422a2 into oxalica:main Jul 6, 2023
@oxalica
Copy link
Owner

oxalica commented Jul 6, 2023

I merged this now since it should have no regression. I'll handle the new constants map maybe later this week.

oxalica added a commit that referenced this pull request Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not building with latest nix
2 participants