vrischmann / zig-sqlite

zig-sqlite is a small wrapper around sqlite's C API, making it easier to use with Zig.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't fetch package using the Official package manager

Doomwhite opened this issue · comments

zig-sqlite commit

master

Zig version

0.11.0

Steps to reproduce

I'm getting the following error whenever trying to use the build.zig.zon dependency:

error: Expected response status '200 OK' got '404 Not Found'
     .url = "https://github.com/vrischmann/zig-sqlite/archive/COMMIT.tar.gz",

This is what my dependencies look like:

    .dependencies = .{
	.sqlite = .{
		.url = "https://github.com/vrischmann/zig-sqlite/archive/COMMIT.tar.gz",
	},
    },

My build.zig looks like this:

const sqlite = b.dependency("sqlite", .{
    .target = target,
    .optimize = mode,
});

exe.addModule("sqlite", sqlite.module("sqlite"));

// Sqlite
exe.linkLibC();
exe.linkSystemLibrary("sqlite3");
exe.addPackage(.{ .name = "sqlite", .path = "third_party/zig-sqlite/sqlite.zig" });

Expected behaviour

It to fetch correctly.

It's not documented properly but you need to replace the COMMIT part with an actual commit from zig-sqlite, like f101ae075124f77a44444d368c869a5b3d3d4a6f: https://github.com/vrischmann/zig-sqlite/archive/f101ae075124f77a44444d368c869a5b3d3d4a6f.tar.gz

When you want to update the version of zig-sqlite you'll have to change the commit in the URL.

I see, makes sense, I think you also need to add the .hash as well.

There's something else that I'm not sure if I should make a new issue for:

exe.addPackage(.{ .name = "sqlite", .path = "third_party/zig-sqlite/sqlite.zig" });

This syntax is deprecated now and doesn't compile.

I see, makes sense, I think you also need to add the .hash as well.

Right, this is also something that's missing from the readme. The official documentation describes the easiest way to get the hash: https://ziglang.org/download/0.11.0/release-notes.html#Package-Management

This syntax is deprecated now and doesn't compile.

True, I'll fix that. Thanks for reporting it.

I updated the readme, I'll close this issue now.