Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt replacing sandboxroot by rules_nixpkgs (or similar) #342

Open
Tracked by #345
leoluk opened this issue Aug 22, 2024 · 2 comments
Open
Tracked by #345

Attempt replacing sandboxroot by rules_nixpkgs (or similar) #342

leoluk opened this issue Aug 22, 2024 · 2 comments
Labels

Comments

@leoluk
Copy link
Member

leoluk commented Aug 22, 2024

Advantages of current approach:

  • Works outside of NixOS without requiring a Nix daemon.
  • Fedora, unlike NixOS, ships with toolchains which are actually meant for building for targets other than NixOS.

Disadvantages of current approach:

  • Requires buildFHSUserEnv on NixOS, which causes complications (such as Git breaking within it, and causing issues with Bazel daemon persistence). Which is unfortunate, given that NixOS is our primary development target.
  • Friction caused by different host and build environments (generally fine, but inconvenient for debugging).
  • Becomes hard to reason about: a build on NixOS currently involves at least three wrappers and two user namespaces: Nix shell, FHS env, Bazel's own sandbox...
  • Hard dependency on Bazel's sandbox + user namespaces, preventing it from building in restricted environments (such as inside gVisor or distros that turn off user namespaces by default).
  • Hard dependency on Fedora.
    • Which is essentially a black box to us and can't easily be built/reproduced from source.

CC @q3k

@leoluk leoluk added enhancement New feature or request c/dev-ux c/build labels Aug 22, 2024
@leoluk leoluk self-assigned this Aug 22, 2024
@fionera fionera self-assigned this Oct 1, 2024
@fionera
Copy link
Contributor

fionera commented Nov 28, 2024

After a lot of trials we probably wont do this quickly. There are multiple ways forward/other options tho.

  1. Wait for Add an easy way to use packages inside run_shell  tweag/rules_nixpkgs#615
  2. Build a derivation that generates a docker container, that we extract and use as sandboxroot
  3. ^ or skip the docker thing and build the sandboxroot directly in nix

@fionera
Copy link
Contributor

fionera commented Nov 28, 2024

Or skip sandboxroot entirely and just use the nix-shell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants