-
Notifications
You must be signed in to change notification settings - Fork 55
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
Reproducible build: introduce a tool to help reproducible build #268
Conversation
The CI failure caused by secure boot verification is due to |
``` | ||
|
||
Solution: <br> | ||
|
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.
Could 2, 3, 4 also be solved by using build container to normalize the build env?
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 is based upon the definition of "reproducible build".
In our definition, "reproducible build" means
A) Release build
B) Build with same code and version
C) Build with same compiler and version
D) Build at different time.
E) Build at different directory/path <==
If we normalize the build, then E) is not requirement, then we don't need 2/3/4.
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.
The final design:
1 and 2 are handled by build option.
3 and 4 are handled by post-build tool as an option.
5. Timestamp is always cleared.
td-reproducible-tool/src/main.rs
Outdated
// check out CARGO_HOME and RUSTUP_HOME | ||
cargo_home = if cargo_home == "" { | ||
if env::var("CARGO_HOME").is_err() { | ||
panic!("Neither --cargo_home nor system environment for \"CARGO_HOME\" is found! ") |
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 we make it optional?
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 we make it optional?
It is optional now, please check the latest code change.
td-reproducible-tool/src/main.rs
Outdated
// check out CARGO_HOME and RUSTUP_HOME | ||
cargo_home = if cargo_home == "" { | ||
if env::var("CARGO_HOME").is_err() { | ||
panic!("Neither --cargo_home nor system environment for \"CARGO_HOME\" is found! ") |
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 we make it optional?
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 we make it optional?
It is optional now, please check the latest code change.
td-reproducible-tool/src/main.rs
Outdated
|
||
rustup_home = if rustup_home == "" { | ||
if env::var("RUSTUP_HOME").is_err() { | ||
panic!("Neither --rustup_home nor system environment for \"RUSTUP_HOME\" is found! ") |
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 we make it optional?
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 we make it optional?
It is optional now, please check the latest code change.
td-reproducible-tool/src/main.rs
Outdated
|
||
rustup_home = if rustup_home == "" { | ||
if env::var("RUSTUP_HOME").is_err() { | ||
panic!("Neither --rustup_home nor system environment for \"RUSTUP_HOME\" is found! ") |
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 we make it optional?
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 is optional now, please check the latest code change.
47de45f
to
c3a977b
Compare
|
||
rustup_home = if rustup_home == "" { | ||
if env::var("RUSTUP_HOME").is_err() { | ||
panic!("Neither --rustup_home nor system environment for \"RUSTUP_HOME\" is found!\n") |
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.
still panic?
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.
still panic?
td-shim/td-reproducible-tool/src/main.rs
Lines 138 to 151 in c3a977b
// No more action is needed if strip_path is not specified. | |
if !strip_path { | |
println!( | |
"INFO: -s or --strip_path is not specified, Skipping strip related rust file path." | |
); | |
return Ok(()); | |
} | |
// Check out CARGO_HOME and RUSTUP_HOME, proceed to strip rust file path. | |
cargo_home = if cargo_home == "" { | |
if env::var("CARGO_HOME").is_err() { | |
panic!("Neither --cargo_home nor system environment for \"CARGO_HOME\" is found!\n") | |
} else { | |
env::var("CARGO_HOME").unwrap() |
If need to strip file path(-s or --strip_path is pecified), then this two is required to set. We can't strip file path without this file path prefix known to us. So I just panic here if not found the path prefix.
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.
OK. I did not found -s or --strip_path in readme.
Please add it.
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.
OK. I did not found -s or --strip_path in readme.
Please add it.
Sorry for forgot to update readme. Now added, please check the latest readme.md
// Check out CARGO_HOME and RUSTUP_HOME, proceed to strip rust file path. | ||
cargo_home = if cargo_home == "" { | ||
if env::var("CARGO_HOME").is_err() { | ||
panic!("Neither --cargo_home nor system environment for \"CARGO_HOME\" is found!\n") |
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.
still panic?
1. Introduce a reproducible tool, td-reproducible-tool, to help reproducible 2. Add strip = "symbols" to cargo.toml in root workspace to remove symbols Signed-off-by: Longlong Yang <longlong.yang@intel.com>
@liuw1 , please file a new issue, or reopen the old issue. |
This position is the where TimeDateStamp sit at, Did you run reproducible tool after every binary built? |
@longlongyang , I think we need update readme.md to add step for reproducible tool. |
Okay, will update. |
fix #256
Signed-off-by: Longlong Yang longlong.yang@intel.com