fix(cli): resolve the project and build roots to absolute paths
VoidBuildSystem CI / 3A · Linux test (debug) (push) Successful in 4m43s
VoidBuildSystem CI / 1 · Requirements (push) Successful in 8s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 3m7s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 3m17s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 4m35s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 52s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 1m32s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 2m57s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 18s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 19s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Successful in 5m6s
VoidBuildSystem CI / 4A2 · VBS installers (windows target) (push) Failing after 44s
VoidBuildSystem CI / 4A2 · VBS installers (linux target) (push) Failing after 52s
VoidBuildSystem CI / 5 · Release (push) Skipped
VoidBuildSystem CI / 3A · Linux test (debug) (push) Successful in 4m43s
VoidBuildSystem CI / 1 · Requirements (push) Successful in 8s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 3m7s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 3m17s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 4m35s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 52s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 1m32s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 2m57s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 18s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 19s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Successful in 5m6s
VoidBuildSystem CI / 4A2 · VBS installers (windows target) (push) Failing after 44s
VoidBuildSystem CI / 4A2 · VBS installers (linux target) (push) Failing after 52s
VoidBuildSystem CI / 5 · Release (push) Skipped
Actions run with their own working directory, so a relative
--build-dir (as CI passes) left relative source paths in the graph and
a dependency's snapshot sources could not be opened
('cc1plus: ... No such file or directory'). The build/test/install
commands now normalize both roots up front.
Verified locally: 'vbs install --build-dir build/repro-rel' failed
before and installs successfully now.
This commit is contained in:
1 parent
b6b9527c9c
commit
286b0044d5
1 file changed
+37
-4
+37
-4
@@ -453,9 +453,26 @@ int execute_build_or_test(BuildCmdOptions opts, bool run_tests) {
|
||||
jobs = static_cast<std::size_t>(parsed_jobs);
|
||||
}
|
||||
|
||||
const std::filesystem::path project_root{opts.project_arg};
|
||||
// Absolute roots: actions run with their own working directory, so relative
|
||||
// paths baked into the graph (e.g. a dependency's snapshot sources) would not
|
||||
// resolve.
|
||||
std::error_code root_ec;
|
||||
const std::filesystem::path project_root =
|
||||
std::filesystem::absolute(opts.project_arg, root_ec).lexically_normal();
|
||||
if (root_ec) {
|
||||
std::cerr << cmd_name << ": cannot resolve project directory '"
|
||||
<< opts.project_arg << "': " << root_ec.message() << '\n';
|
||||
return 1;
|
||||
}
|
||||
const std::filesystem::path build_root =
|
||||
opts.build_arg ? std::filesystem::path{*opts.build_arg} : (project_root / "build");
|
||||
opts.build_arg
|
||||
? std::filesystem::absolute(*opts.build_arg, root_ec).lexically_normal()
|
||||
: (project_root / "build");
|
||||
if (root_ec) {
|
||||
std::cerr << cmd_name << ": cannot resolve build directory '" << *opts.build_arg
|
||||
<< "': " << root_ec.message() << '\n';
|
||||
return 1;
|
||||
}
|
||||
auto trusted_keys =
|
||||
combine_trusted_keys(opts.trusted_public_keys, opts.trusted_key_files, project_root);
|
||||
if (!trusted_keys) {
|
||||
@@ -2582,9 +2599,25 @@ int execute_install_command(const InstallCmdOptions &opts) {
|
||||
}
|
||||
}
|
||||
|
||||
const std::filesystem::path project_root{opts.project_arg};
|
||||
// Absolute roots: the self-hosted dependency build runs actions with their
|
||||
// own working directory, so relative graph paths would not resolve.
|
||||
std::error_code root_ec;
|
||||
const std::filesystem::path project_root =
|
||||
std::filesystem::absolute(opts.project_arg, root_ec).lexically_normal();
|
||||
if (root_ec) {
|
||||
std::cerr << "vbs install: cannot resolve project directory '" << opts.project_arg
|
||||
<< "': " << root_ec.message() << '\n';
|
||||
return 1;
|
||||
}
|
||||
const std::filesystem::path build_root =
|
||||
opts.build_arg ? std::filesystem::path{*opts.build_arg} : (project_root / "build");
|
||||
opts.build_arg
|
||||
? std::filesystem::absolute(*opts.build_arg, root_ec).lexically_normal()
|
||||
: (project_root / "build");
|
||||
if (root_ec) {
|
||||
std::cerr << "vbs install: cannot resolve build directory '" << *opts.build_arg
|
||||
<< "': " << root_ec.message() << '\n';
|
||||
return 1;
|
||||
}
|
||||
|
||||
Install::InstallOptions iopts;
|
||||
iopts.prefix = *opts.prefix_arg;
|
||||
|
||||
Reference in new issue
Block a user