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

use case: ability to declare dependency on single file #17895

Open
Tracked by #8
Techatrix opened this issue Nov 6, 2023 · 2 comments
Open
Tracked by #8

use case: ability to declare dependency on single file #17895

Techatrix opened this issue Nov 6, 2023 · 2 comments
Labels
accepted This proposal is planned. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. zig build system std.Build, the build runner, `zig build` subcommand, package management
Milestone

Comments

@Techatrix
Copy link
Contributor

Techatrix commented Nov 6, 2023

ZLS depends on Zig's langref.html.in file to extract the set of a builtin function.
Right now, this file is being manually downloaded during the build phase which does not integrate well with Zig's package manager and caching system. GitHub can't provide that file as a compressed tarball and fetching the entire repository source code is too wasteful.

It would be nice if there was a way to declare it as dependency to build.zig.zon:

    .dependencies = .{
        .langref = .{
            .url = "https://raw.githubusercontent.com/ziglang/zig/5b2ee5eacc177873ce674a307a1bebdfffeeae10/doc/langref.html.in",
            // have some option here to tell Zig that the url points to a single file and does not need to be decompressed
            .hash = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        },
    },
@Vexu Vexu added proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. zig build system std.Build, the build runner, `zig build` subcommand, package management use case Describes a real use case that is difficult or impossible, but does not propose a solution. labels Nov 6, 2023
@Vexu Vexu added this to the 0.13.0 milestone Nov 6, 2023
@marler8997
Copy link
Contributor

Here's another use case I discovered today. I'm adding a build.zig file to build VVVVVV, and it has a data.zip you can download with free assets and levels. I added the data.zip to build.zig.zon, but the game actually needs the zip file, not the extracted contents. To solve this I "re-zip" the contents and install them to the bin directory for the game to load, however, if there was a way to instead download the zip file as just a "file", this would remove some unnecessary steps.

@andrewrk andrewrk added accepted This proposal is planned. and removed use case Describes a real use case that is difficult or impossible, but does not propose a solution. labels Sep 15, 2024
@andrewrk
Copy link
Member

This seems like it would be fully solved with .unpack = false, yeah?

@andrewrk andrewrk modified the milestones: 0.14.0, 0.15.0 Sep 15, 2024
@andrewrk andrewrk added the contributor friendly This issue is limited in scope and/or knowledge of Zig internals. label Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This proposal is planned. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
None yet
Development

No branches or pull requests

4 participants