feat(install): cross-target installs and target-only builds
VoidBuildSystem CI / 3A · Linux test (debug) (push) Successful in 6m26s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Successful in 6m38s
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Successful in 1m26s
VoidBuildSystem CI / 5 · Release (push) Skipped
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Successful in 1m18s
VoidBuildSystem CI / 4A · Linux package (debug) (push) Successful in 1m15s
VoidBuildSystem CI / 4A2 · VBS installers (self-hosted) (push) Failing after 31s
VoidBuildSystem CI / 1 · Requirements (push) Successful in 2s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 1m51s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 2m31s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 3m13s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 3m24s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 4m43s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 20s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 26s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 1m42s
VoidBuildSystem CI / 4B · Windows package (debug) (push) Successful in 22s
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Successful in 37s

- vbs install accepts --target-os/--target-arch like vbs build, so the
  Windows installers can be produced from the Linux host.
- Only targets carrying an install rule (plus their dependencies) are
  built, so install no longer links test executables.
- Failed install actions print their captured stderr.
- The VBS description compares the target OS case-insensitively.
- The installer job uses a per-run build directory: concurrent runs on
  the same runner share the repository workspace.
This commit is contained in:
faumaray committed 2026-12-06 09:12:21 +03:00
1 parent 0186711a90
commit f1e52467d7
3 files changed
+43 -8

No files matched your search

+19 -3
View File
@@ -2552,6 +2552,8 @@ struct InstallCmdOptions {
std::optional<std::string> build_arg;
std::string profile_name{"debug"};
std::optional<std::string> compiler_arg;
std::optional<std::string> target_os_arg;
std::optional<std::string> target_arch_arg;
std::optional<std::string> prefix_arg;
std::optional<std::string> pkg_name_arg;
std::string pkg_ver{"0.1.0"};
@@ -2636,8 +2638,9 @@ int execute_install_command(const InstallCmdOptions &opts) {
}
ProfileContext ctx;
try {
ctx = profs->resolve(opts.profile_name, compiler_override, Toolchain::host_os_name(),
Toolchain::host_architecture_name());
ctx = profs->resolve(opts.profile_name, compiler_override,
opts.target_os_arg.value_or(Toolchain::host_os_name()),
opts.target_arch_arg.value_or(Toolchain::host_architecture_name()));
} catch (const std::exception &ex) {
std::cerr << "vbs install: " << ex.what() << '\n';
return 2;
@@ -2757,7 +2760,16 @@ int execute_install_command(const InstallCmdOptions &opts) {
std::cerr << "vbs install: " << graph.error().message() << '\n';
return 1;
}
auto exec = Execution::execute_graph(*graph, *state);
// Only the targets that are actually installed (plus their dependencies)
// need to be built: test executables and tools without install rules are
// not part of the package.
Execution::ExecutionOptions eopts;
for (const auto &target : desc->targets) {
if (target.install_rule) {
eopts.selected_targets.push_back(target.name);
}
}
auto exec = Execution::execute_graph(*graph, *state, eopts);
if (!exec || !exec->succeeded) {
std::cerr << "vbs install: build failed before staging\n";
if (!exec) {
@@ -3890,6 +3902,10 @@ int main(int argc, char **argv) {
.option("--build-dir", "-B", "Build output directory", install_opts.build_arg)
.option_default("--profile", "-p", "Profile name", install_opts.profile_name, "debug")
.option("--compiler", "", "Override compiler family (gcc|clang)", install_opts.compiler_arg)
.option("--target-os", "", "Target operating system (default: host, e.g. windows)",
install_opts.target_os_arg)
.option("--target-arch", "", "Target architecture (default: host, e.g. x86_64)",
install_opts.target_arch_arg)
.option("--prefix", "", "Install destination prefix (required)", install_opts.prefix_arg)
.option("--package-name", "", "Exported package name", install_opts.pkg_name_arg)
.option_default("--package-version", "", "Exported package version", install_opts.pkg_ver,