Skip to content
This repository has been archived by the owner on Jun 21, 2020. It is now read-only.

Auto generate ecalls FFI rust code using bindgen in enigma-core enclave #166

Merged
merged 4 commits into from
May 29, 2019

Conversation

elichai
Copy link
Contributor

@elichai elichai commented May 28, 2019

Because build-dependencies and regular dependencies are mixed together it's not possible to import bindgen into the enclave's build.rs (rust-lang/cargo#2589)
The solution is to install the bindgen CLI in the docker and use it manually in the Makefile.

@elichai elichai requested review from AvishaiW and moriaab May 28, 2019 11:43
Copy link
Contributor

@moriaab moriaab left a comment

Choose a reason for hiding this comment

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

@elichai Please put the explanation of this PR as a comment in the code

echo $(BINDGEN_RAW_LINES)
bindgen Enclave_t.h $(BINDGEN_FLAGS) -- $(BINDGEN_CLANG_FLAGS) > $(BINDGEN_OUTPUT_FILE)
rustfmt $(BINDGEN_OUTPUT_FILE)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why didn't you use rustfmt option of builder in #165?

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'll recheck but I'm pretty sure that it doesn't run on the added raw_lines which I add them all at the same line, so rustfmt will sort them later nicely

enigma-core/enclave/Makefile Outdated Show resolved Hide resolved
@elichai elichai merged commit bc68dc0 into develop May 29, 2019
@elichai elichai deleted the bindgen-core-enclave branch May 29, 2019 12:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants