Snapcraft has some special-case code where, if a stage-package is pulled with symlinks to libraries contained within libc, snapcraft allows them to dangle knowing that they'll be pointing to (hopefully) valid locations once run. However, the various plugins in snapcraft also have code that checks for dangling symlinks, and rewrites (or follows) them as necessary to make sure the snap won't be broken once run. This is conflicting logic, and it particularly comes to light when using content sharing. When trying to build a content consumer by tarring the producer's staging area and adding it as a part to the consumer, the plugins follow the symlinks that are dangling in the producer, copying libc in from the system. Which means if any other part in the consumer stages something that has symlinks to libc again (which are left dangling), they conflict with the parts that were already staged.
To overcome this whole issue, ideally snapcraft could simply _remove_ symlinks to libc. However, as discussed in the comments below this doesn't work in practice. Therefore, the plugins that rewrite/follow symlinks need to be updated to allow libc symlinks to pass through.
Fix here: https:/ /github. com/snapcore/ snapcraft/ pull/1100