rules_nixpkgs icon indicating copy to clipboard operation
rules_nixpkgs copied to clipboard

Question re the python docker example

Open Jonpez2 opened this issue 3 years ago • 1 comments

This is a clarifying question not an issue. Apologies if this is an abuse of the issue system.

My question is: given that nix is capable of building totally self contained docker images, why did you need to do any setting of LD_LIBRARY_PATH in your docker example?

I ask because I am hoping to use nix in my bazel setup, at least partially to delete docker from my build, and to make my local runs exactly the same as my docker runs. This felt achievable until I saw the setup code here. What am I missing please?

thank you!

Jonpez2 avatar May 21 '22 08:05 Jonpez2

Another question I have - is the nixpkgs_package a repository rule only because you don’t know a priori what the actual built artefacts will be? Could we make it into a normal rule by ‘simply’ naming the outputs? Or is there something I’m missing?

also please point me somewhere else if there’s a better way to ask questions like this!

thank you

Jonpez2 avatar May 21 '22 11:05 Jonpez2

why did you need to do any setting of LD_LIBRARY_PATH in your docker example?

I'm not the original author of that change so this is a complete guess, but maybe the Flask distribution has some binaries that need to find ld-linux-x86-64.so.2 in /lib64 (as the python binary itself comes from Nix, its interpreter should be okay). Perhaps @kaplan2539 can comment?

Closing as this isn't strictly an issue, but feel free to continue the discussion if it's still relevant to you.

benradf avatar Aug 02 '23 14:08 benradf