Skip to content

Bootstrap: Install dispatch in stage0 #81128

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
Apr 28, 2025

Conversation

etcwilde
Copy link
Contributor

@etcwilde etcwilde commented Apr 28, 2025

The concurrency runtimes require that dispatch is installed or it will fail to load at launch. The C library is built as part of the concurrency build but is not installed. We need to install a copy of dispatch so that programs that link concurrency run.

This is to fix the failure to launch the Swift compiler:

: && /home/build-user/stages/stage0/usr/bin/swiftc -j 36 -num-threads 36 -emit-executable -o cmTC_5fc48  CMakeFiles/cmTC_5fc48.dir/main.swift.o    && :
 <unknown>:0: warning: using (deprecated) legacy driver, Swift installation does not contain swift-driver at: '/home/build-user/stages/stage0/usr/bin/swift-driver-new'
    /usr/bin/ld: warning: libdispatch.so, needed by /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so, not found (try using -rpath or -rpath-link)
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_release'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_queue_create'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_assert_queue'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_set_context'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_after_f'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `_dispatch_main_q'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_main'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_source_create'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `_dispatch_source_type_timer'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_queue_attr_make_with_qos_class'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_source_set_event_handler_f'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_source_set_timer'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_async_f'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `_dispatch_queue_attr_concurrent'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_queue_set_width'
    /usr/bin/ld: /home/build-user/stages/stage0/usr/lib/swift/linux/libswift_Concurrency.so: undefined reference to `dispatch_activate'
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    <unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.

The concurrency runtimes require that dispatch is installed or it will
fail to load at launch. The C library is built as part of the
concurrency build but is not installed. We need to install a copy of
dispatch so that programs that link concurrency run.
@etcwilde etcwilde requested a review from shahmishal April 28, 2025 02:51
@etcwilde
Copy link
Contributor Author

@swift-ci please smoke test

@etcwilde etcwilde merged commit 80527f0 into swiftlang:main Apr 28, 2025
3 checks passed
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