zls icon indicating copy to clipboard operation
zls copied to clipboard

automatically synthesize a check step for build on save

Open techatrix opened this issue 9 months ago • 3 comments

For a typical zig init like project, the "install" step is simple enough that a "check" could automatically be inferred by ZLS. The build runner could inject additional steps into the build graph so that the user doesn't need to do edit their build.zig to get it ready for build on save.

techatrix avatar Feb 20 '26 01:02 techatrix

Hey @Techatrix, I was curious about ZLS and this issue in particular and wanted to take a stub. I was thinking about triggering conditions where ZLS can safely assume the project/install step is simple enough to infer the "check". Was there anything specific on your mind or as long as install has parseasble graph with compilations - it's good enough?

We already collect all compilation steps that are descendants of the install step, have you had in mind simply nullying the generated_bin, generated_pdb and such so we run synthesize a "check" that would simply run such trimmed compilations? Btw, would we also want to include the compilation from the test?

fdesu avatar Jul 27 '26 21:07 fdesu

ideally it should be a single line https://codeberg.org/ziglang/zig/issues/36309

nektro avatar Jul 28 '26 00:07 nektro

@nektro ah, that's neat! so if I get it right, if the upstream issue is fixed, the only thing to do here would be to collect compilation steps and exec them, right?

fdesu avatar Jul 28 '26 20:07 fdesu