@@ -23,6 +23,16 @@ fileprivate struct FileCopyTaskTests {
23
23
try await withTemporaryDirectory { tmpDir in
24
24
let testDataDirPath = try Path ( #require( Bundle . module. resourceURL) . appendingPathComponent ( " TestData " ) . appendingPathComponent ( " FileCopyTask " ) . path)
25
25
26
+ // Many filesystems on other platforms (e.g. various non-ext4 temporary filesystems on Linux) don't support xattrs and will return ENOTSUP.
27
+ // In particular, tmpfs doesn't support xattrs on Linux unless `CONFIG_TMPFS_XATTR` is enabled in the kernel config.
28
+ if try ProcessInfo . processInfo. hostOperatingSystem ( ) == . linux {
29
+ do {
30
+ _ = try localFS. getExtendedAttribute ( testDataDirPath, key: " user.test " )
31
+ } catch let error as SWBUtil . POSIXError where error. code == ENOTSUP {
32
+ return
33
+ }
34
+ }
35
+
26
36
// Set up the copy task and run it.
27
37
let action = FileCopyTaskAction ( . init( skipAppStoreDeployment: false , stubPartialCompilerCommandLine: [ ] , stubPartialLinkerCommandLine: [ ] , stubPartialLipoCommandLine: [ ] , partialTargetValues: [ ] , llvmTargetTripleOSVersion: " " , llvmTargetTripleSuffix: " " , platformName: " " , swiftPlatformTargetPrefix: " " , isMacCatalyst: false ) )
28
38
let task = Task ( forTarget: nil , ruleInfo: [ ] , commandLine: [ " builtin-copy " , testDataDirPath. join ( " LoneFile.txt " ) . str, tmpDir. str] , workingDirectory: testDataDirPath, outputs: [ ] , action: action, execDescription: " Copy File " )
@@ -36,6 +46,9 @@ fileprivate struct FileCopyTaskTests {
36
46
outputDelegate: outputDelegate
37
47
)
38
48
49
+ #expect( outputDelegate. errors == [ ] )
50
+ #expect( outputDelegate. warnings == [ ] )
51
+
39
52
// Make sure it completed successfully.
40
53
#expect( result == . succeeded)
41
54
@@ -49,6 +62,16 @@ fileprivate struct FileCopyTaskTests {
49
62
try await withTemporaryDirectory { tmpDir in
50
63
let testDataDirPath = try Path ( #require( Bundle . module. resourceURL) . appendingPathComponent ( " TestData " ) . appendingPathComponent ( " FileCopyTask " ) . path)
51
64
65
+ // Many filesystems on other platforms (e.g. various non-ext4 temporary filesystems on Linux) don't support xattrs and will return ENOTSUP.
66
+ // In particular, tmpfs doesn't support xattrs on Linux unless `CONFIG_TMPFS_XATTR` is enabled in the kernel config.
67
+ if try ProcessInfo . processInfo. hostOperatingSystem ( ) == . linux {
68
+ do {
69
+ _ = try localFS. getExtendedAttribute ( testDataDirPath, key: " user.test " )
70
+ } catch let error as SWBUtil . POSIXError where error. code == ENOTSUP {
71
+ return
72
+ }
73
+ }
74
+
52
75
// Set up the copy task and run it.
53
76
let action = FileCopyTaskAction ( . init( skipAppStoreDeployment: false , stubPartialCompilerCommandLine: [ ] , stubPartialLinkerCommandLine: [ ] , stubPartialLipoCommandLine: [ ] , partialTargetValues: [ ] , llvmTargetTripleOSVersion: " " , llvmTargetTripleSuffix: " " , platformName: " " , swiftPlatformTargetPrefix: " " , isMacCatalyst: false ) )
54
77
let task = Task ( forTarget: nil , ruleInfo: [ ] , commandLine: [ " builtin-copy " , testDataDirPath. join ( " SimpleDir " ) . str, tmpDir. str] , workingDirectory: testDataDirPath, outputs: [ ] , action: action, execDescription: " Copy Directory " )
@@ -62,6 +85,9 @@ fileprivate struct FileCopyTaskTests {
62
85
outputDelegate: outputDelegate
63
86
)
64
87
88
+ #expect( outputDelegate. errors == [ ] )
89
+ #expect( outputDelegate. warnings == [ ] )
90
+
65
91
// Make sure it completed successfully.
66
92
#expect( result == . succeeded)
67
93
0 commit comments