Skip to content

Commit 2f4ca87

Browse files
committed
Do not limit make command timeout
1 parent b4616ee commit 2f4ca87

16 files changed

+25
-9
lines changed

src/Building/UnixBuild.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class UnixBuild implements Build
2020
{
2121
private const PHPIZE_TIMEOUT_SECS = 60; // 1 minute
2222
private const CONFIGURE_TIMEOUT_SECS = 120; // 2 minutes
23-
private const MAKE_TIMEOUT_SECS = 600; // 10 minutes
23+
private const MAKE_TIMEOUT_SECS = null; // unlimited
2424

2525
/** {@inheritDoc} */
2626
public function __invoke(
@@ -101,7 +101,7 @@ private function make(TargetPlatform $targetPlatform, DownloadedPackage $downloa
101101
$output->writeln('Running make without parallelization - try providing -jN to PIE where N is the number of cores you have.');
102102
} else {
103103
$makeCommand[] = '--jobs';
104-
$makeCommand[] = $targetPlatform->makeParallelJobs;
104+
$makeCommand[] = (string) $targetPlatform->makeParallelJobs;
105105
}
106106

107107
return Process::run(

src/Platform/TargetPlatform.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
namespace Php\Pie\Platform;
66

77
use Php\Pie\Platform\TargetPhp\PhpBinaryPath;
8-
98
use Php\Pie\Util\NumberOfCores;
9+
1010
use function array_key_exists;
1111
use function curl_version;
1212
use function explode;

src/Util/NumberOfCores.php

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
use Symfony\Component\Process\Process;
88

9+
use function is_numeric;
10+
use function trim;
11+
912
final class NumberOfCores
1013
{
1114
/** @psalm-suppress UnusedConstructor */

test/integration/Building/UnixBuildTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testUnixBuildCanBuildExtension(): void
5050
$unixBuilder = new UnixBuild();
5151
$unixBuilder->__invoke(
5252
$downloadedPackage,
53-
TargetPlatform::fromPhpBinaryPath(PhpBinaryPath::fromCurrentProcess()),
53+
TargetPlatform::fromPhpBinaryPath(PhpBinaryPath::fromCurrentProcess(), null),
5454
['--enable-pie_test_ext'],
5555
$output,
5656
);

test/integration/DependencyResolver/ResolveDependencyWithComposerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testDependenciesAreResolvedToExpectedVersions(
6969
$resolve = $container->get(DependencyResolver::class);
7070

7171
$package = $resolve->__invoke(
72-
TargetPlatform::fromPhpBinaryPath(PhpBinaryPath::fromCurrentProcess()),
72+
TargetPlatform::fromPhpBinaryPath(PhpBinaryPath::fromCurrentProcess(), null),
7373
'asgrim/example-pie-extension',
7474
$requestedVersion,
7575
);

test/integration/Installing/UnixInstallTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function testUnixInstallCanInstallExtension(string $phpConfig): void
7575
}
7676

7777
$output = new BufferedOutput();
78-
$targetPlatform = TargetPlatform::fromPhpBinaryPath(PhpBinaryPath::fromPhpConfigExecutable($phpConfig));
78+
$targetPlatform = TargetPlatform::fromPhpBinaryPath(PhpBinaryPath::fromPhpConfigExecutable($phpConfig), null);
7979
$extensionPath = $targetPlatform->phpBinaryPath->extensionPath();
8080

8181
$downloadedPackage = DownloadedPackage::fromPackageAndExtractedPath(

test/integration/Installing/WindowsInstallTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public function testWindowsInstallCanInstallExtension(): void
6565
PhpBinaryPath::fromCurrentProcess(),
6666
Architecture::x86_64,
6767
ThreadSafetyMode::ThreadSafe,
68+
1,
6869
WindowsCompiler::VS16,
6970
);
7071
$phpPath = dirname($targetPlatform->phpBinaryPath->phpBinaryPath);

test/unit/Command/CommandHelperTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function testInvalidRequestedNameAndVersionPairThrowsExceptionWhenNoPacka
9292
public function testDownloadPackage(): void
9393
{
9494
$dependencyResolver = $this->createMock(DependencyResolver::class);
95-
$targetPlatform = TargetPlatform::fromPhpBinaryPath(PhpBinaryPath::fromCurrentProcess());
95+
$targetPlatform = TargetPlatform::fromPhpBinaryPath(PhpBinaryPath::fromCurrentProcess(), null);
9696
$requestedNameAndVersionPair = ['name' => 'php/test-pie-ext', 'version' => '^1.2'];
9797
$downloadAndExtract = $this->createMock(DownloadAndExtract::class);
9898
$output = $this->createMock(OutputInterface::class);

test/unit/DependencyResolver/ResolveDependencyWithComposerTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function testPackageThatCanBeResolved(): void
5757
$phpBinaryPath,
5858
Architecture::x86_64,
5959
ThreadSafetyMode::ThreadSafe,
60+
1,
6061
null,
6162
);
6263

@@ -97,6 +98,7 @@ public function testPackageThatCannotBeResolvedThrowsException(array $platformOv
9798
$phpBinaryPath,
9899
Architecture::x86_64,
99100
ThreadSafetyMode::ThreadSafe,
101+
1,
100102
null,
101103
);
102104

@@ -139,6 +141,7 @@ public function testZtsOnlyPackageCannotBeInstalledOnNtsSystem(): void
139141
$phpBinaryPath,
140142
Architecture::x86_64,
141143
ThreadSafetyMode::NonThreadSafe,
144+
1,
142145
null,
143146
);
144147

@@ -181,6 +184,7 @@ public function testNtsOnlyPackageCannotBeInstalledOnZtsSystem(): void
181184
$phpBinaryPath,
182185
Architecture::x86_64,
183186
ThreadSafetyMode::ThreadSafe,
187+
1,
184188
null,
185189
);
186190

test/unit/Downloading/Exception/CouldNotFindReleaseAssetTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public function testForMissingWindowsCompiler(): void
6767
$phpBinary,
6868
Architecture::x86,
6969
ThreadSafetyMode::NonThreadSafe,
70+
1,
7071
null,
7172
));
7273

test/unit/Downloading/GithubPackageReleaseAssetsTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function testUrlIsReturnedWhenFindingWindowsDownloadUrl(): void
4141
$phpBinaryPath,
4242
Architecture::x86,
4343
ThreadSafetyMode::ThreadSafe,
44+
1,
4445
WindowsCompiler::VC14,
4546
);
4647

@@ -97,6 +98,7 @@ public function testUrlIsReturnedWhenFindingWindowsDownloadUrlWithCompilerAndThr
9798
$phpBinaryPath,
9899
Architecture::x86,
99100
ThreadSafetyMode::ThreadSafe,
101+
1,
100102
WindowsCompiler::VC14,
101103
);
102104

@@ -148,6 +150,7 @@ public function testFindWindowsDownloadUrlForPackageThrowsExceptionWhenAssetNotF
148150
PhpBinaryPath::fromCurrentProcess(),
149151
Architecture::x86,
150152
ThreadSafetyMode::ThreadSafe,
153+
1,
151154
WindowsCompiler::VC14,
152155
);
153156

test/unit/Downloading/UnixDownloadAndExtractTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function testInvoke(): void
3232
PhpBinaryPath::fromCurrentProcess(),
3333
Architecture::x86,
3434
ThreadSafetyMode::NonThreadSafe,
35+
1,
3536
null,
3637
);
3738

test/unit/Downloading/WindowsDownloadAndExtractTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function testInvoke(): void
3737
PhpBinaryPath::fromCurrentProcess(),
3838
Architecture::x86,
3939
ThreadSafetyMode::ThreadSafe,
40+
1,
4041
WindowsCompiler::VC14,
4142
);
4243

test/unit/Installing/InstallNotification/SendInstallNotificationUsingGuzzleTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function setUp(): void
5353
$phpBinaryPath,
5454
Architecture::x86,
5555
ThreadSafetyMode::ThreadSafe,
56+
1,
5657
WindowsCompiler::VC14,
5758
);
5859
}

test/unit/Platform/TargetPlatformTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testWindowsPlatformFromPhpInfo(): void
5050
PHP Extension Build => API20230831,TS,VS16
5151
TEXT);
5252

53-
$platform = TargetPlatform::fromPhpBinaryPath($phpBinaryPath);
53+
$platform = TargetPlatform::fromPhpBinaryPath($phpBinaryPath, null);
5454

5555
self::assertSame(OperatingSystem::Windows, $platform->operatingSystem);
5656
self::assertSame(WindowsCompiler::VS16, $platform->windowsCompiler);
@@ -91,7 +91,7 @@ public function testLinuxPlatform(): void
9191
Thread Safety => disabled
9292
TEXT);
9393

94-
$platform = TargetPlatform::fromPhpBinaryPath($phpBinaryPath);
94+
$platform = TargetPlatform::fromPhpBinaryPath($phpBinaryPath, null);
9595

9696
self::assertSame(OperatingSystem::NonWindows, $platform->operatingSystem);
9797
self::assertSame(null, $platform->windowsCompiler);

test/unit/Platform/WindowsExtensionAssetNameTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function setUp(): void
3333
PhpBinaryPath::fromCurrentProcess(),
3434
Architecture::x86_64,
3535
ThreadSafetyMode::ThreadSafe,
36+
1,
3637
WindowsCompiler::VC14,
3738
);
3839

0 commit comments

Comments
 (0)