Replies: 2 comments
-
|
Hi! Thanks for the interest! It's perhaps important to establish some precedent here to start.
This requires some longer reflection. I definitely won't be making this change in the short-term and there's arguably a simpler approach that could be less brittle in the long-term than the proposal or the current implementations. The benefit of the current implementation being that it is known to work across all supported platforms with the bonus that the sibling project has a similar functional implementation.
I can be more certain that this is highly unlikely to ever reside upstream. While incidental support for an unsupported platform can be a satisfactory happenstance, muddying the lines of what is and is not supported is unacceptable. In all, you should feel empowered to maintain a personal fork for your uses. Incidentally, there is additional platform support upcoming but other than specifically that, future changes required for newer stable versions of Zig, and future support for additional Qt ecosystem modules to the library, the build system is hopefully stabilized in its mostly functional state. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
|
Hi @haze, regarding the first topic here, I've relaxed the pattern matching in the build system's logic and added some logic for path validation. In the short-term, I believe this should address your issues while simultaneously not destabilizing the supported platforms. The library's existing option for extra paths ( With both of these in place, I believe you should be able to consume the library without having to maintain a fork if you find that to be optimal. The same caveats about being on an unsupported platform still apply. Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use libqt6zig on NixOS (and with Nix
devShellenvironments on non-NixOS). Currently it doesn't work out of the box because of two issues inbuild.zig:1. GCC include path filter is too restrictive (line 42)
The GCC C++ header discovery runs
gcc -xc++ -E -Wp,-v /dev/nulland filters the output with:On Nix, all paths are under
/nix/store/, so nothing passes this filter. The-nostdinc++/-nostdlib++flags strip the default C++ headers (correctly, since Qt needs libstdc++ not libc++), but then the GCC-discovered paths that would re-add them are all rejected.The fix is to accept any indented absolute path, which is all the filter was really doing — distinguishing actual paths from noise lines in GCC's stderr:
This preserves the existing behavior on FHS distros (all
/usr/paths still match) while also working on Nix, Guix, and any other non-FHS layout.2.
os_include_pathis hardcoded to FHS paths onlyThe comptime
os_include_patharray only lists paths like/usr/include/qt6,/usr/include/KF6, etc. On Nix these don't exist, Qt/KDE headers are in scattered/nix/store/paths.Nix's
mkShellprovides all include paths via theNIX_CFLAGS_COMPILEenvironment variable as-isystementries (this is the same mechanism Zig's ownstd.zig.system.NativePathsuses internally). Parsing this env var at build time and adding the discovered paths toqt_include_pathmakes the hardcodedos_include_pathunnecessary on Nix, while leaving it as a working fallback on FHS systems.I have a working patch against the current
build.zigthat I can submit as a PR if you're open to it. With the patch, libqt6zig works on Nix with a plainmkShellthat just lists Qt/KDE packages inbuildInputs— no workarounds needed.Beta Was this translation helpful? Give feedback.
All reactions