-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
build(nix): use nix-cargo-integration, make shell.nix use flake devshell #180
Conversation
7c2bfda
to
8a28608
Compare
The project is fairly stable now, I don't expect any big changes or anything (if flakes stay as-is that is), mostly only bug fixes and new features. Next thing I'm working on is adding more documentation to the code. I try to fix issues that pop up as fast as I can since I myself use it on many projects (or other projects). Hope that answers it :D |
Let's see what @archseer says. It looks okay to me since it is able to make use of cachix. |
I'd like to see what @nrdxp and @gytis-ivaskevicius think about it, I tend to avoid wrappers since it's one less layer to go wrong. That said, it's my first Rust flake so I'm open to accepting it if other Nix users agree :) |
Here are my thoughts. I am personally not particularly supportive of this PR
What does this gain us? It adds more lines than it removes
Very nice, but I think this would be a nicer solution https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md#importing-a-cargolock-file-importing-a-cargolock-file
👍 |
I made
That does not support automatic git vendoring (ie. using the revision hash in the lockfile and not needing a seperate hash) while (patched) crate2nix can do that (which is what nix-cargo-integration uses). It also does not do what crate2nix does, which is compiling each crate as a seperate derivation, which means it will have much better caching. Although this does need a more recent Nix version, as it can use attributes like |
I have not tried it yet but I thought that this should take care of git stuff: cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"finalfusion-0.14.0" = "17f4bsdzpcshwh74w5z119xjy2if6l2wgyjy56v621skr2r8y904";
};
} |
Yeah that's what I meant, with |
I see, makes sense. Tho someone should really look into it and add support to nixpkgs. Makes me wonder why is it not there already 🤔 |
Do you have a solid plan for submodule support? If so, this may be a better solution than mine #190 |
Same idea really. There really isn't a good solution since you can't either access EDIT: sorry, accidentally closed |
8ec3813
to
efa5081
Compare
OK, this builds now. Would like to hear if it works for everyone else too. |
09ff97b
to
ec99b39
Compare
ec99b39
to
2a627cf
Compare
does this still build from github, or does it now work locally? |
2a627cf
to
dc35933
Compare
Not right now, but i'm trying something that is much less hackier than symlinkJoin, so we might get local builds ;) |
dc35933
to
24a6c55
Compare
Alright, just pushed something that should make it better. So now at least the local code will be used, submodules will still be taken from the git. |
It looks like this can be fixed conceptually upstream. I tested the patch mentioned NixOS/nix#4423 (comment), and it actually built with Additonally, this type of solution seems to be endorsed by the nix BDFL himself NixOS/nix#4423 (comment). So there is hope for an upstream solution. I'm looking into myself, but I'm not much of a C++ guru so I can't promise anything. |
fa51916
to
0bdbcf0
Compare
0bdbcf0
to
6d84cd9
Compare
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 merging this for now since it makes shell.nix
work on non-flake installs, we'll re-evaluate if it's necessary to keep later.
This does a few changes: