1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-28 05:00:58 +01:00

Move pathsInChroot

This commit is contained in:
Eelco Dolstra 2025-05-26 20:30:36 +02:00
parent 5653bf5e0a
commit 67408807d8
3 changed files with 140 additions and 117 deletions

View file

@ -2,6 +2,8 @@
struct DarwinDerivationBuilder : DerivationBuilderImpl
{
PathsInChroot pathsInChroot;
DarwinDerivationBuilder(
Store & store, std::unique_ptr<DerivationBuilderCallbacks> miscMethods, DerivationBuilderParams params)
: DerivationBuilderImpl(store, std::move(miscMethods), std::move(params))
@ -9,6 +11,11 @@ struct DarwinDerivationBuilder : DerivationBuilderImpl
useChroot = true;
}
void prepareSandbox() override
{
pathsInChroot = getPathsInSandbox();
}
void execBuilder(const Strings & args, const Strings & envStrs) override
{
posix_spawnattr_t attrp;
@ -69,7 +76,7 @@ struct DarwinDerivationBuilder : DerivationBuilderImpl
/* Add all our input paths to the chroot */
for (auto & i : inputPaths) {
auto p = store.printStorePath(i);
pathsInChroot[p] = p;
pathsInChroot.insert_or_assign(p, p);
}
/* Violations will go to the syslog if you set this. Unfortunately the destination does not appear to be