feat(install): --jobs option; bound the CI installer build
The nested dependency build ran at full parallelism and large translation units failed on the runner without a visible diagnostic. vbs install accepts --jobs (also forwarded to the provider build and the parent graph) and the installers use 4.
This commit is contained in:
1 parent
286b0044d5
commit
9091b3dd55
2 files changed
+15
-3
No files matched your search
@@ -301,7 +301,7 @@ jobs:
|
|||||||
local attempt=1
|
local attempt=1
|
||||||
while true; do
|
while true; do
|
||||||
if "${vbs}" install --project . --build-dir "${build_dir}" --profile release \
|
if "${vbs}" install --project . --build-dir "${build_dir}" --profile release \
|
||||||
--prefix "${prefix}" --package-name VoidBuildSystem \
|
--jobs 4 --prefix "${prefix}" --package-name VoidBuildSystem \
|
||||||
--package-version "${version}" \
|
--package-version "${version}" \
|
||||||
--archive "${out}/vbs-${label}-linux-x86_64-${fmt}.${ext}" \
|
--archive "${out}/vbs-${label}-linux-x86_64-${fmt}.${ext}" \
|
||||||
--archive-format "${fmt}"; then
|
--archive-format "${fmt}"; then
|
||||||
@@ -383,7 +383,7 @@ jobs:
|
|||||||
*) ext="${fmt}" ;;
|
*) ext="${fmt}" ;;
|
||||||
esac
|
esac
|
||||||
"${vbs}" install --project . --build-dir "${build_dir}" --profile release \
|
"${vbs}" install --project . --build-dir "${build_dir}" --profile release \
|
||||||
--target-os windows --target-arch x86_64 \
|
--jobs 4 --target-os windows --target-arch x86_64 \
|
||||||
--prefix "${prefix}" --package-name VoidBuildSystem \
|
--prefix "${prefix}" --package-name VoidBuildSystem \
|
||||||
--package-version "${version}" \
|
--package-version "${version}" \
|
||||||
--archive "${out}/vbs-${label}-windows-x86_64-${fmt}.${ext}" \
|
--archive "${out}/vbs-${label}-windows-x86_64-${fmt}.${ext}" \
|
||||||
|
|||||||
+13
-1
@@ -2571,6 +2571,7 @@ struct InstallCmdOptions {
|
|||||||
std::optional<std::string> compiler_arg;
|
std::optional<std::string> compiler_arg;
|
||||||
std::optional<std::string> target_os_arg;
|
std::optional<std::string> target_os_arg;
|
||||||
std::optional<std::string> target_arch_arg;
|
std::optional<std::string> target_arch_arg;
|
||||||
|
std::optional<std::string> jobs_arg;
|
||||||
std::optional<std::string> prefix_arg;
|
std::optional<std::string> prefix_arg;
|
||||||
std::optional<std::string> pkg_name_arg;
|
std::optional<std::string> pkg_name_arg;
|
||||||
std::string pkg_ver{"0.1.0"};
|
std::string pkg_ver{"0.1.0"};
|
||||||
@@ -2598,6 +2599,15 @@ int execute_install_command(const InstallCmdOptions &opts) {
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
std::size_t jobs = 0;
|
||||||
|
if (opts.jobs_arg) {
|
||||||
|
int parsed_jobs = 0;
|
||||||
|
if (!Void::Str::to_int(*opts.jobs_arg, parsed_jobs) || parsed_jobs < 0) {
|
||||||
|
std::cerr << "vbs install: invalid --jobs value '" << *opts.jobs_arg << "'\n";
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
jobs = static_cast<std::size_t>(parsed_jobs);
|
||||||
|
}
|
||||||
|
|
||||||
// Absolute roots: the self-hosted dependency build runs actions with their
|
// Absolute roots: the self-hosted dependency build runs actions with their
|
||||||
// own working directory, so relative graph paths would not resolve.
|
// own working directory, so relative graph paths would not resolve.
|
||||||
@@ -2762,7 +2772,7 @@ int execute_install_command(const InstallCmdOptions &opts) {
|
|||||||
? std::nullopt
|
? std::nullopt
|
||||||
: std::optional{fopts.sdk_library_path},
|
: std::optional{fopts.sdk_library_path},
|
||||||
&(*state),
|
&(*state),
|
||||||
0};
|
jobs};
|
||||||
auto exported = Provider::resolve_foreign_provider(preq);
|
auto exported = Provider::resolve_foreign_provider(preq);
|
||||||
if (!exported) {
|
if (!exported) {
|
||||||
std::cerr << "vbs install: " << exported.error().message() << '\n';
|
std::cerr << "vbs install: " << exported.error().message() << '\n';
|
||||||
@@ -2797,6 +2807,7 @@ int execute_install_command(const InstallCmdOptions &opts) {
|
|||||||
// need to be built: test executables and tools without install rules are
|
// need to be built: test executables and tools without install rules are
|
||||||
// not part of the package.
|
// not part of the package.
|
||||||
Execution::ExecutionOptions eopts;
|
Execution::ExecutionOptions eopts;
|
||||||
|
eopts.jobs = jobs;
|
||||||
for (const auto &target : desc->targets) {
|
for (const auto &target : desc->targets) {
|
||||||
if (target.install_rule) {
|
if (target.install_rule) {
|
||||||
eopts.selected_targets.push_back(target.name);
|
eopts.selected_targets.push_back(target.name);
|
||||||
@@ -3939,6 +3950,7 @@ int main(int argc, char **argv) {
|
|||||||
install_opts.target_os_arg)
|
install_opts.target_os_arg)
|
||||||
.option("--target-arch", "", "Target architecture (default: host, e.g. x86_64)",
|
.option("--target-arch", "", "Target architecture (default: host, e.g. x86_64)",
|
||||||
install_opts.target_arch_arg)
|
install_opts.target_arch_arg)
|
||||||
|
.option("--jobs", "-j", "Parallel job count (0 = auto)", install_opts.jobs_arg)
|
||||||
.option("--prefix", "", "Install destination prefix (required)", install_opts.prefix_arg)
|
.option("--prefix", "", "Install destination prefix (required)", install_opts.prefix_arg)
|
||||||
.option("--package-name", "", "Exported package name", install_opts.pkg_name_arg)
|
.option("--package-name", "", "Exported package name", install_opts.pkg_name_arg)
|
||||||
.option_default("--package-version", "", "Exported package version", install_opts.pkg_ver,
|
.option_default("--package-version", "", "Exported package version", install_opts.pkg_ver,
|
||||||
|
|||||||
Reference in new issue
Block a user