-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add cross-compilation and testing to Arm64 on CI #6
Conversation
@ionut-arm I use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, cleaner code overall! I'm not a fan of not being able to easily see the generated code, but this is a decision the Rust team made for us
.arg(PARSEC_OPERATIONS_VERSION) | ||
.arg("target/parsec-operations") | ||
.output() | ||
if !Command::new("wget") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curl might be easier to use. Using Rust only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if you manage to use curl, you don't need the whole shenanigans of installing wget/having a special Docker image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I will look into using that one.
} | ||
|
||
// Gets extracted as parsec-operations-PARSEC_OPERATIONS_VERSION directory. | ||
if !Command::new("tar") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have bindings to tar as a library too.
src/operations_protobuf/mod.rs
Outdated
@@ -26,8 +26,28 @@ mod convert_asym_verify; | |||
mod convert_list_providers; | |||
mod convert_list_opcodes; | |||
|
|||
// Include the Rust generated file in its own module. | |||
macro_rules! include_protobuf_as_module { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 😎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can move this macro definition inside the generated_ops
module, don't think you'd be using it anywhere else, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, good point, will move!
build.rs
Outdated
|
||
const PROTO_FOLDER: &str = "target/parsec-operations/protobuf"; | ||
const PROTO_OUT_DIR: &str = "src/operations_protobuf/generated_ops"; | ||
const PARSEC_OPERATIONS_VERSION: &str = "0.2.0"; | ||
|
||
// TODO: handle OsStrings more carefully, as .into_string() might fail | ||
|
||
fn generate_mod_file() -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need this file anymore, you've replaced it with a fully-contained module in src/operations_protobuf/mod.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh very good point! I will remove the whole function.
Modifies the code so that the crate only writes to the OUT_DIR directory so it can be used with cross. Add cross-compilation and testing on the CI. Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
bc32836
to
91c755b
Compare
I did not modify the direct command calls of
I think there might be a clash between the OpenSSL library on the host and the one used in the Docker container so that linking fails. This will need more investigating. |
Modifies the code so that the crate only writes to the OUT_DIR directory
so it can be used with cross.
Add cross-compilation and testing on the CI.