rules_nixpkgs icon indicating copy to clipboard operation
rules_nixpkgs copied to clipboard

libstdc++.so.6 not found for haskell binary

Open polyrod opened this issue 1 year ago • 1 comments

Hi,

to reproducably build with bazel and nix i followed the guide at https://rules-haskell.readthedocs.io/en/latest/haskell-use-cases.html.

As shown in the guide in section "Containerization with rules_oci", I used nixpkgs_package to prepare a haskell base image for the projects docker container. it worked until the project grew and pulled more dependencies. These i added to the contents list in the dockerTools.buildLayeredImage function.

grafik

Now i am at the point where the binary in the container won't run due to missing libstdc++.so.6 runtime dependency.

I added stdenv.cc.cc.libs to the "contents list" and the container was build successfully, yet the binary still refuses to run.

grafik

i checked the container fs and despite there is libstdc++.so.6 under /nix/store inside the container image, even if all library dependencies gotten rewritten to libraries in the nix store, libstdc++.so.6 did not.

grafik

Expected behavior binary should find libstdc++.so.6.

Environment

  • Debian + docker:

polyrod avatar Jul 25 '24 19:07 polyrod

Can you provide a minimal reproducer for this? I would like to provide a fix, but I'm not sure I can get into the same state.

malt3 avatar Nov 29 '24 16:11 malt3