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

rustPlatform.buildRustPackage: Add support for setting test flags #75061

Closed
wants to merge 1 commit into from

Conversation

@bkchr
Copy link
Contributor

@bkchr bkchr commented Dec 5, 2019

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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.
Notify maintainers

cc @

@bkchr
Copy link
Contributor Author

@bkchr bkchr commented Dec 10, 2019

CC @andir as I have seen you have other similar stuff before.

@andir
Copy link
Member

@andir andir commented Dec 12, 2019

@GrahamcOfBorg build cargo-graph cargo-xbuild cargo-expand alacritty

Copy link
Member

@andir andir left a comment

It looks fine generally but I'd just like to cleanup that little bit of duplicate code I commented on.

@@ -144,10 +145,10 @@ stdenv.mkDerivation (args // {
runHook postBuild
'';

checkPhase = args.checkPhase or ''
checkPhase = with builtins; args.checkPhase or ''

This comment has been minimized.

@andir

andir Dec 12, 2019
Member

I think we prefer using lib here. In general having a let-binding like let flags = lib.concatStringsSep " " cargoTestFlags; in would remove the need for the with (only need it once anyway) and make the code less repetitive.

@andir andir self-assigned this Dec 12, 2019
@bkchr bkchr force-pushed the bkchr:rust-test-flags branch from a2b595e to 7a90dd8 Dec 20, 2019
@bkchr
Copy link
Contributor Author

@bkchr bkchr commented Dec 20, 2019

@andir is it now better?

@bkchr
Copy link
Contributor Author

@bkchr bkchr commented Jan 9, 2020

Ping @andir

@andir
Copy link
Member

@andir andir commented Jan 9, 2020

Sorry for the delay. I largely gave up on buildRustPackage myself. I think this looks better now. What we should add is documentation to doc/languages-frameworks/rust.section.md and preferable some kind of test for this seldomly used feature. We do not want it to bitrot :)

@bkchr bkchr closed this Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.