Skip to content

[build-script] Begin putting in infrastructure for the multi-compiler stage swift build #38719

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

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Aug 1, 2021

In this PR, I am introducing some new infrastructure to enable me to begin staging in the multi-compilerstage swift build-script product build. This will let us eventually have a stage1 build-script based on this and in the shorter-term be able to bootstrap libswift on platforms where we do not have a toolchain (important for Linux/windows where we do not have a toolchain on the bots).

The key thing here is that I have:

  1. Added support for CMakeProduct subclasses to be able to opt into building against the just built toolchain. No one specifies this today but I will need it for the stage2 compiler.
  2. I added support in HostSpecificConfiguration for dynamically depending on the stage accepting certain stage specific args. The key thing is that it is the same set of options, we just post-fix with _stage2 in the case of a stage2 compiler. This will ensure we can have a single implementation of this code for both compiler stages.

One last thing to note: even though this is adding support for a full stage 2 compiler, we will not actually typically use a full stage2 compilation. Instead most of the time we will do a stage2 compilation where we tell the compiler to just use the just built compiler to build a new stdlib/build libswift/relink swiftc.

@gottesmm gottesmm requested review from drexin and edymtt August 1, 2021 19:25
@gottesmm
Copy link
Contributor Author

gottesmm commented Aug 1, 2021

@swift-ci clean test

@swift-ci
Copy link
Contributor

swift-ci commented Aug 1, 2021

Build failed
Swift Test Linux Platform
Git Sha - f6b2c207ac1878e18769382887a0837e10da3388

@swift-ci
Copy link
Contributor

swift-ci commented Aug 1, 2021

Build failed
Swift Test OS X Platform
Git Sha - f6b2c207ac1878e18769382887a0837e10da3388

@gottesmm gottesmm force-pushed the build-script-bootstrap-stage2-init branch from f6b2c20 to ed78f4e Compare August 1, 2021 22:56
@gottesmm
Copy link
Contributor Author

gottesmm commented Aug 1, 2021

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Aug 2, 2021

Build failed
Swift Test Linux Platform
Git Sha - ed78f4e050ccb93e1cf9ff5b8e26048599925f86

@swift-ci
Copy link
Contributor

swift-ci commented Aug 2, 2021

Build failed
Swift Test OS X Platform
Git Sha - ed78f4e050ccb93e1cf9ff5b8e26048599925f86

@gottesmm gottesmm force-pushed the build-script-bootstrap-stage2-init branch from ed78f4e to aa44292 Compare August 2, 2021 21:46
@gottesmm
Copy link
Contributor Author

gottesmm 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 - aa442920e0578b486b2faea49d85a1cb43cdb150

@swift-ci
Copy link
Contributor

swift-ci commented Aug 3, 2021

Build failed
Swift Test Linux Platform
Git Sha - aa442920e0578b486b2faea49d85a1cb43cdb150

…opt into using the just built swift toolchain.
…ions.

This will let me introduce a stage generic swift implementation that adds a
postfix '_stage2' to certain stage specific options. This ensures we can have a
single swift build-script product implementation for both stage1 and stage2
compilers.
…stage compilers.

The key thing here is that certain options (such as the stdlib deployment
targets and what to build/test) now use stage_dependent_args meaning that when
we us a stage2 compiler we will automagically look up the same argument name,
but with '_stage2' as a postfix.
The option is specifically: SWIFT_RUN_TESTS_WITH_HOST_COMPILER. NOTE: We assume
that swiftc is in the just built toolchain directory and all necessary tools are
next to swiftc.

I am using this to bring up tests for a stage2 swift stdlib build (and eventual
libswift support).
@gottesmm gottesmm force-pushed the build-script-bootstrap-stage2-init branch from aa44292 to 11ec4df Compare August 4, 2021 20:44
@gottesmm
Copy link
Contributor Author

gottesmm commented Aug 4, 2021

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

gottesmm commented Aug 4, 2021

@swift-ci smoke test linux platform

@gottesmm gottesmm merged commit a788461 into swiftlang:main Aug 5, 2021
@gottesmm gottesmm deleted the build-script-bootstrap-stage2-init branch August 5, 2021 02:09
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