Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to copy dependency license directories when building snap #3886

Open
andrei-toterman opened this issue Jan 21, 2025 · 0 comments
Open
Assignees
Labels
bug high high importance jira Create a Jira ticket for this issue

Comments

@andrei-toterman
Copy link
Contributor

The CI fails non-deterministically to build the Snap package, exiting with error code 123. For example: https://github.com/canonical/multipass/actions/runs/12768902319/job/35590266180#step:13:28363

From my preliminary research, it seems that the issue is caused by the following command in our snapcraft.yaml:

find . -name 'LICENSE*' -print0 | xargs -0 -I FILE install --mode=644 -D --no-target-directory FILE ${CRAFT_PART_INSTALL}/licenses/FILE

This command looks for anything that matches that 'LICENSE*' pattern and tries to copy it into the licenses directory inside the snap package.
The issues is that there also seem to be directories that match that pattern, specifically ./3rd-party/vcpkg/buildtrees/c-ares/src/res-1_26_0-bc94026839.clean/LICENSES, and the install command does not work with directories. This is evident from the error message install: omitting directory './vcpkg/buildtrees/c-ares/src/res-1_26_0-bc94026839.clean/LICENSES' which is what we get when we try to run install on a directory.
The 123 error code is a standard xargs error code that is returned when the command it runs fails.
One quick solution to make this problem go away is to add -type f to the find command, so only files are taken into account. But then the licenses inside the LICENSES directory above will not be copied over. So a more complete solution would be to have a more complex finding mechanism that finds both files that match that pattern and files inside directories that match that pattern, and then pass those over to install.

What could also be done is to investigate why doesn't this issue happen deterministically in CI and why it only started happening after a recent vcpkg update.

@andrei-toterman andrei-toterman added bug high high importance jira Create a Jira ticket for this issue labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug high high importance jira Create a Jira ticket for this issue
Projects
None yet
Development

No branches or pull requests

2 participants