-
Notifications
You must be signed in to change notification settings - Fork 131
Avoid error if missing xattr support #690
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,12 +28,22 @@ public final class CreateBuildDirectoryTaskAction: TaskAction { | |
|
|
||
| do { | ||
| try fs.createDirectory(directoryPath, recursive: true) | ||
| try fs.setCreatedByBuildSystemAttribute(directoryPath) | ||
| return .succeeded | ||
| } catch { | ||
| outputDelegate?.emitError(error.localizedDescription) | ||
| return .failed | ||
| } | ||
|
|
||
| // Warn on darwin if we are unable to set the "CreateByBuildSystem" | ||
rauhul marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // attribute | ||
| do { | ||
| try fs.setCreatedByBuildSystemAttribute(directoryPath) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other alternative is we just use 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.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| } catch { | ||
| #if canImport(Darwin) | ||
| outputDelegate?.emitWarning("Failed to set build system attribute on \(directoryPath.str): \(error.localizedDescription)") | ||
| #endif | ||
| } | ||
|
|
||
| return .succeeded | ||
| } | ||
|
|
||
| public override func performTaskAction( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.