swiftlang / swift-corelibs-foundation

The Foundation Project, providing core utilities, internationalization, and OS independence
swift.org
Apache License 2.0
5.29k stars 1.14k forks source link

Restore thread-unsafe fallback for setting the Process working directory #5090

Closed jakepetroules closed 1 month ago

jakepetroules commented 1 month ago

Swift still needs to support Amazon Linux 2 until it EoLs in mid-2025. So restore the thread-unsafe fallback for systems with glibc older than version 2.29, which was removed in #4981.

iCharlesHu commented 1 month ago
/home/build-user/swift-corelibs-foundation/Sources/Foundation/Process.swift:974:60: error: cannot find 'previousDirectoryPath' in scope
 972 |                 // Reset the previous working directory path.
 973 |                 let fileManager = FileManager()
 974 |                 _ = fileManager.changeCurrentDirectoryPath(previousDirectoryPath)
     |                                                            `- error: cannot find 'previousDirectoryPath' in scope
 975 |             }
 976 |         }

Looks like the failure is related

iCharlesHu commented 1 month ago

@swift-ci please test