You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
buildRustCrate should support nix-shell features #37945
Nix-build sets up the environment by downloading all the buildInputs/propagatedBuildInputs, and then runs all the phases, while nix-shell only sets up the environment.
Cargo unifies config by walking up the file tree looking for .cargo/config and ends with $CARGO_HOME/config (where $CARGO_HOME defaults to $HOME/.cargo). The shell environment could specify CARGO_HOME as pointing at a temporary directory that specifies the desired config. The only practical difference here is that a local .cargo/config in a parent directory could potentially override the values specified in the Nix-provided config (though not one in the current directory, as if the current directory already specifies the keys that Nix is adding, then the Nix build would fail as well due to duplicate keys as it appends its configuration onto any existing .cargo/config file).
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
Search for maintainers and people that previously touched the related code and @ mention them in a comment.
The main question is where the right place for this functionality is. Making progress in nixpkgs is more challenging. @andir is working on shell support in crate2nix: nix-community/crate2nix#135
Activity
vitiral commentedon Mar 27, 2018
Quote from @P-E-Meunier
Mic92 commentedon Apr 6, 2018
I am not sure how cargo can pick up downloaded crates from environment variables. In
buildRustCratea .cargo/config file is used.lilyball commentedon May 19, 2019
Cargo unifies config by walking up the file tree looking for
.cargo/configand ends with$CARGO_HOME/config(where$CARGO_HOMEdefaults to$HOME/.cargo). The shell environment could specifyCARGO_HOMEas pointing at a temporary directory that specifies the desired config. The only practical difference here is that a local.cargo/configin a parent directory could potentially override the values specified in the Nix-provided config (though not one in the current directory, as if the current directory already specifies the keys that Nix is adding, then the Nix build would fail as well due to duplicate keys as it appends its configuration onto any existing.cargo/configfile).haslersn commentedon Aug 14, 2019
Currently it seems like
nix-shellworks withbuildRustPackage. Can somebody confirm? Does that solve this issue?stale commentedon Jun 2, 2020
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
Mic92 commentedon Jun 2, 2020
Would this be interesting for crate2nix? https://github.com/kolloch/crate2nix cc @kolloch
kolloch commentedon Jun 2, 2020
The main question is where the right place for this functionality is. Making progress in nixpkgs is more challenging. @andir is working on shell support in crate2nix: nix-community/crate2nix#135
stale commentedon Nov 29, 2020
I marked this as stale due to inactivity. → More info
Mic92 commentedon Nov 29, 2020
I think this is still relevant.
stale commentedon Jun 3, 2021
I marked this as stale due to inactivity. → More info