-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[build] Fix --skip-build-llvm so that its minimal targets, like tblgen, are still built #32860
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
Conversation
It looks like your PR will work. As long as Just to be clear, the only purpose of the The terribly-named
This PR completely broke the My workflow was blocked until I fixed that functionality: AFAICT, your PR will keep the skip-build functionality working. |
@atrick, yes, My problem is not |
Hmm. Ok, I thought the tablegen tool itself would need to be built in order to configure Swift. At any rate, as long as I can reconfigure Swift without building all of LLVM then mission accomplished. I have no need to use |
You're right. I was only checking for the standalone Swift stdlib, where it isn't needed. Configuring the Swift compiler build normally with
No, that was done in your pull, including removing Alex's comment explaining why it couldn't be done. 😉
I've added comments everywhere now, including resurrecting most of Alex's original comment. I think this is ready to go, once it passes the CI. After it gets in, I will submit a pull with the |
I thought that code was redundant with the code I added here: At any rate, this PR now looks like it's just making -skip-build-llvm behave the same as --skip-build with respect to LLVM. I actually prefer that behavior. I thought the intention behind PR #29373 was to add "don't configure and don't build" options for each product, so I tried to preserve that intent. I had no idea there was also a supported |
Yep, that's all it does now, reverting back to the way it was last year.
Yeah, it's just passed to
The Swift CMake config still needs some generated LLVM CMake config files when building the Swift stdlib standalone. That's why the first iteration of this pull, that simply configured the LLVM targets but didn't build them, was enough for me to build the Swift stdlib alone, but I changed it to build the minimal LLVM targets now, since that's needed when configuring the Swift compiler build. |
Now it all finally makes sense. Thanks. These build-script flags are a mess. If it gets properly cleaned up we should just make it clear that configuring swift depends on configuring llvm, configuring stdlib depends on configuring llvm (or hopefully we can completely break that dependence), and configuring llvm requires building some minimal tools. It's really not that hard of a problem. |
@atrick, if this is okay now, can you trigger the CI and merge, as I can't do either. |
@swift-ci smoke test and merge |
@swift-ci test |
Build failed |
Build failed |
The macOS CI failure for lldb looks unrelated. Anyway, please hold off on the CI for now, as I see a test from #32256 that will need to be modified. |
…n, are still built
Modified the relevant test but it isn't run on the CI right now, so this pull will have to wait till #32954 enabling that test is merged first. |
Alright, @atrick, ready to run the CI now, got the related tests enabled again. |
Or @davezarzycki, since you're up, could you just kick off the CI for this? |
@swift-ci please test |
Thanks. This test was disabled on the CI before, should run now. |
Build failed |
Build failed |
Linux passes, macOS CI appears broken right now. @hlopko, since you're the only person to submit a pull to this repo this morning, maybe you know who to report this macOS CI breakage to. |
That known test failure was the only failure. So it's safe to smoke test now. |
@swift-ci smoke test |
Alright, finally passed the CI and I confirmed that the modified test was run: ready for merge. |
Thanks! |
@buttaface This is a good fix. Thanks! I have been meaning to find time to fix this for some time. It also broke a workflow that I use for refactoring quickly (--skip-build-llvm with the Xcode code generator... as you said... you need these binaries if you want to build swift since they are binaries we rely on existing). Thanks for updating the test as well! It is so important that we have these build-system unit tests to freeze the behavior of build-script to stop things like this from sneaking into the tree! |
Sure, I use it too, so just scratching my own itch. 😄 |
There have been some regressions this year that broke the way the three base products- cmark, llvm, and swift- are built if their
skip-build-*
flags are applied. For example, building the standalone stdlib no longer works after pulls #29373, #29500, and #32256. I just noticed this when trying to run this similar build-script command to build the Swift stdlib alone on linux with the latest July 12 source snapshot from trunk and matching prebuilt official compiler (I use an extended version of this command when cross-compiling the stdlib for Android):The three base products were always handled differently in the build scripts until this year, because they would usually be built and relied on each other. For example, LLVM has to be configured for the Swift product to be configured.
The way the build-script worked till January was that
--skip-build-*
meant the product was neither configured or built, with the exception of the base products: CMark, LLVM, and Swift. For those three,--skip-build-swift
or the equivalent would mean that that product was configured, but not built (with one exception, a few LLVM targets like tblgen would always be built even with--skip-build-llvm
or--skip-build
back then).Since January, the first two pulls above changed the base products to match all other products, ie
--skip-build-*
always meansdon't configure and don't build
(with a strange exception of configuring and building the minimal LLVM targets only if the--skip-build
flag was passed, likely a mistake). The way this worked was thatbuild-script-impl
was always run for each of the base products and the flags in that bash script would then disable both configuring and building the unwanted base products.Finally, #32256 last month added another layer and disabled even running
build-script-impl
if askip-build-*
flag was passed for a base product. That made the logic from the first two pulls disabling those same base products inbuild-script-impl
redundant.This pull partially reverts those three pulls for the
--skip-build-llvm
flag alone,with the only difference fromchanging it back to the way it worked last yearthat it will now configure the minimal LLVM targets but not build them. This gets the above pasted command to build the standalone stdlib working again.I'm not sure if more should be done, so I'm only offering this as a potential solution to spur discussion. @atrick and @gottesmm, let me know what you think these
--skip-build*
flags for the three base products should do, given the historical behavior and dependencies laid out above.