-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
make it possible to use stage0 libtest on compiletest #139386
base: master
Are you sure you want to change the base?
make it possible to use stage0 libtest on compiletest #139386
Conversation
This PR modifies If appropriate, please update This PR modifies If appropriate, please update |
15d164d
to
7f3da8c
Compare
src/ci/run.sh
Outdated
@@ -134,6 +134,7 @@ if [ "$DEPLOY$DEPLOY_ALT" = "1" ]; then | |||
|
|||
CODEGEN_BACKENDS="${CODEGEN_BACKENDS:-llvm}" | |||
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.codegen-backends=$CODEGEN_BACKENDS" | |||
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.compiletest-use-stage0-libtest=false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would set this to false
in the dist
profile, in order to be enabled globally on CI, and then have one runner that sets it to true
, to test that compiletest works also with stage0, if we want to gate on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if using it in just one runner gives enough coverage.
Here's what I did: compiletest-use-stage0-libtest
is set to false
in the dist
profile and run.sh
script overrides it to true
unless $DEPLOY
or $DEPLOY_ALT
is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure that most dist builders don't even build compiletest, as they don't run any tests. So if you want to have partial coverage of both true/false, we should do the split inside the test builders, not between test and dist, IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That being said, I'm not sure if we need that much coverage of the true value? It's just a hack to make local rebuilds faster. I would put it maybe into one runner per OS.
Although, if we have both true and false on CI as blocking, can't that break beta bumps? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That being said, I'm not sure if we need that much coverage of the true value? It's just a hack to make local rebuilds faster. I would put it maybe into one runner per OS.
Yeah, probably... I can do that for Linux, Mac and Windows (let me know if I am missing any other) as those are the most popular ones used by devs.
Although, if we have both true and false on CI as blocking, can't that break beta bumps? 🤔
I guess that could happen if libtest is changed before bumping stage0 compiler, which will require compiletest
is always built using the in-tree version of libtest. So if something breaks libtest, it would fail during development already; it wouldn't make it to beta without being caught.cfg(bootstrap)
thing there, I am not sure if this is acceptable. cc @jieyouxu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm yeah, I think there's a window where indeed cfg(bootstrap)
might be needed, a library/testing-devex contributor who wants to modify libtest may need to cfg(bootstrap)
-gate bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That being said, following #139317, the libtest usages in compiletest should be mostly isolated in one single module. We could add a doc comment on that about possibly needing cfg(bootstrap)
-gating libtest changes.
Personally, I think this approach (possibility of compiletest using stage0 libtest for local dev) is reasonable, and I can't really think of a better solution.
7f3da8c
to
8c17501
Compare
This PR modifies If appropriate, please update |
2ceaed5
to
48e9c4a
Compare
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
c757f55
to
c3cfdfc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, cc @Kobzol in case you still have concerns.
Signed-off-by: onur-ozkan <[email protected]>
c3cfdfc
to
c830665
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one comment. The change otherwise looks fine. I'm not sure if we shouldn't do an MCP for this, but I think that libtest
changed very rarely recently, so this shouldn't require a lot of cfg(bootstrap)
places in compiletest. If it becomes a problem in the future, we can discuss it further.
@@ -27,7 +27,7 @@ runners: | |||
<<: *base-job | |||
envs: | |||
env-x86_64-apple-tests: &env-x86_64-apple-tests | |||
SCRIPT: ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact | |||
SCRIPT: ./x.py check compiletest --set build.compiletest-use-stage0-libtest=true && ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x check
doesn't actually go through the same codepath as x build
; I think that for x check
the stage0 config is not used at all, all the tools are checked with Mode::ToolRustc
(
Mode::ToolRustc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d2840fa makes x check compiletest
to respect build.compiletest-use-stage0-libtest
option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This specific file contains just tests mock data btw, it doesn't need to be updated 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am aware, I just wanted them to be 1:1 equal.
In my opinion, the point we are discussing (whether compiletest should support stage0 with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'm fine with this now, so no other concerns.
It seems like you committed a LLVM submodule update by accident.
@@ -27,7 +27,7 @@ runners: | |||
<<: *base-job | |||
envs: | |||
env-x86_64-apple-tests: &env-x86_64-apple-tests | |||
SCRIPT: ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact | |||
SCRIPT: ./x.py check compiletest --set build.compiletest-use-stage0-libtest=true && ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This specific file contains just tests mock data btw, it doesn't need to be updated 😆
&[], | ||
); | ||
|
||
cargo.allow_features("test"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It kinds sucks that we have to duplicate the code in this way. Would be maybe nice to merge build/check logic into the same step. But that's not relevant for this PR, anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the macro will be super complicated and ugly with compiletest specific changes, it's better to re-write the whole macro to make it more generic so...
Signed-off-by: onur-ozkan <[email protected]>
d2840fa
to
cae28b5
Compare
With #119899, building the library tree will require a stage 1 compiler. This is because
compiletest
is defined as aToolStd
(since #68019) in order to use the in-tree library. As a result, #119899 makes certain development workflows more difficult as changes on the compiler tree will now require recompilingcompiletest
each time.This PR allows switching
ToolStd
toToolBootstrap
with a simple boolean option inbootstrap.toml
to allowcompiletest
to use the stage 0libtest
instead.The changes under
src/ci
are clearly intended to make sure thatcompiletest
doesn't break during future bootstrap beta bumps.