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

Replace the "no-std" feature with a "std" feature #114

Merged
merged 2 commits into from
Aug 18, 2023

Conversation

egrimley-arm
Copy link
Collaborator

Negative feature names are rejected by Clippy: they cause confusion when several crates depend on the same crate but with different sets of features.

The default set of features is changed but anyone who specifies --no-default-features or default-features = false will need to change what features they specify, so this is an incompatible change.

Also update toolchain from 1.58.1 to 1.60.0 in .github/workflows/ci.yml as regex-syntax v0.7.2 requires rustc 1.60.0 or newer.

@egrimley-arm egrimley-arm self-assigned this Aug 3, 2023
Negative feature names are rejected by Clippy: they cause confusion
when several crates depend on the same crate but with different sets
of features.

The default set of features is changed but anyone who specifies
"--no-default-features" or "default-features = false" will need to
change what features they specify, so this is an incompatible change.

Signed-off-by: Edmund Grimley Evans <edmund.grimley-evans@arm.com>
Copy link
Member

@ionut-arm ionut-arm left a comment

Choose a reason for hiding this comment

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

Nice, thank you!

You might want to sync with @ithinuel (see #113 ) regarding proper "no-std" support :)

@ithinuel
Copy link
Contributor

ithinuel commented Aug 3, 2023

I'm happy to remove the last commit from my PR if this one is merged first.

Signed-off-by: Edmund Grimley Evans <edmund.grimley-evans@arm.com>
@egrimley-arm egrimley-arm force-pushed the pr-no-std branch 2 times, most recently from b6194e3 to 23a8864 Compare August 16, 2023 08:48
@egrimley-arm egrimley-arm marked this pull request as ready for review August 16, 2023 09:18
@egrimley-arm
Copy link
Collaborator Author

Summary: I have proposed three ways of getting the CI tests to pass:

The first way seems bad because we want to keep things working with the old toolchain. I quite like the third one because it doesn't unnecessarily affect users of the crate with a recent toolchain, but perhaps it increases the maintenance burden.

Which shall we use? Or is there a fourth way?

@gowthamsk-arm
Copy link
Contributor

Thanks for the patch @egrimley-arm. :)
Usually for library crates the cargo.lock file gets ignored when the crate is added as a dependency to any binary crate and the lock file in the binary crate might still cause the issue when compiled against 1.58.1. So I'm inclined towards the Cargo.toml commit.

@ionut-arm what do you think?

@ithinuel
Copy link
Contributor

ithinuel commented Aug 16, 2023

If building with older toolchain is a requirement, it should be committed to with the definition of an MSRV (not present on any of the 3 listed commits). This would need to go with the restriction imposed on log and regex-syntax.

This restriction could be mitigated by (optionally) depending on multiple version of log and regex-syntax and using features to enable compatibility with older/newer versions of the toolchain.
Choice will depend on what the default should be:

  • building on 1.58.1
  • or building on 1.60.0+

(see https://slint.dev/blog/rust-adding-default-cargo-feature)

Keeping Cargo.lock for CI purposes will make CI have a different experience than new users and hide new breakage introduced by dependencies.

I'd also highly recommend to use stable rather than a specific version in CI.
If an MSRV is defined, then both the MSRV and stable should be run.

@egrimley-arm
Copy link
Collaborator Author

I'd also highly recommend to use stable rather than a specific version in CI. If an MSRV is defined, then both the MSRV and stable should be run.

That sounds like a good idea. I've just made a separate PR for that: #116.

@ionut-arm
Copy link
Member

I'm against the Cargo.lock approach for the same reasons that @gowthamsk-arm and @ithinuel highlighted.

@gowthamsk-arm - was there a strong reason to keep the MSRV at 1.58?

@egrimley-arm
Copy link
Collaborator Author

I have reverted this PR back to the second version, the one that modifies */Cargo.toml.

@gowthamsk-arm
Copy link
Contributor

One of the distributions that Parsec is packaged for has 1.58 as the minimum RUST version so we had to set it as MSRV.

@ithinuel
Copy link
Contributor

Since this PR sets the dependencies' version range, should'nt it also include:

  • the setting of the MSRV
  • the setup of github flow for the msrv & stable?

i.e. what's in #116

@egrimley-arm
Copy link
Collaborator Author

Since this PR sets the dependencies' version range, should'nt it also include:

  • the setting of the MSRV
  • the setup of github flow for the msrv & stable?

i.e. what's in #116

As I see it, this PR is mostly about replacing no-std with std, with minimal additions to get CI to pass. Presumably if #116 goes in soon it doesn't really matter how the commits are divided between PRs.

@egrimley-arm egrimley-arm merged commit 22f1e27 into parallaxsecond:main Aug 18, 2023
@egrimley-arm egrimley-arm deleted the pr-no-std branch August 18, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants