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

Standard library portability #8

Open
ehuss opened this issue Jul 20, 2019 · 6 comments
Open

Standard library portability #8

ehuss opened this issue Jul 20, 2019 · 6 comments
Labels
features Issues related to Cargo features plan before stabilization This needs a plan for how to address before stabilization, but does not need to be implemented. RFC Discussion for a possible new RFC

Comments

@ehuss
Copy link
Contributor

ehuss commented Jul 20, 2019

This issue is for discussing different needs for making the standard library more portable and configurable.

There have been a number of proposals over the years for improving the portability of the standard library, and improving the organization and use of platform-specific APIs.

Some people also desire ways to change the behavior of the standard library, such as through using Cargo features to choose alternate implementations or additions (see #4).

Portability and configurability are two loosely related concepts that perhaps should be considered separately. However, they may have the same or related ways to approach, so I am combining them here.

This issue is a place to explore this rather large problem space. Perhaps initially it would be best to clearly articulate the needs for making it more portable, configurable, and also how libraries declare what they are compatible with. Perhaps listing some concrete use cases, existing problems and pain points, etc.

For those interested in different historical concepts for standard library portability:

@ehuss ehuss added RFC Discussion for a possible new RFC features Issues related to Cargo features labels Jul 20, 2019
@SimonSapin
Copy link

I think this is two related but distinct topics:

  • Porting the standard library itself to new targets. (std::sys, PAL, Portability WG, …)
  • Helping users of the standard library to write portable code (Portability lint, aturon’s vision, …)

They are both important, but I’m not sure that Cargo needs to be involved at all in either. So maybe this repository is not the best place to discuss them?

@ehuss
Copy link
Contributor Author

ehuss commented Jul 23, 2019

So maybe this repository is not the best place to discuss them?

Very likely. There are a few reasons why I bring it up:

  • The mechanism of making it more portable may require some syntax in Cargo.toml, like features, but those may not be appropriate for stability reasons. If we end up needing to change how features works, then it is relevant to Cargo.
  • One of the goals of this project is to make it easier to build for unsupported targets. To that end, this is one of the impediments.
  • If a custom target needs to somehow provide its own implementation of parts of the standard library, how would that be expressed?

I just wanted to keep the big picture in mind as we move forward.

@Ericson2314
Copy link

Ericson2314 commented Jul 23, 2019

[For my vision at least :)] The most important thing to do is get the official rustc build system to leverage this feature std-aware Cargo as soon as possible. (Since rustc boots from a specific rustc and Cargo version, can it use unstable features?) This will make using external crates in std like hashbrown and parking_lot easier, after which I hope this problem can be resolves in a rather organic / distributed fashion.

Should we have a ticket for the rustc build system using this? Beyond the benefits I mention, we want to make sure this feature is good enough for that before stabilization. If it can't work for that, we probably messed something up!

@SimonSapin
Copy link

What do you mean by “this” feature? This thread is about a rather wide (pair of) topic(s) with a number of different proposals, not a single specific feature. (Perhaps you meant this comment for another thread?)

@Ericson2314
Copy link

Sorry by "this feature" I meant std-aware Cargo as a whole.

@SimonSapin
Copy link

Ok, so this thread is not quite the place for that topic. Regardless, rustc’s build system is quite special since there are multiple stages of bootstrapping, it’s not clear that Cargo will (or should) know how to do deal with that.

@ehuss ehuss added the plan before stabilization This needs a plan for how to address before stabilization, but does not need to be implemented. label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
features Issues related to Cargo features plan before stabilization This needs a plan for how to address before stabilization, but does not need to be implemented. RFC Discussion for a possible new RFC
Projects
None yet
Development

No branches or pull requests

3 participants