Skip to content

DNM: Add -Rmodule-interface-rebuild to startOnMainActor #64653

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

Closed

Conversation

etcwilde
Copy link
Contributor

@etcwilde etcwilde commented Mar 27, 2023

Add remark to see why we're rebuilding from the swiftinterface occasionally, instead of using the perfectly good swiftmodule for the stdlib.

This is starting to affect the Windows CI now. Hopefully I get lucky and can trigger the failure first try.

The other workaround is here, to produce the private.swiftinterface. We're supposed to prefer digging things out of the swiftmodule for the stdlib though, so that fix will just mask the issue for now.

Add remark to see why we're rebuilding from the swiftinterface
occasionally, instead of using the perfectly good swiftmodule for the
stdlib.
@etcwilde etcwilde requested review from compnerd and xymus March 27, 2023 21:32
@etcwilde
Copy link
Contributor Author

@swift-ci please test

@etcwilde
Copy link
Contributor Author

We can merge if I don't catch it the first time so that we get some parallel data collection action going.

llvm-lit isn't showing me the output from stdout, so I don't think we're
getting the remarks when things fail. Redirect the stdout to stderr so
llvm-lit shows _all the things_.
@etcwilde
Copy link
Contributor Author

@swift-ci please smoke test

@etcwilde
Copy link
Contributor Author

Windows failure:

FAIL: Swift(windows-x86_64) :: Concurrency/Runtime/startOnMainActor.swift (547 of 9197)
******************** TEST 'Swift(windows-x86_64) :: Concurrency/Runtime/startOnMainActor.swift' FAILED ********************
Script:
--
: 'RUN: at line 1';   rm -rf "T:\swift\test-windows-x86_64\Concurrency\Runtime\Output\startOnMainActor.swift.tmp" && mkdir -p "T:\swift\test-windows-x86_64\Concurrency\Runtime\Output\startOnMainActor.swift.tmp"
: 'RUN: at line 2';   't:\\swift\\bin\\swiftc.exe' -target x86_64-unknown-windows-msvc  -vfsoverlay T:/swift\stdlib\windows-vfs-overlay.yaml -swift-version 4  -Xfrontend -define-availability -Xfrontend 'SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -Xfrontend -define-availability -Xfrontend 'SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2' -Xfrontend -define-availability -Xfrontend 'SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -Xfrontend -define-availability -Xfrontend 'SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4' -Xfrontend -define-availability -Xfrontend 'SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0' -Xfrontend -define-availability -Xfrontend 'SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5' -Xfrontend -define-availability -Xfrontend 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -Xfrontend -define-availability -Xfrontend 'SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4' -Xfrontend -define-availability -Xfrontend 'SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0' -Xfrontend -define-availability -Xfrontend 'SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4' -Xfrontend -define-availability -Xfrontend 'SwiftStdlib 5.9:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999'  -libc MD -Xfrontend -Rmodule-interface-rebuild -Xfrontend -disable-availability-checking C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Concurrency\Runtime\startOnMainActor.swift -o T:\swift\test-windows-x86_64\Concurrency\Runtime\Output\startOnMainActor.swift.tmp/a.out 1>&2
: 'RUN: at line 3';   echo T:\swift\test-windows-x86_64\Concurrency\Runtime\Output\startOnMainActor.swift.tmp/a.out
: 'RUN: at line 4';     T:\swift\test-windows-x86_64\Concurrency\Runtime\Output\startOnMainActor.swift.tmp/a.out
--
Exit Code: 127

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "rm" "-rf" "T:\swift\test-windows-x86_64\Concurrency\Runtime\Output\startOnMainActor.swift.tmp"
$ "mkdir" "-p" "T:\swift\test-windows-x86_64\Concurrency\Runtime\Output\startOnMainActor.swift.tmp"
$ ":" "RUN: at line 2"
$ "t:\\swift\\bin\\swiftc.exe" "-target" "x86_64-unknown-windows-msvc" "-vfsoverlay" "T:/swift\stdlib\windows-vfs-overlay.yaml" "-swift-version" "4" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.9:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999" "-libc" "MD" "-Xfrontend" "-Rmodule-interface-rebuild" "-Xfrontend" "-disable-availability-checking" "C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\test\Concurrency\Runtime\startOnMainActor.swift" "-o" "T:\swift\test-windows-x86_64\Concurrency\Runtime\Output\startOnMainActor.swift.tmp/a.out"
# command stderr:
Unsupported redirect: (('>&', 1), '2')
error: command failed with exit status: 127

--

@etcwilde
Copy link
Contributor Author

Unsupported redirect: (('>&', 1), '2')

Bah humbug. Right test, wrong failure.

@etcwilde
Copy link
Contributor Author

@compnerd managed to get it to reproduce reliably enough to get the remarks. It's the issue @bnbarham and I talked about yesterday.

The indexer is pulling the module from the cache that was built from the swiftinterface instead of the swiftmodule in _Concurrency.swiftmodule. The swiftmodule in the module cache doesn't have the SPI because swift interfaces don't have SPI.

In case it's useful CC: @xymus

<unknown>:0: remark: loaded module '_Concurrency'; source: 's:\b\1\lib\swift\windows\_Concurrency.swiftmodule\x86_64-unknown-windows-msvc.swiftinterface', loaded: 'C:\Users\abdulras\AppData\Local\clang\ModuleCache\_Concurrency-2AQVR06CKMPLY.swiftmodule'

S:\b\1>"s:\\b\\1\\bin\\swiftc.exe" "-target" "x86_64-unknown-windows-msvc" "-vfsoverlay" "S:/b/1/tools/swift\stdlib\windows-vfs-overlay.yaml" "-swift-version" "4" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4" "-Xfrontend" "-define-availability" "-Xfrontend" "SwiftStdlib 5.9:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999" "-libc" "MD" "-Xfrontend" "-disable-availability-checking" "S:\SourceCache\swift-project\swift\test\Concurrency\Runtime\startOnMainActor.swift" "-o" "S:\b\1\tools\swift\test-windows-x86_64\Concurrency\Runtime\Output\startOnMainActor.swift.tmp/a.out" -Xfrontend -Rmodule-interface-rebuild -Xfrontend -Rmodule-loading -Xfrontend -disable-availability-checking
<unknown>:0: remark: loaded module 'SwiftShims'; source: 's:\b\1\lib\swift\shims\module.modulemap', loaded: 'C:\Users\abdulras\AppData\Local\clang\ModuleCache\3Q584P7L7QF\SwiftShims-2W5ATRTSKQ0VZ.pcm'
<unknown>:0: remark: loaded module 'Swift'; source: 's:\b\1\lib\swift\windows\Swift.swiftmodule\x86_64-unknown-windows-msvc.swiftinterface', loaded: 's:\b\1\lib\swift\windows\Swift.swiftmodule\x86_64-unknown-windows-msvc.swiftmodule'
<unknown>:0: remark: loaded module '_StringProcessing'; source: 's:\b\1\lib\swift\windows\_StringProcessing.swiftmodule\x86_64-unknown-windows-msvc.swiftinterface', loaded: 'C:\Users\abdulras\AppData\Local\clang\ModuleCache\_StringProcessing-2WRRVN7HJZKQ2.swiftmodule'
<unknown>:0: remark: loaded module '_SwiftConcurrencyShims'; source: 's:\b\1\lib\swift\shims\module.modulemap', loaded: 'C:\Users\abdulras\AppData\Local\clang\ModuleCache\3Q584P7L7QF\_SwiftConcurrencyShims-2W5ATRTSKQ0VZ.pcm'
<unknown>:0: remark: loaded module '_Concurrency'; source: 's:\b\1\lib\swift\windows\_Concurrency.swiftmodule\x86_64-unknown-windows-msvc.swiftinterface', loaded: 'C:\Users\abdulras\AppData\Local\clang\ModuleCache\_Concurrency-2AQVR06CKMPLY.swiftmodule'
<unknown>:0: remark: loaded module 'SwiftOnoneSupport'; source: 's:\b\1\lib\swift\windows\SwiftOnoneSupport.swiftmodule\x86_64-unknown-windows-msvc.swiftinterface', loaded: 's:\b\1\lib\swift\windows\SwiftOnoneSupport.swiftmodule\x86_64-unknown-windows-msvc.swiftmodule'
<unknown>:0: remark: loaded module 'SwiftOverlayShims'; source: 's:\b\1\lib\swift\shims\module.modulemap', loaded: 'C:\Users\abdulras\AppData\Local\clang\ModuleCache\3Q584P7L7QF\SwiftOverlayShims-2W5ATRTSKQ0VZ.pcm'
<unknown>:0: remark: loaded module 'CRT'; source: 's:\b\1\lib\swift\windows\CRT.swiftmodule\x86_64-unknown-windows-msvc.swiftinterface', loaded: 's:\b\1\lib\swift\windows\CRT.swiftmodule\x86_64-unknown-windows-msvc.swiftmodule'
<unknown>:0: remark: loaded module 'WinSDK'; source: 's:\b\1\lib\swift\windows\WinSDK.swiftmodule\x86_64-unknown-windows-msvc.swiftinterface', loaded: 's:\b\1\lib\swift\windows\WinSDK.swiftmodule\x86_64-unknown-windows-msvc.swiftmodule'
<unknown>:0: remark: loaded module 'SwiftPrivate'; source: 's:\b\1\lib\swift\windows\SwiftPrivate.swiftmodule\x86_64-unknown-windows-msvc.swiftinterface', loaded: 's:\b\1\lib\swift\windows\SwiftPrivate.swiftmodule\x86_64-unknown-windows-msvc.swiftmodule'
<unknown>:0: remark: loaded module 'SwiftPrivateLibcExtras'; source: 's:\b\1\lib\swift\windows\SwiftPrivateLibcExtras.swiftmodule\x86_64-unknown-windows-msvc.swiftinterface', loaded: 's:\b\1\lib\swift\windows\SwiftPrivateLibcExtras.swiftmodule\x86_64-unknown-windows-msvc.swiftmodule'
<unknown>:0: remark: loaded module 'SwiftPrivateThreadExtras'; source: 's:\b\1\lib\swift\windows\SwiftPrivateThreadExtras.swiftmodule\x86_64-unknown-windows-msvc.swiftinterface', loaded: 's:\b\1\lib\swift\windows\SwiftPrivateThreadExtras.swiftmodule\x86_64-unknown-windows-msvc.swiftmodule'
S:\SourceCache\swift-project\swift\test\Concurrency\Runtime\startOnMainActor.swift:14:8: remark: loaded module 'StdlibUnittest'; source: 's:\b\1\lib\swift\windows\StdlibUnittest.swiftmodule\x86_64-unknown-windows-msvc.swiftinterface', loaded: 's:\b\1\lib\swift\windows\StdlibUnittest.swiftmodule\x86_64-unknown-windows-msvc.swiftmodule'
import StdlibUnittest
       ^
S:\SourceCache\swift-project\swift\test\Concurrency\Runtime\startOnMainActor.swift:15:2: warning: '@_spi' import of '_Concurrency' will not include any SPI symbols; '_Concurrency' was built from the public interface at s:\b\1\lib\swift\windows\_Concurrency.swiftmodule\x86_64-unknown-windows-msvc.swiftinterface
@_spi(MainActorUtilities) import _Concurrency
 ^
S:\SourceCache\swift-project\swift\test\Concurrency\Runtime\startOnMainActor.swift:44:14: error: generic parameter 'Success' could not be inferred
    let t2 = Task.startOnMainActor {
             ^
S:\SourceCache\swift-project\swift\test\Concurrency\Runtime\startOnMainActor.swift:44:14: error: generic parameter 'Failure' could not be inferred
    let t2 = Task.startOnMainActor {
             ^
S:\SourceCache\swift-project\swift\test\Concurrency\Runtime\startOnMainActor.swift:44:14: note: explicitly specify the generic arguments to fix this issue
    let t2 = Task.startOnMainActor {
             ^
                 <<#Success: Sendable#>, <#Failure: Error#>>
S:\SourceCache\swift-project\swift\test\Concurrency\Runtime\startOnMainActor.swift:44:19: error: type 'Task<Success, Failure>' has no member 'startOnMainActor'
    let t2 = Task.startOnMainActor {
             ~~~~ ^~~~~~~~~~~~~~~~
S:\SourceCache\swift-project\swift\test\Concurrency\Runtime\startOnMainActor.swift:79:14: error: generic parameter 'Success' could not be inferred
    let t2 = Task.startOnMainActor {
             ^
S:\SourceCache\swift-project\swift\test\Concurrency\Runtime\startOnMainActor.swift:79:14: error: generic parameter 'Failure' could not be inferred
    let t2 = Task.startOnMainActor {
             ^
S:\SourceCache\swift-project\swift\test\Concurrency\Runtime\startOnMainActor.swift:79:14: note: explicitly specify the generic arguments to fix this issue
    let t2 = Task.startOnMainActor {
             ^
                 <<#Success: Sendable#>, <#Failure: Error#>>
S:\SourceCache\swift-project\swift\test\Concurrency\Runtime\startOnMainActor.swift:79:19: error: type 'Task<Success, Failure>' has no member 'startOnMainActor'
    let t2 = Task.startOnMainActor {
             ~~~~ ^~~~~~~~~~~~~~~~

@etcwilde etcwilde closed this Apr 12, 2023
@etcwilde etcwilde deleted the ewilde/module-debugging-flag branch April 12, 2023 17:13
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.

2 participants