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

no_std support for all crates #717

Closed
wants to merge 5 commits into from
Closed

no_std support for all crates #717

wants to merge 5 commits into from

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Aug 13, 2021

Fixes #609.

Our dependencies need to support no_std Done:

As far as I can see there's a few ways to solve the std::net issue noted in the linked issue:

  1. Use something like no-std-net on no_std targets. Since that library doesn't have a MSRV, we might need to define that no_std support doesn't guarantee a MSRV (until we find a more permanent solution).
  2. Change the structure of Host to store custom ip address types, and return std::net types in functions (that can then be feature gated). Requires a breaking version.
  3. Wait until the RFC is merged, implemented and stabilized, and wait further until they have been around long enough to be in our MSRV.

As far as I can see option 1 is possible now, and it could even (with a little more work on no-std-net beforehand) be possible to migrate away from once (if) the RFC is stabilized, all without breaking changes.

@MathiasKoch
Copy link

Could this PR be revisited, now that all the dependencies are merged?

@madsmtm
Copy link
Contributor Author

madsmtm commented Oct 5, 2021

I think option 1 described above is feasible: We'll use no-std-net until these parts of net becomes available in core (if they ever do). We can't guarantee an MSRV on no_std, because no-std-net should be kept up to date with the current standard library, and hence might not compile on older Rust versions.

Currently I'm waiting for no-std-net to become a facade to std, see dunmatt/no-std-net#13, and for it to update to the implementation from newer Rust versions, see dunmatt/no-std-net#14.

Once these are done, we'll probably need to convince no-std-net to not have differences to std::net (like their extra const fns). This is required so that if core::net ever happens, migration to that is possible without breaking changes.

And finally, we'll need a new release with these changes.

If you can get some traction on the linked PRs, then I'll be glad to give this some more work.

@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #728) made this pull request unmergeable. Please resolve the merge conflicts.

Add default feature flag "std" that enables a `std::error::Error` impl for `Errors`.
@MathiasKoch
Copy link

What is the current state of this? It seems to have completely stalled, even though all the blockers seems to have been merged & resolved?

@madsmtm
Copy link
Contributor Author

madsmtm commented Jul 20, 2022

It has stalled mainly because I haven't received word from the maintainers on neither this nor #722.

In the meantime, a PR for changing the layout of the network primitives is almost merged, after that RFC 2832 should be fairly trivial to accept. A way forward once we get that is to use something like if_rust_version to optionally import these from core instead of std (and then, once our MSRV is high enough, remove the dependency on if_rust_version again).

@MathiasKoch
Copy link

Wauw, that is awesome news! 👍

@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #783) made this pull request unmergeable. Please resolve the merge conflicts.

@lucacasonato lucacasonato mentioned this pull request Jul 11, 2023
4 tasks
@madsmtm
Copy link
Contributor Author

madsmtm commented Dec 22, 2023

@domenukk rebased this in #831, given that they seem to want to continue on this work, I'll close this PR (though I'm willing to pick it up again if you'd like my help).

@madsmtm madsmtm closed this Dec 22, 2023
@domenukk
Copy link
Contributor

@domenukk rebased this in #831, given that they seem to want to continue on this work, I'll close this PR (though I'm willing to pick it up again if you'd like my help).

Happy to work together on this in any case

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.

no_std support?
4 participants