VBS can now produce Windows-target packages from a Linux host (vbs install --target-os windows, MinGW-w64 cross toolchain). The native VoidLibrary description is evaluated for the Windows target, but its external dependency detection still looks at the host's conventional roots (/usr/include, ...).
Symptoms
On a Linux host with system Boost/OpenSSL installed:
detect_dependency("OpenSSL", {"openssl/ssl.h", ...}) finds the host headers, so VOID_CRYPTO_HAS_OPENSSL=1 is defined for the Windows build.
The exported include directory is /usr/include (a host path). Passing it to MinGW either mixes glibc headers into the Windows build:
or, once host system includes are filtered out by the consumer, the OpenSSL headers cannot be found:
src/Crypto/Crypto.cpp:18:10: fatal error: openssl/core_names.h: No such file or directory
Request
Make the external dependency detection target-aware: when cross-compiling (target != host), do not search the host's system roots for the target build; only use explicitly configured target roots (OPENSSL_ROOT_DIR etc. pointing at target libraries) or disable the optional dependency. The same applies to Boost.
Reproduced in an Arch container with mingw-w64-gcc, running the self-hosted install of Void/Build-System (--target-os windows).
## Context
VBS can now produce Windows-target packages from a Linux host (`vbs install --target-os windows`, MinGW-w64 cross toolchain). The native VoidLibrary description is evaluated for the Windows target, but its external dependency detection still looks at the **host**'s conventional roots (`/usr/include`, ...).
## Symptoms
On a Linux host with system Boost/OpenSSL installed:
- `detect_dependency("OpenSSL", {"openssl/ssl.h", ...})` finds the host headers, so `VOID_CRYPTO_HAS_OPENSSL=1` is defined for the Windows build.
- The exported include directory is `/usr/include` (a host path). Passing it to MinGW either mixes glibc headers into the Windows build:
```
/usr/include/stdlib.h:67:5: error: conflicting declaration 'typedef struct div_t div_t'
```
or, once host system includes are filtered out by the consumer, the OpenSSL headers cannot be found:
```
src/Crypto/Crypto.cpp:18:10: fatal error: openssl/core_names.h: No such file or directory
```
## Request
Make the external dependency detection target-aware: when cross-compiling (target != host), do not search the host's system roots for the target build; only use explicitly configured target roots (`OPENSSL_ROOT_DIR` etc. pointing at target libraries) or disable the optional dependency. The same applies to Boost.
Reproduced in an Arch container with `mingw-w64-gcc`, running the self-hosted install of Void/Build-System (`--target-os windows`).
Fixed on main in 1b19473. When the target OS differs from the host, the description no longer searches host roots (/usr, /usr/local, /opt/homebrew) or CPATH/LIBRARY_PATH; it uses _ROOT/_INCLUDE_DIR/_LIBRARY_DIR and the profile sysroot instead. Native builds are unchanged.
Fixed on main in 1b19473. When the target OS differs from the host, the description no longer searches host roots (/usr, /usr/local, /opt/homebrew) or CPATH/LIBRARY_PATH; it uses <NAME>_ROOT/<NAME>_INCLUDE_DIR/<NAME>_LIBRARY_DIR and the profile sysroot instead. Native builds are unchanged.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Context
VBS can now produce Windows-target packages from a Linux host (
vbs install --target-os windows, MinGW-w64 cross toolchain). The native VoidLibrary description is evaluated for the Windows target, but its external dependency detection still looks at the host's conventional roots (/usr/include, ...).Symptoms
On a Linux host with system Boost/OpenSSL installed:
detect_dependency("OpenSSL", {"openssl/ssl.h", ...})finds the host headers, soVOID_CRYPTO_HAS_OPENSSL=1is defined for the Windows build./usr/include(a host path). Passing it to MinGW either mixes glibc headers into the Windows build:Request
Make the external dependency detection target-aware: when cross-compiling (target != host), do not search the host's system roots for the target build; only use explicitly configured target roots (
OPENSSL_ROOT_DIRetc. pointing at target libraries) or disable the optional dependency. The same applies to Boost.Reproduced in an Arch container with
mingw-w64-gcc, running the self-hosted install of Void/Build-System (--target-os windows).Fixed on main in
1b19473. When the target OS differs from the host, the description no longer searches host roots (/usr, /usr/local, /opt/homebrew) or CPATH/LIBRARY_PATH; it uses _ROOT/_INCLUDE_DIR/_LIBRARY_DIR and the profile sysroot instead. Native builds are unchanged.