Sandbox blocks output to default plugin output directory when it's under <pkgdir>/.build
#4009
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The sandbox rules introduced in #3996 made the entire package directory read-only, but that isn't appropriate when
.build
is inside the package directory.Motivation
This fixes a bug with package command plugins such as DocC that write into the package working directory, in the particular case in which that working directory is inside the package directory (as in the
.build
default case).Changes
The rules for applying read-only directories were intended to shadow the implicit rules added by specifying a writable temporary directory, not to block the ones specified by explicit writable directories. This fixes that ordering, and adds the missing unit test that would have caught the problem.
A future change reworks Sandbox completely so that it becomes a struct that can carry around the sandbox profile configuration until it is applied — this change is intended to be small enough to be nominatable
rdar://87417780