Skip to content
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

[SR-7724] libdispatch gets built twice on Linux when sourcekit is enabled #654

Open
kevints mannequin opened this issue May 18, 2018 · 5 comments
Open

[SR-7724] libdispatch gets built twice on Linux when sourcekit is enabled #654

kevints mannequin opened this issue May 18, 2018 · 5 comments
Assignees

Comments

@kevints
Copy link
Mannequin

kevints mannequin commented May 18, 2018

Previous ID SR-7724
Radar None
Original Reporter @kevints
Type Bug
Status In Progress
Resolution
Additional Detail from JIRA
Votes 0
Component/s libdispatch, Source Tooling
Labels Bug
Assignee @kevints
Priority Medium

md5: be0f60374adcf80ee5d8090c026d8f95

Issue Description:

This appears to be a bug in the build system, on Linux sourcekit will cause libdispatch to be built a second time, using the CMake ExternalProject feature.

This unfortunately doesn't preserve all of the options that were passed to build-script (which builds libdispatch separately here, but a seemingly-arbitrary subset of them.

We should ideally refactor the build so that dispatch is only built once, and with the same collection of arguments.

@kevints
Copy link
Mannequin Author

kevints mannequin commented May 18, 2018

Note that the swift-cmake-built libdispatch gets deleted by build-script here: https://github.com/apple/swift/blob/3156180c082d469fdeaa003b7d4c7b7fe0f4ecfb/utils/build-script-impl#L2511-L2512

@belkadan
Copy link

I think this is deliberate. SourceKit uses the C parts of Dispatch, but not the Swift parts. The alternative would be to build the Swift repo in two stages. cc @akyrtzi, @compnerd

@kevints
Copy link
Mannequin Author

kevints mannequin commented May 21, 2018

Hmm, I'm not sure I follow. At the end of the build only one libdispatch.so is installed on the system and both build invocations pass -DENABLE_SWIFT=YES. If they do need to be different they could at least use different build dirs to avoid the need for the

call rm -fr "${LIBDISPATCH_BUILD_DIR}"

which has the effect of making the libdispatch build nonincremental on Linux

@compnerd
Copy link
Collaborator

The ordering at this point is tracked well enough to allow building libdispatch with the SDK overlay in a single go. I think that there was some issue with the build at one point, not sure if is still there (and I don't remember the details 🙁).

@kevints
Copy link
Mannequin Author

kevints mannequin commented Oct 1, 2018

PR: apple/swift#19640

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants