Skip to content

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

Description

@techatrix

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",
        },
    },

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    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.zig build systemstd.Build, the build runner, `zig build` subcommand, package management

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions