Skip to content

[swift-stdlib-tool] Add support for back deployed concurrency #40026

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

Conversation

DougGregor
Copy link
Member

Description: Make Swift's swift-stdlib-tool copy libswift_Concurrency.dylib when needed for back-deployed concurrency. Xcode's build system has a built-in version of this tool that already knows how to copy the libraries, but this tool (used by, e.g., Bazel) required updating to handle multiple source directories.
Risk: Low
Reviewed by: Doug Gregor, Keith Smiley
Testing: PR testing
Original PR: #39996
Radar: rdar://84768417

keith added 2 commits November 2, 2021 16:24
This tool was mostly already compatible with copying
`libswift_Concurrency.dylib` based on whether or not the executables it
was scanning linked it. The only thing missing was that it can now end
up copying from different source directories, the older `swift-5.0`
directory, and the new `swift-5.5` directory.

This change allows users to pass `--source-libraries` multiple times
(or picks a default with both) in order to have it scan both directories
for any libraries the app links. The biggest part of this change is
instead of storing just the library name throughout this logic we now
store the actual discovered path, so that we don't have to loop through
all potential source directories each time we need to find the library,
only the first time.
@DougGregor DougGregor requested a review from a team as a code owner November 2, 2021 23:30
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please nominate

@keith
Copy link
Member

keith commented Nov 3, 2021

Windows failure appears unrelated:

-- Testing: 7628 tests, 64 workers --
Testing: 
FAIL: Swift(windows-x86_64) :: AutoDiff/SILOptimizer/generics.swift (23 of 7628)
******************** TEST 'Swift(windows-x86_64) :: AutoDiff/SILOptimizer/generics.swift' FAILED ********************
Script:
--
: 'RUN: at line 1';   't:\\swift\\bin\\swift-frontend.exe' -target x86_64-unknown-windows-msvc  -module-cache-path T:\swift\swift-test-results\x86_64-unknown-windows-msvc\clang-module-cache -swift-version 4  -define-availability 'SwiftStdlib 5.5:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -typo-correction-limit 10  -emit-sil -verify-syntax-tree -verify C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\AutoDiff\SILOptimizer\generics.swift | "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe" C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\utils\PathSanitizingFileCheck --sanitize BUILD_DIR=T:/swift --sanitize SOURCE_DIR=C:/Users/swift-ci/jenkins/workspace/swift-PR-windows/swift --use-filecheck t:\llvm\bin\filecheck.exe --enable-windows-compatibility C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\AutoDiff\SILOptimizer\generics.swift -check-prefix=CHECK-SIL
--
Exit Code: 2

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "t:\\swift\\bin\\swift-frontend.exe" "-target" "x86_64-unknown-windows-msvc" "-module-cache-path" "T:\swift\swift-test-results\x86_64-unknown-windows-msvc\clang-module-cache" "-swift-version" "4" "-define-availability" "SwiftStdlib 5.5:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0" "-typo-correction-limit" "10" "-emit-sil" "-verify-syntax-tree" "-verify" "C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\AutoDiff\SILOptimizer\generics.swift"
# command stderr:
<unknown>:0: error: fatal error encountered while in -verify mode

<unknown>:0: error: unexpected error produced: could not build C module 'SwiftShims'

<unknown>:0: error: unexpected error produced: fatal error encountered while in -verify mode

<unknown>:0: error: diagnostic produced elsewhere: could not build C module 'SwiftShims'

<unknown>:0: error: diagnostic produced elsewhere: fatal error encountered while in -verify mode


error: command failed with exit status: 1
$ "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe" "C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\utils\PathSanitizingFileCheck" "--sanitize" "BUILD_DIR=T:/swift" "--sanitize" "SOURCE_DIR=C:/Users/swift-ci/jenkins/workspace/swift-PR-windows/swift" "--use-filecheck" "t:\llvm\bin\filecheck.exe" "--enable-windows-compatibility" "C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\AutoDiff\SILOptimizer\generics.swift" "-check-prefix=CHECK-SIL"
# command stderr:
FileCheck error: '<stdin>' is empty.

FileCheck command line:  t:\llvm\bin\filecheck.exe C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\AutoDiff\SILOptimizer\generics.swift -check-prefix=CHECK-SIL


error: command failed with exit status: 2

@DougGregor DougGregor merged commit e3d5a72 into swiftlang:release/5.5 Nov 3, 2021
@DougGregor DougGregor deleted the swift-stdlib-tool-add-support-for-back-deployed-concurrency-5.5 branch November 3, 2021 05:54
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.

3 participants