tweag/rules_nixpkgs

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

polyrod opened this issue · 0 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: