Open berrange opened 4 months ago
@berrange The AE reproducibility build is based on the provided docker file with Nix env. So we assume the reproducibility verification is also based on the same environment from the provided docker. May I know if the NixOS ld-path is the only issue that prevent you from reproducing the AEs in non Nix env?
@berrange The AE reproducibility build is based on the provided docker file with Nix env. So we assume the reproducibility verification is also based on the same environment from the provided docker. May I know if the NixOS ld-path is the only issue that prevent you from reproducing the AEs in non Nix env?
I'm aiming to distribute the pre-built AE's in Fedora, but as a pre-requisite for proposing that be allowed by Fedora, I need to be able to reproduce their build process within Fedora, not NixOS. This isn't easy, as obviously you've never expected/intended for this to be done. The three biggest issues that affect reproducibility which I'm having to patch
I've not had time to investigate whether there's an easy way to avoid the absolute files paths in the last 2 cases, so I've not filed any issues requesting changes for those yet.
FYI, I've currently got reproducibility succeeding for SGX 2.22 release, and now working on 2.24 release for the qve.so AE that was re-issued. https://gitlab.com/berrange/fedora-sgx-ng-copr/-/tree/main/linux-sgx-enclaves-2_22?ref_type=heads Of course this all relies on me packaging the same versions of GCC, binutils, nasm that your NixOS env uses, which I've done in that same git repo.
Attempting to reproduce the architectural enclaves on a non-NixOS platform fails, despite having the same toolchain versions. Debugging revealed that this is a result of the built enclaves containing a reference to the NixOS ld-linux path.
This can be easily seen by querying the INTERP section of the binaries
IIUC, the ld-linux interpretor is irrelevant for SGX, since the SGX SDK contains native logic for loading code into the enclaves. If this is indeed the case, then I'd request that the reference to the NixOX ld-linux is removed from future pre-built enclave binaries.
Looking at the build system this could potentially be achieved by extending the 'strip' command usage to also purge the '.interp' section of the ELF binary.
Alternatively the
-Wl,-dynamic-linker
arg could be used to set the .interp section contents to some dummy value to indicate it is redundant / unused e.g.There are probably other options too - I don't mind as long as this (apparently) redundant NixOS path can be removed from future pre-built enclave binaries.