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

cmake: Sort source files for reproducible builds #5523

Merged
merged 1 commit into from May 23, 2020

Conversation

pks-t
Copy link
Member

@pks-t pks-t commented May 15, 2020

We currently use FILE(GLOB ...) in most places to find source and
header files. This is problematic in that the order of files returned
depends on the operating system's directory iteration order and may thus
not be deterministic. As a result, we link object files in unspecified
order, which may cause the linker to emit different code across runs.

Fix this issue by sorting all code used as input to the libgit2 library
to improve the reliability of reproducible builds.

Fixes #5521

We currently use `FILE(GLOB ...)` in most places to find source and
header files. This is problematic in that the order of files returned
depends on the operating system's directory iteration order and may thus
not be deterministic. As a result, we link object files in unspecified
order, which may cause the linker to emit different code across runs.

Fix this issue by sorting all code used as input to the libgit2 library
to improve the reliability of reproducible builds.
@pks-t pks-t mentioned this pull request May 15, 2020
Copy link
Contributor

@utkarsh2102 utkarsh2102 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Patrick,

With this patch applied, the CI still fails :/
cf: https://salsa.debian.org/debian/libgit2/pipelines/136877

Reprotest is still failing :/

@utkarsh2102
Copy link
Contributor

Additionally, I also wanted you to know that in Debian, we remove the embedded deps/ but use the packaged ones instead. I hope this has nothing to do with it or does it?

@pks-t
Copy link
Member Author

pks-t commented May 16, 2020 via email

@pks-t
Copy link
Member Author

pks-t commented May 16, 2020 via email

@ethomson ethomson merged commit 3b7b4d2 into master May 23, 2020
@pks-t pks-t deleted the pks/cmake-sort-reproducible-builds branch June 1, 2020 12:04
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 this pull request may close these issues.

Build not reproducible
3 participants