derived-path: refuse built derived path with a non-derivation base
Example: /nix/store/dr53sp25hyfsnzjpm8mh3r3y36vrw3ng-neovim-0.9.5^out This is nonsensical since selecting outputs can only be done for a buildable derivation, not for a realised store path. The build worker side of things ends up crashing with an assertion when trying to handle such malformed paths. Change-Id: Ia3587c71fe3da5bea45d4e506e1be4dd62291ddf
This commit is contained in:
@@ -77,6 +77,15 @@ TEST_F(DerivedPathTest, built_built_xp) {
|
||||
MissingExperimentalFeature);
|
||||
}
|
||||
|
||||
/**
|
||||
* Built paths with a non-derivation base should fail parsing.
|
||||
*/
|
||||
TEST_F(DerivedPathTest, non_derivation_base) {
|
||||
ASSERT_THROW(
|
||||
DerivedPath::parse(*store, "/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-x^foo"),
|
||||
InvalidPath);
|
||||
}
|
||||
|
||||
#ifndef COVERAGE
|
||||
|
||||
RC_GTEST_FIXTURE_PROP(
|
||||
|
||||
Reference in New Issue
Block a user