-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Arm64 build process for ci #1887
Conversation
053c66e
to
7e550fa
Compare
e59e282
to
b40ba3b
Compare
This should work given that it doesn't time out. From testing the cargo build could easily take 30 minutes. |
… ci script stuff.
Ready for review. I will be unavailable this weekend, so I would recommend holding off merging until monday. |
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.
LGTM modulo long lines.
I will wait for @piscisaureus's approval before merging.
build.rs
Outdated
@@ -20,8 +20,22 @@ fn main() { | |||
env::var("PROFILE").unwrap() | |||
}; | |||
|
|||
// Equivilent to target arch != host arch | |||
let is_cross_compile = env::var("CARGO_CFG_TARGET_ARCH").unwrap().as_str() |
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 would suggest let is_cross_compile = env::var("TARGET") != env::var("HOST");
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.
This might not have the intended effect. Some targets might vary from host, but will still be compatible with the host. I.E. x86_64-unknown-linux-musl
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.
is_cross_compile
might be a bad name for this one.
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.
Did a full merge from master, fixed the formatting on .travis.yml, and made some changes to build.rs.
build.rs
Outdated
.collect::<Vec<&str>>()[0]; | ||
|
||
// If we are not using a standard target | ||
let is_nonstandard_target = |
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.
Can you list some example strings here that we might see for "HOST" and "TARGET" ? What is an example of a non-standard target? it's not immediately clear to me.
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.
HOST
, TARGET
, and CARGO_CFG_TARGET_ARCH
are standard variables provided by cargo and documented here https://doc.rust-lang.org/cargo/reference/environment-variables.html
I might rename this is_not_default_target
. The output of rustup target list
will tell you what is default for your install of cargo/rustup.
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.
Actually I like is_default_target
better.
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.
Sure - but some concrete examples are always very valuable when debugging these things - I guess host is "linux-x64" ? or is it "linux-misc-x64"? No one remembers and if it's not listed it will require me to println it later.
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 added some more detailed comments
Including how to check your default target: rustup target list
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.
It would just be nice to know what these values are concretely on your machine (since this will be their values in 90% of cross-compile cases)
@@ -20,8 +20,27 @@ fn main() { | |||
env::var("PROFILE").unwrap() | |||
}; | |||
|
|||
// Equivalent to target arch != host arch | |||
let is_different_target_arch = |
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.
Would be useful to list some examples of what CARGO_CFG_TARGET_ARCH and HOST looks like.
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.
LGTM - thank you so much for doing this. I know how annoying it can be waiting for CI over and over. This is a huge contribution : )
Note: disabled at c9614d8 |
Work in progress build process for arm64 builds in CI.