libstore: generate darwin sandbox profile outside of sandbox process

Change-Id: I1a82e1dfa3709e1513d7acbdff50dc594cbc2323
This commit is contained in:
eldritch horrors
2026-02-02 14:20:54 +00:00
parent 9a31cc7da0
commit f09ed729b5
2 changed files with 9 additions and 5 deletions
+5 -2
View File
@@ -254,10 +254,10 @@ try {
co_return result::current_exception();
}
void DarwinLocalDerivationGoal::finishChildSetup()
void DarwinLocalDerivationGoal::prepareSandbox()
{
/* This has to appear before import statements. */
std::string sandboxProfile = "(version 1)\n";
sandboxProfile = "(version 1)\n";
if (useChroot) {
@@ -369,7 +369,10 @@ void DarwinLocalDerivationGoal::finishChildSetup()
}
debug("Generated sandbox profile: %1%", sandboxProfile);
}
void DarwinLocalDerivationGoal::finishChildSetup()
{
bool allowLocalNetworking = parsedDrv->getBoolAttr("__darwinAllowLocalNetworking");
/* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try
+4 -3
View File
@@ -37,11 +37,12 @@ public:
using LocalDerivationGoal::LocalDerivationGoal;
private:
std::string sandboxProfile;
/**
* Prepare the sandbox: This is empty on Darwin since sandbox setup happens in
* enterSandbox
* Prepare the sandbox: generate the sandboxProfile
*/
void prepareSandbox() override{};
void prepareSandbox() override;
void finishChildSetup() override;