-
Notifications
You must be signed in to change notification settings - Fork 265
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
Initial Bazel Targets #151
Conversation
Sorry for a delay. Moving jobs at the moment, which is taking more time then expected. Hope initial direction works for you. Want to nail the riskiest portions in the next PR. But we need to figure a way to circumvent cargo features, which wouldn't cause problems for you. I can prepare an example with configurable builds which could be controlled via command flags/.bazelrc files. |
Hey @Sythanis , thank you so much for your contribution!! Your works are really helpful to us!! Please see my answers below:
I think behavior like "alignment" can be hard-coded for now. Its behavior depends on Intel SDK and I can't see any possibility to change in linux-sgx environment. Is it an option that we hardcode it now, and (unlikely) make it configurable in future? I'm not familiar with bazel 😂
I can see that some projects are using Xargo but most people keep using Cargo because cargo seems easier to understand. Xargo seems can be replaced by the the |
Hey @dingelish thanks for the fast reply. Your answers are illuminating! Didn't know that xargo even exists. Learned something new today. Both xargo and std-awared cargo looks pretty amazing! Not sure about their support in bazel in the near future haha. Work on Anyways let me see if I have understood that correctly:
I will make the changes to the |
Oh and final thing I forgot to mention... I am assuming bazel 0.28.1 version for now as specified in I also suggest that you use bazelisk tool to run bazel. It will always resolve to the feature defined in the If you have any further questions about bazel, I will be happy to answer :) |
@Sythanis pretty good stuff! BTW, here are a few extra thoughts (not for this PR, but some future PRs): I think this could later be used to bootstrap the environment. My future ideal project workflow with Rust SGX SDK and Bazel looks something like this (on a fresh machine):
The Google Bazel rules can help with installing / building the Intel SGX SDK environment that currently one had to install manually or use a Docker image. |
Hey @tomtau wow will check those rules tomorrow. I think the workflow you have described is definitely possible. I would need to get up to speed in sgx but I could write some rules to replace makefiles. For now I have pushed hard coded align cargo feature in Anyways, things are good from my side for now. In the next PR I would need some help to setup sgx environment to try to test some features and see that everything is working as it should. But I have the weekend for this ;) . |
@tomtau I prefer master. how do you think? |
master is fine, it doesn't interfere with anything at the moment |
Alright then, should I squash the commits them in preparation for the merge? |
yes please! |
Added minimal bazel workspace with initialized `rules_rust` with the nightly compiler set to the date mentioned in `rust-toolchain` file in root of the repository. Expanded `.gitignore` with bazel artifacts folders and `bazel` plugin temp folder. `sgx_types`, `sgx_libc` and `sgx_trts` have been ported to `rust_library` bazel targets, with default cargo features set on. Signed-off-by: Urban Avsec <[email protected]>
All squashed and commit message has been unified. Hope it describes well enough what was done. Ready to merge from my side |
Basic bazel configuration + 3 basic simplest targets have been ported for review of general direction to resolve #52 .
Some questions that popped up till this point:
align
insgx_libc
. Do you want to trasnfer them to bazel BUILD files as well?cfg(not(target_env = "sgx"))
from toml files. Cargo features are not fully supported the best withingrules_rust
rules_rust#37. Alternative solution exists with configurable buildThis is for now. If there is anything unclear happy to explain