You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
devconfig,shellgen: option to patch ELF binaries with newer glibc
Add an optional `patch_glibc` boolean field to packages in devbox.json.
When true, devbox will patch any ELF binaries in a package to link
against the latest `nixpkgs#glibc` at runtime. This is a workaround for
dynamic linking issues that can arise when using older packages.
For example, an old Python interpreter that's linked against glibc 2.35
might run a script that loads a native library that requires glibc
2.37. Because the linker only loads a library into a process once
(regardless of version), linking will fail when the script references a
2.37 symbol.
The following devbox.json will reproduce a glibc version bug when the
`virtenv` and `crash` scripts are run on x86-64-linux (aarch64 will not
work). Setting the `patch_glibc` field to true will fix it:
```json
{
"packages": {
"binutils": "latest",
"libpqxx": "latest",
"libxcrypt": "latest",
"libz": "latest",
"python37Packages.pip": "latest",
"python": {
"version": "3.7",
"patch_glibc": false
}
},
"shell": {
"scripts": {
"crash": "python3 -c 'import psycopg2'",
"virtenv": [
"rm -rf \"$VENV_DIR\"",
"echo \"python3 path: $(readlink -f $(command -v python3))\"",
"python3 -m venv \"$VENV_DIR\"",
". \"$VENV_DIR/bin/activate\"",
"echo \"pip3 path: $(readlink -f $(command -v pip3))\"",
"pip3 install psycopg2==2.9.5"
]
}
}
}
```
This field is intended to be a "last resort" for when a package cannot
be updated to a newer version. Upgrading to a newer version of Python
in the example above is preferable.
0 commit comments