From edaafdf57ad413c8e19c9ffbfc9fd039b74ed169 Mon Sep 17 00:00:00 2001 From: Krzysztof Wolicki Date: Mon, 26 Feb 2024 18:00:43 +0100 Subject: [PATCH 1/4] build API change: update usage of addCSourceFiles --- pkg/fontconfig/build.zig | 2 +- pkg/freetype/build.zig | 2 +- pkg/glslang/build.zig | 6 +++--- pkg/highway/build.zig | 2 +- pkg/libpng/build.zig | 2 +- pkg/libxml2/build.zig | 2 +- pkg/oniguruma/build.zig | 2 +- pkg/pixman/build.zig | 2 +- pkg/spirv-cross/build.zig | 2 +- pkg/utf8proc/build.zig | 2 +- pkg/zlib/build.zig | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pkg/fontconfig/build.zig b/pkg/fontconfig/build.zig index a6c635e70..a43a2cb6e 100644 --- a/pkg/fontconfig/build.zig +++ b/pkg/fontconfig/build.zig @@ -157,7 +157,7 @@ pub fn build(b: *std.Build) !void { } lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .files = srcs, .flags = flags.items, }); diff --git a/pkg/freetype/build.zig b/pkg/freetype/build.zig index 8716c572a..d330140b6 100644 --- a/pkg/freetype/build.zig +++ b/pkg/freetype/build.zig @@ -46,7 +46,7 @@ pub fn build(b: *std.Build) !void { if (libpng_enabled) try flags.append("-DFT_CONFIG_OPTION_USE_PNG=1"); lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .files = srcs, .flags = flags.items, }); diff --git a/pkg/glslang/build.zig b/pkg/glslang/build.zig index 5baab1812..9dcae7b1e 100644 --- a/pkg/glslang/build.zig +++ b/pkg/glslang/build.zig @@ -66,7 +66,7 @@ fn buildGlslang( }); lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .flags = flags.items, .files = &.{ // GenericCodeGen @@ -125,7 +125,7 @@ fn buildGlslang( if (target.result.os.tag != .windows) { lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .flags = flags.items, .files = &.{ "glslang/OSDependent/Unix/ossource.cpp", @@ -133,7 +133,7 @@ fn buildGlslang( }); } else { lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .flags = flags.items, .files = &.{ "glslang/OSDependent/Windows/ossource.cpp", diff --git a/pkg/highway/build.zig b/pkg/highway/build.zig index 1b5157572..f086f0491 100644 --- a/pkg/highway/build.zig +++ b/pkg/highway/build.zig @@ -73,7 +73,7 @@ pub fn build(b: *std.Build) !void { lib.addCSourceFiles(.{ .flags = flags.items, .files = &.{"bridge.cpp"} }); lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .flags = flags.items, .files = &.{ "hwy/aligned_allocator.cc", diff --git a/pkg/libpng/build.zig b/pkg/libpng/build.zig index 5d37370dc..ee1846add 100644 --- a/pkg/libpng/build.zig +++ b/pkg/libpng/build.zig @@ -35,7 +35,7 @@ pub fn build(b: *std.Build) !void { }); lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .files = srcs, .flags = flags.items, }); diff --git a/pkg/libxml2/build.zig b/pkg/libxml2/build.zig index 19890dcb0..26c44fb92 100644 --- a/pkg/libxml2/build.zig +++ b/pkg/libxml2/build.zig @@ -95,7 +95,7 @@ pub fn build(b: *std.Build) !void { } lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .files = srcs, .flags = flags.items, }); diff --git a/pkg/oniguruma/build.zig b/pkg/oniguruma/build.zig index 0b5d43e83..e9f7bc546 100644 --- a/pkg/oniguruma/build.zig +++ b/pkg/oniguruma/build.zig @@ -71,7 +71,7 @@ fn buildOniguruma( defer flags.deinit(); try flags.appendSlice(&.{}); lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .flags = flags.items, .files = &.{ "src/regerror.c", diff --git a/pkg/pixman/build.zig b/pkg/pixman/build.zig index 42c514e9d..70f78e35e 100644 --- a/pkg/pixman/build.zig +++ b/pkg/pixman/build.zig @@ -57,7 +57,7 @@ pub fn build(b: *std.Build) !void { } lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .files = srcs, .flags = flags.items, }); diff --git a/pkg/spirv-cross/build.zig b/pkg/spirv-cross/build.zig index 37da13eee..a75c72346 100644 --- a/pkg/spirv-cross/build.zig +++ b/pkg/spirv-cross/build.zig @@ -58,7 +58,7 @@ fn buildSpirvCross( }); lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .flags = flags.items, .files = &.{ // Core diff --git a/pkg/utf8proc/build.zig b/pkg/utf8proc/build.zig index a29716983..1ee04ef9b 100644 --- a/pkg/utf8proc/build.zig +++ b/pkg/utf8proc/build.zig @@ -21,7 +21,7 @@ pub fn build(b: *std.Build) !void { try flags.append("-DUTF8PROC_EXPORTS"); defer flags.deinit(); lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .files = &.{"utf8proc.c"}, .flags = flags.items, }); diff --git a/pkg/zlib/build.zig b/pkg/zlib/build.zig index 7c7a5b4c9..334c3c59e 100644 --- a/pkg/zlib/build.zig +++ b/pkg/zlib/build.zig @@ -34,7 +34,7 @@ pub fn build(b: *std.Build) !void { "-DZ_HAVE_UNISTD_H", }); lib.addCSourceFiles(.{ - .dependency = upstream, + .root = upstream.path(""), .files = srcs, .flags = flags.items, }); From f4e8982e5c86bb2a37ef9b177d8ed4da9f0d943f Mon Sep 17 00:00:00 2001 From: Krzysztof Wolicki Date: Mon, 26 Feb 2024 18:01:06 +0100 Subject: [PATCH 2/4] Windows Utf8 -> Wtf8 --- src/os/homedir.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/homedir.zig b/src/os/homedir.zig index 854c7d62c..1542ab77e 100644 --- a/src/os/homedir.zig +++ b/src/os/homedir.zig @@ -88,7 +88,7 @@ fn homeWindows(buf: []u8) !?[]u8 { const fba = fba_instance.allocator(); const drive = std.process.getEnvVarOwned(fba, "HOMEDRIVE") catch |err| switch (err) { error.OutOfMemory => return Error.BufferTooSmall, - error.InvalidUtf8, error.EnvironmentVariableNotFound => return null, + error.InvalidWtf8, error.EnvironmentVariableNotFound => return null, }; // could shift the contents if this ever happens if (drive.ptr != buf.ptr) @panic("codebug"); @@ -101,7 +101,7 @@ fn homeWindows(buf: []u8) !?[]u8 { const fba = fba_instance.allocator(); const homepath = std.process.getEnvVarOwned(fba, "HOMEPATH") catch |err| switch (err) { error.OutOfMemory => return Error.BufferTooSmall, - error.InvalidUtf8, error.EnvironmentVariableNotFound => return null, + error.InvalidWtf8, error.EnvironmentVariableNotFound => return null, }; // could shift the contents if this ever happens if (homepath.ptr != path_buf.ptr) @panic("codebug"); From 737e7758e4a4951bf1af30bcef700087eba91d51 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 27 Feb 2024 08:57:31 -0800 Subject: [PATCH 3/4] update zig version --- build.zig | 2 +- flake.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.zig b/build.zig index 0d0fc931b..ff8f848af 100644 --- a/build.zig +++ b/build.zig @@ -24,7 +24,7 @@ const Command = @import("src/Command.zig"); // but we liberally update it. In the future, we'll be more careful about // using released versions so that package managers can integrate better. comptime { - const required_zig = "0.12.0-dev.2818+97290e0bf"; + const required_zig = "0.12.0-dev.3033+031f23117"; const current_zig = builtin.zig_version; const min_zig = std.SemanticVersion.parse(required_zig) catch unreachable; if (current_zig.order(min_zig) == .lt) { diff --git a/flake.lock b/flake.lock index 0e5a44698..3d277e651 100644 --- a/flake.lock +++ b/flake.lock @@ -194,11 +194,11 @@ ] }, "locked": { - "lastModified": 1708776432, - "narHash": "sha256-BgVtWuK4v0J0z+8wj2ww0T7M85NrknimOFDVp7Yx7XU=", + "lastModified": 1709035693, + "narHash": "sha256-ac5fR8n4RPjP5GHhFMdtUhdL6e/eFCxIOO+7UoP1B/g=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "14ec3b93067932906652567e01bfc171f72c750e", + "rev": "e1c418c2315adaeca6f27fd8919141eb7992866d", "type": "github" }, "original": { From 41f670eb9b9a84802999859252ee00045c09164e Mon Sep 17 00:00:00 2001 From: Chris Marchesi Date: Tue, 27 Feb 2024 10:59:39 -0800 Subject: [PATCH 4/4] nix: update nixpkgs-zig-0-12 This updates the nixpkgs-zig-0-12 to be in line with the current overlay Zig (0.12.0-dev.3033+031f23117). --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 3d277e651..fe78e4904 100644 --- a/flake.lock +++ b/flake.lock @@ -147,11 +147,11 @@ }, "nixpkgs-zig-0-12": { "locked": { - "lastModified": 1708536163, - "narHash": "sha256-UdGZLYXoIJRal/J/uYlMqPi27LE92wdsIHtDOWRVXhM=", + "lastModified": 1709060268, + "narHash": "sha256-IGt0MDqdojBXdE97ORxL2Pk5x4GHFEOc3G7tjsMXLfU=", "owner": "vancluever", "repo": "nixpkgs", - "rev": "aba18e2126357afc8a997c12dcf027517b7432b0", + "rev": "c7dc015475bd4ac5de01a04680aa08777879add1", "type": "github" }, "original": {