Skip to content

Commit 6d1fc7c

Browse files
Sander Mullerclaude
andcommitted
Stamp member mtimes in the re-signed arms, drop the Windows leg
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 27d0bfd commit 6d1fc7c

5 files changed

Lines changed: 87 additions & 3 deletions

File tree

‎.github/workflows/tiny-run-bench.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: tiny-run-bench
33
on:
44
push:
55
branches: [tiny-run-bench]
6-
paths-ignore: [sig/**, probe/**, .github/workflows/sig-bench.yml, .github/workflows/probe.yml, .github/workflows/tiny-run-bench.yml]
6+
paths-ignore: [sig/**, probe/**, .github/workflows/sig-bench.yml, .github/workflows/probe.yml]
77
workflow_dispatch:
88

99
permissions:
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
os: [ubuntu-24.04, macos-15, windows-2022]
17+
os: [ubuntu-24.04, macos-15]
1818
runs-on: ${{ matrix.os }}
1919
defaults:
2020
run:
@@ -35,6 +35,7 @@ jobs:
3535
set -e
3636
W="$RUNNER_TEMP/w"
3737
(cd bench/project && composer install -q --no-interaction)
38+
(cd bench/tools && composer install -q --no-interaction)
3839
git clone -q --depth 1 https://github.com/nikic/PHP-Parser "$RUNNER_TEMP/php-parser"
3940
php bench/setup.php "$W" bench/project/vendor/phpstan/phpstan stock fc0 fcv fcve conc
4041
if [ "$RUNNER_OS" = Linux ]; then

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bench/tools/vendor/

‎bench/make-arm.php‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@
2525
}
2626
$phar[$inner] = $src;
2727
}
28-
$phar->setSignatureAlgorithm($alg === 'sha1' ? Phar::SHA1 : Phar::SHA512);
2928
$phar->stopBuffering();
29+
unset($phar);
30+
// A Phar API rewrite can leave members at mtime 0 (seen on Linux), which OPcache refuses to cache with
31+
// validate_timestamps on. Stamp them the way compiler/build/resign.php does.
32+
require_once __DIR__ . '/tools/vendor/autoload.php';
33+
$util = new Seld\PharUtils\Timestamps($pharPath);
34+
$util->updateTimestamps(new DateTimeImmutable('2026-09-29 09:57:28'));
35+
$util->save($pharPath, $alg === 'sha1' ? Phar::SHA1 : Phar::SHA512);
36+
$zero = 0;
37+
foreach (new RecursiveIteratorIterator(new Phar($pharPath)) as $m) {
38+
$zero += $m->getMTime() === 0 ? 1 : 0;
39+
}
40+
if ($zero > 0) {
41+
fwrite(STDERR, "$zero members at mtime 0\n");
42+
exit(1);
43+
}
3044
echo $pharPath, ': ', (new Phar($pharPath))->getSignature()['hash_type'], $dir !== null ? ", file cache $dir" . ($vts ? ', timestamps on' : '') : '', "\n";

‎bench/tools/composer.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"require":{"seld/phar-utils":"^1.2"}}

‎bench/tools/composer.lock‎

Lines changed: 67 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)