com web/rmtools: Basic intrinsic build implementation: data/config/branch/x64/phpmaster.ini include/Branch.php include/BranchConfig.php
script/snap.php
| From: | Anatol Belski | Date: | Fri, 02 Mar 2018 22:03:46 +0000 |
| Subject: | com web/rmtools: Basic intrinsic build implementation: data/config/branch/x64/phpmaster.ini include/Branch.php include/BranchConfig.php script/snap.php |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-26796@lists.php.net to get a copy of this message | ||
Commit: 4f511accbff62550dfd59bc2b45bb06ec307abd4
Author: Anatol Belski <ab@php.net> Fri, 2 Mar 2018 23:03:46 +0100
Parents: 9f9e6fe18f0899462cf1b8f6925d4dd6bf3f9b3b
Branches: master
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=4f511accbff62550dfd59bc2b45bb06ec307abd4
Log:
Basic intrinsic build implementation
Changed paths:
M data/config/branch/x64/phpmaster.ini
M include/Branch.php
M include/BranchConfig.php
M script/snap.php
Diff:
diff --git a/data/config/branch/x64/phpmaster.ini b/data/config/branch/x64/phpmaster.ini
index 748b4f7..a10cb55 100644
--- a/data/config/branch/x64/phpmaster.ini
+++ b/data/config/branch/x64/phpmaster.ini
@@ -24,3 +24,20 @@ compiler=vc15
arch=x64
configure_options=--enable-snapshot-build --enable-debug-pack
--with-pdo-oci=c:/php-snap-build/deps_aux/oracle/x64/instantclient_12_1/sdk,shared
--with-oci8-12c=c:/php-snap-build/deps_aux/oracle/x64/instantclient_12_1/sdk,shared
--enable-com-dotnet=shared --without-analyzer
platform=windows
+
+[build-nts-windows-vc15-x64-avx]
+name=nts-windows-vc15-x64
+compiler=vc15
+arch=x64
+configure_options=--enable-snapshot-build --disable-zts --enable-debug-pack
--with-pdo-oci=c:/php-snap-build/deps_aux/oracle/x64/instantclient_12_1/sdk,shared
--with-oci8-12c=c:/php-snap-build/deps_aux/oracle/x64/instantclient_12_1/sdk,shared
--enable-com-dotnet=shared --without-analyzer --enable-native-intrinsics=avx
+platform=windows
+intrinsics=avx
+
+[build-ts-windows-vc15-x64-avx]
+name=ts-windows-vc15-x64
+compiler=vc15
+arch=x64
+configure_options=--enable-snapshot-build --enable-debug-pack
--with-pdo-oci=c:/php-snap-build/deps_aux/oracle/x64/instantclient_12_1/sdk,shared
--with-oci8-12c=c:/php-snap-build/deps_aux/oracle/x64/instantclient_12_1/sdk,shared
--enable-com-dotnet=shared --without-analyzer --enable-native-intrinsics=avx
+platform=windows
+intrinsics=avx
+
diff --git a/include/Branch.php b/include/Branch.php
index b8dd6a1..6b05e1e 100644
--- a/include/Branch.php
+++ b/include/Branch.php
@@ -6,7 +6,7 @@ include __DIR__ . '/Repository.php';
include __DIR__ . '/BuildVC.php';
class Branch {
- const REQUIRED_BUILDS_NUM = 4;
+ public $required_builds_num = 4;
public $last_revision;
public $last_revision_has_snap;
public $config;
@@ -15,7 +15,7 @@ class Branch {
protected $db_fd;
public $data = NULL;
- public function __construct($config_path)
+ public function __construct($config_path, $required_builds_num = 4)
{
if (!is_readable($config_path)) {
throw new \Exception('Cannot open config data <' .. $config_path .
'>');
@@ -25,6 +25,7 @@ class Branch {
$this->repo->setModule($this->config->getModule());
$this->repo->setBranch($this->config->getRepoBranch());
$this->db_path = __DIR__ . '/.../data/db/' . $this->config->getName() .
'.json';
+ $this->required_builds_num = $required_builds_num;
$this->data = $this->readData();
}
@@ -124,7 +125,7 @@ class Branch {
}
}
- if ($data->build_num > self::REQUIRED_BUILDS_NUM) {
+ if ($data->build_num > $this->required_builds_num) {
throw new \Exception("Inconsistent db, build number can't be
{$data->build_num}.");
}
@@ -212,7 +213,7 @@ class Branch {
{
$data = $this->readdata();
$this->data->build_num = $data->build_num;
- return $this->data->build_num == self::REQUIRED_BUILDS_NUM;
+ return $this->data->build_num == $this->required_builds_num;
}
public function hasNewRevision()
diff --git a/include/BranchConfig.php b/include/BranchConfig.php
index 1ebb31f..19283d3 100644
--- a/include/BranchConfig.php
+++ b/include/BranchConfig.php
@@ -25,6 +25,7 @@ class BranchConfig {
'PeclDepsBase' => 'pecl_deps_base',
'CoreDepsBase' => 'core_deps_base',
'PeclNonCoreExtDepsBase' => 'pecl_non_core_ext_deps_base',
+ 'Intrinsics' => 'intrinsics',
);
function __construct($path)
@@ -83,4 +84,21 @@ class BranchConfig {
return explode(",", $this->config["pgo_scenario"]);
}
+
+ public static function getRequiredBuildsNum($path, $branch)
+ {
+ $files = glob("$path/*/$branch.ini");
+ $i = 0;
+
+ foreach ($files as $fname) {
+ $cfg = parse_ini_file($fname, true, INI_SCANNER_RAW);
+ foreach ($cfg as $name => $entry) {
+ if (substr($name, 0, 6) == 'build-' && is_array($entry)) {
+ $i++;
+ }
+ }
+ }
+
+ return $i;
+ }
}
diff --git a/script/snap.php b/script/snap.php
index 7b1927b..aa10aad 100644
--- a/script/snap.php
+++ b/script/snap.php
@@ -18,17 +18,19 @@ $sdk_arch = getenv("PHP_SDK_ARCH");
if (!$sdk_arch) {
throw new \Exception("Arch is empty, the SDK might not have been setup. ");
}
-$config_path = __DIR__ . '/../data/config/branch/' . $sdk_arch . '/' .
$branch_name . '.ini';
+$all_branch_confs_path = __DIR__ . '/../data/config/branch';
+$config_path = $all_branch_confs_path . '/' . $sdk_arch . '/' . $branch_name .
'.ini';
+$req_builds_num = rm\BranchConfig::getRequiredBuildsNum($all_branch_confs_path, $branch_name);
$err_msg = NULL;
try {
- $branch = new rm\Branch($config_path);
+ $branch = new rm\Branch($config_path, $req_builds_num);
} catch (\Exception $e) {
$err_msg = $e->getMessage();
goto out_here;
}
-if (!$branch->requiredBuildRunsReached() && rm\Branch::REQUIRED_BUILDS_NUM ==
$branch->numBuildsRunning()) {
+if (!$branch->requiredBuildRunsReached() && $branch->numBuildsRunning() ==
$req_builds_num) {
$err_msg = "Waiting for " . $branch->getLastRevisionId() . " builds to
finish.";
goto out_here;
}
@@ -218,7 +220,7 @@ if ($branch->hasNewRevision() ||
!$branch->isLastRevisionExported($branch->getLa
$src_dir = $branch_name . '/r' . $last_rev;
rm\upload_build_result_ftp_curl($toupload_dir, $src_dir);
/* FIXME This is still not safe, locking needed! */
- foreach (["$toupload_dir/logs", $toupload_dir] as $path) {
+ /*foreach (["$toupload_dir/logs", $toupload_dir] as $path) {
$items = scandir($path);
foreach ($items as $item) {
$full = $path . "/" . $item;
@@ -226,7 +228,7 @@ if ($branch->hasNewRevision() ||
!$branch->isLastRevisionExported($branch->getLa
@unlink($full);
}
}
- }
+ }*/
//rm\rmdir_rf($toupload_dir);
$branch->setLastRevisionExported($last_rev);