While reviewing the v3 source code, I realized I had inadvertently confused the concept of extract. In source, it represents the source code path, but in binary, it becomes the installation path. This also conflicts with the concept in #1169. Basically in that PR shows that we need to define something about install.
Conclusion: we should declare installation step things explicitly:
zig:
source: { ... }
binary: custom
metadata:
license: MIT
license-files: [LICENSE]
source-root: null
install:
destination: zig # default: {pkg_root_path}
root: zig # default: {pkg_root_path}
bin-dir: '' # default: {pkg_root_path}/bin
bin: '' # default: {bin-dir}/{artifact_name}
And we also need to extract in a temp dir anyway, and install stage we rename() it to the real target path. This completely resolves the confusing relationship between extract and install, with almost no performance impact because we're using rename.
Of course, we also have selective extract, which only requires one move and one delete, consistent with the current situation.
While reviewing the v3 source code, I realized I had inadvertently confused the concept of
extract. Insource, it represents the source code path, but inbinary, it becomes the installation path. This also conflicts with the concept in #1169. Basically in that PR shows that we need to define something aboutinstall.Conclusion: we should declare installation step things explicitly:
And we also need to extract in a temp dir anyway, and
installstage werename()it to the real target path. This completely resolves the confusing relationship between extract and install, with almost no performance impact because we're using rename.Of course, we also have selective extract, which only requires one move and one delete, consistent with the current situation.