Skip to content

libstore/build/local-derivation-goal: error earlier when sandbox path is inaccessible#13396

Open
cole-h wants to merge 1 commit into
NixOS:masterfrom
cole-h:error-earlier-when-sandbox-path-inaccessible
Open

libstore/build/local-derivation-goal: error earlier when sandbox path is inaccessible#13396
cole-h wants to merge 1 commit into
NixOS:masterfrom
cole-h:error-earlier-when-sandbox-path-inaccessible

Conversation

@cole-h
Copy link
Copy Markdown
Member

@cole-h cole-h commented Jun 25, 2025

Forward port of DeterminateSystems#88.

Motivation

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions Bot added the with-tests Issues related to testing. PRs with tests have some priority label Jun 25, 2025
Comment on lines +906 to +920

std::string inside, outside;
if (p == std::string::npos) {
inside = i;
outside = i;
} else {
inside = i.substr(0, p);
outside = i.substr(p + 1);
}

if (!optional && !maybeLstat(outside)) {
throw SysError("path '%s' is configured as part of the `sandbox-paths` option, but is inaccessible", outside);
}

pathsInChroot[inside] = {outside, optional};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I think all of the parsing and preprocessing code should be done in a less ad-hoc way. Can't the sandboxPaths setting be a better datastructure like a map of path -> path + attributes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#13315 gives us a structured sandboxPaths datatype.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants