-
Notifications
You must be signed in to change notification settings - Fork 94
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
Git sources of child crates are not properly used #33
Labels
Milestone
Comments
Thank you for the excellent description of the problem and the analysis! I will look if I have enough info in the |
Solving #53 might also solve this. |
kolloch
added a commit
to kolloch/nixpkgs
that referenced
this issue
Mar 9, 2020
…sub directories This is what cargo does for git repositories. See related issues: * nix-community/crate2nix#53 * nix-community/crate2nix#33
10 tasks
kolloch
added a commit
that referenced
this issue
Mar 11, 2020
Cargo does this for git repositories as well: rust-lang/cargo#1462 (comment) This will fix #33, #53 -- integration tests pending. It depends on a nixpkgs buildRustCrate feature PR: NixOS/nixpkgs#82155
kolloch
added a commit
that referenced
this issue
Mar 12, 2020
Cargo does this for git repositories as well: rust-lang/cargo#1462 (comment) This will fix #33, #53 -- integration tests pending. It depends on a nixpkgs buildRustCrate feature PR: NixOS/nixpkgs#82155
kolloch
added a commit
that referenced
this issue
Mar 12, 2020
Cargo does this for git repositories as well: rust-lang/cargo#1462 (comment) This will fix #33, #53 -- integration tests pending. It depends on a nixpkgs buildRustCrate feature PR: NixOS/nixpkgs#82155
andir
pushed a commit
to andir/nixpkgs
that referenced
this issue
Mar 28, 2020
…sub directories This is what cargo does for git repositories. See related issues: * nix-community/crate2nix#53 * nix-community/crate2nix#33 (cherry picked from commit 8a6638d)
stigok
pushed a commit
to stigok/nixpkgs
that referenced
this issue
Jun 12, 2020
…sub directories This is what cargo does for git repositories. See related issues: * nix-community/crate2nix#53 * nix-community/crate2nix#33 (cherry picked from commit 8a6638d)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
When building a package from a git source where the git repository contains multiple crates the nix expression (sometimes?) doesn't know about the child directory for dependency in relative child directories.
Example:
Imagine the following section in your
Cargo.toml
:Then looking further into the
Cargo.toml
of therocksdb
crate:(https://github.com/rust-rocksdb/rust-rocksdb/blob/bc8520a86e96c38f79caac0d09349a01cbd113e9/Cargo.toml#L26-L28)
We see that the
librocksdb-sys
crate is supposed to be at the relative pathlibrocksdb-sys
within therocksdb
crate source. When we now look at the definition oflibrocksdb-sys
in the generatedCargo.nix
we see the following:What is missing here is the child directory that actually hosts the crate
librocksdb-sys
. By changing thesrc
attribute towe can workaround the issue.
I spent some time looking at how
cargo
handles those internally. It seems like each directory is cloned into your local "db" (in cargo speech?) at~/.cargo/git/checkouts/<repo>-<somehash>/<git short ref>/
. In the above example thepackage_path
of our package then is~/.cargo/git/checkouts/<repo>-<somehash>/<git short ref>/librocksdb-sys/
.The choices we have here seem to be limited. The trivial approach to fixing this would be to collect path elements from the
package_path
until the short id has been found. The collected paths can then be used as a suffix of the git cloned sources.The text was updated successfully, but these errors were encountered: