Skip to content

Lightpanda: the headless browser designed for AI and automation

Fix linux build

Karl Seguindf7bde233d2b
diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml
index 6d52911b7..f6a6eaf09 100644
--- a/.github/actions/install/action.yml
+++ b/.github/actions/install/action.yml
@@ -41,6 +41,14 @@ runs:
# Zig version used from the `minimum_zig_version` field in build.zig.zon
- uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
+ # Zig 0.16 writes fetched .zip archives to <global cache>/tmp but no longer
+ # creates that directory, so zip dependencies (sqlite amalgamation) fail
+ # with "failed to create temporary zip file: FileNotFound" on the fresh
+ # cache dir setup-zig points ZIG_GLOBAL_CACHE_DIR at.
+ - name: Zig 0.16 zip-fetch workaround
+ shell: bash
+ run: mkdir -p "${ZIG_GLOBAL_CACHE_DIR:-$HOME/.cache/zig}/tmp"
+
# Rust Toolchain for html5ever
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
with:
diff --git a/src/sys/net.zig b/src/sys/net.zig
index 2d3f1ae2d..30b4a9446 100644
--- a/src/sys/net.zig
+++ b/src/sys/net.zig
@@ -98,7 +98,7 @@ pub fn socket(domain: u32, socket_type: u32, protocol: u32) !socket_t {
// SOCK.NONBLOCK/CLOEXEC are Zig-invented shim values); strip them and
// apply via fcntl instead. Linux/FreeBSD accept them natively.
const flag_bits = posix.SOCK.NONBLOCK | posix.SOCK.CLOEXEC;
- const extra = if (comptime builtin.os.tag.isDarwin()) socket_type & flag_bits else 0;
+ const extra: u32 = if (comptime builtin.os.tag.isDarwin()) socket_type & flag_bits else 0;
const rc = c.socket(domain, socket_type & ~extra, protocol);
if (rc < 0) {
return errnoError(c.errno(rc));