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

Investigate making all enclaves use one cargo workspace #1481

Open
cbeck88 opened this issue Feb 14, 2022 · 1 comment
Open

Investigate making all enclaves use one cargo workspace #1481

cbeck88 opened this issue Feb 14, 2022 · 1 comment
Labels
build Issues related to the build system

Comments

@cbeck88
Copy link
Contributor

cbeck88 commented Feb 14, 2022

Currently our build has 5 cargo workspaces:

  • Untrusted code
  • Consensus enclave
  • Fog ingest enclave
  • Fog view enclave
  • Fog ledger enclave

This was expedient for getting the cargo-based enclave build to work. However, there is not much reason for each enclave to have a separate workspace. That creates some problems:

  • Separate Cargo.toml maintained with patches 5 times
  • Separate Cargo.lock files and dependabot PRs for 5 different work spaces
  • Many targets are built 5 times because there is a different target directory per workspace. For instance I think we build rust-mbedtls 5 times when we do a release.

The enclaves cannot be in the same workspace as untrusted, because untrusted turns on std features for many crates and pulls in the standard library, but this does not build in the enclave.

However, we may be able to unify the four enclave workspace into one workspace for all enclaves. Then we could have just two workspaces overall instead of five. The main reason would be to make the build faster and ease maintenance.

@cbeck88 cbeck88 changed the title Investigate making all encalves use one cargo workspace Investigate making all enclaves use one cargo workspace Feb 14, 2022
@nick-mobilecoin nick-mobilecoin added the build Issues related to the build system label Apr 26, 2022
@nick-mobilecoin
Copy link
Collaborator

Documenting here for later perusal.
As part of the #1062 work looked into per-package-target. The intent was to try and resolve the multiple workspaces into one.
It seems that the per-pakcage-target is still a bit immature.

See rust-lang/cargo#9521, rust-lang/cargo#9406, and rust-lang/cargo#9451
The enclaves are utilizing zbuild-std

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues related to the build system
Projects
Status: Todo
Development

No branches or pull requests

4 participants