-
Notifications
You must be signed in to change notification settings - Fork 68
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
Fixes for Rust 1.81.0 #1333
Merged
Merged
Fixes for Rust 1.81.0 #1333
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
leighmcculloch
commented
Sep 10, 2024
leighmcculloch
force-pushed
the
sigabrt
branch
2 times, most recently
from
September 10, 2024 03:34
3cf2514
to
4eefe03
Compare
Closed
dmkozh
approved these changes
Sep 10, 2024
Oh great, thanks for the fix! I started getting these in my CI and was not sure if I needed to do something. Looks like I just need to wait for a new release 🙌 |
Planning a new release shortly! |
Shortly as in hours, not days. |
Awesome, thanks 🚀 |
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.
What
Fixes for Rust 1.81:
Update semver-checks to 0.35.0.
Don't use the
extern
function for invoking a contract function when executing tests.Why
Semver checks is failing to run on the new version of Rust and needs updating.
Rust 1.81.0 changed the behavior of panics on
extern "C"
functions, such that panics cannot be caught by std::panic::catch_unwind.Contracts expose their functions as an
extern
function that defaults toextern "C"
. The test environment catches panics inside contract functions and resurfaces them as errors by using catch_unwind.The solution used was to make it so that the test environment never calls through the extern function, and instead calls through a non-extern function that does the same work. This seems like the sanest way to take away any dependence / relationship between the test environment and the Rust C-ABI so that any future changes to the C-ABI don't affect the test environment.
An alternative solution would be to mark the contract function as
extern "C-unwind"
so that it retained unwind functionality, but that would continue to bind the SDK test environment to behaviour changes in extern fns.In the solution in this change the Abi qualifier
"C"
has been added. When the Abi qualifier is not specified it defaults to"C"
, but for the sake of being explicit and removing any doubt from a reader it is now specified. The Rust reference confirms that"C"
is the default:More details on this change to Rust 1.81.0 can be found at:
Close Rust 1.81.0 causes SIGABRT in test environment #1332