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

[Build] Make LLVM a build-script product #38507

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

drexin
Copy link
Contributor

@drexin drexin commented Jul 20, 2021

rdar://80733826

@drexin drexin marked this pull request as draft July 20, 2021 18:12
@drexin
Copy link
Contributor Author

drexin commented Jul 20, 2021

@swift-ci test

@drexin drexin requested a review from gottesmm July 20, 2021 18:12
@drexin
Copy link
Contributor Author

drexin commented Jul 20, 2021

I left the original build-script-impl code in the comments, so it's easier to review.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 96a0762ef26f3d127c7642cd5b46eacbf3cab6a3

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 96a0762ef26f3d127c7642cd5b46eacbf3cab6a3

@drexin
Copy link
Contributor Author

drexin commented Jul 20, 2021

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 2a55ff520b120931846f44afe2cab5f0a79b5093

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 2a55ff520b120931846f44afe2cab5f0a79b5093

@drexin
Copy link
Contributor Author

drexin commented Jul 22, 2021

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 2a55ff520b120931846f44afe2cab5f0a79b5093

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 2a55ff520b120931846f44afe2cab5f0a79b5093

@drexin
Copy link
Contributor Author

drexin commented Jul 23, 2021

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c304ed6dc613c0292e80fd928cb4ada17dabec08

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c304ed6dc613c0292e80fd928cb4ada17dabec08

@drexin
Copy link
Contributor Author

drexin commented Jul 23, 2021

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - cc8eb6eaac4759bcbf293604b691e7b14235b9b2

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - cc8eb6eaac4759bcbf293604b691e7b14235b9b2

@drexin drexin force-pushed the wip-llvm-build-script branch from cc8eb6e to 977f4fe Compare August 2, 2021 22:13
@drexin
Copy link
Contributor Author

drexin commented Aug 2, 2021

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Aug 2, 2021

Build failed
Swift Test OS X Platform
Git Sha - 977f4fecc07e7f338183c5bf9ebcee94de7bf84f

@drexin
Copy link
Contributor Author

drexin commented Aug 2, 2021

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Aug 2, 2021

Build failed
Swift Test OS X Platform
Git Sha - c5e9ad398da844db1850eff50b8817984926265d

@swift-ci
Copy link
Contributor

swift-ci commented Aug 2, 2021

Build failed
Swift Test Linux Platform
Git Sha - c5e9ad398da844db1850eff50b8817984926265d

@drexin
Copy link
Contributor Author

drexin commented Aug 3, 2021

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Aug 3, 2021

Build failed
Swift Test Linux Platform
Git Sha - cc71d54f3af085f321b5ceab6641c506add3472d

@swift-ci
Copy link
Contributor

swift-ci commented Aug 3, 2021

Build failed
Swift Test OS X Platform
Git Sha - cc71d54f3af085f321b5ceab6641c506add3472d

@drexin
Copy link
Contributor Author

drexin commented Aug 3, 2021

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Aug 3, 2021

Build failed
Swift Test Linux Platform
Git Sha - b119e2e0db1b9083952333bc2518daf412d197e4

@swift-ci
Copy link
Contributor

swift-ci commented Aug 3, 2021

Build failed
Swift Test OS X Platform
Git Sha - b119e2e0db1b9083952333bc2518daf412d197e4

@drexin
Copy link
Contributor Author

drexin commented Mar 25, 2022

@swift-ci build toolchain macos

@drexin drexin force-pushed the wip-llvm-build-script branch from 4648a35 to 937a381 Compare March 25, 2022 22:06
@drexin
Copy link
Contributor Author

drexin commented Mar 25, 2022

@swift-ci build toolchain macos

@drexin drexin force-pushed the wip-llvm-build-script branch from 937a381 to 4c49500 Compare March 25, 2022 22:40
@drexin
Copy link
Contributor Author

drexin commented Mar 25, 2022

@swift-ci build toolchain macos

@drexin drexin force-pushed the wip-llvm-build-script branch from 4c49500 to 9fd1531 Compare March 28, 2022 16:38
@drexin
Copy link
Contributor Author

drexin commented Mar 28, 2022

@swift-ci build toolchain macos

@drexin drexin force-pushed the wip-llvm-build-script branch from 9fd1531 to fcb6ec4 Compare August 26, 2022 20:59
@drexin
Copy link
Contributor Author

drexin commented Aug 26, 2022

@swift-ci test

@drexin drexin force-pushed the wip-llvm-build-script branch from fcb6ec4 to d6f9782 Compare August 26, 2022 21:01
@drexin
Copy link
Contributor Author

drexin commented Aug 26, 2022

@swift-ci test

@drexin drexin force-pushed the wip-llvm-build-script branch from 72fa3e1 to 54b0a30 Compare August 29, 2022 16:49
@drexin
Copy link
Contributor Author

drexin commented Aug 29, 2022

@swift-ci test

@drexin drexin force-pushed the wip-llvm-build-script branch from 54b0a30 to 61ee2fb Compare October 4, 2022 16:39
@drexin drexin force-pushed the wip-llvm-build-script branch from 61ee2fb to 3f80cb6 Compare October 31, 2022 05:47
@drexin
Copy link
Contributor Author

drexin commented Oct 31, 2022

@swift-ci smoke test

@finagolfin
Copy link
Member

@drexin, just noticed that this finally went in when building the latest trunk snapshot, great to see. However, it did cause a problem when building LLVM: the number of build jobs is no longer passed to CMake and ninja just maxes out the number of CPUs used, rather than applying the number of jobs passed to build-script.

I just looked into it and the issue is that these CMake build args were always generated in build_args() then passed into build-script-impl, but this isn't passed into build_with_cmake() when building LLVM after this pull.

I've worked around it locally by pulling in that flag I need with this patch, not sure exactly what you want to do generally to fix this:

diff --git a/utils/swift_build_support/swift_build_support/products/cmake_product.py b/utils/swift_build_support/swift_build_support/products/cmake_product.py
index e141c386008..60c4da516d1 100644
--- a/utils/swift_build_support/swift_build_support/products/cmake_product.py
+++ b/utils/swift_build_support/swift_build_support/products/cmake_product.py
@@ -43,6 +43,7 @@ class CMakeProduct(product.Product):
         generator_output_path = ""
         if self.args.cmake_generator == "Ninja":
             generator_output_path = os.path.join(self.build_dir, "build.ninja")
+            build_args.append('-j%s' % self.args.build_jobs)
 
         cmake_cache_path = os.path.join(self.build_dir, "CMakeCache.txt")
         if self.args.reconfigure or not os.path.isfile(cmake_cache_path) or \

@drexin
Copy link
Contributor Author

drexin commented Dec 3, 2022

@buttaface Ah, good catch. Would you mind creating an issue and assigning it to me?

drexin added a commit to drexin/swift that referenced this pull request Dec 7, 2022
Some parameters were accidentally dropped with the introduction of swiftlang#38507.

rdar://103080745
finagolfin added a commit to finagolfin/swift that referenced this pull request Dec 11, 2022
Also, add flag and comment from `build-script-util` that was missed in the
recent Python translation, swiftlang#38507.
meg-gupta pushed a commit to meg-gupta/swift that referenced this pull request Dec 16, 2022
Also, add flag and comment from `build-script-util` that was missed in the
recent Python translation, swiftlang#38507.
meg-gupta pushed a commit to meg-gupta/swift that referenced this pull request Dec 16, 2022
Some parameters were accidentally dropped with the introduction of swiftlang#38507.

rdar://103080745
ando-huang pushed a commit to ando-huang/swift that referenced this pull request Jan 2, 2023
Also, add flag and comment from `build-script-util` that was missed in the
recent Python translation, swiftlang#38507.
ando-huang pushed a commit to ando-huang/swift that referenced this pull request Jan 2, 2023
Some parameters were accidentally dropped with the introduction of swiftlang#38507.

rdar://103080745
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.

6 participants