-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
building the std for aarch64_be-unknown-linux-gnu_ilp32 twice in a row, the binary libcompiler_builtins.rlib is inconsistent #119372
Comments
Maybe some changes of crate |
If I understand you correctly this issue has been fixed already since compiler-builtins 0.1.103. rust-lang/compiler-builtins#549 was probably the fix. Given that this has been fixed already, can this issue be closed? |
I guess I need to add more context to clarify more about our issue. The beginning of the event is that, when building rust std for target aarch64_be-unknown-linux-gnu_ilp32, most rlib exhibit binary inconsistencies, including the libstd so itself. After some investigation, it comes accross that the main issue was hash difference for compiler_builtins between two build. Maybe there could be some verification setup for binary comparison? For example, ci running every week or monthly check on those issue |
Compiler builtins itself was giving a nondeterministic output of it's build script, which caused libcompiler_builtins.rlib to change and as a result everything that depends on it to change too. The build script of compiler builtins has been fixed in 0.1.103. There is not much we can do about non-deterministic build scripts and proc macros. They are not sandboxed and may intentionally depend on the environment. For example they could be reading C header files from the system to produce bindings (eg because the target doesn't have a stable ABI) or read from a database. Optional sandboxing of proc macros by compiling them to wasm has been concidered, but for build scripts sandboxing is guaranteed to break things as one of the main reasons they exist is to invoke an external C compiler. And even with sandboxing there can be sources of non-determinism through for example multithreading inside build scripts. (or even deliberate random number generation) |
I'm going to close this as there's nothing for us to do - the binary inconsistency described in this issue has been resolved. rust-lang/compiler-builtins#549 fixed the issue by changing from a |
We have experimented with recent versions of rust(from 2023-10-30 to 2023-12-27).
use
RUSTC_BOOTSTRAP=1 cargo build --target aarch64_be-unknown-linux-gnu_ilp32 -Z build-std
It has been found that the 2023-11-05 version has binary inconsistencies in libcompiler_builtins.rmeta, and the 11-06 version is completely consistent. So th problem is fixed on 11-05. And I also found that 11-05 uses compiler_builtins v0.1.101, but 11-06 uses compiler_builtins v0.1.103.
I replaced the compiler_builtins version in rust-2023-11-05 from v0.1.101 to v0.1.103, and then found libcompiler_builtins.rmeta is consistent.
The text was updated successfully, but these errors were encountered: