Skip to content

support fetching dependencies with the file:// protocol scheme #17364

@andrewrk

Description

@andrewrk

This should work:

zig fetch file://C:/Code/myproject/

and of course the equivalent build.zig.zon snippet:

    .url = "file://C:/Code/myproject/"

Support file:// just like any other URL scheme.

URLs already can be private or require a proxy, or blocked in some countries. File paths have the exact same properties. There is no reason to not support this kind of URL.

If someone has a security concern about this and wants to be taken seriously then please explain the threat model and let's analyze it.

The previous issue for this feature was #14339 however, that was two separate use cases, and the resulting enhancement that came out of that was paths relative to the build root which are exempt from hashing. The use case for supporting file:/// still remains and is still planned.

Metadata

Metadata

Assignees

Labels

acceptedThis proposal is planned.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.zig build systemstd.Build, the build runner, `zig build` subcommand, package management

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions