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

gitignore.nix breaks crate2nix (Rust) #51

Open
srid opened this issue Apr 8, 2021 · 3 comments
Open

gitignore.nix breaks crate2nix (Rust) #51

srid opened this issue Apr 8, 2021 · 3 comments

Comments

@srid
Copy link

srid commented Apr 8, 2021

Perhaps a warning is worth adding to the README?

Details: https://www.reddit.com/r/rust/comments/mmbfnj/nixifying_a_rust_project/gtsgxal/?utm_source=reddit&utm_medium=web2x&context=3

@roberth
Copy link
Member

roberth commented Apr 8, 2021

Do you have the error message at hand? Perhaps it can be fixed.

@srid
Copy link
Author

srid commented Apr 8, 2021

The error can be reproduced by using a particular (pre-revert) commit from soywod/himalaya#73

❯ nix run github:srid/himalaya/a267f6b876b938605e583147cf311ec5baa7a4b2
error: builder for '/nix/store/vqyq9brra8qmn6yq0jvy7ssn18zhs7cq-himalaya-crate2nix.drv' failed with exit code 3;
       last 10 log lines:
       > -rw-r--r-- 1 nixbld nixbld  1571 Jan  1  1970 LICENSE
       > -rw-r--r-- 1 nixbld nixbld  8240 Jan  1  1970 README.md
       > -rw-r--r-- 1 nixbld nixbld   480 Jan  1  1970 default.nix
       > -rw-r--r-- 1 nixbld nixbld  2489 Jan  1  1970 flake.lock
       > -rw-r--r-- 1 nixbld nixbld  1922 Jan  1  1970 flake.nix
       > -rw-r--r-- 1 nixbld nixbld   764 Jan  1  1970 install.sh
       > -rw-r--r-- 1 nixbld nixbld   453 Jan  1  1970 shell.nix
       > drwxr-xr-x 8 nixbld nixbld  4096 Jan  1  1970 src
       > drwxr-xr-x 7 nixbld nixbld  4096 Jan  1  1970 vim
       > == ls -la (END)
       For full logs, run 'nix log /nix/store/vqyq9brra8qmn6yq0jvy7ssn18zhs7cq-himalaya-crate2nix.drv'.
(use '--show-trace' to show detailed location information)

and

❯ nix log /nix/store/vqyq9brra8qmn6yq0jvy7ssn18zhs7cq-himalaya-crate2nix.drv
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/bnlp2br14mh3z7wv0kagkk8jxlvrvbhb-source
source root is source
@nix { "action": "setPhase", "phase": "buildPhase" }
building
++ crate2nix generate -f ./Cargo.toml -o Cargo-generated.nix -h /nix/store/nzvk2yxgmcz0jkzpwsgl4wpvq43646pr-himalaya-crate2nix/crate-hashes.json
Error: while retrieving metadata about ./Cargo.toml: Error during execution of `cargo metadata`: error: no matching package named `clap` found
location searched: registry `https://github.com/rust-lang/crates.io-index`
required by package `himalaya v0.2.2 (/build/source)`

crate2nix failed.
== cargo/config (BEGIN)
    [source.crates-io]
    replace-with = "vendored-sources"
    
    
    [source.vendored-sources]
    directory = "/nix/store/y1qfdpg2anpsvh321yr97sph54hdxwis-deps"

== cargo/config (END)

== crate-hashes.json (BEGIN)
    {}
== crate-hashes.json (END)

== ls -la (BEGIN)
total 108
drwxr-xr-x 6 nixbld nixbld  4096 Jan  1  1970 .
drwx------ 3 nixbld nixbld  4096 Apr  8 13:28 ..
drwxr-xr-x 3 nixbld nixbld  4096 Jan  1  1970 .github
-rw-r--r-- 1 nixbld nixbld    30 Jan  1  1970 .gitignore
-rw-r--r-- 1 nixbld nixbld    79 Jan  1  1970 .gitmodules
drwxr-xr-x 2 nixbld nixbld  4096 Jan  1  1970 .vscode
-rw-r--r-- 1 nixbld nixbld  3672 Jan  1  1970 CHANGELOG.md
-rw-r--r-- 1 nixbld nixbld 32251 Jan  1  1970 Cargo.lock
-rw-r--r-- 1 nixbld nixbld   576 Jan  1  1970 Cargo.toml
-rw-r--r-- 1 nixbld nixbld  1571 Jan  1  1970 LICENSE
-rw-r--r-- 1 nixbld nixbld  8240 Jan  1  1970 README.md
-rw-r--r-- 1 nixbld nixbld   480 Jan  1  1970 default.nix
-rw-r--r-- 1 nixbld nixbld  2489 Jan  1  1970 flake.lock
-rw-r--r-- 1 nixbld nixbld  1922 Jan  1  1970 flake.nix
-rw-r--r-- 1 nixbld nixbld   764 Jan  1  1970 install.sh
-rw-r--r-- 1 nixbld nixbld   453 Jan  1  1970 shell.nix
drwxr-xr-x 8 nixbld nixbld  4096 Jan  1  1970 src
drwxr-xr-x 7 nixbld nixbld  4096 Jan  1  1970 vim
== ls -la (END)

@srid
Copy link
Author

srid commented Apr 8, 2021

Also worth noting that this happens only when the git working copy is not dirty.

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

No branches or pull requests

2 participants