Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package management: support downloading arbitrary archives ala git submodules #14488

Closed
david-vanderson opened this issue Jan 29, 2023 · 5 comments

Comments

@david-vanderson
Copy link
Contributor

Extracted from #14282

Some people will want to use the zig package manager to download an archive (with arbitrary files) to a local directory that your code references directly. Unsure if or how that should be supported.

@leroycep says in #14282 (comment)

I personally would like to use something like b.packagePath("clap") to depend on a binary release. For example I depend on ZWO ASI's SDK, which only contains binary .a and .so files. While I could have some other system of getting the library files (like say, checking it into a git repository), it would also be nice to specify that in the build.zig.ini, and then add the include/library path using b.packagePath("asicamera").

@andrewrk
Copy link
Member

andrewrk commented Feb 2, 2023

Can you please expand on this? As is, I don't understand the proposal enough to keep this issue open. Perhaps you could provide some example files that would take advantage of this feature so we can examine them.

@david-vanderson
Copy link
Contributor Author

Sure. For myself, my gui lib https://github.com/david-vanderson/gui currently copies (vendors) icons and fonts. I'm wondering if I could have a directory of icons (no zig or build.zig) as a dependency. How would my zig code get a path to the icon directory?

Does the zig code just assume a particular directory will appear from the package being unpacked? Or does the directory have to be passed from build.zig to the rest of the code?

Does that at least clear up the kind of questions I'm asking?

I think @leroycep is asking a similar thing for depending on a package (no zig or build.zig in it) with a static lib in it.

@praschke
Copy link
Contributor

praschke commented Feb 2, 2023

in the example https://github.com/andrewrk/libgroove/blob/zig-pkg/build.zig.ini all of the dependencies were forked to include a build.zig and a build.zig.ini. this assumption seems a bit untenable, not all dependencies are zig packages. assets and datasets are two particular static examples. a ports tree like BSD, KISS linux, or nixpkgs is another use case that might like to use zig dependency management with completely non-zig archives.

@andrewrk
Copy link
Member

I still don't understand the proposal. Please provide complete code examples that would work if this were to be implemented and I will re-open as a proposal.

@andrewrk andrewrk closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2023
@david-vanderson
Copy link
Contributor Author

Good plan. Will revisit with code examples if there is interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants