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

ability to specify additional build dependency mirrors that affect any package in the full dependency tree #14292

Open
Tracked by #14265
andrewrk opened this issue Jan 13, 2023 · 4 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system std.Build, the build runner, `zig build` subcommand, package management
Milestone

Comments

@andrewrk
Copy link
Member

Extracted from #14265.

After supporting URL mirrors (#14291), an additional enhancement is to allow any project in the dependency tree to provide additional mirrors for any dependency in the entire tree.

This might look something like:

.{
    .name = "libffmpeg",
    .version = "5.1.2",
    // ...
    .mirrors = .{
        .@"sha256=c9b30cffc40999d2c078ff350cbcee642970a224fe123c756d0892f876cf1aae" = .{
            "https://example.com/1.tar.gz",
            "https://example.com/2.tar.gz",
        },
    },
}

This would provide a way for a project to vendor dependencies in a git branch, or use something like git-subtrac.

@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system std.Build, the build runner, `zig build` subcommand, package management labels Jan 13, 2023
@andrewrk andrewrk added this to the 0.12.0 milestone Jan 13, 2023
@ikskuh
Copy link
Contributor

ikskuh commented Jan 13, 2023

Imho, this is a pretty important feature, especially in a company context. Consider the following scenario:

ACME is depending on some external packages (clap and zig-ini) and set up a local caching server where all their dependencies must be stored for archiving reasons.

This would require both an additional mirror (https://cache.acme.example.com/github.com/ziglibs/ini), but also the ability to remove the original mirrors, so they have the guarantee that zig will always fetch from their internal mirror.

Another option would be to give URLs a priority, so that Zig will prefer mirrors with higher priority first, and in this case, prefer the cache url over the others.

@daurnimator
Copy link
Contributor

As a user compiling software, I shouldn't have to modify the build.zon to add my local mirror. I should be able to provide some sort of overrides file (or potentially via argument/environment variable?)

@ikskuh
Copy link
Contributor

ikskuh commented Jan 13, 2023

Good point! I guess it's better to not modify the project in order to add overrides

@nektro
Copy link
Contributor

nektro commented Jan 13, 2023

thats a separate but valid use case. the developer should still be able to provide mirrors as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
Status: Fetching
Development

No branches or pull requests

4 participants