Code Monkey home page Code Monkey logo

ld-floxlib's Introduction

ld-floxlib.so

ld.so hack allowing Nix binaries to impurely load RHEL system libraries as last resort


Background

Ideally, we would migrate to Nix by first porting all software to work in Nix and then update the default paths to point to the Nix versions. Unfortunately this plan requires that everything must first be ported to Nix before we can run anything in Nix.

As a fallback position, we have updated the python sitecustomize.py module to call out to bootstrap.py to load "impure" python modules not found in Nix, and this has introduced the requirement that dynamic python extensions compiled on RHEL be able to load RHEL versions of system libraries found in /lib64.


Description

The ld-floxlib.so plugin works with the GNU dynamic linker auditing API LD_AUDIT variable to search for libraries in the RHEL default /lib64 path when they are not found in the Nix default (/path/to/glibc/lib) location.

To be clear, this mechanism exists to defeat the purity guarantees inherent in Nix and is therefore A Bad Idea. However, it also simplifies the process of migrating to Nix, so we are adding it with the hope and expectation that it will only be used for a (perhaps extended) transition period while we port all front-office code to Nix.


Usage

The ld-floxlib customization is enabled by setting the LD_AUDIT environment variable:

% LD_AUDIT=/path/to/ld-floxlib.so <command and args>

Impure library references can be audited by defining the LD_FLOXLIB_AUDIT_IMPURE environment variable. Auditing lines are prefaced with the string "AUDIT:" and printed to STDERR:

% LD_AUDIT=~/src/ld-floxlib/ld-floxlib.so LD_FLOXLIB_AUDIT_IMPURE=1 \
    /tmp/python-std -c 'import deshaw.datetime' > /dev/null
AUDIT: /nix/store/jc8higknnpzvvx92djv38rprnd5457s2-glibc-2.30/lib/libstdc++.so.6 -> /lib64/libstdc++.so.6
AUDIT: /nix/store/jc8higknnpzvvx92djv38rprnd5457s2-glibc-2.30/lib/libsnappy.so.1 -> /lib64/libsnappy.so.1

See also

rtld-audit(7)

N.B. "Auditing API" as described in the above manpage is in one regard a misnomer since it actually allows the dynamic behavior to be changed.

ld-floxlib's People

Contributors

limeytexan avatar desmfb avatar

Stargazers

Jeff Hykin avatar Someone avatar Yang, Bo avatar

Watchers

 avatar leigh capili avatar Alex Ameen avatar  avatar  avatar  avatar

Forkers

atry

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.