GithubHelp home page GithubHelp logo

Comments (6)

rupurt avatar rupurt commented on July 18, 2024 1

Would definitely love to figure out how to make this work on per project basis. For example I personally use home-manager. But most people on my team don't, and they don't want to do it either which I feel like is completely understandable.

from nix-ld.

Mic92 avatar Mic92 commented on July 18, 2024

If you are doing buildFHSEnv, you are already getting /lib64/ld-linux-x86-64.so.2 based on the real glibc and you don't need nix-ld in the first place. So it doesn't make sense to replicate this behavior with nix-ld. I would say buildFHSEnv is the per project-based alternative to nix-ld.

from nix-ld.

bonsairobo avatar bonsairobo commented on July 18, 2024

it doesn't make sense to replicate this behavior with nix-ld

buildFHSEnv does quite a bit more than just providing a global loader. It simulates an entire file hierarchy for binaries and libraries in the nix store. And as it's said in the README of nix-ld:

these sandboxes have their own weaknesses:

  • setuid binaries cannot be executed inside a fhsuserenv
  • inside a buildFHSUserEnv you can not use other sandbox tools like bwrap or 'nix build'.
  • buildFHSUserEnv requires a subshell which does not work well with direnv

I couldn't say if any of these weaknesses are strictly a result of the per-project nature of buildFHSEnv, so I ask you to consider that.

So it would seem there is room for a per-project nix-ld to overcome the weaknesses of buildFHSEnv.

from nix-ld.

Mic92 avatar Mic92 commented on July 18, 2024

You can enable NIX_LD_LIBRARY_PATH in your project's devshell. Is this not what you want?

from nix-ld.

bonsairobo avatar bonsairobo commented on July 18, 2024

You can enable NIX_LD_LIBRARY_PATH in your project's devshell. Is this not what you want?

For this to have any effect, doesn't that require that nix-ld is already installed on your system?

from nix-ld.

Mic92 avatar Mic92 commented on July 18, 2024

You can enable NIX_LD_LIBRARY_PATH in your project's devshell. Is this not what you want?

For this to have any effect, doesn't that require that nix-ld is already installed on your system?

Yes. But it needs to be. This is the tradeoff. I don't see how otherwise nix-ld would be made work.

from nix-ld.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.