Allow ipc-sysv* in the Darwin sandbox #623
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#623
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is your feature request related to a problem? Please describe.
The sandbox profile in CppNix was updated in https://github.com/NixOS/nix/pull/10878 to allow the
shmget
syscall, which is used by the postgresql tests.Describe the solution you'd like
It would be nice if
372d5a441e
could be backported to Lix:Describe alternatives you've considered
The postgresql derivation in nixpkgs could be updated to set
sandboxProfile
(though this would be redundant for CppNix):Additional context
I ran into this while debugging a build failure (not specific to Lix) in nixpkgs: https://github.com/NixOS/nixpkgs/issues/371242
I don't know if this should be trivially just bypassed in the sandbox: sysv IPC API is effectively deprecated on macOS and should probably not be used to begin with https://forums.developer.apple.com/forums/thread/719897
I looked into why postgres was using APIs which are jank on every POSIX platform (POSIX shared memory is preferred on basically every other platform as well) and it seems that it is because they need it for some kind of synchronization purposes that cannot be avoided:
102de3be73/src/backend/port/sysv_shmem.c (L43-L49)
However, all of this together makes me think that postgres really should be the special case here, and we shouldn't allow derivations to do things that are 1. uncommon, 2. liable to be incompatible with e.g. app sandbox, 3. which allow arbitrary communication with the rest of the system, without the derivation specifying it needs them. However, I am not a macOS maintainer and I might be missing some details here.
I do know that
sandboxProfile
is only permitted whensandbox
isrelaxed
innix.conf
, which is a non-ideal restriction for something which probably be stuck in there forever, but weh. idk.@lilyball may know more/have other thoughts
That makes sense. AFAICT sysv IPC was added to CppNix primarily to support running the postgres tests. The postgres tests were recently disabled so it's likely unnecessary (no other derivations need it, AFAIK).
I think we can just close this wontfix then, since it doesn't cause any other known problems (I think?).
In fact we were able to enable them in August thanks to the sandbox change in CppNix. We only disabled them recently again, because we hit #691 and didn't understand it fully, yet.
I'd really like to enable PostgreSQL tests again on Darwin in nixpkgs. It's not only the tests for PostgreSQL itself, but also a lot of packages depending on it and running some tests against it in their checkPhase. Currently, almost all of them are special cased for darwin - and then they disable all their tests.
This really creates a big gap of testing on darwin. I'm sure @ma27 agrees with me here: As the nixpkgs' postgres maintainers, we would like to provide first class support for MacOS as well.
Yeah, not good. Additionally, the knowledge would have to be spread over all kinds of places in nixpkgs. Hard to maintain, really.
Of course, now that we know about #691, it makes sense to only do the backport if we can fix that issue as well. The status quo, for lix, is that it gives a hard error (permission denied), which is predictable. The status quo for CppNix is that it fails in very unpredictable ways, because of that "leak".
@wolfgangwalther wrote in #623 (comment):
In fact, we only disabled the tests for x86_64-darwin, not for aarch64-darwin. So currently lix can not build nixpkgs' postgresql derivation on aarch64-darwin.