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: fix equality testing #37928

Merged
merged 2 commits into from Mar 28, 2018
Merged

buildRustCrate: fix equality testing #37928

merged 2 commits into from Mar 28, 2018

Conversation

VShell
Copy link
Contributor

@VShell VShell commented Mar 27, 2018

Use string equality instead of integer equality.

Motivation for this change

Compiling a crate named cargo-watch results in a binary named cargo_watch due to a script error - the logic already existed to name the binary correctly, but used the wrong comparison operator and so failed.

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.

Use string equality instead of integer equality.
@Mic92
Copy link
Member

Mic92 commented Mar 28, 2018

cc @P-E-Meunier

@@ -19,7 +19,7 @@ let makeDeps = dependencies:
echo_build_heading() {
start=""
end=""
if [[ x"${colors}" -eq x"always" ]]; then
if [[ x"${colors}" = x"always" ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this x" stuff needed in any posix shell from this century?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have absolutely no idea - I made the minimal changes to make it work. I'm not very good at bash.

@P-E-Meunier
Copy link
Contributor

Wow, cool, thanks for that!

Let's leave x"" to the 1990s, where they belong
@Mic92
Copy link
Member

Mic92 commented Mar 28, 2018

@GrahamcOfBorg build cargo-vendor

@Mic92 Mic92 merged commit 8a8a737 into NixOS:master Mar 28, 2018
@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: cargo-vendor

Partial log (click to expand)

warning: redundant linker flag specified for library `ssl`

warning: redundant linker flag specified for library `z`

installing
post-installation fixup
strip is /nix/store/0fzpxnsanc02i4jsb1yhchjp4p62b2n3-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/nhrwnp83kabg885h1h7x0h0967lxchr6-rust_cargo-vendor-0.1.13/lib  /nix/store/nhrwnp83kabg885h1h7x0h0967lxchr6-rust_cargo-vendor-0.1.13/bin
patching script interpreter paths in /nix/store/nhrwnp83kabg885h1h7x0h0967lxchr6-rust_cargo-vendor-0.1.13
/nix/store/nhrwnp83kabg885h1h7x0h0967lxchr6-rust_cargo-vendor-0.1.13

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: cargo-vendor

Partial log (click to expand)


installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/70ppwdhbny6991arfr16ydj439iikhy0-rust_cargo-vendor-0.1.13
shrinking /nix/store/70ppwdhbny6991arfr16ydj439iikhy0-rust_cargo-vendor-0.1.13/bin/cargo-vendor
strip is /nix/store/fzcs0fn6bb04m82frhlb78nc03ny3w55-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/70ppwdhbny6991arfr16ydj439iikhy0-rust_cargo-vendor-0.1.13/lib  /nix/store/70ppwdhbny6991arfr16ydj439iikhy0-rust_cargo-vendor-0.1.13/bin
patching script interpreter paths in /nix/store/70ppwdhbny6991arfr16ydj439iikhy0-rust_cargo-vendor-0.1.13
checking for references to /build in /nix/store/70ppwdhbny6991arfr16ydj439iikhy0-rust_cargo-vendor-0.1.13...
/nix/store/70ppwdhbny6991arfr16ydj439iikhy0-rust_cargo-vendor-0.1.13

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: cargo-vendor

Partial log (click to expand)

cannot build derivation '/nix/store/d4p4dx7rr51h4wq18m6njq1an18250pc-rust_git2-0.6.8.drv': 15 dependencies couldn't be built
cannot build derivation '/nix/store/vc4jvsxwc4gh9ggjlzv3dqin58imqnkj-rust_globset-0.2.1.drv': 14 dependencies couldn't be built
cannot build derivation '/nix/store/gyb3j1jki33jvb6wn60w0hg6q53biycc-rust_serde_derive-1.0.18.drv': 6 dependencies couldn't be built
cannot build derivation '/nix/store/vj6jv6n55ilggnp6f0vxxxdr0avqcsq0-rust_crates-io-0.11.0.drv': 30 dependencies couldn't be built
cannot build derivation '/nix/store/q60hv43ini1gxq3zrf1a6z364g2i9msx-rust_docopt-0.8.1.drv': 19 dependencies couldn't be built
cannot build derivation '/nix/store/3czb1iinyr9bs0w6jp0cjw2qidngv2na-rust_git2-curl-0.7.0.drv': 20 dependencies couldn't be built
cannot build derivation '/nix/store/4zc1y8smyf44z42ql422gibh8r05ss4n-rust_ignore-0.2.2.drv': 18 dependencies couldn't be built
cannot build derivation '/nix/store/cm5f69nz3lg6m0lfykp0qb3bsqa84axx-rust_cargo-0.22.0.drv': 78 dependencies couldn't be built
cannot build derivation '/nix/store/9qbrlv0khiqd0f1y7vnffwlrkwlhsqj8-rust_cargo-vendor-0.1.13.drv': 79 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/9qbrlv0khiqd0f1y7vnffwlrkwlhsqj8-rust_cargo-vendor-0.1.13.drv' failed

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