Skip to content

[CMake] Establish a dependency from standard library variants onto 'libSwiftScan' #77606

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 1 commit into from
Nov 14, 2024

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Nov 14, 2024

  • Move libSwiftScan from 'tools' to 'lib/Tooling'. Due to

    swift/CMakeLists.txt

    Lines 1475 to 1500 in 1965f96

    ###############
    # PLEASE READ #
    ###############
    #
    # We have to include stdlib/ before tools/.
    # Do not move add_subdirectory(stdlib) after add_subdirectory(tools)!
    #
    # We must include stdlib/ before tools/ because stdlib/CMakeLists.txt
    # declares the swift-stdlib-* set of targets. These targets will then
    # implicitly depend on any targets declared with IS_STDLIB.
    #
    # https://github.com/apple/swift/issues/48534
    if(SWIFT_BUILD_STDLIB)
    add_subdirectory(stdlib)
    else()
    set(SWIFT_STDLIB_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/stdlib")
    # Some of the things below depend on the threading library
    add_subdirectory(stdlib/public/Threading)
    if(SWIFT_BUILD_STDLIB_EXTRA_TOOLCHAIN_CONTENT)
    add_subdirectory(stdlib/toolchain)
    if(SWIFT_BUILD_STDLIB_CXX_MODULE)
    add_subdirectory(stdlib/public/Cxx)
    endif()
    endif()
    we currently configure stdlib before tools. To bypass that, begin separating libraries used by the compiler into a separate directory in lib: Tooling, just like Clang does, and ensure they get configured before the standard library build.

@artemcm artemcm requested a review from a team as a code owner November 14, 2024 00:39
@artemcm
Copy link
Contributor Author

artemcm commented Nov 14, 2024

@swift-ci smoke test

@artemcm artemcm enabled auto-merge November 14, 2024 01:07
@artemcm artemcm force-pushed the MoveLibSwiftScanOutOfTools branch from ac7c176 to 691de13 Compare November 14, 2024 16:37
@artemcm
Copy link
Contributor Author

artemcm commented Nov 14, 2024

@swift-ci smoke test

'tools' should be reserved for executable tools.
@artemcm artemcm force-pushed the MoveLibSwiftScanOutOfTools branch from 691de13 to 338b914 Compare November 14, 2024 16:44
@artemcm
Copy link
Contributor Author

artemcm commented Nov 14, 2024

@swift-ci smoke test

@artemcm artemcm merged commit 201edb8 into swiftlang:main Nov 14, 2024
3 checks passed
artemcm added a commit to swiftlang/swift-driver that referenced this pull request Dec 3, 2024
…ibSwiftScan

When building the compiler toolchain, there is currently a race condition which makes it so that the 'libSwiftScan.dylib' is not ready by the time the driver is used to begin compilation of the Swift standard library. For now, disable in-process queries altogether.

On 'main', this is resolved with swiftlang/swift#77606, which seems to be a challenge to backport to 6.0.
artemcm added a commit to swiftlang/swift-driver that referenced this pull request Dec 9, 2024
…ibSwiftScan

When building the compiler toolchain, there is currently a race condition which makes it so that the 'libSwiftScan.dylib' is not ready by the time the driver is used to begin compilation of the Swift standard library. For now, disable in-process queries altogether.

On 'main', this is resolved with swiftlang/swift#77606, which seems to be a challenge to backport to 6.0.
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