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 Loader #749

Merged
merged 7 commits into from
Apr 8, 2020
Merged

Rust Oak Loader #749

merged 7 commits into from
Apr 8, 2020

Conversation

ipetr0v
Copy link
Contributor

@ipetr0v ipetr0v commented Mar 23, 2020

This change adds a Rust version of the Oak Loader

Fixes #723

Checklist

  • Pull request includes prototype/experimental work that is under
    construction.

@ipetr0v ipetr0v mentioned this pull request Mar 29, 2020
1 task
@ipetr0v
Copy link
Contributor Author

ipetr0v commented Mar 29, 2020

Should oak_loader crate be in ./sdk or ./oak/server/rust?

@tiziano88
Copy link
Collaborator

Definitely not under SDK :)

@ipetr0v ipetr0v marked this pull request as ready for review April 7, 2020 17:54
@ipetr0v ipetr0v requested a review from tiziano88 April 7, 2020 17:55
oak/server/rust/oak_loader/src/main.rs Outdated Show resolved Hide resolved
oak/server/rust/oak_loader/src/main.rs Outdated Show resolved Hide resolved
oak/server/rust/oak_loader/src/main.rs Outdated Show resolved Hide resolved
Comment on lines 73 to 75
let error_msg = format!("Runtime error: {:?}", error);
error!("{}", error_msg);
error_msg
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure I get the point of logging something here and also returning it. Doesn't it end up being logged twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deleted logging, but kept explanation messages

oak/server/rust/oak_loader/src/main.rs Outdated Show resolved Hide resolved

fn read_file(filename: &str) -> Result<Vec<u8>, std::io::Error> {
let mut file = File::open(filename).map_err(|error| {
error!("Couldn't open file \"{}\": {:?}", filename, error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the std::io::Error not contain any information at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't contain filename, so it just says: couldn't open a file

@ipetr0v ipetr0v merged commit 3619cab into project-oak:master Apr 8, 2020
@ipetr0v ipetr0v deleted the rust_oak_loader branch April 8, 2020 11:11
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.

Create Rust oak_loader binary
3 participants