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

thin-provisioning-tools: 0.7.5 -> 0.7.6, fix w/musl, enable parallel #40559

Merged
merged 4 commits into from May 16, 2018

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented May 15, 2018

Fix with musl, update and enable parallel building while visiting.

Recent musl touches up how/when PAGE_SIZE/PAGESIZE are exported[1][2][3],
but unfortunately that doesn't fix compilation here.

This fixes build by using PAGE_SIZE from limits.h explicitly,
instead of defining local version.
Unlikely to change but might as well use what libc exports
in case it has a different value.

[1] https://git.musl-libc.org/cgit/musl/commit/?id=8e1381be44642523b5cbd1bba4d7ca20ee920b85
[2] https://git.musl-libc.org/cgit/musl/commit/?id=6ecb9c14c429cc73ace937fd7459f58f0b7a8e6e
[3] https://git.musl-libc.org/cgit/musl/commit/?id=c9c2cd3e6955cb1d57b8be01d4b072bf44058762

  • 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.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: thin-provisioning-tools

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/dwbnix6al97bwc6s21s0sx3r7flffpcz-thin-provisioning-tools-0.7.6
shrinking /nix/store/dwbnix6al97bwc6s21s0sx3r7flffpcz-thin-provisioning-tools-0.7.6/sbin/pdata_tools
gzipping man pages under /nix/store/dwbnix6al97bwc6s21s0sx3r7flffpcz-thin-provisioning-tools-0.7.6/share/man/
strip is /nix/store/mgyvr3kil9qv0mywikpi0dbli061bpg4-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/dwbnix6al97bwc6s21s0sx3r7flffpcz-thin-provisioning-tools-0.7.6/sbin
patching script interpreter paths in /nix/store/dwbnix6al97bwc6s21s0sx3r7flffpcz-thin-provisioning-tools-0.7.6
checking for references to /build in /nix/store/dwbnix6al97bwc6s21s0sx3r7flffpcz-thin-provisioning-tools-0.7.6...
moving /nix/store/dwbnix6al97bwc6s21s0sx3r7flffpcz-thin-provisioning-tools-0.7.6/sbin/* to /nix/store/dwbnix6al97bwc6s21s0sx3r7flffpcz-thin-provisioning-tools-0.7.6/bin
/nix/store/dwbnix6al97bwc6s21s0sx3r7flffpcz-thin-provisioning-tools-0.7.6

@dtzWill dtzWill requested a review from globin May 15, 2018 18:22
@dtzWill
Copy link
Member Author

dtzWill commented May 15, 2018

(unsure who to ask to review, following github's suggestion! :))

};

nativeBuildInputs = [ autoreconfHook ];

buildInputs = [ expat libaio boost ];

postPatch = stdenv.lib.optional stdenv.hostPlatform.isMusl ''
sed -i -e '/PAGE_SIZE/d' -e '1i#include <limits.h>' \
block-cache/io_engine.h unit-tests/io_engine_t.cc
Copy link
Member

Choose a reason for hiding this comment

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

A patch might be better here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Aye aye, sounds good! Just pushed commit that uses patch + comments explaining the changes.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: thin-provisioning-tools

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/fl3633lrf4lpczjfkp7435n66w043wm4-thin-provisioning-tools-0.7.6
shrinking /nix/store/fl3633lrf4lpczjfkp7435n66w043wm4-thin-provisioning-tools-0.7.6/sbin/pdata_tools
gzipping man pages under /nix/store/fl3633lrf4lpczjfkp7435n66w043wm4-thin-provisioning-tools-0.7.6/share/man/
strip is /nix/store/mgyvr3kil9qv0mywikpi0dbli061bpg4-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/fl3633lrf4lpczjfkp7435n66w043wm4-thin-provisioning-tools-0.7.6/sbin
patching script interpreter paths in /nix/store/fl3633lrf4lpczjfkp7435n66w043wm4-thin-provisioning-tools-0.7.6
checking for references to /build in /nix/store/fl3633lrf4lpczjfkp7435n66w043wm4-thin-provisioning-tools-0.7.6...
moving /nix/store/fl3633lrf4lpczjfkp7435n66w043wm4-thin-provisioning-tools-0.7.6/sbin/* to /nix/store/fl3633lrf4lpczjfkp7435n66w043wm4-thin-provisioning-tools-0.7.6/bin
/nix/store/fl3633lrf4lpczjfkp7435n66w043wm4-thin-provisioning-tools-0.7.6

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: thin-provisioning-tools

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/8sasc92267hysgx59f1k67lk42g5vk8k-thin-provisioning-tools-0.7.6
shrinking /nix/store/8sasc92267hysgx59f1k67lk42g5vk8k-thin-provisioning-tools-0.7.6/sbin/pdata_tools
gzipping man pages under /nix/store/8sasc92267hysgx59f1k67lk42g5vk8k-thin-provisioning-tools-0.7.6/share/man/
strip is /nix/store/k4w0i2ja8g2xxgx46i8h5m4bzcf6g9pj-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/8sasc92267hysgx59f1k67lk42g5vk8k-thin-provisioning-tools-0.7.6/sbin
patching script interpreter paths in /nix/store/8sasc92267hysgx59f1k67lk42g5vk8k-thin-provisioning-tools-0.7.6
checking for references to /build in /nix/store/8sasc92267hysgx59f1k67lk42g5vk8k-thin-provisioning-tools-0.7.6...
moving /nix/store/8sasc92267hysgx59f1k67lk42g5vk8k-thin-provisioning-tools-0.7.6/sbin/* to /nix/store/8sasc92267hysgx59f1k67lk42g5vk8k-thin-provisioning-tools-0.7.6/bin
/nix/store/8sasc92267hysgx59f1k67lk42g5vk8k-thin-provisioning-tools-0.7.6

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: thin-provisioning-tools

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/vckn68z6bnp50sccg1fzqz2jbapnq8ki-thin-provisioning-tools-0.7.6
shrinking /nix/store/vckn68z6bnp50sccg1fzqz2jbapnq8ki-thin-provisioning-tools-0.7.6/sbin/pdata_tools
gzipping man pages under /nix/store/vckn68z6bnp50sccg1fzqz2jbapnq8ki-thin-provisioning-tools-0.7.6/share/man/
strip is /nix/store/k4w0i2ja8g2xxgx46i8h5m4bzcf6g9pj-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/vckn68z6bnp50sccg1fzqz2jbapnq8ki-thin-provisioning-tools-0.7.6/sbin
patching script interpreter paths in /nix/store/vckn68z6bnp50sccg1fzqz2jbapnq8ki-thin-provisioning-tools-0.7.6
checking for references to /build in /nix/store/vckn68z6bnp50sccg1fzqz2jbapnq8ki-thin-provisioning-tools-0.7.6...
moving /nix/store/vckn68z6bnp50sccg1fzqz2jbapnq8ki-thin-provisioning-tools-0.7.6/sbin/* to /nix/store/vckn68z6bnp50sccg1fzqz2jbapnq8ki-thin-provisioning-tools-0.7.6/bin
/nix/store/vckn68z6bnp50sccg1fzqz2jbapnq8ki-thin-provisioning-tools-0.7.6

@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: thin-provisioning-tools

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

No attempt on x86_64-darwin (full log)

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

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.


@dtzWill dtzWill requested review from dezgeg and removed request for globin May 16, 2018 00:06
@dtzWill
Copy link
Member Author

dtzWill commented May 16, 2018

Post-merge review welcome as always! :)

@dtzWill dtzWill merged commit 16b6f53 into NixOS:staging May 16, 2018
Mic92 added a commit to Mic92/thin-provisioning-tools that referenced this pull request May 22, 2018
a) Fix build if limits.h provides definition for PAGE_SIZE, as musl does w/musl per XSI[1] although it's apparently optional [2].
   This value is only provided when it's known to be a constant, to avoid the need to discover the value dynamically.
b) If not using system-provided (kernel headers, or libc headers, or something) use the POSIX approach of querying the value
   dynamically using sysconf(_SC_PAGE_SIZE) instead of hardcoded value that hopefully is correct.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
[2] http://www.openwall.com/lists/musl/2015/09/11/8

This patch originate from:

  https://raw.githubusercontent.com/voidlinux/void-packages/a0ece13ad7ab2aae760e09e41e0459bd999a3695/srcpkgs/thin-provisioning-tools/patches/musl.patch

and was also applied in NixOS:

  NixOS/nixpkgs#40559

cc @dtzWill
@Mic92
Copy link
Member

Mic92 commented May 22, 2018

I felt free to send it upstream.

jthornber pushed a commit to jthornber/thin-provisioning-tools that referenced this pull request May 22, 2018
a) Fix build if limits.h provides definition for PAGE_SIZE, as musl does w/musl per XSI[1] although it's apparently optional [2].
   This value is only provided when it's known to be a constant, to avoid the need to discover the value dynamically.
b) If not using system-provided (kernel headers, or libc headers, or something) use the POSIX approach of querying the value
   dynamically using sysconf(_SC_PAGE_SIZE) instead of hardcoded value that hopefully is correct.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
[2] http://www.openwall.com/lists/musl/2015/09/11/8

This patch originate from:

  https://raw.githubusercontent.com/voidlinux/void-packages/a0ece13ad7ab2aae760e09e41e0459bd999a3695/srcpkgs/thin-provisioning-tools/patches/musl.patch

and was also applied in NixOS:

  NixOS/nixpkgs#40559

cc @dtzWill
@Mic92
Copy link
Member

Mic92 commented May 22, 2018

... and it was merged.

@dtzWill
Copy link
Member Author

dtzWill commented May 22, 2018

@Mic92 aweseome, thank you very much!! (And thanks to upstream maintainers for accepting it! 😁)

@dtzWill dtzWill deleted the update/thin-provisioning-tools-0.7.6 branch May 22, 2018 16:17
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