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

BuildRustCrate: more general overrides, and handling the "dylib" crate type #35171

Merged
merged 6 commits into from Feb 20, 2018
Merged

BuildRustCrate: more general overrides, and handling the "dylib" crate type #35171

merged 6 commits into from Feb 20, 2018

Conversation

P-E-Meunier
Copy link
Contributor

@P-E-Meunier P-E-Meunier commented Feb 19, 2018

Motivation for this change

This PR introduces overriding phases (preUnpack…postInstall), and handles the dylib crate type, recently introduced in carnix.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@sjmackenzie
Copy link
Contributor

nox-review wip failed on my machine

Click to see output of nox-review
$ nix-shell -p nox --run "nox-review wip"
...
Building ./src/lib.rs (image)
Running rustc --crate-name image ./src/lib.rs --crate-type lib -C opt-level=3 -C metadata=2a495c5fd3 -C extra-filename=-2a495c5fd3 --cfg feature="webp" --cfg feature="tiff" --cfg feature="tga" --cfg feature="scoped_threadpool" --cfg feature="ppm" --cfg feature="png_codec" --cfg feature="png" --cfg feature="jpeg-decoder" --cfg feature="jpeg" --cfg feature="ico" --cfg feature="hdr" --cfg feature="gif_codec" --cfg feature="gif" --cfg feature="default" --cfg feature="bmp" --out-dir target/lib --emit=dep-info,link -L dependency=target/deps --extern byteorder=/nix/store/f0mxwv76i36wxxa108vd5hw6hiflyzvj-rust_byteorder-1.0.0/lib/libbyteorder-79a80d72eb.rlib --extern enum_primitive=/nix/store/5xgxrsnzk237ynx88g13dr4jz5q3xcyn-rust_enum_primitive-0.1.1/lib/libenum_primitive-fc773b47c3.rlib --extern glob=/nix/store/qxg8ippj187va05zzx0z1lmsfmjcsh82-rust_glob-0.2.11/lib/libglob-67202cca89.rlib --extern num_iter=/nix/store/13i0wmdcpzayrwsx591bq8nzxd15l0kw-rust_num-iter-0.1.33/lib/libnum_iter-da6f8e2e13.rlib --extern num_rational=/nix/store/ck8a7xinrkaf6zxm07vhhn0lmq6i8ghg-rust_num-rational-0.1.36/lib/libnum_rational-6944f525fb.rlib --extern num_traits=/nix/store/kpm94jkihj6hdb8bqv1533wzj7xmpn57-rust_num-traits-0.1.37/lib/libnum_traits-b07ce563c7.rlib --extern gif=/nix/store/p46b73ly8mdg5qxxczdjdnczsjj12lb0-rust_gif-0.9.1/lib/libgif-0fd864a135.rlib --extern jpeg_decoder=/nix/store/2gc671ywk3s2mb2bhzc05k36yi3g9k0p-rust_jpeg-decoder-0.1.11/lib/libjpeg_decoder-212dd146f0.rlib --extern png=/nix/store/gn8m0zghrba6y9lj78ba6ibqmdhv62r1-rust_png-0.6.2/lib/libpng-0058f7788e.rlib --extern scoped_threadpool=/nix/store/answrzkb079mdv6jb66w9ymaxlczg1bs-rust_scoped_threadpool-0.1.7/lib/libscoped_threadpool-568946a60d.rlib --cap-lints allow --color always
error[E0463]: can't find crate for `semver` which `rustc_version` depends on
 --> build.rs:1:1
  |
1 | extern crate rustc_version;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

builder for ‘/nix/store/3bh21a184w8gxv0lilw2r5habm8l6ykp-rust_tempfile-2.1.5.drv’ failed with exit code 101
building path(s) ‘/nix/store/a15ppncc8yps4821sy0fa8mjrpdxp47p-rust_phf_shared-0.7.21’
building path(s) ‘/nix/store/ng4skndfanyzl42scpfd97s42n3z5699-rust_serde-0.9.15’
cannot build derivation ‘/nix/store/gwy54dv93q8jmpa3wdwlq4ids7i2q44b-rust_wc-lock-0.2.1.drv’: 1 dependencies couldn't be built
building path(s) ‘/nix/store/gf9062gm33a7sr01c4yn5sjj82ljj0m1-rust_winapi-0.2.8’
building path(s) ‘/nix/store/92x0wjzhh8ym4bws0lwivpln9zwnfxq3-rust_winapi-build-0.1.1’
building path(s) ‘/nix/store/580pbas7jdmgwd3d24rcyxz8wx5k0nmy-rust_xcb-0.8.1’
building path(s) ‘/nix/store/1kk88v0m24vlhd9r22dkzp1gvzljqk8w-rust_xml-rs-0.6.1’
building path(s) ‘/nix/store/6vz0x53ry1p5sayiq7qld2h9qwkp29jh-rust_xml-rs-0.7.0’
cannot build derivation ‘/nix/store/b2kxv29axvir7k75wclnjxcz2ifbrw8x-way-cooler-with-extensions-0.8.0.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/b2kxv29axvir7k75wclnjxcz2ifbrw8x-way-cooler-with-extensions-0.8.0.drv’ failed
The invocation of "nix-build -A way-cooler /home/stewart/dev/fractalide/nixpkgs" failed

@P-E-Meunier
Copy link
Contributor Author

I just fixed it, I have no idea where the faulty line comes from, I believe it was already in nixpkgs before this PR.

@sjmackenzie
Copy link
Contributor

@qknight nox-review wip passes.

@qknight qknight merged commit 8e5ab6e into NixOS:master Feb 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants