-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Reproducibility problems with libcrypto and libtss2 #1616
Comments
Found out that problem with libtss2 is the RPATHs: https://reproducible-builds.org/docs/deterministic-build-systems/ For openssl, there is a perl script that generates |
@miczyg1 some progress on this yet nothing official. Openssl is now reproducible under master...tlaurion:heads:reproducible_openssl_libtss2 for patches/openssl-3.0.8.patch (Feel free to borrow, hack, open a PR if working!) Trying a sed approach to patch configure on the fly after bootstrap/autoreconf there. No more hardcode nor rpath references under configure scripts as a result, but still I get
Not sure what to push forward there, this is messy. Will retry later :/ |
@tlaurion If I understand what you're looking for correctly, the output you have looks good. The output shows that So instead of Also, I started looking over the seds in the WIP commit to see if there's a better way to control that behavior - it looks like a lot of them probably are not actually relevant, e.g. I'd start by eliminating the substitutions that aren't having any effect until we find the minimal changes that do fix the problem (which IIRC were rpaths, |
@JonathonHall-Purism under Circleci heads is project :/ Maybe I went too far and should replace dest dir for CircleCI... Will recheck how to force output dir there and clean WiP commit. Thanks for checking this out! |
What do you mean, how does that relate to the path? The If it's still different, could you post the differences between a CircleCI build and a local build? |
@JonathonHall-Purism Issue vanished with PoC under master...tlaurion:heads:reproducible_openssl_libtss2 But i'm even more challenged now with the behavior I observe: More specifically tpm2 binary hardcoded strings:
Where the hell this git version is coming from?!?! I was hoping #1269 to permit to fix it al together, but we
So we will need to fix this one more cleanly prior of nix to come to the rescue. I also attempted to hack around PACKAGE_STRING and PACKAGE_VERSION under https://github.com/tlaurion/heads/tree/reproducible_openssl_libtss2_version_embedded_into_tpm2tools_more_chars_then_git_abbrev-failed but as the name of the branch says, that was not successful either. @JonathonHall-Purism Any idea here? |
project is the name of the output directory that CircleCI creates and checks out git under. |
The top of configure.ac (https://github.com/tpm2-software/tpm2-tools/blob/5.2/configure.ac#L1):
The second argument is a version string, which becomes AC_PACKAGE_VERSION. That's used to set the VERSION macro, which is used in lib/tpm2_options.c. Since we are building tpm2-tools from a tarball, and bootstrapping ourselves rather than running the pre-generated configure script, it happens to pick up a version from the Heads repo. Putting aside a bit of a rant about autotools, I think two options are:
|
@JonathonHall-Purism I fixed it by changing the configure script itself which might not be the best. Will go forward and try to clean master...tlaurion:heads:reproducible_openssl_libtss2 to open PR |
Glad that produces the result we want, it's a step in the right direction. IMO, try to trim down the seds to just the few that are actually needed (most of them don't seem to be relevant), then I could help make it a proper patch. |
This comment has been minimized.
This comment has been minimized.
All tools/libs packed under tools.cpio reproducible per #1630. |
Please describe the problem
Describe the bug
libcrypto
andlibtss2
are not reproducible. A build made by two different people on the same revision showed that libcrypto and libtss2 libraries do not have the same hashes (by checking that hashes.txt file after build).Expected behavior
libcrypto
andlibtss2
should be reproducible.Additional context
Checking the affected libraries with diffoscope shows that there are paths and dates included in these libraries. For reference, full diffoscope output is available here (pastebin cannot handle nearly 500k lines file).
Most notable are:
The libs seems to put the full path into the shared object file. Either the prefix is
/home/michal/Development/Dasharo/heads/build/x86/
or/home/coreboot/coreboot/build/x86/
. The difference here results from using the same docker image as base environment to build heads, but the parameter for mounting the directory with source was different, i.e.-v $PWD:$PWD
vs-v $PWD:/home/coreboot/coreboot
.While the paths are easy to workaround (simply enforce the same mounting paths to docker), these libraries should give the same hashes no matter the paths where they have been built.
The text was updated successfully, but these errors were encountered: