-
Notifications
You must be signed in to change notification settings - Fork 44
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
crux-mir
: Support nightly-2023-01-23
#1096
Merged
Merged
Conversation
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
- updated libs - changed crux_mir to crux::mir in tests - new lib build script (build.sh) - changes to crux-mir to support changes to rustc (nightly-2023-01-22)
This is in preparation for permitting various translation functions to be called from `transStatics`.
If a static is initialized with a constant value, we now detect and handle this in `translateStatics`.
Adapted from the original patch in 0374310
Previously, only constant arrays of bytes were translatable. This patch lifts that restriction so that constant arrays of arbitrary types can be translated, which is necessary to support some constant arrays used in a newer Rust nightly.
Adapted from the original commit in 52f6f57
This took us a while to debug before we realized what was going on. Let's make the failure obvious.
Originally from commit 42424ae
Originally from commit 69e92cb
RyanGlScott
added a commit
to GaloisInc/saw-script
that referenced
this pull request
Jul 7, 2023
This patch bumps the `crucible` submodule to bring in the changes from GaloisInc/crucible#1096 and updates the code in `crucible-mir-comp` and `crux-mir-comp` accordingly. Some highlights: * All of the `crux-mir-comp` test cases now use `crux::test` instead of `crux_test`. * All of the `crux-mir-comp` test cases now scrub out the values of crate hash disambiguators to make their output more stable. * The overrides in `crux-mir-comp` no longer depend on the specific disambiguator values being used, which makes them work with the sometimes unpredictable hash values used for crate disambiguators. * I have added a `tyToShape` case for `TyStr` to handle new kinds of static values that arise in the new Rust nightly (mostly coming from constant values in the `fmt` crate). The code for this case is nearly identical to that in the `TySlice` case. * There are now static values of type `TyFnPtr` in the new Rust nightly (mostly coming from constant values in the `fmt` crate), so in order to handle them in `clobberGlobals`, I needed to add a `FnPtrShape` data constructor to `TypeShape`. This is mostly a quick hack, since I implemented all other functionality for `FnPtrShape` with calls to `error`. Nevertheless, that is enough to make all of the tests pass. We can always fill out the calls to `error` later if need be.
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.
Mostly looks good, aside from a possible correctness issue with the handling of StatementKind::Intrinsic
.
This require a fair bit of refactoring to avoid problematic uses of `textId` that were relying on `defaultDisambiguator`.
Because `Box<T>` no longer uses the same `TypeRep` as `mut *T`, it is not sound to translate `ShallowInitBox` as though it were an identity function. Thankfully, nothing in the test suite actually uses `ShallowInitBox`, so we simply leave it unimplemented for now.
There's not much of a point in checking for the `crux` configuration attribute, since one wouldn't be able to compile these tests with bare `rustc` anyway due to their use of the `crucible` crate.
RyanGlScott
added a commit
to GaloisInc/saw-script
that referenced
this pull request
Jul 13, 2023
This patch bumps the `crucible` submodule to bring in the changes from GaloisInc/crucible#1096 and updates the code in `crucible-mir-comp` and `crux-mir-comp` accordingly. Some highlights: * All of the `crux-mir-comp` test cases now use `crux::test` instead of `crux_test`. * All of the `crux-mir-comp` test cases now scrub out the values of crate hash disambiguators to make their output more stable. * The overrides in `crux-mir-comp` no longer depend on the specific disambiguator values being used, which makes them work with the sometimes unpredictable hash values used for crate disambiguators. * I have added a `tyToShape` case for `TyStr` to handle new kinds of static values that arise in the new Rust nightly (mostly coming from constant values in the `fmt` crate). The code for this case is nearly identical to that in the `TySlice` case. * There are now static values of type `TyFnPtr` in the new Rust nightly (mostly coming from constant values in the `fmt` crate), so in order to handle them in `clobberGlobals`, I needed to add a `FnPtrShape` data constructor to `TypeShape`. This is mostly a quick hack, since I implemented all other functionality for `FnPtrShape` with calls to `error`. Nevertheless, that is enough to make all of the tests pass. We can always fill out the calls to `error` later if need be.
This was referenced Jul 14, 2023
This was referenced Dec 5, 2023
RyanGlScott
added a commit
that referenced
this pull request
Feb 1, 2024
RyanGlScott
added a commit
that referenced
this pull request
Feb 6, 2024
(cherry picked from commit cd84599)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a fairly large overhaul of
crux-mir
's andcrucible-mir
's internals to support a more recent Rust nightly (nightly-2023-01-23
). The work is split between myself, @m10f, and @spernsteiner.There is a lot happening here, so if you want to learn specifics, I'd encourage you to look at individual commits. Some of the broad themes in the patchset include:
crucible-mir
can know about non-isize
discriminant types (e.g.,Ordering
, which uses ani8
discriminant)crux-mir/lib/Patches.md
file for explanations of each patch)MaybeUninit
andOption
crux-mir
, which was previously disabled due to the nightly not working on recent macOSesThis should fix several issues:
crux-mir
macOS builds after upgrade to Clang 14 #1050