From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cPBJFGUH6WH+fwEAgWs5BA (envelope-from ) for ; Thu, 20 Jan 2022 07:55:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iDCkEWUH6WH69wAA9RJhRA (envelope-from ) for ; Thu, 20 Jan 2022 07:55:33 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7F60D33168 for ; Thu, 20 Jan 2022 07:55:32 +0100 (CET) Received: from localhost ([::1]:43594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nARM3-0001fA-4C for larch@yhetil.org; Thu, 20 Jan 2022 01:55:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nARGk-0001Ul-Nb for guix-patches@gnu.org; Thu, 20 Jan 2022 01:50:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34968) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nARGj-00052J-Uw for guix-patches@gnu.org; Thu, 20 Jan 2022 01:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nARGj-0003ek-Pc for guix-patches@gnu.org; Thu, 20 Jan 2022 01:50:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53350] [PATCH] gnu: zig: Update to 0.9.0 Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 20 Jan 2022 06:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53350 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Calum Irwin Cc: 53350@debbugs.gnu.org Received: via spool by 53350-submit@debbugs.gnu.org id=B53350.164266137914021 (code B ref 53350); Thu, 20 Jan 2022 06:50:01 +0000 Received: (at 53350) by debbugs.gnu.org; 20 Jan 2022 06:49:39 +0000 Received: from localhost ([127.0.0.1]:56104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nARGM-0003e4-Kj for submit@debbugs.gnu.org; Thu, 20 Jan 2022 01:49:39 -0500 Received: from mout01.posteo.de ([185.67.36.65]:54407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nARGK-0003dq-0S for 53350@debbugs.gnu.org; Thu, 20 Jan 2022 01:49:37 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id DF81E240028 for <53350@debbugs.gnu.org>; Thu, 20 Jan 2022 07:49:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1642661369; bh=vlYkEzTrGrftitCNVq/JF5rcF45/GFvhM8j6l/EZt4U=; h=From:To:Cc:Subject:Date:From; b=rp+VCYTpDU4tRIWfkJZrOAdq9wZaXMr9p1at5xZHHl5fNg+wJJvX7iCHB0030Pnki vm0t+1gv99kBIGDviFy47sAme4FM1HxX3c2WV8AeGVbTUja4h3VH8cTC7818OGTn5K Sw97nyPvN/O5z1svpLbXhWMIFhpv4Y/C1h6ymoOkkjiX/EXiKlKqOpghFxYvDePGDW 2oOujya8fe4hToomOpbttspeUXGhAeKtNsp9vo1yBZY2GovMM56xxxpbK0puByD101 7CyoHQSE9a97MNnYpyGLz1ANscJ3VL3PsvefkxkHzy0GM2PnM2I+NP095RgaxQC/lS KEH2O6TWgyqWQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4JfY5h4qQsz6tmG; Thu, 20 Jan 2022 07:49:28 +0100 (CET) References: <20220119081125.2487-1-calumirwin1@gmail.com> From: pukkamustard Date: Thu, 20 Jan 2022 06:45:38 +0000 In-reply-to: <20220119081125.2487-1-calumirwin1@gmail.com> Message-ID: <86h79yucjs.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642661732; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=g9GI6vkZBkailZz1Ln+KN8XuqMsEMiQqdKW5jTwLJ9o=; b=TuEOITLXEeziLJPeWZi0SYs8fzRoRiVFa+rLa+5uLhqTZWxH8YR9JIv/cUMoVDKTE5Se1F +S/BBZZeryRw8AAn7/aZ5UuKXLKk9c7K4w8faedXU42+jNCQmvH7BePtiBF9QkIZL/+2qO gH8NAEHCExxbQ7zynvqVLrtLaXBMFXnTHXpyyIqRGXg0kF05DmGtzTslup90tZdmmSjSaX sPOWarP20MCQmIeKCToa6ILz8IxvNPq+Y+nSwsxYFJjdiObG+VZ5O/UqCNx3sbxn9vE6IF 8xt6BMfzou56XuG2LhnkvrbkhD7LjV5REWDHfbUDrVypKiOvsGyG1DNhWTxPgQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642661732; a=rsa-sha256; cv=none; b=uCjLE4ZW/kI/kgS7uEOfbQXV9HLXlv4iSTRPCe9Fp/h6y2x1HPMEOsnGB1rhNLfLz0hsTc lEQPUXEpi5UJ5bCNGFDeUU1/4BqrAJcC4EUFTIHFytUmPk+2uTwGCxe1dYB7WGiDOkdzgV sykjB3qdpVrCRC8TUTej64f525sqKWXKp3yfiQDJfwQE4G1p2opp4aSUdvO0Hb/xXudH+a /qwkLBnBpcnPYD7rl7mimgywXjxKTmK/o7qJlTvUapE6tQITXiw+XGlxQd0F1PVSZttGGZ UC8J2ramwyfjDOm6GhlhQChynIa7FpDwnK+PrW3QGA/4CycFTEX1/M6iomWXaw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=rp+VCYTp; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.82 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=rp+VCYTp; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 7F60D33168 X-Spam-Score: -3.82 X-Migadu-Scanner: scn0.migadu.com X-TUID: tYVfDMwpcQfO Hi, I can't comment on the changes to the *.patch changes but I can confirm that it builds and seems to be working fine. Thanks! -pukkamustard Calum Irwin writes: > * gnu/packages/patches/zig-disable-libc-note-test.patch: Move patch chang= es to new file. > * gnu/packages/patches/zig-use-system-paths.patch: Update line numbers. > * gnu/packages/zig.scm: Update to 0.9.0 > --- > .../patches/zig-disable-libc-note-test.patch | 32 +-- > .../patches/zig-use-system-paths.patch | 261 +++++++++--------- > gnu/packages/zig.scm | 11 +- > 3 files changed, 152 insertions(+), 152 deletions(-) > > diff --git a/gnu/packages/patches/zig-disable-libc-note-test.patch b/gnu/= packages/patches/zig-disable-libc-note-test.patch > index 4d76139efb..b2c57cb571 100644 > --- a/gnu/packages/patches/zig-disable-libc-note-test.patch > +++ b/gnu/packages/patches/zig-disable-libc-note-test.patch > @@ -1,14 +1,12 @@ > -This test fails with "error.CompilationIncorrectlySucceeded". > - > diff --git a/test/compile_errors.zig b/test/compile_errors.zig > -index fd1255c..20d5548 100644 > +index b1eaa0302..621f9db0a 100644 > --- a/test/compile_errors.zig > +++ b/test/compile_errors.zig > -@@ -2751,15 +2751,15 @@ pub fn addCases(cases: *tests.CompileErrorContex= t) void { > +@@ -2943,15 +2943,15 @@ pub fn addCases(ctx: *TestContext) !void { > "tmp.zig:3:5: error: dependency on libc must be explicitly = specified in the build command", > }); > - > -- cases.addTest("libc headers note", > +=20 > +- ctx.testErrStage1("libc headers note", > - \\const c =3D @cImport(@cInclude("stdio.h")); > - \\export fn entry() void { > - \\ _ =3D c.printf("hello, world!\n"); > @@ -17,15 +15,15 @@ index fd1255c..20d5548 100644 > - "tmp.zig:1:11: error: C import failed", > - "tmp.zig:1:11: note: libc headers not available; compilatio= n does not link against libc", > - }); > -+// cases.addTest("libc headers note", > -+// \\const c =3D @cImport(@cInclude("stdio.h")); > -+// \\export fn entry() void { > -+// \\ _ =3D c.printf("hello, world!\n"); > -+// \\} > -+// , &[_][]const u8{ > -+// "tmp.zig:1:11: error: C import failed", > -+// "tmp.zig:1:11: note: libc headers not available; compilat= ion does not link against libc", > -+// }); > ++ // ctx.testErrStage1("libc headers note", > ++ // \\const c =3D @cImport(@cInclude("stdio.h")); > ++ // \\export fn entry() void { > ++ // \\ _ =3D c.printf("hello, world!\n"); > ++ // \\} > ++ // , &[_][]const u8{ > ++ // "tmp.zig:1:11: error: C import failed", > ++ // "tmp.zig:1:11: note: libc headers not available; compila= tion does not link against libc", > ++ // }); > } > - > - cases.addTest("comptime vector overflow shows the index", > +=20 > + ctx.testErrStage1("comptime vector overflow shows the index", > diff --git a/gnu/packages/patches/zig-use-system-paths.patch b/gnu/packag= es/patches/zig-use-system-paths.patch > index 33b7da1e0d..0a3cbb0e92 100644 > --- a/gnu/packages/patches/zig-use-system-paths.patch > +++ b/gnu/packages/patches/zig-use-system-paths.patch > @@ -1,143 +1,144 @@ > -This patch replaces the OS-specific detection mechanism by one that sole= ly > -relies on environment variables. This has the benefit that said environ= ment > -variables can be used as search paths in Guix. > - > -Index: zig-0.8.1/lib/std/zig/system.zig > -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > ---- zig-0.8.1.orig/lib/std/zig/system.zig > -+++ zig-0.8.1/lib/std/zig/system.zig > -@@ -39,101 +39,57 @@ pub const NativePaths =3D struct { > - }; > - errdefer self.deinit(); > - > -- var is_nix =3D false; > -- if (process.getEnvVarOwned(allocator, "NIX_CFLAGS_COMPILE")) |n= ix_cflags_compile| { > -- defer allocator.free(nix_cflags_compile); > +diff --git a/lib/std/zig/system/NativePaths.zig b/lib/std/zig/system/Nat= ivePaths.zig > +index 8e3e46e48..1ed9d3206 100644 > +--- a/lib/std/zig/system/NativePaths.zig > ++++ b/lib/std/zig/system/NativePaths.zig > +@@ -26,73 +26,42 @@ pub fn detect(allocator: Allocator, native_info: Nat= iveTargetInfo) !NativePaths > + }; > + errdefer self.deinit(); > +=20 > +- var is_nix =3D false; > +- if (process.getEnvVarOwned(allocator, "NIX_CFLAGS_COMPILE")) |nix_c= flags_compile| { > +- defer allocator.free(nix_cflags_compile); > - > -- is_nix =3D true; > -- var it =3D mem.tokenize(nix_cflags_compile, " "); > -+ // TODO: Support cross-compile paths? > -+ if (process.getEnvVarOwned(allocator, "C_INCLUDE_PATH")) |c_inc= lude_path| { > -+ defer allocator.free(c_include_path); > -+ var it =3D mem.tokenize(c_include_path, ":"); > - while (true) { > -- const word =3D it.next() orelse break; > -- if (mem.eql(u8, word, "-isystem")) { > -- const include_path =3D it.next() orelse { > -- try self.addWarning("Expected argument after -i= system in NIX_CFLAGS_COMPILE"); > -- break; > -- }; > -- try self.addIncludeDir(include_path); > -- } else { > -- if (mem.startsWith(u8, word, "-frandom-seed=3D")) { > -- continue; > -- } > -- try self.addWarningFmt("Unrecognized C flag from NI= X_CFLAGS_COMPILE: {s}", .{word}); > +- is_nix =3D true; > +- var it =3D mem.tokenize(u8, nix_cflags_compile, " "); > ++ // TODO: Support cross-compile paths? > ++ if (process.getEnvVarOwned(allocator, "C_INCLUDE_PATH")) |c_include= _path| { > ++ defer allocator.free(c_include_path); > ++ var it =3D mem.tokenize(u8, c_include_path, ":"); > + while (true) { > +- const word =3D it.next() orelse break; > +- if (mem.eql(u8, word, "-isystem")) { > +- const include_path =3D it.next() orelse { > +- try self.addWarning("Expected argument after -isyst= em in NIX_CFLAGS_COMPILE"); > +- break; > +- }; > +- try self.addIncludeDir(include_path); > +- } else { > +- if (mem.startsWith(u8, word, "-frandom-seed=3D")) { > +- continue; > - } > -+ const dir =3D it.next() orelse break; > -+ try self.addIncludeDir(dir); > - } > - } else |err| switch (err) { > - error.InvalidUtf8 =3D> {}, > - error.EnvironmentVariableNotFound =3D> {}, > - error.OutOfMemory =3D> |e| return e, > +- try self.addWarningFmt("Unrecognized C flag from NIX_CF= LAGS_COMPILE: {s}", .{word}); > +- } > ++ const dir =3D it.next() orelse break; > ++ try self.addIncludeDir(dir); > } > -- if (process.getEnvVarOwned(allocator, "NIX_LDFLAGS")) |nix_ldfl= ags| { > -- defer allocator.free(nix_ldflags); > - > -- is_nix =3D true; > -- var it =3D mem.tokenize(nix_ldflags, " "); > -+ if (process.getEnvVarOwned(allocator, "CPLUS_INCLUDE_PATH")) |c= plus_include_path| { > -+ defer allocator.free(cplus_include_path); > -+ var it =3D mem.tokenize(cplus_include_path, ":"); > - while (true) { > -- const word =3D it.next() orelse break; > -- if (mem.eql(u8, word, "-rpath")) { > -- const rpath =3D it.next() orelse { > -- try self.addWarning("Expected argument after -r= path in NIX_LDFLAGS"); > -- break; > -- }; > -- try self.addRPath(rpath); > -- } else if (word.len > 2 and word[0] =3D=3D '-' and word= [1] =3D=3D 'L') { > -- const lib_path =3D word[2..]; > -- try self.addLibDir(lib_path); > -- } else { > -- try self.addWarningFmt("Unrecognized C flag from NI= X_LDFLAGS: {s}", .{word}); > + } else |err| switch (err) { > + error.InvalidUtf8 =3D> {}, > + error.EnvironmentVariableNotFound =3D> {}, > + error.OutOfMemory =3D> |e| return e, > + } > +- if (process.getEnvVarOwned(allocator, "NIX_LDFLAGS")) |nix_ldflags|= { > +- defer allocator.free(nix_ldflags); > +- > +- is_nix =3D true; > +- var it =3D mem.tokenize(u8, nix_ldflags, " "); > ++ if (process.getEnvVarOwned(allocator, "CPLUS_INCLUDE_PATH")) |cplus= _include_path| { > ++ defer allocator.free(cplus_include_path); > ++ var it =3D mem.tokenize(u8, cplus_include_path, ":"); > + while (true) { > +- const word =3D it.next() orelse break; > +- if (mem.eql(u8, word, "-rpath")) { > +- const rpath =3D it.next() orelse { > +- try self.addWarning("Expected argument after -rpath= in NIX_LDFLAGS"); > - break; > -- } > -+ const dir =3D it.next() orelse break; > -+ try self.addIncludeDir(dir); > - } > - } else |err| switch (err) { > - error.InvalidUtf8 =3D> {}, > - error.EnvironmentVariableNotFound =3D> {}, > - error.OutOfMemory =3D> |e| return e, > +- }; > +- try self.addRPath(rpath); > +- } else if (word.len > 2 and word[0] =3D=3D '-' and word[1] = =3D=3D 'L') { > +- const lib_path =3D word[2..]; > +- try self.addLibDir(lib_path); > +- } else { > +- try self.addWarningFmt("Unrecognized C flag from NIX_LD= FLAGS: {s}", .{word}); > +- break; > +- } > ++ const dir =3D it.next() orelse break; > ++ try self.addIncludeDir(dir); > } > -- if (is_nix) { > -- return self; > -- } > + } else |err| switch (err) { > + error.InvalidUtf8 =3D> {}, > + error.EnvironmentVariableNotFound =3D> {}, > + error.OutOfMemory =3D> |e| return e, > + } > +- if (is_nix) { > +- return self; > +- } > - > -- if (comptime Target.current.isDarwin()) { > -- try self.addIncludeDir("/usr/include"); > -- try self.addIncludeDir("/usr/local/include"); > - > -- try self.addLibDir("/usr/lib"); > -- try self.addLibDir("/usr/local/lib"); > +- if (comptime builtin.target.isDarwin()) { > +- try self.addIncludeDir("/usr/include"); > +- try self.addIncludeDir("/usr/local/include"); > - > -- try self.addFrameworkDir("/Library/Frameworks"); > -- try self.addFrameworkDir("/System/Library/Frameworks"); > +- try self.addLibDir("/usr/lib"); > +- try self.addLibDir("/usr/local/lib"); > - > -- return self; > -+ if (process.getEnvVarOwned(allocator, "LIBRARY_PATH")) |library= _path| { > -+ defer allocator.free(library_path); > -+ var it =3D mem.tokenize(library_path, ":"); > -+ while (true) { > -+ const dir =3D it.next() orelse break; > -+ try self.addLibDir(dir); > -+ } > -+ } else |err| switch (err) { > -+ error.InvalidUtf8 =3D> {}, > -+ error.EnvironmentVariableNotFound =3D> {}, > -+ error.OutOfMemory =3D> |e| return e, > - } > - > -- if (native_target.os.tag !=3D .windows) { > -- const triple =3D try native_target.linuxTriple(allocator); > -- const qual =3D native_target.cpu.arch.ptrBitWidth(); > +- try self.addFrameworkDir("/Library/Frameworks"); > +- try self.addFrameworkDir("/System/Library/Frameworks"); > - > -- // TODO: $ ld --verbose | grep SEARCH_DIR > -- // the output contains some paths that end with lib64, mayb= e include them too? > -- // TODO: what is the best possible order of things? > -- // TODO: some of these are suspect and should only be added= on some systems. audit needed. > +- return self; > ++ if (process.getEnvVarOwned(allocator, "LIBRARY_PATH")) |library_pat= h| { > ++ defer allocator.free(library_path); > ++ var it =3D mem.tokenize(u8, library_path, ":"); > ++ while (true) { > ++ const dir =3D it.next() orelse break; > ++ try self.addLibDir(dir); > ++ } > ++ } else |err| switch (err) { > ++ error.InvalidUtf8 =3D> {}, > ++ error.EnvironmentVariableNotFound =3D> {}, > ++ error.OutOfMemory =3D> |e| return e, > + } > +=20 > + if (comptime native_target.os.tag =3D=3D .solaris) { > +@@ -106,32 +75,17 @@ pub fn detect(allocator: Allocator, native_info: Na= tiveTargetInfo) !NativePaths > + return self; > + } > +=20 > +- if (native_target.os.tag !=3D .windows) { > +- const triple =3D try native_target.linuxTriple(allocator); > +- const qual =3D native_target.cpu.arch.ptrBitWidth(); > - > -- try self.addIncludeDir("/usr/local/include"); > -- try self.addLibDirFmt("/usr/local/lib{d}", .{qual}); > -- try self.addLibDir("/usr/local/lib"); > +- // TODO: $ ld --verbose | grep SEARCH_DIR > +- // the output contains some paths that end with lib64, maybe in= clude them too? > +- // TODO: what is the best possible order of things? > +- // TODO: some of these are suspect and should only be added on = some systems. audit needed. > - > -- try self.addIncludeDirFmt("/usr/include/{s}", .{triple}); > -- try self.addLibDirFmt("/usr/lib/{s}", .{triple}); > +- try self.addIncludeDir("/usr/local/include"); > +- try self.addLibDirFmt("/usr/local/lib{d}", .{qual}); > +- try self.addLibDir("/usr/local/lib"); > - > -- try self.addIncludeDir("/usr/include"); > -- try self.addLibDirFmt("/lib{d}", .{qual}); > -- try self.addLibDir("/lib"); > -- try self.addLibDirFmt("/usr/lib{d}", .{qual}); > -- try self.addLibDir("/usr/lib"); > +- try self.addIncludeDirFmt("/usr/include/{s}", .{triple}); > +- try self.addLibDirFmt("/usr/lib/{s}", .{triple}); > - > -- // example: on a 64-bit debian-based linux distro, with zli= b installed from apt: > -- // zlib.h is in /usr/include (added above) > -- // libz.so.1 is in /lib/x86_64-linux-gnu (added here) > -- try self.addLibDirFmt("/lib/{s}", .{triple}); > -+ if (process.getEnvVarOwned(allocator, "DYLD_FRAMEWORK_PATH")) |= dyld_framework_path| { > -+ defer allocator.free(dyld_framework_path); > -+ var it =3D mem.tokenize(dyld_framework_path, ":"); > -+ while (true) { > -+ const dir =3D it.next() orelse break; > -+ try self.addFrameworkDir(dir); > -+ } > -+ } else |err| switch (err) { > -+ error.InvalidUtf8 =3D> {}, > -+ error.EnvironmentVariableNotFound =3D> {}, > -+ error.OutOfMemory =3D> |e| return e, > - } > - > - return self; > +- try self.addIncludeDir("/usr/include"); > +- try self.addLibDirFmt("/lib{d}", .{qual}); > +- try self.addLibDir("/lib"); > +- try self.addLibDirFmt("/usr/lib{d}", .{qual}); > +- try self.addLibDir("/usr/lib"); > +- > +- // example: on a 64-bit debian-based linux distro, with zlib in= stalled from apt: > +- // zlib.h is in /usr/include (added above) > +- // libz.so.1 is in /lib/x86_64-linux-gnu (added here) > +- try self.addLibDirFmt("/lib/{s}", .{triple}); > ++ if (process.getEnvVarOwned(allocator, "DYLD_FRAMEWORK_PATH")) |dyld= _framework_path| { > ++ defer allocator.free(dyld_framework_path); > ++ var it =3D mem.tokenize(u8, dyld_framework_path, ":"); > ++ while (true) { > ++ const dir =3D it.next() orelse break; > ++ try self.addFrameworkDir(dir); > ++ } > ++ } else |err| switch (err) { > ++ error.InvalidUtf8 =3D> {}, > ++ error.EnvironmentVariableNotFound =3D> {}, > ++ error.OutOfMemory =3D> |e| return e, > + } > +=20 > + return self; > diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm > index 9cd869389b..b3de72226b 100644 > --- a/gnu/packages/zig.scm > +++ b/gnu/packages/zig.scm > @@ -1,6 +1,7 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright =C2=A9 2021 Liliana Marie Prikler > ;;; Copyright =C2=A9 2021 Sarah Morgensen > +;;; Copyright =C2=A9 2021 Calum Irwin > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -28,7 +29,7 @@ (define-module (gnu packages zig) > (define-public zig > (package > (name "zig") > - (version "0.8.1") > + (version "0.9.0") > (source > (origin > (method git-fetch) > @@ -37,18 +38,18 @@ (define-public zig > (commit version))) > (file-name (git-file-name name version)) > (sha256 > - (base32 "147qx7xgj0r353wh5ragzn6kmm1vrf31i8038z3zqwjnqqgqxi6c")) > + (base32 "1zdz5s434c48z3y0c8l9wm2z1gxa7yyzd53zmr68lwj6mcl7by8x")) > (patches > (search-patches > "zig-disable-libc-note-test.patch" > "zig-use-system-paths.patch")))) > (build-system cmake-build-system) > (inputs > - (list clang-12 ; Clang propagates llvm. > - lld-12)) > + (list clang-13 ; Clang propagates llvm. > + lld)) > ;; Zig compiles fine with GCC, but also needs native LLVM libraries. > (native-inputs > - (list llvm-12)) > + (list llvm-13)) > (arguments > `(#:configure-flags > (list ,@(if (%current-target-system)