1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-21 07:34:08 +00:00

Put notes on zig master workaround back into README.

This commit is contained in:
Rene Schallner 2023-05-16 16:06:00 +02:00
parent 6e3c980516
commit 94fe2d24c2
2 changed files with 15 additions and 7 deletions

View file

@ -122,13 +122,18 @@ $ mkdir zaptest && cd zaptest
$ zig init-exe $ zig init-exe
$ git init ## (optional) $ git init ## (optional)
``` ```
**Note 1**: Zap is developed with zig master (0.11.0-dev.2985+3f3b1a680 at the **Note 1**: Zap is developed with zig master (0.11.0-dev.3132+465272921 at the
time of writing). This version of zig has the package management features in time of writing). This version of zig has the package management features in
place that are used in the following instructions. Nix users are lucky; you can place that are used in the following instructions. Nix users are lucky; you can
use the existing `flake.nix` and run `nix develop` to get a development shell use the existing `flake.nix` and run `nix develop` to get a development shell
providing zig, and also all dependencies to build the and run the GO, python, providing zig, and also all dependencies to build the and run the GO, python,
and rust examples for the `wrk` performance tests. and rust examples for the `wrk` performance tests.
**Note 2**: Current ZIG master has a nasty TLS bug which prevents it from
downloading from GitHub. See the release notes of
[release-0.0.20-localhost](https://github.com/zigzap/zap/releases/tag/release-0.0.20-localhost)
for a workaround.
With an existing zig project, adding zap to it is easy: With an existing zig project, adding zap to it is easy:
1. Add zap to your `build.zig.zon` 1. Add zap to your `build.zig.zon`
@ -142,15 +147,18 @@ To add zap to `build.zig.zon`:
.version = "0.0.1", .version = "0.0.1",
.dependencies = .{ .dependencies = .{
// zap release-0.0.19 // zap release-0.0.20
.zap = .{ .zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.19.tar.gz", .url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.20.tar.gz",
.hash = "1220e8618ae2240e22e1e01c3f5f8c95f70291cd5ca98c92bdfb86b01e81a9d0314b", .hash = "12200772b594bc50bbdc18b14aa3c7461991a33179f9c254de05eb34d214662971da",
} }
} }
} }
``` ```
**!!!PLEASE NOTE!!!** Current ZIG master has a bug in fetching archives from GitHub.
Please see the release notes of [release-0.0.20-localhost](https://github.com/zigzap/zap/releases/tag/release-0.0.20-localhost) for a workaround.
Then, in your `build.zig`'s `build` function, add the following before Then, in your `build.zig`'s `build` function, add the following before
`b.installArtifact(exe)``: `b.installArtifact(exe)``:

6
flake.lock generated
View file

@ -166,11 +166,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1683461227, "lastModified": 1684066016,
"narHash": "sha256-IhHbNNK+XeiKEvsdnMTiFw99ck2Iwdrt2gCbWXrmlRc=", "narHash": "sha256-yruKXIwISE+cuu1rz6vK49BYK3B9fiOJ888tnf1FywI=",
"owner": "mitchellh", "owner": "mitchellh",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "6ab09a96babc526ba9743ebab3f7863d140a73a5", "rev": "0ffd6ed7472e5fa79589c6bd7b8e1b8e290289ef",
"type": "github" "type": "github"
}, },
"original": { "original": {