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

rust/oak_abi: Make oak_abi #643

Merged
merged 3 commits into from
Feb 24, 2020
Merged

Conversation

blaxill
Copy link
Contributor

@blaxill blaxill commented Feb 24, 2020

This is a temporary fix to allow oak_abi no_std compilation. See #638, a follow up PR will be done to resolve this long term. I would like to add this as a temporary fix as it blocks work on making the oak_runtime no_std compatible.

Checklist

  • Pull request affects core Oak functionality (e.g. runtime, SDK, ABI)
    • I have written tests that cover the code changes.
    • I have checked that these tests are run by Cloudbuild
    • I have updated documentation accordingly.
    • I have raised an issue to
      cover any TODOs and/or unfinished work.
  • Pull request includes prototype/experimental work that is under
    construction.

pub mod proto;

// TODO(#638): Generate from protobuf in a no_std compatible way
#[cfg(feature = "no_std")]
pub mod proto {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would something like this work?

#[cfg(feature = "no_std")]
mod inner {
  pub enum ChannelReadStatus { /* ... */ }
  pub enum OakStatus { /* ... */ }
}

#[cfg(feature = "std")]
mod inner {
  mod proto;
  pub use proto::oak_api::{ChannelReadStatus, OakStatus};
}

pub use inner::*;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't put the mod proto; inside inner, but I can do the rest, WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

LG! Are nested mods not supported then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are supported, but as that one in particular is a file import, rustc looks for the definition in src/inner/proto and using super/crate doesn't seem to work for this.

@blaxill blaxill merged commit 7b150a4 into project-oak:master Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants