Skip to content

Build with a stable compiler without the platform module - #378

Open
ogoffart wants to merge 2 commits into
rust-osdev:mainfrom
ogoffart:olivier/stable-without-platform
Open

ogoffart wants to merge 2 commits into
rust-osdev:mainfrom
ogoffart:olivier/stable-without-platform

Conversation

@ogoffart

@ogoffart ogoffart commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

For programs that build the interpreter from the tables themselves (Interpreter::new) and are built with a stable compiler, such as a UEFI boot manager reading the battery.

The allocator API, which needs nightly, is only used by the platform module and Interpreter::new_from_platform. They are now behind a platform feature, on by default; default-features = false, features = ["aml"] builds with a stable compiler. CI builds that configuration, so it keeps working.


This would allow me to use this crate with a stable compiler.

For programs that build the interpreter from the tables themselves
(Interpreter::new) and are built with a stable compiler, such as a UEFI
boot manager reading the battery.

The allocator API, which needs nightly, is only used by the `platform`
module and `Interpreter::new_from_platform`. They are now behind a
`platform` feature, on by default; `default-features = false, features =
["aml"]` builds with a stable compiler. CI builds that configuration, so
it keeps working.
@martin-hughes

Copy link
Copy Markdown
Contributor

Nice idea, thanks @ogoffart. I have also wondered about using a stable compiler, but didn't realise it'd be so straightforward 😆

One question: does the "alloc" feature actually do anything now? Is it worth just removing it?

With the platform module behind its own feature, `alloc` only enabled
`extern crate alloc`, which only the aml and platform features need:
it did nothing on its own. The crate now uses alloc when either is on.
CI's i686 build without the interpreter uses `platform` instead.
@ogoffart

Copy link
Copy Markdown
Contributor Author

yes that's true, the alloc feature itself don't make sense. I've removed it.

@martin-hughes martin-hughes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks very sensible to me. I think this is an area where I'd like to get @IsaacWoods to double-check, since he knows the background of why the features were designed how they were - any thoughts Isaac?

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