Skip to content
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

Drop AT&T syntax from inline asm #274

Merged
merged 2 commits into from
Oct 26, 2020
Merged

Conversation

thalesfragoso
Copy link
Member

This was breaking compilation on thumbv6 targets and miscompiling on thumbv7.

Fixes #272
Fixes #267

@rust-highfive
Copy link

r? @jonas-schievink

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive
Copy link

⚠️ Warning ⚠️

  • Pull requests are usually filed against the master branch for this repo, but this one is against v0.6.x. Please double check that you specified the right target!

@rust-highfive rust-highfive added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m labels Oct 20, 2020
Copy link
Contributor

@jonas-schievink jonas-schievink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

bors bot added a commit that referenced this pull request Oct 20, 2020
274: Drop AT&T syntax from inline asm r=jonas-schievink a=thalesfragoso

This was breaking compilation on thumbv6 targets and miscompiling on thumbv7.

Fixes #272 
Fixes #267 

Co-authored-by: Thales Fragoso <thales.fragosoz@gmail.com>
@thalesfragoso
Copy link
Member Author

Hmm, aligned depends on as-slice that depends on generic-array that uses MaybeUninit, which breaks our MSRV.

@bors
Copy link
Contributor

bors bot commented Oct 20, 2020

Build failed:

@jonas-schievink
Copy link
Contributor

Just bump it, master doesn't use those anymore

@thalesfragoso
Copy link
Member Author

thalesfragoso commented Oct 20, 2020

Just bump it, master doesn't use those anymore

We can't release 0.6.4 if we do that. I will try to get rid of aligned, should be easy™.

@jonas-schievink
Copy link
Contributor

That's a breaking change, since we use it in public APIs. Why can't we bump the MSRV?

@thalesfragoso
Copy link
Member Author

//! # Minimum Supported Rust Version (MSRV)
//!
//! This crate is guaranteed to compile on stable Rust 1.31 and up. It might
//! compile with older versions but that may change in any new patch release.

But you are right about removing aligned, hmmm

@jonas-schievink
Copy link
Contributor

I don't think the intention was to make that part of our semver guarantees. We cannot give more guarantees than our dependencies there.

@adamgreig
Copy link
Member

adamgreig commented Oct 21, 2020

At least in principle we do require a semver bump for MSRV changes, which would prevent releasing 0.6.4 with an MSRV above 1.31.

Edit: I am aware we've talked about this before, e.g. rust-embedded/wg#449 (comment), and have at various times wanted to change that policy.

Can we require an older version of aligned?

@thalesfragoso
Copy link
Member Author

Can we require an older version of aligned?

Wouldn't that also be breaking ?

@adamgreig
Copy link
Member

Yes, I suppose it would. Shame for us that nothing in the aligned -> generic_array -> as_slice link made a semver bump when increasing their MSRV, but probably points to our current policy being untenable in general. Sounds like bumping the MSRV for 0.6.4 is probably the least bad option?

@thalesfragoso
Copy link
Member Author

thalesfragoso commented Oct 21, 2020

Sounds like bumping the MSRV for 0.6.4 is probably the least bad option?

I think so, should I change the version in the docs or just remove it entirely ? I think the later option is probably better, since we don't control all of our dependencies.

@adamgreig
Copy link
Member

Throwing away the MSRV entirely seems a bit more drastic for a bug-fix patch release, even if it might become wrong if our dependencies increase it again. What MSRV will we need for this release?

@thalesfragoso
Copy link
Member Author

Throwing away the MSRV entirely seems a bit more drastic for a bug-fix patch release, even if it might become wrong if our dependencies increase it again. What MSRV will we need for this release?

1.36. I think it doesn't make much sense to say that this crate is guaranteed to compile with some specific version if we can't guarantee that...

@therealprof
Copy link
Contributor

If our dependencies bumped the MSRV without following semver best practises, doesn't that automatically mean they already made the decision for us (unless we want to pin a specific version of that dependency)?

@thalesfragoso
Copy link
Member Author

thalesfragoso commented Oct 21, 2020

Well, the aligned crate doesn't have a MSRV to start with, we can't blame them. The problem was that we added a crate with an incompatible MSRV. It seems to be a bit hard to include MSRV in semver, unless you control all of your dependencies.

@adamgreig
Copy link
Member

If our dependencies bumped the MSRV without following semver best practises, doesn't that automatically mean they already made the decision for us (unless we want to pin a specific version of that dependency)?

I don't think it's well established what the semver "best practices" even are around MSRV, or at least I couldn't find anything when we last worried about this. It's possible we both have sensible but incompatible policies.

@therealprof
Copy link
Contributor

Well, I was thinking about the general semver best practises (unrelated to Rust) but actually they really only seem to bother about API surface and not other factors like MSRV so that point is moot.

@adamgreig
Copy link
Member

To get this fix in, shall we bump our reported MSRV for now (and for this 0.6.4 release) to 1.36, leave it in the documentation, and we can spend some more time considering what to do about MSRV generally afterwards? If a user still needs a lower MSRV, at least nothing in our crate stops it; they could always specify an earlier version of aligned in their own Cargo.toml and which is still compatible with cortex-m and should allow the build to continue on earlier rustc.

@thalesfragoso
Copy link
Member Author

thalesfragoso commented Oct 22, 2020

To get this fix in, shall we bump our reported MSRV for now (and for this 0.6.4 release) to 1.36, leave it in the documentation, and we can spend some more time considering what to do about MSRV generally afterwards? If a user still needs a lower MSRV, at least nothing in our crate stops it; they could always specify an earlier version of aligned in their own Cargo.toml and which is still compatible with cortex-m and should allow the build to continue on earlier rustc.

I don't feel very comfortable leaving the MSRV notice as it's now for 0.6.4, maybe change the wording ? We can bring it back on 0.7, given that we can control our dependencies (we already dropped aligned) or at least ask them for setting a MSRV. That is, if we decide on going forward with having a MSRV aware semver policy.

@thalesfragoso
Copy link
Member Author

Ok, I don't think this fix should be blocked by this, so I updated the MSRV and left things as it was. I can change more things if it's required, leaving this decision to you folks.

@thalesfragoso
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Oct 26, 2020
@bors
Copy link
Contributor

bors bot commented Oct 26, 2020

try

Build succeeded:

Copy link
Contributor

@therealprof therealprof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, too.

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 26, 2020

Build succeeded:

@bors bors bot merged commit a624b6a into rust-embedded:v0.6.x Oct 26, 2020
@adamgreig adamgreig mentioned this pull request Oct 26, 2020
@adamgreig
Copy link
Member

I don't feel very comfortable leaving the MSRV notice as it's now for 0.6.4, maybe change the wording ? We can bring it back on 0.7, given that we can control our dependencies (we already dropped aligned) or at least ask them for setting a MSRV. That is, if we decide on going forward with having a MSRV aware semver policy.

Sorry, I didn't mean to leave this sitting. I still think it makes sense to get 0.6.4 out now, but I think overall you're right about the MSRV, as this example clearly illustrates. I still think there's value in stating an MSRV at least so that we're aware of when we change it and can consider if a PR merits a large bump, especially for a crate like cortex-m which is going to be quite widely used in embedded. Maybe it doesn't make sense for bumping the MSRV to be a semver breaking change, though, and maybe we will need to be more careful of dependencies too.

bors bot added a commit that referenced this pull request Oct 26, 2020
275: Prepare 0.6.4 r=jonas-schievink a=adamgreig

Includes #274 to fix recent issues with inline-asm on nightly.

Co-authored-by: Adam Greig <adam@adamgreig.com>
bors bot added a commit that referenced this pull request Oct 26, 2020
275: Prepare 0.6.4 r=jonas-schievink a=adamgreig

Includes #274 to fix recent issues with inline-asm on nightly.

Co-authored-by: Adam Greig <adam@adamgreig.com>
bors bot added a commit that referenced this pull request Oct 26, 2020
275: Prepare 0.6.4 r=jonas-schievink a=adamgreig

Includes #274 to fix recent issues with inline-asm on nightly.

Co-authored-by: Adam Greig <adam@adamgreig.com>
bors bot added a commit that referenced this pull request Oct 26, 2020
275: Prepare 0.6.4 r=jonas-schievink a=adamgreig

Includes #274 to fix recent issues with inline-asm on nightly.

Co-authored-by: Adam Greig <adam@adamgreig.com>
@thalesfragoso thalesfragoso deleted the atet branch January 2, 2021 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants