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

nbd: add which to buildInputs #46635

Merged
merged 2 commits into from Sep 14, 2018
Merged

nbd: add which to buildInputs #46635

merged 2 commits into from Sep 14, 2018

Conversation

qolii
Copy link
Contributor

@qolii qolii commented Sep 14, 2018

Motivation for this change

The nbd build complains numerously about not being able to find the which package during its testing phase:

make  check-TESTS
make[3]: Entering directory '/build/nbd-3.18/tests/run'
./simple_test: line 9: which: not found
./cfg1
5442: Requests: 0
** Message: 01:01:44.884: 5442: Throughput read test (without flushes) complete. Took 0.080 seconds to complete, 50.222Mib/s
PASS: cfg1
./simple_test: line 9: which: not found
./cfgmulti
5463: Requests: 0
** Message: 01:01:45.988: 5463: Throughput read test (without flushes) complete. Took 0.079 seconds to complete, 50.925Mib/s
5469: Requests: 0
** Message: 01:01:46.068: 5469: Throughput read test (without flushes) complete. Took 0.077 seconds to complete, 52.084Mib/s
PASS: cfgmulti
./simple_test: line 9: which: not found
./cfgnew
5490: Requests: 0
** Message: 01:01:47.178: 5490: Throughput read test (without flushes) complete. Took 0.084 seconds to complete, 47.414Mib/s
PASS: cfgnew
./simple_test: line 9: which: not found
./cfgsize

and so on.

I'm not sure why the build doesn't fail under these conditions, but anyway, simply adding which to its buildInputs fixes this.

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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
patches = [ ./dont-run-make-in-broken-systemd-subdir.patch ];

buildInputs =
[ pkgconfig glib ]
[ pkgconfig glib which ]
Copy link
Member

@Mic92 Mic92 Sep 14, 2018

Choose a reason for hiding this comment

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

Can you add this to nativeBuildInputs instead? Also pkgconfig belongs there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gah! One day, I'll get something right the first time.

Copy link
Member

@Mic92 Mic92 Sep 14, 2018

Choose a reason for hiding this comment

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

You can also cargo-cult this knowledge for examples like pkgconfig.
A rule of thumb is: Does the system (i.e x86_64) that builds the packages would like to execute this tool during its build and therefore needs the executable for its own cpu architecture or is it a dependencies that is needed for the target platform (aarch64), that the package is build for.

@Mic92
Copy link
Member

Mic92 commented Sep 14, 2018

@GrahamcOfBorg build nbd

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: nbd

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: nbd

Partial log (click to expand)

shrinking /nix/store/1ijrpqfyg2qff78srkgvvp9zgh0liapn-nbd-3.18/sbin/nbd-client
shrinking /nix/store/1ijrpqfyg2qff78srkgvvp9zgh0liapn-nbd-3.18/bin/nbd-server
shrinking /nix/store/1ijrpqfyg2qff78srkgvvp9zgh0liapn-nbd-3.18/bin/nbd-trdump
gzipping man pages under /nix/store/1ijrpqfyg2qff78srkgvvp9zgh0liapn-nbd-3.18/share/man/
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/1ijrpqfyg2qff78srkgvvp9zgh0liapn-nbd-3.18/bin  /nix/store/1ijrpqfyg2qff78srkgvvp9zgh0liapn-nbd-3.18/sbin
patching script interpreter paths in /nix/store/1ijrpqfyg2qff78srkgvvp9zgh0liapn-nbd-3.18
checking for references to /build in /nix/store/1ijrpqfyg2qff78srkgvvp9zgh0liapn-nbd-3.18...
moving /nix/store/1ijrpqfyg2qff78srkgvvp9zgh0liapn-nbd-3.18/sbin/* to /nix/store/1ijrpqfyg2qff78srkgvvp9zgh0liapn-nbd-3.18/bin
/nix/store/1ijrpqfyg2qff78srkgvvp9zgh0liapn-nbd-3.18

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: nbd

Partial log (click to expand)

shrinking /nix/store/j2njq4sl95hwh9lq1x0nglp0236w6489-nbd-3.18/sbin/nbd-client
shrinking /nix/store/j2njq4sl95hwh9lq1x0nglp0236w6489-nbd-3.18/bin/nbd-trdump
shrinking /nix/store/j2njq4sl95hwh9lq1x0nglp0236w6489-nbd-3.18/bin/nbd-server
gzipping man pages under /nix/store/j2njq4sl95hwh9lq1x0nglp0236w6489-nbd-3.18/share/man/
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/j2njq4sl95hwh9lq1x0nglp0236w6489-nbd-3.18/bin  /nix/store/j2njq4sl95hwh9lq1x0nglp0236w6489-nbd-3.18/sbin
patching script interpreter paths in /nix/store/j2njq4sl95hwh9lq1x0nglp0236w6489-nbd-3.18
checking for references to /build in /nix/store/j2njq4sl95hwh9lq1x0nglp0236w6489-nbd-3.18...
moving /nix/store/j2njq4sl95hwh9lq1x0nglp0236w6489-nbd-3.18/sbin/* to /nix/store/j2njq4sl95hwh9lq1x0nglp0236w6489-nbd-3.18/bin
/nix/store/j2njq4sl95hwh9lq1x0nglp0236w6489-nbd-3.18

@qolii
Copy link
Contributor Author

qolii commented Sep 14, 2018

(No idea what happened with the conflict there. I've rebased, looks ok now.)

@qolii
Copy link
Contributor Author

qolii commented Sep 14, 2018

@GrahamcOfBorg build nbd

@xeji
Copy link
Contributor

xeji commented Sep 14, 2018

sorry, not everyone can trigger builds
@GrahamcOfBorg build nbd

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: nbd

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: nbd

Partial log (click to expand)

shrinking /nix/store/fdrw448yya0xqfjxs4jz37c7i2b1w8nk-nbd-3.18/sbin/nbd-client
shrinking /nix/store/fdrw448yya0xqfjxs4jz37c7i2b1w8nk-nbd-3.18/bin/nbd-server
shrinking /nix/store/fdrw448yya0xqfjxs4jz37c7i2b1w8nk-nbd-3.18/bin/nbd-trdump
gzipping man pages under /nix/store/fdrw448yya0xqfjxs4jz37c7i2b1w8nk-nbd-3.18/share/man/
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/fdrw448yya0xqfjxs4jz37c7i2b1w8nk-nbd-3.18/bin  /nix/store/fdrw448yya0xqfjxs4jz37c7i2b1w8nk-nbd-3.18/sbin
patching script interpreter paths in /nix/store/fdrw448yya0xqfjxs4jz37c7i2b1w8nk-nbd-3.18
checking for references to /build in /nix/store/fdrw448yya0xqfjxs4jz37c7i2b1w8nk-nbd-3.18...
moving /nix/store/fdrw448yya0xqfjxs4jz37c7i2b1w8nk-nbd-3.18/sbin/* to /nix/store/fdrw448yya0xqfjxs4jz37c7i2b1w8nk-nbd-3.18/bin
/nix/store/fdrw448yya0xqfjxs4jz37c7i2b1w8nk-nbd-3.18

@qolii
Copy link
Contributor Author

qolii commented Sep 14, 2018

Ah, hehe. Thought I'd give the magic incantation a try :)

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: nbd

Partial log (click to expand)

shrinking /nix/store/wi92y3ynninv6g86qbmgap2mw4i4njcn-nbd-3.18/sbin/nbd-client
shrinking /nix/store/wi92y3ynninv6g86qbmgap2mw4i4njcn-nbd-3.18/bin/nbd-trdump
shrinking /nix/store/wi92y3ynninv6g86qbmgap2mw4i4njcn-nbd-3.18/bin/nbd-server
gzipping man pages under /nix/store/wi92y3ynninv6g86qbmgap2mw4i4njcn-nbd-3.18/share/man/
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/wi92y3ynninv6g86qbmgap2mw4i4njcn-nbd-3.18/bin  /nix/store/wi92y3ynninv6g86qbmgap2mw4i4njcn-nbd-3.18/sbin
patching script interpreter paths in /nix/store/wi92y3ynninv6g86qbmgap2mw4i4njcn-nbd-3.18
checking for references to /build in /nix/store/wi92y3ynninv6g86qbmgap2mw4i4njcn-nbd-3.18...
moving /nix/store/wi92y3ynninv6g86qbmgap2mw4i4njcn-nbd-3.18/sbin/* to /nix/store/wi92y3ynninv6g86qbmgap2mw4i4njcn-nbd-3.18/bin
/nix/store/wi92y3ynninv6g86qbmgap2mw4i4njcn-nbd-3.18

@xeji xeji merged commit 3c57887 into NixOS:master Sep 14, 2018
@qolii
Copy link
Contributor Author

qolii commented Sep 14, 2018

Thanks @xeji!

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