-
Notifications
You must be signed in to change notification settings - Fork 271
Nix refactor #1285
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
Nix refactor #1285
Conversation
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.
Hey @RossSmyth, thanks for this PR, but we don't really have the capacity to review nix improvements. If you can finish this up so it's not a draft and it looks generally okay, we can try to merge it, but we won't be able to help or review it with any depth.
Sounds good. I've been slammed at work so I've not been able to get back to this quite yet. |
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.
Thanks for improving the Nix expressions!
python3 | ||
}: | ||
let | ||
# Something changed in nixpkgs since this snapshot, |
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.
We can use a newer snapshot if the derivation is changed to only build c2rust
:
cargoBuildFlags = [
"-p"
"c2rust"
];
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.
What is the MSRV of c2rust? The whole point is tracking what the repo does.
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.
At the moment, 1.65 (the pinned nightly). Not sure if it works on any older versions.
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.
Yes, I realize that. cydparser said that if you only build c2rust you can "use a newer snapshot". I'm unsure how, so I am asking what they mean.
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.
AFAICT this is needed to be able to build c2rust from the devshell
And route all instantiations through the overlay.
The tests still fail though
|
@RossSmyth oh shoot, I didn't see this. I made a PR to fix up the nix build as well, didn't mean to step on any toes! I did manage to get all of the tests passing under nix as well, if that's helpful for you. |
@RossSmyth / @kkysen I'm wondering if you think it makes sense to merge #1341 first, as it's ready to go, and then the additional refactoring in this PR can be merged on top of it later? The shell.nix / README changes / flake checks / CI changes / general refactoring here are valuable, but maybe it makes sense to stage it so we can have a working nix package / shell now? I'm happy to help with merging these changes with mine after the fact! Thanks! |
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.
@RossSmyth / @kkysen I'm wondering if you think it makes sense to merge #1341 first, as it's ready to go, and then the additional refactoring in this PR can be merged on top of it later?
The shell.nix / README changes / flake checks / CI changes / general refactoring here are valuable, but maybe it makes sense to stage it so we can have a working nix package / shell now? I'm happy to help with merging these changes with mine after the fact!
I don't really have a strong opinion either way. I think whichever one is ready first can merge first, unless it's much more difficult to rebase one of them or something like that.
I'd say merge the other PR, but if I ever come back around to this (I am very busy with work and life and unfortunately this is low priority for me) I'll clean it up as it isn't quite idiomatic nix. |
Hello,
This nix devshell was a bit jank. I cleaned it up, and also added a nix derivation.
This is fine because the version in nixpkgs is the same version that was being fetched via git anyways.
This provides things that c2rust needs in its environment to run, such as setting up PATH and other things.
This is basically the same as before. It is hooked up to the flake too.
This allows to check that it builds when updating and other things.
This is very useful, because it allows for people to directly import c2rust as an overlay into their NixOS config, home-manager config, or devshells.
I am unsure what sort of scope the project would like for Nix integration. This is basically the minimum of being able to build it on Nix easily. There are other things that could be done:
There is a TODO for a test failures:
c2rust/c2rust-analyze/tests/analyze.rs
Line 47 in 2120093
And various filecheck failures. It also looks like there is some sort of race happening on stderr output?
filecheck.log