Skip to content

utils: avoid double staging the SDK #79627

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

Merged
merged 2 commits into from
Mar 10, 2025
Merged

Conversation

compnerd
Copy link
Member

Directly install the SDK into the final location. This avoids moving files around after installation, improving incremental builds.

@compnerd
Copy link
Member Author

@swift-ci please test Windows platform

@compnerd
Copy link
Member Author

@swift-ci please test Windows platform

@compnerd
Copy link
Member Author

@swift-ci please test Windows platform

@compnerd
Copy link
Member Author

@swift-ci please test Windows platform

@compnerd
Copy link
Member Author

@swift-ci please smoke test

@compnerd
Copy link
Member Author

Please test with following PRs:
swiftlang/swift-installer-scripts#393

@swift-ci please test Windows platform

1 similar comment
@compnerd
Copy link
Member Author

Please test with following PRs:
swiftlang/swift-installer-scripts#393

@swift-ci please test Windows platform

@compnerd
Copy link
Member Author

Please test with following PRs:
swiftlang/swift-installer-scripts#393

@swift-ci please test Windows platform

@compnerd
Copy link
Member Author

compnerd commented Mar 2, 2025

The failure on Windows seem to be related to the staging changes. However, they are more interesting in that it appears that we have a mixture of static and dynamic linking occurring. It is unclear what is the cause of that. It exposed at least one case of incorrect linkage handling that is addressed in swiftlang/swift-corelibs-foundation#5181

@compnerd
Copy link
Member Author

compnerd commented Mar 2, 2025

* thread #1, stop reason = Exception 0xc0000005 encountered at address 0x7ff7318dec22: Access violation writing location 0xfffffffff9433a10
    frame #0: 0x00007ff7318dec22 swift-corelibs-foundationPackageTests.xctest`type metadata accessor for Dispatch.DispatchQueue + 2
swift-corelibs-foundationPackageTests.xctest`type metadata accessor for Dispatch.DispatchQueue:
->  0x7ff7318dec22 <+2>: addl   %esi, -0x6bcc5f0(%rax)
    0x7ff7318dec28 <+8>: addb   %al, (%rdx)
* thread #1, stop reason = Exception 0xc0000005 encountered at address 0x7ff7318dec22: Access violation writing location 0xfffffffff9433a10
  * frame #0: 0x00007ff7318dec22 swift-corelibs-foundationPackageTests.xctest`type metadata accessor for Dispatch.DispatchQueue + 2
    frame #1: 0x00007ff73145c6c0 swift-corelibs-foundationPackageTests.xctest`one-time initialization function for subsystemQueue at XCTWaiter.swift:115:42 [opt]
    frame #2: 0x00007ffe241d5f85 swiftCore.dll`__modti3 + 3909
    frame #3: 0x00007ff731468641 swift-corelibs-foundationPackageTests.xctest`XCTestExpectation.init(description:file:line:) [inlined] XCTest.XCTWaiter.subsystemQueue.unsafeMutableAddressor : Dispatch.DispatchQueue at XCTWaiter.swift:115:25 [opt]
    frame #4: 0x00007ff73146862d swift-corelibs-foundationPackageTests.xctest`XCTestExpectation.init(description:file:line:) [inlined] static XCTest.XCTestExpectation.nextMonotonicallyIncreasingToken() -> Swift.UInt64 at XCTestExpectation.swift:23:26 [opt]
    frame #5: 0x00007ff73146862d swift-corelibs-foundationPackageTests.xctest`XCTestExpectation.init(description=<unavailable>, file="XCTest/XCTestCase.swift", line=343) at XCTestExpectation.swift:229:43 [opt]
    frame #6: 0x00007ff731462d45 swift-corelibs-foundationPackageTests.xctest`awaitUsingExpectation(_:) [inlined] XCTest.XCTestExpectation.__allocating_init(description: Swift.String, file: Swift.StaticString, line: Swift.Int) -> XCTest.XCTestExpectation at <stdin>:0 [opt]
    frame #7: 0x00007ff731462cef swift-corelibs-foundationPackageTests.xctest`awaitUsingExpectation(closure=0x00007ff733cfa7f0 async function pointer to partial apply forwarder for closure #1 () async throws -> () in XCTest.XCTestCase.performSetUpSequence() -> ()) at XCTestCase.swift:343:23 [opt]
    frame #8: 0x00007ff731463951 swift-corelibs-foundationPackageTests.xctest`XCTestCase.invokeTest() at XCTestCase.swift:233:21 [opt]
    frame #9: 0x00007ff73146393f swift-corelibs-foundationPackageTests.xctest`XCTestCase.invokeTest() at XCTestCase.swift:121:9 [opt]
    frame #10: 0x00007ff73146378c swift-corelibs-foundationPackageTests.xctest`XCTestCase.perform(run=0x00000143a2548f30) at XCTestCase.swift:100:9 [opt]
    frame #11: 0x00007ff7314505e4 swift-corelibs-foundationPackageTests.xctest`XCTest.run() at XCAbstractTest.swift:52:9 [opt]
    frame #12: 0x00007ff73146f875 swift-corelibs-foundationPackageTests.xctest`XCTestSuite.perform(run=0x00000143a254de60) at XCTestSuite.swift:49:18 [opt]
    frame #13: 0x00007ff7314505e4 swift-corelibs-foundationPackageTests.xctest`XCTest.run() at XCAbstractTest.swift:52:9 [opt]
    frame #14: 0x00007ff73146f875 swift-corelibs-foundationPackageTests.xctest`XCTestSuite.perform(run=0x00000143a254b540) at XCTestSuite.swift:49:18 [opt]
    frame #15: 0x00007ff7314505e4 swift-corelibs-foundationPackageTests.xctest`XCTest.run() at XCAbstractTest.swift:52:9 [opt]
    frame #16: 0x00007ff73146f875 swift-corelibs-foundationPackageTests.xctest`XCTestSuite.perform(run=0x00000143a2489cf0) at XCTestSuite.swift:49:18 [opt]
    frame #17: 0x00007ff7314505e4 swift-corelibs-foundationPackageTests.xctest`XCTest.run() at XCAbstractTest.swift:52:9 [opt]
    frame #18: 0x00007ff73146ae3e swift-corelibs-foundationPackageTests.xctest`XCTMain(testCases=<unavailable>, arguments=1 value, observers=<unavailable>) at XCTestMain.swift:149:23 [opt]
    frame #19: 0x00007ff73146b530 swift-corelibs-foundationPackageTests.xctest`XCTMain(testCases=<unavailable>) at XCTestMain.swift:158:10 [opt]
    frame #20: 0x00007ff73182693d swift-corelibs-foundationPackageTests.xctest`specialized static Runner.$main() [inlined] static swift_corelibs_foundationPackageTests.Runner.main() async -> () at runner.swift:49:14 [opt]
swift-corelibs-foundationPackageTests.xctest`one-time initialization function for subsystemQueue:
    0x7ff73145c6b0 <+0>:   pushq  %r13
    0x7ff73145c6b2 <+2>:   pushq  %rsi
    0x7ff73145c6b3 <+3>:   pushq  %rdi
    0x7ff73145c6b4 <+4>:   pushq  %rbx
    0x7ff73145c6b5 <+5>:   subq   $0x38, %rsp
    0x7ff73145c6b9 <+9>:   xorl   %ecx, %ecx
    0x7ff73145c6bb <+11>:  callq  0x7ff7318dec20 ; type metadata accessor for Dispatch.DispatchQueue
->  0x7ff73145c6c0 <+16>:  movq   %rax, %r13
(lldb) image list
...
[ 35] AE12A8D1 0x00007ffe3f700000 S:\Program Files\Swift\Runtimes\0.0.0\usr\bin\swiftDispatch.dll
...
(lldb) image lookup -a 0x7ff7318dec20
      Address: swift-corelibs-foundationPackageTests.xctest[0x0000000140eeec20] (swift-corelibs-foundationPackageTests.xctest..text + 15653920)
      Summary: swift-corelibs-foundationPackageTests.xctest`type metadata accessor for Dispatch.DispatchQueue

It seems that we do not indirect through the import symbol and end up in the wrong location.

@compnerd
Copy link
Member Author

compnerd commented Mar 8, 2025

Please test with following PRs:
swiftlang/swift-installer-scripts#393

@swift-ci please test Windows platform

compnerd and others added 2 commits March 8, 2025 14:41
Directly install the SDK into the final location. This avoids moving
files around after installation, improving incremental builds.
Install the experimental SDK directly into the final install/stage so
that we have a complete working toolchain that we can directly package.
@compnerd
Copy link
Member Author

compnerd commented Mar 8, 2025

Please test with following PRs:
swiftlang/swift-installer-scripts#393

@swift-ci please test Windows platform

@compnerd
Copy link
Member Author

compnerd commented Mar 9, 2025

@swift-ci please smoke test Linux platform

@compnerd
Copy link
Member Author

compnerd commented Mar 9, 2025

@swift-ci please smoke test macOS platform

@compnerd
Copy link
Member Author

compnerd commented Mar 9, 2025

@swift-ci please smoke test Linux platform

@compnerd
Copy link
Member Author

compnerd commented Mar 9, 2025

@swift-ci please smoke test macOS platform

1 similar comment
@compnerd
Copy link
Member Author

@swift-ci please smoke test macOS platform

@compnerd
Copy link
Member Author

@swift-ci please smoke test Linux platform

@compnerd compnerd merged commit d75b7cd into swiftlang:main Mar 10, 2025
3 checks passed
@compnerd compnerd deleted the sdk-takes-stage branch March 10, 2025 22: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