How do I download, say, a jpg at build time for access at runtime? Is there an easy way to download a file only once so that it does not get downloaded with every zig build? Currently I use @embedFile() with files in the local file system, but these would clutter the source code repository.
can’t you just download the file and put it next to your build.zig file? Am I missing something ?
I want the download to happen in the build without a manual download step.
I think you can basically adjust this word select tool in the build system guide - embed-file example to instead get an url as input argument, download the file and then write it to the output argument, which then gets used in an anonymous import, which is then used with @embedFile.
If used like described in that example, I think the download should only happen once or when the input url changes and the resulting output file would be stored in the build cache.
@Sze , thanks, never found that with Google. Throw in an http.Client fetch and it should allow me to @embedFile remote data. A responsible security conscious person would of course add checkums…