Skip to content

Conversation

@rauhul
Copy link
Member

@rauhul rauhul commented Jul 30, 2025

When building on a darwin host (e.g. macOS) using a file-system that doesn't support xattrs (e.g. tmpfs) swift-build would fail trying to set the "CreatedByBuildSystem" xattribute. This commit changes swift-build to warn instead, allowing the build to complete.

When building on a darwin host (e.g. macOS) using a file-system that
doesn't support xattrs (e.g. tmpfs) swift-build would fail trying to set
the "CreatedByBuildSystem" xattribute. This commit changes swift-build
to warn instead, allowing the build to complete.
// Warn on darwin if we are unable to set the "CreateByBuildSystem"
// attribute
do {
try fs.setCreatedByBuildSystemAttribute(directoryPath)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The other alternative is we just use try? and drop the diagnostic entirely. @owenv, what do you think?

The reason I suggested the if-Darwin to @rauhul is because we'd otherwise have to change tests to ignore this message since most Linux build environments are using containers, which use tmpfs, which don't support xattrs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the xattr still control whether we're willing to clean a directory? If yes, it could be quite confusing that we never told the user about the fact that we couldn't set it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

There's a setting to allow deleting directories without the attr, but I think this warning still makes sense

@rauhul rauhul enabled auto-merge (squash) July 31, 2025 21:16
@rauhul
Copy link
Member Author

rauhul commented Jul 31, 2025

@swift-ci test

@rauhul rauhul merged commit 5aab44a into swiftlang:main Aug 1, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants