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

rustPackages.clippy: init at rust-1.36.0 #66681

Merged
merged 1 commit into from Aug 16, 2019

Conversation

basvandijk
Copy link
Member

Motivation for this change

This packages rust-clippy at the version specified by the git submodule at:
https://github.com/rust-lang/rust/tree/1.36.0/src/tools

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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 nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@basvandijk
Copy link
Member Author

@GrahamcOfBorg build rustPackages.clippy

@basvandijk basvandijk changed the title clippy: init at rust-1.36.0 rustPackages.clippy: init at rust-1.36.0 Aug 15, 2019
@basvandijk
Copy link
Member Author

Currently debugging:

cargo clippy -- -D clippy::all 

error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/nix/store/69hb0j56ds87l8xmijm0cg2ngdkc73dm-clippy-1.36.0/bin/clippy-driver /nix/store/yly9ihpxm0w19p4hdmkx6nrpja18kj7h-rustc-1.36.0/bin/rustc - --crate-name ___ --print=file-names -W rust-2018-idioms -D warnings --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro` (signal: 6, SIGABRT: process abort signal)
--- stderr
dyld: Library not loaded: @rpath/librustc_driver-ec53b32ba44677b6.dylib
  Referenced from: /nix/store/69hb0j56ds87l8xmijm0cg2ngdkc73dm-clippy-1.36.0/bin/clippy-driver
  Reason: image not found

@basvandijk basvandijk changed the title rustPackages.clippy: init at rust-1.36.0 WIP: rustPackages.clippy: init at rust-1.36.0 Aug 15, 2019
@basvandijk basvandijk changed the title WIP: rustPackages.clippy: init at rust-1.36.0 rustPackages.clippy: init at rust-1.36.0 Aug 15, 2019
@basvandijk
Copy link
Member Author

I fixed the @rpath/librustc_driver-ec53b32ba44677b6.dylib issue by depending on rustc.

@edolstra
Copy link
Member

Could we build rustfmt in the same way (i.e. from the rustc source tarball)?

@basvandijk
Copy link
Member Author

Could we build rustfmt in the same way (i.e. from the rustc source tarball)?

I suspect so.

@basvandijk
Copy link
Member Author

I fixed the @rpath/librustc_driver-ec53b32ba44677b6.dylib issue by depending on rustc.

Somehow this error came back in a local build so don't merge yet.

@Mic92
Copy link
Member

Mic92 commented Aug 16, 2019

Could we build rustfmt in the same way (i.e. from the rustc source tarball)?

I suspect so.

I actually quite like the idea to build it from the rust tarball since clippy is closely linked to rustc and this way we can ensure it will be in sync.

@basvandijk
Copy link
Member Author

I fixed the @rpath/librustc_driver-ec53b32ba44677b6.dylib issue by depending on rustc.

Somehow this error came back in a local build so don't merge yet.

The following fixed the problem:

  preFixup = stdenv.lib.optionalString stdenv.isDarwin ''
    install_name_tool -add_rpath "${rustc}/lib" $out/bin/clippy-driver
  '';

And clippy works on my project. This is now ready for review.

@basvandijk
Copy link
Member Author

@GrahamcOfBorg build rustPackages.clippy

@edolstra edolstra merged commit 96ec1bc into NixOS:master Aug 16, 2019
@symphorien symphorien mentioned this pull request Aug 17, 2019
10 tasks
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

3 participants