-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Move std_detect
into stdlib
#143412
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
base: master
Are you sure you want to change the base?
Move std_detect
into stdlib
#143412
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
9086668
to
277837d
Compare
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. There are changes to the cc @jieyouxu |
std_detect
into stdlibstd_detect
into stdlib
This is not yet ready for review, but it will need some input from stdarch maintainers regarding the test changes, as they have to happen in this PR, otherwise we either lose testing for CC @rust-lang/libs |
One of my peers is looking at implementing aarch64 outlined atomics in compiler-builtins, which needs to check for the LSE feature. Will it still be possible for it to use (That said, I'm not sure if that can work either way since the feature caching also uses atomics, so that might create a chicken-and-egg situation...) |
How would it work before? |
Do you mean LSE would need to be checked within compiler-builtins? I don't think that is easily possible since AIUI (Amanieu would know more if you want to zulip this) |
The code is currently not doing this, only implementing the more basic LL/LC mode that doesn't need feature checks. That kind of defeats the point of "outlined atomics", but it's functional.
Yes, I think so, but I'm open to suggestions.
Note that https://github.com/llvm/llvm-project/blob/6a993264ee0105da32a6a57fb077796076cf6bf4/compiler-rt/lib/builtins/cpu_model/aarch64.c#L49-L51 |
Anyway, as I said, I'm not even sure it's possible for that to work, given that |
Rather than checking auxvec in compiler-builtins itself, could we check a weakly defined symbol? Then if LLVM indeed puts everything into compiler-rt, but I don't believe we need to follow exact suit here (#138944 is similar). |
If we allow a constructor like LLVM is doing, then we could have a static symbol like |
☔ The latest upstream changes (presumably #143762) made this pull request unmergeable. Please resolve the merge conflicts. |
r? @Amanieu Not sure who is responsible for maintaining the stdarch CI test suite :) |
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 happy with the test changes. r=me
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.
Seems like a typo in the path.
Just to clarify, I haven't implemented any of these test changes yet 😅 Just wanted to get a vibe check on the general direction. I'll work on it then. |
277837d
to
92d9d7f
Compare
cc @Amanieu, @folkertdev, @sayantn |
92d9d7f
to
dc93317
Compare
dc93317
to
42d602b
Compare
std_detect
into stdlibstd_detect
into stdlib
The stdarch part of this has green CI (rust-lang/stdarch#1873), and I documented the targets whose coverage we lose for This should be ready for another review. |
This PR moves the
std_detect
crate fromstdarch
to be a part of rust-lang/rust instead.The first commit actually moves the whole directory from the stdarch Josh subtree, so that git blame history is kept intact. Then I had to make a few changes to appease
tidy
.The most complex thing here is porting the tests. We can't have
std_detect
both in r-l/r and stdarch, because they could get desynchronized, so we have to perform the move more or less "atomically", which means that we also have to port all the existingstd_detect
tests from thestdarch
repository.The stdarch repo runs the following
std_detect
tests:Build
The
build-std-detect.sh
script (https://github.com/rust-lang/stdarch/blob/e2b6512aed87df45294ae680181eeef7a802cd95/ci/build-std-detect.sh) buildsstd_detect
using the nightly compiler for several targets. This will be subsumed by normalx build library
on our Tier 1/2 targets. However, the stdarch repository also tests the following targets:Which we don't build/test on our CI currently. I think we have mostly two options here:
std_detect
crate?) for these targets.Documentation
The
dox.sh
script (https://github.com/rust-lang/stdarch/blob/3fec5adcd52a815f227805d4959a25b6402c7fd5/ci/dox.sh) builds and documentsstd_detect
for several targets. All of them are Tier 2/we havedist-
jobs for them, so I think that we can just skip this and let our normal CI subsume it?Tests
The
run.sh
script (https://github.com/rust-lang/stdarch/blob/1b201cec2cca7465602a65ed6ae60517224b15f3/ci/run.sh) runscargo test
onstd_detect
with a bunch of variations of feature flags. This will be subsumed byx test library
in our CI. The only problem is thatstdarch
runs these tests for a ludicrous number of targets:We definitely do not run tests for all of these targets on our CI.
Outcome
We have decided to just subsume std_detect tests by our normal test suite for now, and not create a separate CI job. Therefore, this PR performs the following changes in target testing for
std_detect
:The following T3 targets would go from "build" to "nothing":
The following T3 targets would go from "test" to "nothing":
The following T2 targets would go from "test" to "build":
I have confirmed in rust-lang/stdarch#1873 that the current version of this PR would pass stdarch's CI testsuite.
r? @ghost