@@ -127,6 +127,21 @@ TEST_ATERM_JSON(advancedAttributes_structuredAttrs_defaults, "advanced-attribute
127127
128128#undef TEST_ATERM_JSON
129129
130+ /* *
131+ * Since these are both repeated and sensative opaque values, it makes
132+ * sense to give them names in this file.
133+ */
134+ static std::string pathFoo = " /nix/store/p0hax2lzvjpfc2gwkk62xdglz0fcqfzn-foo" ,
135+ pathFooDev = " /nix/store/z0rjzy29v9k5qa4nqpykrbzirj7sd43v-foo-dev" ,
136+ pathBar = " /nix/store/r5cff30838majxk5mp3ip2diffi8vpaj-bar" ,
137+ pathBarDev = " /nix/store/9b61w26b4avv870dw0ymb6rw4r1hzpws-bar-dev" ,
138+ pathBarDrvIA = " /nix/store/vj2i49jm2868j2fmqvxm70vlzmzvgv14-bar.drv" ,
139+ pathBarDrvCA = " /nix/store/qnml92yh97a6fbrs2m5qg5cqlc8vni58-bar.drv" ,
140+ placeholderFoo = " /164j69y6zir9z0339n8pjigg3rckinlr77bxsavzizdaaljb7nh9" ,
141+ placeholderFooDev = " /0nr45p69vn6izw9446wsh9bng9nndhvn19kpsm4n96a5mycw0s4z" ,
142+ placeholderBar = " /0nyw57wm2iicnm9rglvjmbci3ikmcp823czdqdzdcgsnnwqps71g" ,
143+ placeholderBarDev = " /07f301yqyz8c6wf6bbbavb2q39j4n8kmcly1s09xadyhgy6x2wr8" ;
144+
130145using ExportReferencesMap = decltype (DerivationOptions::exportReferencesGraph);
131146
132147static const DerivationOptions advancedAttributes_defaults = {
@@ -216,16 +231,16 @@ DerivationOptions advancedAttributes_ia = {
216231 .outputChecks =
217232 DerivationOptions::OutputChecks{
218233 .ignoreSelfRefs = true ,
219- .allowedReferences = StringSet{" /nix/store/p0hax2lzvjpfc2gwkk62xdglz0fcqfzn-foo " },
220- .disallowedReferences = StringSet{" /nix/store/r5cff30838majxk5mp3ip2diffi8vpaj-bar " },
221- .allowedRequisites = StringSet{" /nix/store/z0rjzy29v9k5qa4nqpykrbzirj7sd43v-foo-dev " },
222- .disallowedRequisites = StringSet{" /nix/store/9b61w26b4avv870dw0ymb6rw4r1hzpws-bar-dev " },
234+ .allowedReferences = StringSet{pathFoo },
235+ .disallowedReferences = StringSet{pathBar, " dev " },
236+ .allowedRequisites = StringSet{pathFooDev, " bin " },
237+ .disallowedRequisites = StringSet{pathBarDev },
223238 },
224239 .unsafeDiscardReferences = {},
225240 .passAsFile = {},
226241 .exportReferencesGraph {
227- {" refs1" , {" /nix/store/p0hax2lzvjpfc2gwkk62xdglz0fcqfzn-foo " }},
228- {" refs2" , {" /nix/store/vj2i49jm2868j2fmqvxm70vlzmzvgv14-bar.drv " }},
242+ {" refs1" , {pathFoo }},
243+ {" refs2" , {pathBarDrvIA }},
229244 },
230245 .additionalSandboxProfile = " sandcastle" ,
231246 .noChroot = true ,
@@ -246,16 +261,16 @@ DerivationOptions advancedAttributes_ca = {
246261 .outputChecks =
247262 DerivationOptions::OutputChecks{
248263 .ignoreSelfRefs = true ,
249- .allowedReferences = StringSet{" /164j69y6zir9z0339n8pjigg3rckinlr77bxsavzizdaaljb7nh9 " },
250- .disallowedReferences = StringSet{" /0nyw57wm2iicnm9rglvjmbci3ikmcp823czdqdzdcgsnnwqps71g " },
251- .allowedRequisites = StringSet{" /0nr45p69vn6izw9446wsh9bng9nndhvn19kpsm4n96a5mycw0s4z " },
252- .disallowedRequisites = StringSet{" /07f301yqyz8c6wf6bbbavb2q39j4n8kmcly1s09xadyhgy6x2wr8 " },
264+ .allowedReferences = StringSet{placeholderFoo },
265+ .disallowedReferences = StringSet{placeholderBar, " dev " },
266+ .allowedRequisites = StringSet{placeholderFooDev, " bin " },
267+ .disallowedRequisites = StringSet{placeholderBarDev },
253268 },
254269 .unsafeDiscardReferences = {},
255270 .passAsFile = {},
256271 .exportReferencesGraph {
257- {" refs1" , {" /164j69y6zir9z0339n8pjigg3rckinlr77bxsavzizdaaljb7nh9 " }},
258- {" refs2" , {" /nix/store/qnml92yh97a6fbrs2m5qg5cqlc8vni58-bar.drv " }},
272+ {" refs1" , {placeholderFoo }},
273+ {" refs2" , {pathBarDrvCA }},
259274 },
260275 .additionalSandboxProfile = " sandcastle" ,
261276 .noChroot = true ,
@@ -375,13 +390,13 @@ DerivationOptions advancedAttributes_structuredAttrs_ia = {
375390 std::map<std::string, DerivationOptions::OutputChecks>{
376391 {" out" ,
377392 DerivationOptions::OutputChecks{
378- .allowedReferences = StringSet{" /nix/store/p0hax2lzvjpfc2gwkk62xdglz0fcqfzn-foo " },
379- .allowedRequisites = StringSet{" /nix/store/z0rjzy29v9k5qa4nqpykrbzirj7sd43v-foo-dev " },
393+ .allowedReferences = StringSet{pathFoo },
394+ .allowedRequisites = StringSet{pathFooDev, " bin " },
380395 }},
381396 {" bin" ,
382397 DerivationOptions::OutputChecks{
383- .disallowedReferences = StringSet{" /nix/store/r5cff30838majxk5mp3ip2diffi8vpaj-bar " },
384- .disallowedRequisites = StringSet{" /nix/store/9b61w26b4avv870dw0ymb6rw4r1hzpws-bar-dev " },
398+ .disallowedReferences = StringSet{pathBar, " dev " },
399+ .disallowedRequisites = StringSet{pathBarDev },
385400 }},
386401 {" dev" ,
387402 DerivationOptions::OutputChecks{
@@ -393,8 +408,8 @@ DerivationOptions advancedAttributes_structuredAttrs_ia = {
393408 .passAsFile = {},
394409 .exportReferencesGraph =
395410 {
396- {" refs1" , {" /nix/store/p0hax2lzvjpfc2gwkk62xdglz0fcqfzn-foo " }},
397- {" refs2" , {" /nix/store/vj2i49jm2868j2fmqvxm70vlzmzvgv14-bar.drv " }},
411+ {" refs1" , {pathFoo }},
412+ {" refs2" , {pathBarDrvIA }},
398413 },
399414 .additionalSandboxProfile = " sandcastle" ,
400415 .noChroot = true ,
@@ -417,13 +432,13 @@ DerivationOptions advancedAttributes_structuredAttrs_ca = {
417432 std::map<std::string, DerivationOptions::OutputChecks>{
418433 {" out" ,
419434 DerivationOptions::OutputChecks{
420- .allowedReferences = StringSet{" /164j69y6zir9z0339n8pjigg3rckinlr77bxsavzizdaaljb7nh9 " },
421- .allowedRequisites = StringSet{" /0nr45p69vn6izw9446wsh9bng9nndhvn19kpsm4n96a5mycw0s4z " },
435+ .allowedReferences = StringSet{placeholderFoo },
436+ .allowedRequisites = StringSet{placeholderFooDev, " bin " },
422437 }},
423438 {" bin" ,
424439 DerivationOptions::OutputChecks{
425- .disallowedReferences = StringSet{" /0nyw57wm2iicnm9rglvjmbci3ikmcp823czdqdzdcgsnnwqps71g " },
426- .disallowedRequisites = StringSet{" /07f301yqyz8c6wf6bbbavb2q39j4n8kmcly1s09xadyhgy6x2wr8 " },
440+ .disallowedReferences = StringSet{placeholderBar, " dev " },
441+ .disallowedRequisites = StringSet{placeholderBarDev },
427442 }},
428443 {" dev" ,
429444 DerivationOptions::OutputChecks{
@@ -435,8 +450,8 @@ DerivationOptions advancedAttributes_structuredAttrs_ca = {
435450 .passAsFile = {},
436451 .exportReferencesGraph =
437452 {
438- {" refs1" , {" /164j69y6zir9z0339n8pjigg3rckinlr77bxsavzizdaaljb7nh9 " }},
439- {" refs2" , {" /nix/store/qnml92yh97a6fbrs2m5qg5cqlc8vni58-bar.drv " }},
453+ {" refs1" , {placeholderFoo }},
454+ {" refs2" , {pathBarDrvCA }},
440455 },
441456 .additionalSandboxProfile = " sandcastle" ,
442457 .noChroot = true ,
0 commit comments