Skip to content

[WIP] fhs-userenv-bubblewrap: Support ld.so.conf/cache - #102178

Closed
moben wants to merge 2 commits into
NixOS:masterfrom
moben:steam_runtime
Closed

moben wants to merge 2 commits into
NixOS:masterfrom
moben:steam_runtime

Conversation

@moben

@moben moben commented Oct 30, 2020

Copy link
Copy Markdown
Contributor
Motivation for this change

This is an effort to fix compatibility with the new steam runtime. See also #100655

There are currently 2 parts to this:

  1. Preserve the symlink structure that is created for the FHS environment when launching the bwrap container (bin --> usr/bin, ...). This is to allow things like bind-mounting another /usr inside to work like they would on another distribution with a "usr-merge" implemented and also overwrite the things in /bin.
  2. Create the setup some symlinks to allow /etc/ld.so.conf and /etc/ld.so.cache to function with our glibc. This should make our current setting of LD_LIBRARY_PATH obsolete as well and improves compatibility e.g. with games that incorrectly overwrite that instead of appending to it.

There is still a bit more testing needed until the linked issue is fully resolved. However as far as I can currently tell these changes are all that is necessarily NixOS specific.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't include pkgs but glibc.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the infinit recursion is occurring here. Can the pkgs be removed and glibc added directly?

@ofborg ofborg Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Oct 30, 2020
@ryantm
ryantm marked this pull request as draft October 31, 2020 14:01
moben added 2 commits November 2, 2020 22:56
Preserve top-level symlinks such as /lib -> /usr/lib.

This allows nested containers such as Steam's new runtime to remount
/usr if they need to and then run unmodified binaries that reference
e.g. /lib/ld-linux-x86-64.so.2

Before, we would mount the fully resolved host directory at /lib and
thus the dynamic loader would always be the one from the host filesystem.
@ashkitten

Copy link
Copy Markdown
Contributor

superseded by #114024

@ashkitten ashkitten closed this Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants