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

e2fsprogs: fix w/musl, __GNUC_PREREQ is glibc-ism #45703

Merged
merged 1 commit into from
Aug 28, 2018

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Aug 28, 2018

These are used to guard diagnostic push/pop pragmas
(to selectively quiet warnings).

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

@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: e2fsprogs

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: e2fsprogs

Partial log (click to expand)

checking for references to /build in /nix/store/d98jijjcb12kb6najv6ikchqbillp4kz-e2fsprogs-1.44.4...
shrinking RPATHs of ELF executables and libraries in /nix/store/i4dv4crg437zq74ydl83s7amhfbqkjk5-e2fsprogs-1.44.4-man
gzipping man pages under /nix/store/i4dv4crg437zq74ydl83s7amhfbqkjk5-e2fsprogs-1.44.4-man/share/man/
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/i4dv4crg437zq74ydl83s7amhfbqkjk5-e2fsprogs-1.44.4-man
checking for references to /build in /nix/store/i4dv4crg437zq74ydl83s7amhfbqkjk5-e2fsprogs-1.44.4-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/di0n8lz46vzavvfp8fy7070cjfhwqd0s-e2fsprogs-1.44.4-info
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/di0n8lz46vzavvfp8fy7070cjfhwqd0s-e2fsprogs-1.44.4-info
checking for references to /build in /nix/store/di0n8lz46vzavvfp8fy7070cjfhwqd0s-e2fsprogs-1.44.4-info...

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: e2fsprogs

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/6ykaw09b6qab8x01xsac3bz73136rlys-e2fsprogs-1.44.4-man
gzipping man pages under /nix/store/6ykaw09b6qab8x01xsac3bz73136rlys-e2fsprogs-1.44.4-man/share/man/
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/6ykaw09b6qab8x01xsac3bz73136rlys-e2fsprogs-1.44.4-man
checking for references to /build in /nix/store/6ykaw09b6qab8x01xsac3bz73136rlys-e2fsprogs-1.44.4-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/vm1ik4bwj8412hqlnswmz9nr7fva5c8z-e2fsprogs-1.44.4-info
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/vm1ik4bwj8412hqlnswmz9nr7fva5c8z-e2fsprogs-1.44.4-info
checking for references to /build in /nix/store/vm1ik4bwj8412hqlnswmz9nr7fva5c8z-e2fsprogs-1.44.4-info...
/nix/store/hpqgvyhs8bhifaip3k2lygrjkihj8lz0-e2fsprogs-1.44.4-bin

@@ -14,6 +14,10 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig texinfo ];
buildInputs = [ libuuid gettext ];

preConfigure = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
NIX_CFLAGS_COMPILE+=" -D__GNUC_PREREQ(maj,min)=0"
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a short explanation here? It looks quite cryptic.

Copy link
Member

@Mic92 Mic92 Aug 28, 2018

Choose a reason for hiding this comment

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

This can be also done in nix, no?

NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.hostPlatform.isMusl " -D__GNUC_PREREQ(maj,min)=0";

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call, updated thank you! How's it look now? :)

@@ -14,6 +14,11 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig texinfo ];
buildInputs = [ libuuid gettext ];

# Only use glibc's __GNUC_PREREQ(X,Y) (checks if compiler is gcc version >= X.Y) when using glibc
# It's safe to use on non-gcc is glibc's features.h is being used.
Copy link
Member

Choose a reason for hiding this comment

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

It is not clear to me what you mean with:

# It's safe to use on non-gcc is glibc's features.h is being used. 

Copy link
Member Author

Choose a reason for hiding this comment

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

Typo "is" -> "if"; dropping that line since not really useful.

What I was intending to say was that this is glibc-specific, not (glibc+gcc)-specific, despite checking for a gcc version number. At least it will be defined to something, instead of failing to compile.

For "special reasons" clang defines macros claiming to be GCC 4.2, so this is all a bit confusing anyway 😁.

@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: e2fsprogs

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 aarch64-linux (full log)

Attempted: e2fsprogs

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/mijnj0h01h8bws6rjcdgkx987zwwi6dh-e2fsprogs-1.44.4-man
gzipping man pages under /nix/store/mijnj0h01h8bws6rjcdgkx987zwwi6dh-e2fsprogs-1.44.4-man/share/man/
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/mijnj0h01h8bws6rjcdgkx987zwwi6dh-e2fsprogs-1.44.4-man
checking for references to /build in /nix/store/mijnj0h01h8bws6rjcdgkx987zwwi6dh-e2fsprogs-1.44.4-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/jp06bg8ihc7k3zkaf3nj0p7cryg94fwz-e2fsprogs-1.44.4-info
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/jp06bg8ihc7k3zkaf3nj0p7cryg94fwz-e2fsprogs-1.44.4-info
checking for references to /build in /nix/store/jp06bg8ihc7k3zkaf3nj0p7cryg94fwz-e2fsprogs-1.44.4-info...
/nix/store/dsvlh80s41b0zcr8ssiy9ca81y207ax1-e2fsprogs-1.44.4-bin

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: e2fsprogs

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/vr2as7f21kyy8zq3x2170knjz7xx8yz6-e2fsprogs-1.44.4-man
gzipping man pages under /nix/store/vr2as7f21kyy8zq3x2170knjz7xx8yz6-e2fsprogs-1.44.4-man/share/man/
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/vr2as7f21kyy8zq3x2170knjz7xx8yz6-e2fsprogs-1.44.4-man
checking for references to /build in /nix/store/vr2as7f21kyy8zq3x2170knjz7xx8yz6-e2fsprogs-1.44.4-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/avwzg6b91fryp3kspbqg8viwciapiyvl-e2fsprogs-1.44.4-info
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/avwzg6b91fryp3kspbqg8viwciapiyvl-e2fsprogs-1.44.4-info
checking for references to /build in /nix/store/avwzg6b91fryp3kspbqg8viwciapiyvl-e2fsprogs-1.44.4-info...
/nix/store/spfi77j1a92wk65sj325hs8lakiv3miw-e2fsprogs-1.44.4-bin

Fixes compilation on non-glibc at minor cost since these are only
used to guard the use of pragmas selectively disabling warnings
based on the GCC version used.
@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: e2fsprogs

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: e2fsprogs

Partial log (click to expand)

/nix/store/spfi77j1a92wk65sj325hs8lakiv3miw-e2fsprogs-1.44.4-bin

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: e2fsprogs

Partial log (click to expand)

/nix/store/dsvlh80s41b0zcr8ssiy9ca81y207ax1-e2fsprogs-1.44.4-bin

Copy link
Member

@Mic92 Mic92 left a comment

Choose a reason for hiding this comment

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

now it makes sense.

@dtzWill dtzWill merged commit 4c2d822 into NixOS:staging Aug 28, 2018
@dtzWill dtzWill deleted the fix/e2fsprogs-musl branch August 28, 2018 14:15
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.

3 participants