-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
a zig subcommand that fetches remote dependencies so that subsequent zig build
executions are guaranteed to not attempt network access
#14280
Comments
Until the last sentence I thought there will be two separate commands: |
|
I like the elixir approach where you have to run |
Would this also mean that Zig would get hooks for sandboxing? If not: Should, and if yes, what tools should the user be given to prevent this? |
Perhaps the command could be |
zig fetch [options] <url> zig fetch [options] <path> Fetches a package which is found at <url> or <path> into the global cache directory, printing the package hash to stdout. Closes #16972 Related to #14280 Additionally, this commit: * Adds uncompressed .tar support to package fetching * Introduces symlink support to package fetching
zig fetch [options] <url> zig fetch [options] <path> Fetches a package which is found at <url> or <path> into the global cache directory, printing the package hash to stdout. Closes #16972 Related to #14280 Additionally, this commit: * Adds uncompressed .tar support to package fetching * Introduces symlink support to package fetching
Extracted from #14265.
I can think of two possibilities:
This is straightforward to implement; it would run this code, without actually running the build_runner:
zig/src/main.zig
Lines 4080 to 4126 in 7cb2f92
One thing to consider would be a slightly higher level abstraction of subcommand which would additionally build and install dev dependencies. For example, if there were a binary tool that should be available, it should get installed. But that can be a follow-up issue.
I think I like the
zig build --fetch
option better becausezig fetch
sounds like it might download a URL directly, which is not an outrageous idea considering the "Zig as Dependency Zero" motto.The text was updated successfully, but these errors were encountered: