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

hdf5 pulls in gcc-wrapper #29889

Closed
shajra opened this issue Sep 28, 2017 · 6 comments
Closed

hdf5 pulls in gcc-wrapper #29889

shajra opened this issue Sep 28, 2017 · 6 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@shajra
Copy link
Contributor

shajra commented Sep 28, 2017

Issue description

The hdf5 library pulls in gcc-wrapper as a transitive dependency, which seems less than ideal.

The problem is that the build creates this text file summary of the build in lib/libhdf5.settings, that has the following:

Compiling Options:
------------------
               Compilation Mode: production
               C Compiler: /nix/store/kd7vb1afwvm2k65n9qjdw767w6lnwsrd-gcc-wrapper-6.4.0/bin/gcc ( gcc (GCC) 6.4.0)
               CFLAGS:
               ...

Additionally, this same text is embedded as a string in one of the shared libraries (lib/libhdf5.so.10.2.1).

The reason this is annoying for me is that I use transitive closures to bundle minimized tarballs, which I then put into Docker. But now gcc is grabbed, just because someone put in a informational string of which compiler was used.

I still have to go through the hdf5 source code and see if there's a simple fix. I could use the replace-literal utility to crop off the "/nix/store" from the reference in the shared library (maybe... not sure how tricky that might be). It's certainly easier to modify the libhdf5.settings file.

I'm open to other ideas.

Steps to reproduce

nix-store -qR "$(nix-build -E '(import <nixpkgs> {}).hdf5' --no-link)" | grep gcc-wrapper

yields

/nix/store/kd7vb1afwvm2k65n9qjdw767w6lnwsrd-gcc-wrapper-6.4.0

Technical details

  • System: (NixOS: nixos-version, Ubuntu/Fedora: lsb_release -a, ...)

Debian testing with Nix

  • Nix version: (run nix-env --version)

nix-env (Nix) 1.11.14

  • Nixpkgs version: (run nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion)

"18.03pre116475.d757d8142e"

  • Sandboxing enabled: (run grep build-use-sandbox /etc/nix/nix.conf)

build-use-sandbox = true

@orivej
Copy link
Contributor

orivej commented Sep 28, 2017

Here removeReferencesTo is more appropriate than replace-literal.

@shajra
Copy link
Contributor Author

shajra commented Sep 28, 2017

@orivej cool, I just did that and it worked pretty well. I'll have a PR made up shortly and link to this ticket.

FRidh pushed a commit that referenced this issue Sep 28, 2017
The build provides as text a summary of the build, including the
absolute path of the compiler used for compilation.  Unfortunately, this
pulls in stdenv.cc as a transitive closure.

So this change just calls remove-references-to as a postInstall step for
the one stdenv.cc dependency.

See #29889 for details.
FRidh pushed a commit that referenced this issue Sep 28, 2017
The build provides as text a summary of the build, including the
absolute path of the compiler used for compilation.  Unfortunately, this
pulls in stdenv.cc as a transitive closure.

So this change just calls remove-references-to as a postInstall step for
the one stdenv.cc dependency.

See #29889 for details.

(cherry picked from commit 405c7f9e437a89bbebc3e2663e8fcc74e69783d6)
@FRidh FRidh closed this as completed Sep 28, 2017
@shajra
Copy link
Contributor Author

shajra commented Sep 28, 2017

@FRidh thanks for taking care of the recommended changes (I was sleeping). I need to look up again the difference between native and normal build inputs. I still get confused about the difference.

@oxij
Copy link
Member

oxij commented Aug 21, 2018

A fun problem found via doCheckByDefault. With 82667fe applied h5cc fails with

h5cc: line 318: /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-gcc-wrapper-7.3.0/bin/gcc: No such file or directory

in installcheck phase, and this eeeeeeeeeeeeeeeee* is made by remove-references-to.

I guess nobody uses binaries this package has in nixpkgs, but having those be broken by default isn't nice, I think.

I can't reopen this, but I suggest doing so and solving this by splitting the package into multiple outputs or something.

@FRidh FRidh reopened this Aug 21, 2018
@stale
Copy link

stale bot commented Jun 4, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 4, 2020
@Artturin
Copy link
Member

No longer

@Artturin Artturin closed this as not planned Won't fix, can't repro, duplicate, stale Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

5 participants