I have a build.zig task to create a file on disk, which returns me a LazyPath. How do I additionally make sure that the lazy path is marked executable?
The LazyPath in question comes originally from a Step.Run.captureStdOut.
I guess I can additionally addSystemCommand(&.{"chmod"}) somewhere, but I’d rather not make this platform specfic.
You can use chmod and have a cross platform solution.
Because Build runs at configure time, you must create a custom Step with a make function that runs chmod at build time.
I was expecting Build to have some kind of install that copies files into bin and raises the executable flag. But I could not find a function like that in Build.
I found that the executable flag is raised by the linker outside the standard library.