-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: runtime test expectation file #70
Open
Gankra
wants to merge
10
commits into
main
Choose a base branch
from
testkey
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a6c5a63
WIP
Gankra 0afa742
feat: runtime test expectation file
Gankra 89127dc
fix
Gankra e814e89
feat: migrate builtin test expectations to static file
Gankra d7bb583
fix: typo
Gankra 03b8ea3
fmt
Gankra a6bb706
fix: make vendor god
Gankra 1297b82
feat: add --disable-builtin-rules
Gankra 88632cc
feat: suggest abi-cafe-rules.toml keys
Gankra 8c28daf
fix: don't emit conv:: twice
Gankra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Here are some example annotations for test expecations | ||
|
||
# this test fails on this platform, with this toolchain pairing | ||
[targets.x86_64-pc-windows-msvc."simple::cc_calls_rustc"] | ||
fail = "check" | ||
|
||
# this test has random results on this platform, whenever rustc is the caller (callee also supported) | ||
[targets.x86_64-pc-windows-msvc."simple::rustc_caller"] | ||
random = true | ||
|
||
# whenever this test involves cc, only link it, and expect linking to fail | ||
[targets.x86_64-pc-windows-msvc."EmptyStruct::cc_toolchain"] | ||
run = "link" | ||
fail = "link" | ||
|
||
# any repr(c) version of this test fails to run | ||
[targets.x86_64-unknown-linux-gnu."simple::repr_c"] | ||
busted = "run" | ||
|
||
# for this pairing, with the rust calling convention, only generate the test, and expect it to work | ||
[targets.x86_64-unknown-linux-gnu."simple::rustc_calls_rustc::conv_rust"] | ||
run = "generate" | ||
pass = "generate" | ||
|
||
# can match all tests with leading :: | ||
[targets.x86_64-unknown-linux-gnu."::rustc_calls_rustc"] | ||
run = "generate" | ||
pass = "generate" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# i128 types are fake on windows so this is all random garbage that might | ||
# not even compile, but that datapoint is a little interesting/useful | ||
# so let's keep running them and just ignore the result for now. | ||
# | ||
# Anyone who cares about this situation more can make the expectations more precise. | ||
[targets.x86_64-pc-windows-msvc."i128::cc_toolchain"] | ||
random = true | ||
[targets.x86_64-pc-windows-msvc."u128::cc_toolchain"] | ||
random = true | ||
|
||
# FIXME: investigate why this is failing to build | ||
[targets.x86_64-pc-windows-msvc."EmptyStruct::cc_toolchain"] | ||
busted = "build" | ||
[targets.x86_64-pc-windows-msvc."EmptyStructInside::cc_toolchain"] | ||
busted = "build" | ||
|
||
# CI GCC is too old to support _Float16 | ||
[targets.x86_64-unknown-linux-gnu."f16::conv_c"] | ||
random = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Having some way to support arbitrary
cfg()
conditions would be really useful to indicate that something is broken on a certain architecture or OS without having to list every single target with this architecture or OS you want to 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.
Hmm yeah I agree, but am definitely running out of steam to build out this feature myself, and am hoping this is an acceptable MVP X3
A few things:
[targets."*"."blhablhablha"]
if you really don't careThere 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.
Partially there is some sense of like, when bringing up a new platform, I think you do want some expectations tabula-rasa? But I might be wrong.
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.
If you have a test failing on x86_64-unknown-linux-gnu, it is almost guaranteed to fail on all x86_64 unix targets as those share a single abi document. The only cases I know of where the OS actually matters are unix vs windows-msvc vs windows-gnu(?) on x86_64 and (non-apple) unix vs apple vs windows arm64ec on arm64.
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.
Hmm are there any libraries y'all compiler devs have for evaling this stuff at runtime?
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.
You could try using the target-lexicon crate (as used by cranelift and by extension cg_clif). It has a
default_calling_convention
method which returns the calling convention used forextern "C"
(also mostly applies toextern "Rust"
) on the respective target. It doesn't yet handle arm64ec though.