From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4QWCE5UCPWHCHAEAgWs5BA (envelope-from ) for ; Sat, 11 Sep 2021 21:25:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id MJmgDpUCPWHRJgAAbx9fmQ (envelope-from ) for ; Sat, 11 Sep 2021 19:25:09 +0000 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 B864C2C176 for ; Sat, 11 Sep 2021 21:25:08 +0200 (CEST) Received: from localhost ([::1]:35392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mP8cd-0000ge-PP for larch@yhetil.org; Sat, 11 Sep 2021 15:25:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mP8cZ-0000g2-2m for guix-patches@gnu.org; Sat, 11 Sep 2021 15:25:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58128) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mP8cY-0001wo-Rf for guix-patches@gnu.org; Sat, 11 Sep 2021 15:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mP8cY-0002nC-OL for guix-patches@gnu.org; Sat, 11 Sep 2021 15:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47006] [WIP PATCH v2 2/2] gnu: Add zig. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 11 Sep 2021 19:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47006 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Prikler Cc: 47006@debbugs.gnu.org, 39480@debbugs.gnu.org, maximedevos@telenet.be, efraim@flashner.co.il Received: via spool by 47006-submit@debbugs.gnu.org id=B47006.163138829210708 (code B ref 47006); Sat, 11 Sep 2021 19:25:02 +0000 Received: (at 47006) by debbugs.gnu.org; 11 Sep 2021 19:24:52 +0000 Received: from localhost ([127.0.0.1]:41440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mP8cO-0002mY-0x for submit@debbugs.gnu.org; Sat, 11 Sep 2021 15:24:52 -0400 Received: from out0.migadu.com ([94.23.1.103]:55998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mP8cK-0002mG-QJ; Sat, 11 Sep 2021 15:24:50 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1631388287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gzCYYvAd5+ZAIn3f7jLDtonREpLW3t7EC1zuBrV9oY4=; b=hr6mZ7jA/J+IArkZNvbqPVVUuLVnWpObwRGqTQCYklII68GMF0Etja6KvQWMAqSf4MSWKt 0lt3PVckkQwPzsVWeofE8oy8Xa7i1kgQn5qXemqoMBVQaX5kclHAbhontPWWKkh3/KSKE7 k3SzUtnfdhb1fncKxw/x3nUZFIdIjSc= From: Sarah Morgensen References: <0f6c5b692df8d06a0d7adddc9e5abf93894a366f.1631226695.git.liliana.prikler@gmail.com> Date: Sat, 11 Sep 2021 12:24:39 -0700 In-Reply-To: (Liliana Prikler's message of "Thu, 9 Sep 2021 15:32:22 +0200 (2 days, 5 hours, 3 minutes ago)") Message-ID: <86wnnmnceg.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631388309; 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: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=gzCYYvAd5+ZAIn3f7jLDtonREpLW3t7EC1zuBrV9oY4=; b=QWM02E4IR7cijMKWD5NNBazWerTs6CF7un+Ml3kv4VpZt5OKNri1fp9aJLGqyYUSyRbsI7 yd/2fvm0DLcR0nPTcuMTg6HSVjkWATthS+zUg5v7nAfvpmaPsEdCMdB3Ej++NuO3VyWot7 UzUIWSC6Lr+bXhw7MFHSYjb35FwmDHqm6pn4te2Y298/7Bav68hpV2SWpts6iw++SI7bWp BR59fr94LS/yWUDKFCzPWMk34yhKe/pX2Qsy+Sm0YNaolmGz2AuXO45+vHD+YUzJvuLR4P n5Q2cZTj7L7BY+YxYHc5QsFdwyea9sBOzs7zSLRMsZWTT2L1WXIpwCt00ESsuA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631388309; a=rsa-sha256; cv=none; b=Ij8SLPF+Vlz/oxPeS9VXrbiCgXDxm8xo2pPyDXRNQOjMV9fnVHmeMwFU4JQ1NiSo6dGheT /5lZmB+QH4NBkpuGK83KcA4Y3V7dT5bXM9BISvRRBmDp2jN9aEGkCGOLcGnlYYMk1ZK9cA 2w/9Qh1OTKtb/BNrKLibcB4KlvhwZhugVv6PzMzBZrZEIGJeCHAa0vePftoemH9dNtrOJo PgKwmNR3mWfLc+V3cmkfQh8LEOkCuljgF5Ib31t0/8z8JnXwzjV1lhJQrY04UD7JWX65Jn 9Je3qjtPMhPYSNtm5nVnFEZlfwZO2poZwTCjvqAf3NekO3aIhEYfXZfmAfm0Lw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=hr6mZ7jA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.19 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=hr6mZ7jA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: B864C2C176 X-Spam-Score: 0.19 X-Migadu-Scanner: scn0.migadu.com X-TUID: UOR3+mLdtCFr --=-=-= Content-Type: text/plain All, Apologies for the empty email earlier. That shows me for trying to send from mobile! Liliana, Liliana Prikler writes: > I've added a patch to use explicit search paths rather than whatever Zig used > before and tried fixing some (syntactic) errors with the tests, but was > unsuccesful, as there appear to be failing tests in the suite itself. Could > you have a look at the revised patch and check what flags you could add to > the check phase to make it meaningful? > > Btw. I haven't checked whether my cosmetic changes to #:configure-flags break > things or not. The end of the build phase puts a large amount of stress onto > my system that I'd like to avoid at this hour. I'm still working through the tests, but I did find one issue that has cropped up either from your patch or from the 0.7.1 -> 0.8.1 upgrade. This is from attempting to build tetris [0] (though I had to make a few syntax fixes, attached below, to build with 0.8.1): --8<---------------cut here---------------start------------->8--- Zig attempted to find the path to native system libc headers by executing this command: cc -E -Wp,-v -xc /dev/null error: unable to create compilation: UnableToSpawnCCompiler --8<---------------cut here---------------end--------------->8--- No combination of ZIG_LIB_DIRS and ZIG_INCLUDE_DIRS seems to fix it. Neither does --search-prefix. If I set CC=gcc, it works fine. But I think something changed such that it now has to fall back to this method of detection. I have no idea why. [0] https://github.com/andrewrk/tetris -- Sarah --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=build-tetris.patch Content-Description: build tetris diff --git a/src/all_shaders.zig b/src/all_shaders.zig index a855bba..fb7eac8 100644 --- a/src/all_shaders.zig +++ b/src/all_shaders.zig @@ -107,7 +107,7 @@ pub const ShaderProgram = struct { pub fn attribLocation(sp: ShaderProgram, name: [*]const u8) c.GLint { const id = c.glGetAttribLocation(sp.program_id, name); if (id == -1) { - panic("invalid attrib: {}\n", .{name}); + panic("invalid attrib: {*}\n", .{name}); } return id; } @@ -115,7 +115,7 @@ pub const ShaderProgram = struct { pub fn uniformLocation(sp: ShaderProgram, name: [*]const u8) c.GLint { const id = c.glGetUniformLocation(sp.program_id, name); if (id == -1) { - panic("invalid uniform: {}\n", .{name}); + panic("invalid uniform: {*}\n", .{name}); } return id; } @@ -169,7 +169,7 @@ pub const ShaderProgram = struct { c.glGetProgramiv(sp.program_id, c.GL_INFO_LOG_LENGTH, &error_size); const message = try c_allocator.alloc(u8, @intCast(usize, error_size)); c.glGetProgramInfoLog(sp.program_id, error_size, &error_size, message.ptr); - panic("Error linking shader program: {}\n", .{message.ptr}); + panic("Error linking shader program: {*}\n", .{message.ptr}); } pub fn destroy(sp: *ShaderProgram) void { @@ -205,5 +205,5 @@ fn initGlShader(source: []const u8, name: [*]const u8, kind: c.GLenum) !c.GLuint const message = try c_allocator.alloc(u8, @intCast(usize, error_size)); c.glGetShaderInfoLog(shader_id, error_size, &error_size, message.ptr); - panic("Error compiling {} shader:\n{}\n", .{ name, message.ptr }); + panic("Error compiling {*} shader:\n{*}\n", .{ name, message.ptr }); } diff --git a/src/debug_gl.zig b/src/debug_gl.zig index 2fdcda0..543202b 100644 --- a/src/debug_gl.zig +++ b/src/debug_gl.zig @@ -2,7 +2,7 @@ const c = @import("c.zig"); const std = @import("std"); const os = std.os; const panic = std.debug.panic; -const builtin = @import("builtin"); +const builtin = std.builtin; pub const is_on = if (builtin.mode == builtin.Mode.ReleaseFast) c.GL_FALSE else c.GL_TRUE; diff --git a/src/main.zig b/src/main.zig index fd83f8a..fa5f264 100644 --- a/src/main.zig +++ b/src/main.zig @@ -19,7 +19,7 @@ var static_geometry: StaticGeometry = undefined; var font: Spritesheet = undefined; fn errorCallback(err: c_int, description: [*c]const u8) callconv(.C) void { - panic("Error: {}\n", .{@as([*:0]const u8, description)}); + panic("Error: {s}\n", .{@as([*:0]const u8, description)}); } fn keyCallback(win: ?*c.GLFWwindow, key: c_int, scancode: c_int, action: c_int, mods: c_int) callconv(.C) void { @@ -95,9 +95,10 @@ pub fn main() !void { defer font.deinit(); var seed_bytes: [@sizeOf(u64)]u8 = undefined; - std.crypto.randomBytes(seed_bytes[0..]) catch |err| { - panic("unable to seed random number generator: {}", .{err}); - }; + std.crypto.random.bytes(seed_bytes[0..]); +// catch { +// panic("unable to seed random number generator", .{}); +// }; t.prng = std.rand.DefaultPrng.init(std.mem.readIntNative(u64, &seed_bytes)); t.rand = &t.prng.random; --=-=-=--