Skip to content

[plugin] support for resources packaging on ubuntu #467

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

Merged
merged 12 commits into from
Jan 21, 2025

Conversation

sebsto
Copy link
Contributor

@sebsto sebsto commented Jan 18, 2025

When including resources in the package and packaging on Ubuntu, FileManager throws a FilePermission error. The docker daemon runs as root and files to be copied are owned by root while the archiver runs as the current user (ubuntu on EC2 Ubuntu). The FileManager manages to copy the files but throws an error after the copy. We suspect the FileManager to perform some kind of operation after the copy and it fails because of the root permission of the files.

See #449 (comment) for a description of the problem.

This PR contains code to reproduce the problem, a very simple workaround, and an integration test.
The workaround consists of

  • trapping all errors
  • verify if the error is the permission error (Code = 513)
  • verify if the files have been copied or not
  • if the two above conditions are met, ignore the error, otherwise re-throw it

I would rather prefer a solution that solves the root cause rather than just ignoring the error.
We're still investigating the root cause (see this thread on the Swift Forum and this issue on Swift Foundation swiftlang/swift-foundation#1125

@sebsto sebsto added the semver/none No version bump required. label Jan 18, 2025
@sebsto sebsto requested a review from 0xTim January 20, 2025 07:11
Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sebsto sebsto merged commit 71d49b0 into swift-server:main Jan 21, 2025
30 checks passed
@sebsto sebsto deleted the sebsto/plugin-ubuntu branch January 21, 2025 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants