Skip to content

Commit

Permalink
build: Prepare zipball build for Composer bump
Browse files Browse the repository at this point in the history
Composer 2.6.4+ wants to have reproducible outputs so it preserves `mtime` when copying files:
composer/composer#11663
This becomes an issue with `vendor/composer/ClassLoader.php`,
which is copied from Nix store so it has `mtime` of 0 (1970-01-01),
because that is not supported by ZIP:

    ValueError: ZIP does not support timestamps before 1980

Let’s disable strict timestamps to clamp the out-of-range timestamps to ZIP epoch.
That argument was actually introduced because of reproducible builds:
https://bugs.python.org/issue34097
  • Loading branch information
jtojnar committed Jan 6, 2024
1 parent fe35fd1 commit b166b5b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions utils/create-zipball.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def main() -> None:
source_dir / filename,
mode="w",
compression=zipfile.ZIP_DEFLATED,
strict_timestamps=False,
) as archive:
archive.prefix = Path("selfoss")

Expand Down

0 comments on commit b166b5b

Please sign in to comment.