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

makedist script does not handle non-GNU systems correctly #14688

Closed
NattyNarwhal opened this issue Jun 27, 2024 · 2 comments · Fixed by #14690
Closed

makedist script does not handle non-GNU systems correctly #14688

NattyNarwhal opened this issue Jun 27, 2024 · 2 comments · Fixed by #14690

Comments

@NattyNarwhal
Copy link
Member

Description

While it does mandate GNU tar and checks for it correctly, it:

  • Seems to use touch in a manner that confuses macOS touch. Oddly, the date it passes looks valid for the format, so I'm not sure why it complains.
  • Does not check for the proper md5(sum) binary, assuming the GNU coreutils name of md5sum, when on macOS and BSD systems, it's md5.
    For example:
[...]
makedist: Resetting the modification and access times of package files to 2024-06-27T10:26:23-03:00
touch: out of range or illegal time specification: YYYY-MM-DDThh:mm:SS[.frac][tz]

makedist: Creating php-8.4.0alpha1test.tar archive.
makedist: Creating php-8.4.0alpha1test.tar.gz archive.
./scripts/dev/makedist: line 184: md5sum: command not found
makedist: Creating php-8.4.0alpha1test.tar.bz2 archive.
./scripts/dev/makedist: line 192: md5sum: command not found
makedist: Creating php-8.4.0alpha1test.tar.xz archive.
./scripts/dev/makedist: line 200: md5sum: command not found

makedist: Cleaning up.

makedist: All done.

PHP Version

PHP 8.4.0-dev

Operating System

macOS 14.5

@NattyNarwhal
Copy link
Member Author

Same for gen_verify_stub

./scripts/dev/gen_verify_stub: line 44: sha256sum: command not found
./scripts/dev/gen_verify_stub: line 44: sha256sum: command not found
./scripts/dev/gen_verify_stub: line 44: sha256sum: command not found

@NattyNarwhal
Copy link
Member Author

touch looks like it only can handle UTC dates:

An optional letter Z indicating the time is in UTC. Otherwise, the time is assumed to be in local time. Local time is affected by the value of the TZ environment variable.

NattyNarwhal added a commit to NattyNarwhal/php-src that referenced this issue Jun 27, 2024
The BSDs have different checksum utilities than GNU systems do. If we
don't see the GNU checksum utilities installed, use the BSD ones, as
their output is compatible enough.

Addresses part of phpGH-14688.
NattyNarwhal added a commit that referenced this issue Jul 8, 2024
* Handle BSD checksum utilities

The BSDs have different checksum utilities than GNU systems do. If we
don't see the GNU checksum utilities installed, use the BSD ones, as
their output is compatible enough.

Addresses part of GH-14688.

* Prefer GNU touch

BSD touch at least in macOS does not handle local timezone in the
timestamp (like 2024-06-27T10:26:23-03:00). As such, try GNU touch (as
ports systems almost always prefix with g if coreutils is installed) and
prefer that if available. It's not the end of the world though if GNU
touch isn't available, as BSD touch on some systems may support it, and
if it doesn't, then it's just timestamps, nothing too serious.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant