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

Mark library as #![no_std] #15

Merged
merged 3 commits into from
Jun 15, 2020
Merged

Conversation

alexcrichton
Copy link
Contributor

Additionally also enable this library to be included into the standard
library itself with some [dependencies] and [features] voodoo. My
hope is to eventually enable the backtrace crate to depend on the
gimli crate for parsing DWARF information and symbolizing backtraces.
DWARF info in objects may be compressed though, and most zlib-related
crates use this crate! As a result if libstd is going to be
decompressing object files, we'll need to include this crate in the
standard library build itself.

If you've got any questions about this just let me know! I know it's a
bit odd, but unfortunately this is "as nice as it can be" for now at
least.

@alexcrichton
Copy link
Contributor Author

Ah yes this would also make this library incompatible with 1.17.0 (which CI has notified me). While possible to work around if it's ok it's probably best to simply raise the rustc requirement.

@remram44
Copy link
Owner

That is fine by me, as long as this doesn't affect "normal" users. I think you have sufficiently commented this in Cargo.toml.

Raising the rustc version is fine, 1.17 is 3 years old. Even Debian oldstable ships 1.34.

@alexcrichton
Copy link
Contributor Author

Ok great! I've pushed a commit to drop 1.17.0 from CI.

And yeah the intention here is that the libstd integrate goop has zero impact on day-to-day users. Crates like libc and backtrace have had this integration for quite some time now and no issues have arisen AFAIK. Eventually I would like this goop to become zero (so we could remove all this), but it'll take some time and many changes in Cargo to do that, and we're not sure how it'll all be done honestly.

Otherwise the changes here are sort of the standard bits for having a #![no_std] library that's enhanced with a std feature that enables more functions in the crate.

[dependencies]
# Internal features, only used when building as part of libstd, not part of the
# stable interface of this crate.
core = { version = '1.0.0', optional = true, package = 'rustc-std-workspace-core' }
Copy link
Owner

Choose a reason for hiding this comment

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

IIUC This needs the rename-dependency feature which makes the whole manifest unreadable until 1.31

Additionally also enable this library to be included into the standard
library itself with some `[dependencies]` and `[features]` voodoo. My
hope is to eventually enable the `backtrace` crate to depend on the
`gimli` crate for parsing DWARF information and symbolizing backtraces.
DWARF info in objects may be compressed though, and most zlib-related
crates use this crate! As a result if libstd is going to be
decompressing object files, we'll need to include this crate in the
standard library build itself.
@remram44 remram44 merged commit dc74d7c into remram44:master Jun 15, 2020
@alexcrichton alexcrichton deleted the dep-of-std branch June 15, 2020 17:30
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