-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ci: Always run with sandbox, even on Darwin #8240
Conversation
This fails on macOS with:
|
Fwiw, this commit did work in CI about 2 months ago: https://github.com/NixOS/nix/actions/runs/4208121587/jobs/7303768161 I suspect that some commit to master in that time frame broke the build in the sandbox. |
This broke in #8062 |
I worked around the two problems, by calling getDefaultSSLCertFile() only when it's not overridden or set, and by ignoring EPERM from getDefaultNixPath(). The main problem is, I think, that the settings are not set up to have dynamic defaults. It also leads to misleading documentation entries, since the outputs of these functions at build time end up in the docs, and don't even match the runtime behaviour. See also the However, I'm just here to fix the sandbox build. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/tweag-nix-dev-update-48/28102/1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that looks good overall, and it's a nice addition :) (I didn't even know it wasn't enabled by default on GH actions).
I'm curious why these test failures didn't happen on hydra. I'm assuming that Hydra does have the sandbox on, even on Darwin, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that looks good overall, and it's a nice addition :) (I didn't even know it wasn't enabled by default on GH actions).
I'm curious why these test failures didn't happen on hydra. I'm assuming that Hydra does have the sandbox on, even on Darwin, right?
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-05-12-nix-team-meeting-minutes-54/28197/1 |
And fix a test failure in the sandbox due to /home existing on Darwin but not being accessible in the sandbox since it's a symlink to /System/Volumes/Data/home, see https://github.com/NixOS/nix/actions/runs/4205378453/jobs/7297384658#step:6:2127: C++ exception with description "error: getting status of /home/schnitzel/darmstadt/pommes: Operation not permitted" thrown in the test body. On Linux this wasn't a problem because there /home doesn't exist in the sandbox
This does pathExists on various paths, which crashes on EPERM in the macOS sandbox.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it's great to have that!
I ran into this issue while working on the Darwin stdenv update in nixpkgs, so I wanted to add a comment regarding sandboxing and Hydra. Hydra does not have the sandbox enabled. There are a number of packages I’ve had to add sandbox profiles to build them after bootstrapping the Darwin stdenv. There’s also been at least one failure on Hydra due to a lack of sandbox (NixOS/nixpkgs#201095). |
And fix a test failure in the sandbox due to /home existing on Darwin but not being accessible in the sandbox since it's a symlink to /System/Volumes/Data/home, see
https://github.com/NixOS/nix/actions/runs/4205378453/jobs/7297384658#step:6:2127:
On Linux this wasn't a problem because there /home doesn't exist in the sandbox
Motivation
#7735 (comment)
Context
originally by @infinisil
Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.sh
src/*/tests
tests/nixos/*
Priorities
Add 👍 to pull requests you find important.