fix(toolchain): do not pass the compiler's implicit include dirs
VoidBuildSystem CI / 4A2 · VBS installers (linux target) (push) Successful in 3m58s
VoidBuildSystem CI / 1 · Requirements (push) Successful in 7s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 3m28s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 5m13s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 4m4s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Successful in 6m7s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Successful in 6m2s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 1m19s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 1m38s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 3m11s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 16s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 17s
VoidBuildSystem CI / 4A2 · VBS installers (windows target) (push) Failing after 1m33s
VoidBuildSystem CI / 5 · Release (push) Failing after 9s

VoidLibrary's dependency detection exports /usr/include as a system
include directory; passing it as -isystem makes GCC drop its implicit
entry for that path, so libstdc++'s '#include_next <stdlib.h>' fails
('stdlib.h: No such file or directory'). This broke the self-hosted
install only in environments where the dependency finds Boost/OpenSSL.

Probe the implicit include search list for GCC as well as Clang and
skip those directories when lowering compile commands. Also log the
executed command at debug level.

Verified: 'vbs install' (self-hosted) now succeeds inside an Arch
container matching the CI image.
This commit is contained in:
faumaray committed 2026-12-06 13:08:22 +03:00
1 parent 00e14bae98
commit b2c869961a
3 files changed
+52 -1

No files matched your search

+23 -1
View File
@@ -1171,6 +1171,28 @@ run_native_provider(const ProviderRequest &request, const std::filesystem::path
return std::unexpected{exec.error()};
}
if (!exec->succeeded) {
// Void::Result::Error bounds its message, and a raw compiler stderr
// starts with a long include chain: keep the error lines (or the tail)
// so the actual diagnostic survives.
const auto compact = [](std::string_view text) {
std::string errors;
std::size_t pos = 0;
while (pos < text.size()) {
const auto nl = text.find('\n', pos);
const auto end = nl == std::string_view::npos ? text.size() : nl;
const auto line = text.substr(pos, end - pos);
if (line.find("error") != std::string_view::npos ||
line.find("Error") != std::string_view::npos) {
errors.append(line).push_back('\n');
}
pos = end + 1;
}
if (!errors.empty()) {
return errors;
}
constexpr std::size_t kTail = 900;
return std::string{text.size() > kTail ? text.substr(text.size() - kTail) : text};
};
std::string detail;
for (const auto &ar : exec->results) {
if (!ar.succeeded) {
@@ -1179,7 +1201,7 @@ run_native_provider(const ProviderRequest &request, const std::filesystem::path
}
detail += ar.action_id + ": " + ar.error_message;
if (!ar.stderr_data.empty()) {
detail += "\n" + ar.stderr_data;
detail += "\n" + compact(ar.stderr_data);
}
}
}