When cross-compiling with the specified target aarch64-unknown-linux-gnu, I found that the environment variable target changed during the execution of the build program for openssl-sys. What caused this?How should I set it to ensure it has the correct value(aarch64-unknown-linux-gnu)?
Additionally, there is another warning:
warning: build failed, waiting for other jobs to finish...
warning: openssl-sys@0.9.101: Compiler version doesn't include clang or GCC: "aarch64-linux-gnu-gcc" "--version"
This warning can be a false positive, and is most likely completely unrelated, so don't worry too much about it.
The real reason the build failed is not caused by this warning. Because of poor quality build script error integration in Cargo the real build error is somewhere below, under many irrelevant lines of variables. Read carefully to find the error somewhere towards the end of the stderr dump.
However, because the target changed to x86_64-unknown-linux-gnu, it started looking for the wrong environment variable. I verified this in a relatively simple project where the target was correct.
I found the issue: openssl-sys was compiled twice, with targets x86_64-unknown-linux-gnu and aarch64-unknown-linux-gnu respectively. However, I don't know why it was compiled twice.