com web/rmtools: Make PGO scenarios confgurable from rmtools: include/BranchConfig.php include/BuildVC.php
| From: | Anatol Belski | Date: | Mon, 30 Oct 2017 06:40:54 +0000 |
| Subject: | com web/rmtools: Make PGO scenarios confgurable from rmtools: include/BranchConfig.php include/BuildVC.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-26519@lists.php.net to get a copy of this message | ||
Commit: 7a4d416b7f795358ee5784414e33f1cf9fd1ede3
Author: Anatol Belski <ab@php.net> Mon, 30 Oct 2017 07:40:54 +0100
Parents: 78297905d0b9b2de0a53358bd173fa54e161366b
Branches: master
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=7a4d416b7f795358ee5784414e33f1cf9fd1ede3
Log:
Make PGO scenarios confgurable from rmtools
Changed paths:
M include/BranchConfig.php
M include/BuildVC.php
Diff:
diff --git a/include/BranchConfig.php b/include/BranchConfig.php
index 966076f..1ebb31f 100644
--- a/include/BranchConfig.php
+++ b/include/BranchConfig.php
@@ -73,4 +73,14 @@ class BranchConfig {
return '';
}
}
+
+ function getPgoScenarios()
+ {
+ if (!isset($this->config["pgo_scenario"])) {
+ /* TODO obtain all from SDK. */
+ return array("default", "cache");
+ }
+
+ return explode(",", $this->config["pgo_scenario"]);
+ }
}
diff --git a/include/BuildVC.php b/include/BuildVC.php
index d409703..1e42990 100644
--- a/include/BuildVC.php
+++ b/include/BuildVC.php
@@ -154,7 +154,7 @@ class BuildVC {
$env = $this->env;
$env["Path"] = dirname($this->build_dir) . DIRECTORY_SEPARATOR . "deps" .
DIRECTORY_SEPARATOR . "bin;" . $env["Path"];
- foreach (array("default", "cache") as $scenario) {
+ foreach ($this->branch->config->getPgoScenarios() as $scenario) {
$cmd = 'phpsdk_pgo --train --scenario=' . $scenario;
$ret = exec_single_log($cmd, $this->build_dir, $env);
if (!$ret || 0 != $ret["return_value"]) {