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

build fails because of missing crate #19

Closed
gilligan opened this issue Aug 29, 2019 · 4 comments
Closed

build fails because of missing crate #19

gilligan opened this issue Aug 29, 2019 · 4 comments

Comments

@gilligan
Copy link

Description: I was trying to use crate2nix for hydra-cli but it fails because it can't find some crates.


  • Expected: The build succeeds as it does with cargo build
  • Actual: The build fails because some crate is missing
  • How to reproduce:
$ git clone https://github.com/nlewo/hydra-cli
$ git checkout test-crate2nix
$ nix-build -A hydra-cli
Error Output
Building src/lib.rs (flate2)                                                                                                                                   
Running rustc --crate-name flate2 src/lib.rs --crate-type lib -C opt-level=3 -C codegen-units=4 --edition 2015 -C metadata=0cab654bef -C extra-filename=-0cab65
4bef --cfg feature="miniz_oxide" --cfg feature="rust_backend" --out-dir target/lib --emit=dep-info,link -L dependency=target/deps --extern crc32fast=/nix/store
/3m24x66k8w7snjsdzsmcgprahqvn5ija-rust_crc32fast-1.2.0/lib/libcrc32fast-093f96a061.rlib --extern libc=/nix/store/fcsgigv8c5d74403ak65r4rpzi834743-rust_libc-0.2
.62/lib/liblibc-68f9c48770.rlib --cap-lints allow --color always 
unpacking sources                                                                                  
unpacking source archive /nix/store/95n075cbnpnm7ys0b3bdkrv8rid5x27n-crossbeam-queue-0.1.2.tar.gz                                         
unpacking sources                                                                    
source root is crossbeam-queue-0.1.2.tar.gz                                                                                                                   
unpacking source archive /nix/store/85p4a11g26c17xwc7v63v1zkp9qq70d9-getrandom-0.1.11.tar.gz 
error[E0463]: can't find crate for `miniz_oxide`                                                           
   --> src/ffi.rs:469:5                                            
    |                                                                                                                                                         
469 |     extern crate miniz_oxide;                                                  
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
patching sources
@gilligan
Copy link
Author

FWIW when i changed feature="rust_backend" to default that one worked but then it fails elsewhere..

gilligan added a commit to nlewo/hydra-cli that referenced this issue Aug 30, 2019
Sadly carnix builds won't work until there is a fix for
https://nest.pijul.com/pmeunier/carnix/discussions/35 so
the currently only option is `buildRustPackage` as crate2nix
also doesn't work: nix-community/crate2nix#19
gilligan added a commit to nlewo/hydra-cli that referenced this issue Aug 30, 2019
Sadly carnix builds won't work until there is a fix for
https://nest.pijul.com/pmeunier/carnix/discussions/35 so
the currently only option is `buildRustPackage` as crate2nix
also doesn't work: nix-community/crate2nix#19
@TMVector
Copy link
Contributor

@gilligan out of curiosity, what did you mean by "when i changed feature="rust_backend" to default"? How I would I do the same to reproduce later errors?

@kolloch
Copy link
Collaborator

kolloch commented Sep 2, 2019

Thank you very much for reporting this! Sorry, that I didn't have much time last week.

If I read the comments right, this is also about the rand crate renames?

I created an issue for this #22. Help is appreciated. How can we make this work on the nix level?

@kolloch
Copy link
Collaborator

kolloch commented Sep 15, 2019

Do I take it that the rename PR fixes this? Please reopen if it doesn't.

@kolloch kolloch closed this as completed Sep 15, 2019
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

3 participants