You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MobileCoin repo uses the environment variable SGX_MODE to determine whether to build the crates in simulation vs hardware mode.
The environment variable usage was chosen as it lets one set up the development environment once and then they can call cargo build to build based on the environment, instead of having to remember to pass a flag cargo build --features sgx-sim
The downside of this approach is that there isn't a way to propagate features based on the environment variable down to dependencies:
sequenceDiagram
cargo build->>+Top Level Crate: Build crate With features
Top Level Crate->>Top Level Crate: Resolve features
Top Level Crate->>+Dependency Crate: Build crate With features
Dependency Crate->>-Top Level Crate: Propagate `CARGO_DEP` values
Top Level Crate->>Top Level Crate: Invoke build.rs
Note over Top Level Crate: build.rs adds rustc-cfg=feature="sgx-sim"
Top Level Crate->>-Top Level Crate: Compile with rustc
Loading
From the above diagram one can see that the depency has already been built by the time that the top level crate updates the feature it's building with based on the environment variable.
In order to work collaboratively with the MobileCoin repo this repo should be updated to:
rename feature sim to sgx-sim
Key off of the environment variable of SGX_MODE with values of HW and SW
Probably pull in functionality from conf.rs and update the MobileCoin repo to use it from this repos mc-sgx-build crate.
The text was updated successfully, but these errors were encountered:
This isn't needed at this time for the MobileCoin repo.
The MobileCoin implements the current sim logic it needs from this repo.
This may be needed if the MobileCoin repo uses more of this repos types and behavior.
The MobileCoin repo uses the environment variable
SGX_MODE
to determine whether to build the crates in simulation vs hardware mode.The environment variable usage was chosen as it lets one set up the development environment once and then they can call
cargo build
to build based on the environment, instead of having to remember to pass a flagcargo build --features sgx-sim
The downside of this approach is that there isn't a way to propagate features based on the environment variable down to dependencies:
From the above diagram one can see that the depency has already been built by the time that the top level crate updates the feature it's building with based on the environment variable.
In order to work collaboratively with the MobileCoin repo this repo should be updated to:
sim
tosgx-sim
SGX_MODE
with values ofHW
andSW
conf.rs
and update the MobileCoin repo to use it from this reposmc-sgx-build
crate.The text was updated successfully, but these errors were encountered: