Our code that archives the lifecycle payload as a new layer is taking the usrmerge into account when handling files, but not when handling subdirectories; So for example, if a part primes two files:
- bin/f1
- lib/subdir/f2
bin/f1 will be correctly archived as usr/bin/f1, butlib/subdir/f2 will stay as lib/subdir/f2, possibly breaking the usrmerge symlink (depends on the version of... something).
Building it and then loading it in dive shows the issue; see on the right the lib entry has no permissions - that's the tell that it's broken:
The build log shows it too:
2023-02-07 16:02:11.359 :: 2023-02-07 19:02:10.607 Creating new layer
2023-02-07 16:02:11.359 :: 2023-02-07 19:02:10.608 Skipping /root/prime/bin because it exists as a symlink on the lower layer
2023-02-07 16:02:11.359 :: 2023-02-07 19:02:10.608 Adding to layer: /root/prime/bin/f1 as 'usr/bin/f1'
2023-02-07 16:02:11.359 :: 2023-02-07 19:02:10.614 Skipping /root/prime/lib because it exists as a symlink on the lower layer
2023-02-07 16:02:11.359 :: 2023-02-07 19:02:10.614 Adding to layer: /root/prime/lib/subdir
2023-02-07 16:02:11.359 :: 2023-02-07 19:02:10.615 Adding to layer: /root/prime/lib/subdir/f2 as 'lib/subdir/f2'
Our code that archives the lifecycle payload as a new layer is taking the usrmerge into account when handling files, but not when handling subdirectories; So for example, if a part primes two files:
bin/f1
will be correctly archived asusr/bin/f1
, butlib/subdir/f2
will stay aslib/subdir/f2
, possibly breaking the usrmerge symlink (depends on the version of... something).Here's a rockcraft.yaml that repros this:
Building it and then loading it in dive shows the issue; see on the right the
lib
entry has no permissions - that's the tell that it's broken:The build log shows it too: