Closed timsavage closed 5 months ago
After investigating more, I've found this is more of an issue with the Zig toolchain.
For anybody encountering this problem, here is how to work around the issue and get things working.
zig build
with dependencies - ZigTest
and ZigRun
will no longer work (will cause build failures)test
for testsNative Application
run config
./zig-out/bin
ZigBuild Build
run-config so any re-compilation is done on run.It would be nice if the plugin could handle some of this work, but this is a suitable workaround. Before-lanch does have an annoying side effect where if there are build errors, the binary is still run rather than stopping at the failure.
Will leave this issue open so the plugin author can determine if they want to take any action.
The plugin already supports this, in the ZigBuild task type, you need to directly specify the executable generated by your zig build inside the task itself, this is effectively what you're doing with the Native Application solution, but integrated with the toolchain system.
Unfortunately i have not yet figured out a way to fully automate this without requiring the user to add extra code to build.zig.
Would it be possible to add command line arguments for the executable?
Yep, i will add that in the next update
Fixed in 13.2.0, debugging Zig build
type intellij tasks should now work, even if you set the build step to run
. If the exe path is not specified, it will try finding it automatically on a best effort basis, assuming that there is a single executable file inside ./zig-out/bin
after running the build, otherwise it will just require you to set the exe path in the intellij task like before.
Thanks very much, that works good.
Cheers
This may be a limitation of the zig tooling rather than this plugin.
Using a Zig-Run does not use the
build.zig
andbuild.zig.zon
dependencies causing builds to fail where dependencies are required.Using a Zig-Build will successfully build, and adding the run argument will allow a build to subsequently be run. However, the debugger gets stuck at
Connecting
. Have tested with both GDB and LLDB.Plugin version: 13.1.1-233 CLion version: 2023.3.4 Zig: 0.12....nightly ZLS: 0.12...nightly OS: Ubuntu 22.04