-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
ensure JSON-defined targets are consistent #133409
Conversation
These commits modify compiler targets. |
This comment has been minimized.
This comment has been minimized.
3be78e5
to
1628e60
Compare
This comment has been minimized.
This comment has been minimized.
1628e60
to
198a5fb
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.
r=me after nits
ac22231
to
5dbca06
Compare
This will conflict with #133411 so let's let that one land first. |
This comment has been minimized.
This comment has been minimized.
5dbca06
to
38f3c7c
Compare
Not really, it's a sort of linting to avoid accidental mistakes in target specs.
And that's entirely fine, the check was intended for built-in targets, and all the exception cases also taken only from built-in targets (and documented so we know why we diverge from the default in some specific cases). Although, not all of the checks are the same. |
#133410 is something I'd definitely like to rely on in other parts of the compiler. It's hard to say which of the checks here are load-bearing vs just indicating something "unusual". It's also easy to imagine parts of the compiler seeing these invariants enshrined in the consistency checks, and beginning to rely on them. |
☔ The latest upstream changes (presumably #133500) made this pull request unmergeable. Please resolve the merge conflicts. |
ab740ea
to
3ef83e2
Compare
I've now made it so that all the dynamic linker checks are skipped for JSON targets. Many of them were anyway already skipped on some targets, so it seems like those are more of the form "this makes an odd target" than "this makes an invalid target". |
1aa6f90
to
2cd3eff
Compare
2cd3eff
to
562a855
Compare
also fine with me, just don't like big files :< |
Yeah me neither. But the file is already huge before this PR... |
Well I did the move in this PR. The thumbs-up didn't trigger a notification so I figured maybe you want me to do it in this PR. @rustbot ready |
ah, damn, I didn't actually send a previous comment here 😅 well, paraphrasing
I am not sure whether the linker stuff is the only thing which doesn't belong in the second category, but given that this is unstable we can move anything else that's actually just "weird, not wrong" to also only be checked for builtin targets later. With this @bors r+ rollup=iffy |
ensure JSON-defined targets are consistent We have a `check_consistency` check that ensures some invariants which (presumably) the rest of the compiler relies on. However, JSON targets can easily be written in a way that violates those invariants. So this PR applies the same consistency check to JSON targets that we already enforce for built-in targets. I have converted many of the assertions in that function to new macros that show a nice error instead of a panic; if people are okay with the general approach here, I can do that for the rest of the checks as well.
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors retry
|
That was probably #127883. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (d6f8829): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -2.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 774.051s -> 773.667s (-0.05%) |
We have a
check_consistency
check that ensures some invariants which (presumably) the rest of the compiler relies on. However, JSON targets can easily be written in a way that violates those invariants. So this PR applies the same consistency check to JSON targets that we already enforce for built-in targets.I have converted many of the assertions in that function to new macros that show a nice error instead of a panic; if people are okay with the general approach here, I can do that for the rest of the checks as well.