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

Add nostd tests #89

Merged
merged 3 commits into from
Nov 6, 2023
Merged

Add nostd tests #89

merged 3 commits into from
Nov 6, 2023

Conversation

nyurik
Copy link
Contributor

@nyurik nyurik commented Nov 5, 2023

This uses MSRV fix #90

  • Fix cargo test --no-default-features to pass by making std-only tests/docs conditional (added to CI)
  • Added Error::Custom(&'static str) for no-std mode

There are a few FIXME in the code where things seemed suspicious

@nyurik nyurik mentioned this pull request Nov 5, 2023
1 task
@nyurik nyurik force-pushed the nostd-test branch 3 times, most recently from 58c987d to 8291ce1 Compare November 5, 2023 22:06
src/error.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
* Fix `cargo test --no-default-features` to pass by making std-only tests/docs conditional (added to CI)
* Added `Error::Custom(&'static str)` for no-std mode

There are a few `FIXME` in the code where things seemed suspicious
@nyurik nyurik force-pushed the nostd-test branch 2 times, most recently from 201aa62 to 631a360 Compare November 5, 2023 23:26
src/error.rs Outdated
#[cfg(feature = "std")]
Custom(String),
/// A custom static Scroll error for reporting messages to clients
CustomStatic(&'static str),
Copy link
Owner

Choose a reason for hiding this comment

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

ok sorry to go back and forth, but can you remove these changes (adding CustomStatic); i thought it would be required to get the tests to pass, but a change like this (which is a breaking change) would require clients to update on the additional matches. Because this is just for fixing tests I don't think it should be included in this PR.

Additionally, it's unclear to me why we need this, since technically in a no-std environment the user of scroll could return BadInput which also has a static str (they could set size to 0 if they wanted).

Once the static str stuff is walked out we can merge this immediately, sorry for the busy work and appreciate you getting these changes in, but adding a new variant should be discussed separately I think (and isn't required for this, so let's remove it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, np, removed

Copy link
Owner

@m4b m4b left a comment

Choose a reason for hiding this comment

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

just remove CustomStatic for now, we can consider it in a follow up/additional patch, thanks, otherwise this is good to go

@nyurik nyurik requested a review from m4b November 6, 2023 02:22
/// Returned when IO based errors are encountered
#[cfg(feature = "std")]
Copy link
Owner

Choose a reason for hiding this comment

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

i just realized this got added; this is technically a breaking change, but nostd could never have worked with this, iiuc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct, io does not exist without std, so technically it is not a breaking change :)

@m4b m4b merged commit b4de465 into m4b:master Nov 6, 2023
6 checks passed
@nyurik nyurik deleted the nostd-test branch November 6, 2023 05:06
Frostie314159 pushed a commit to Frostie314159/scroll that referenced this pull request Nov 7, 2023
* Add nostd tests
* Fix `cargo test --no-default-features` to pass by making std-only tests/docs conditional (added to CI)
* There are a few `FIXME` in the code where things seemed suspicious
Frostie314159 pushed a commit to Frostie314159/scroll that referenced this pull request Nov 20, 2023
* Add nostd tests
* Fix `cargo test --no-default-features` to pass by making std-only tests/docs conditional (added to CI)
* There are a few `FIXME` in the code where things seemed suspicious
m4b pushed a commit that referenced this pull request Dec 31, 2023
* Add nostd tests
* Fix `cargo test --no-default-features` to pass by making std-only tests/docs conditional (added to CI)
* There are a few `FIXME` in the code where things seemed suspicious
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.

2 participants