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

[Bug] td-shim should support reproducible build #256

Closed
liuw1 opened this issue May 2, 2022 · 4 comments · Fixed by #268
Closed

[Bug] td-shim should support reproducible build #256

liuw1 opened this issue May 2, 2022 · 4 comments · Fixed by #268
Assignees

Comments

@liuw1
Copy link
Contributor

liuw1 commented May 2, 2022

There are some differences between 2 times build with same code base. Currently td-shim does not support reproducible build.

image

@jiangliu
Copy link
Member

jiangliu commented May 2, 2022

It's really import to get this fixed, reproducible build is fatal for CC:)
Thanks for working this!

@jyao1
Copy link
Member

jyao1 commented May 12, 2022

Some investigation result from @longlongyang.

Elements break reproducible build (x86_64-unknown-uefi + target x86_64-unknown-none)

  1. Debug related sections (PE + ELF)
  2. Code base path like \home\long\rust-tpa\xxx\xxx.rs (PE + ELF)
  3. CARGO_HOME like \home\long.cargo\xxx\xxx.rs (PE + ELF)
  4. RUSTUP_HOME like \home\long.rustup\xxx\xxx.rs (PE + ELF)
  5. TimeDateStamp field in COFF file header (PE only)

Solution:

  1. Use strip = "symbols" option to [profile.release]
  2. Use strip = "symbols" option to [profile.release]
  3. Use a post-build tool to zero CARGO_HOME string
  4. Use a post-build tool to zero RUSTUP_HOME string
  5. Use a post-build tool to zero TimeDateStamp for PE

NOTE: 3 and 4 may be resolved directly after rust-lang RFC 3127. It is temp solution before RFC is implemented.

@longlongyang
Copy link
Contributor

I would like to take this issue.

@jyao1
Copy link
Member

jyao1 commented May 20, 2022

After more investigation, we notice that Use strip = "symbols" option to [profile.release] is not stable.

It is just added in latest 1.59 version - #269.

And it causes weird issue - #272

As such, I think we need use post-build tool to resolve 1 and 2 as well.

After the tool is stable, we can use strip again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants