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

Fix cpio test in 2038 #1836

Merged
merged 1 commit into from
Jan 13, 2023
Merged

Fix cpio test in 2038 #1836

merged 1 commit into from
Jan 13, 2023

Conversation

bmwiedemann
Copy link
Contributor

Without this patch, bsdcpio_test_option_c failed after 2038-01-19 with

 .../libarchive-3.6.2/cpio/test/test_option_c.c:143: Assertion failed: t >= now - 2
 .../libarchive-3.6.2/cpio/test/test_option_c.c:169: Assertion failed: t >= now - 2
 .../libarchive-3.6.2/cpio/test/test_option_c.c:205: Assertion failed: t >= now - 2

Background:
As part of my work on reproducible builds for openSUSE, I check that software still gives identical build results in the future.
The usual offset is +16 years, because that is how long I expect some software will be used in some places.
This showed up failing tests in our package build.
See https://reproducible-builds.org/ for why this matters.

@kientzle
Copy link
Contributor

kientzle commented Jan 9, 2023

This causes an error:

/Users/runner/work/libarchive/libarchive/cpio/test/test_option_c.c:165:7: error: format specifies type "unsigned int" but the argument has type "long long" [-Werror,-Wformat]
                    from_octal(e + 6, 6));
                    ^~~~~~~~~~~~~~~~~~~~

Without this patch, bsdcpio_test_option_c failed with

 .../libarchive-3.6.2/cpio/test/test_option_c.c:143: Assertion failed: t >= now - 2
 .../libarchive-3.6.2/cpio/test/test_option_c.c:169: Assertion failed: t >= now - 2
 .../libarchive-3.6.2/cpio/test/test_option_c.c:205: Assertion failed: t >= now - 2
@bmwiedemann
Copy link
Contributor Author

I adapted the format accordingly. Can you retest? It seems our builds run without -Werror or -Wformat

@kientzle kientzle merged commit 45c728b into libarchive:master Jan 13, 2023
@kientzle
Copy link
Contributor

Looks great! Thank you!

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.

2 participants