Skip to content
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

rustup binaries vary from readdir order #2972

Closed
bmwiedemann opened this issue Mar 31, 2022 · 3 comments
Closed

rustup binaries vary from readdir order #2972

bmwiedemann opened this issue Mar 31, 2022 · 3 comments
Labels
not-rustup Whatever is described in this issue isn't Rustup's fault

Comments

@bmwiedemann
Copy link

Problem

While working on reproducible builds for openSUSE, I found that
our rustup package varies from non-deterministic filesystem readdir order that influences the rustup binary machine code.

In the build system I can see variations in
liblzma_sys ...rlib
libzstd_sys ...rlib
rustup_init

Steps

  1. use disorderfs --shuffle-dirents=yes or a scratch ext4 filesystem to build rustup twice

Possible Solution(s)

need to sort relevant source or .o file lists

Notes

/usr/bin/rustup differs in assembler output
--- old /usr/bin/rustup (disasm)
+++ new /usr/bin/rustup (disasm)
@@ -1068357,1696 +1068357,126 @@
        jmp    <ZSTD_decompressStream + ofs>
        xchg   %ax,%ax

-ZSTDv07_defaultAllocFunction:
-       mov    %rsi,%rdi
-       jmp    <malloc@plt>
-       nopl   offset(%rax,%rax,1)
-...
+FSEv05_buildDTable:

Rustup version

rustup-1.24.3~0.tar.xz

Installed toolchains

openSUSE Tumbleweed 20220330
rust-1.59.0
@kinnison
Copy link
Collaborator

This is very likely out of our control - that looks like it's code which is differing, and that'd be up to the compiler not us. You should try and discuss this with the rust-lang/rust people.

@kinnison
Copy link
Collaborator

If, after discussion with them, they believe it's the fault of something in rustup then please reopen this issue.

@bmwiedemann
Copy link
Author

Meanwhile I found gyscos/zstd-rs#162 helps and
liblzma_sys.rlib needs a similar fix.
So probably not a rust-lang issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-rustup Whatever is described in this issue isn't Rustup's fault
Projects
None yet
Development

No branches or pull requests

2 participants