Duplicated directories, /src/ and /build/, are a space issue

Chromium builds in x64 are getting out of space in Launchpad during the override-build phase of the chromium part.

Poking at the builder, the top offenders are

24G build/chromium/parts/chromium/src/third_party
24G build/chromium/parts/chromium/build/third_party

Why does Snapcraft make this duplication? Should I expect trouble if I delete build/chromium/parts/chromium/src/ (which is equal to $CRAFT_PART_SRC if I understand correctly) once I am past the pull phase, e.g. in override-build of that part?


There are still some mysteries to which I don’t expect a response but might provide some information.

Why does the ARM build not hit this?

Why does a build in my machine (on Snapcraft 8.5.1 and LXD 5.21.2) chug along just fine, reporting merely 12 GB for each directory? I only have a storage pool of 57 GB anyway, while Launchpad builders reportedly have 100 GB at their disposal.

Snapcraft creates hardlinks between those directories. If that fails to hardlink, it copies the files.

You could probably delete the source files in an override build without issue, but it may not free any space if it’s hardlinked. I also wouldn’t recommend it, because it’s internal, Snapcraft doesn’t expect those files to be modified, and it may break when re-running locally.