From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id gNG+OsDvTmfKQwAAe85BDQ:P1 (envelope-from ) for ; Tue, 03 Dec 2024 11:47:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id gNG+OsDvTmfKQwAAe85BDQ (envelope-from ) for ; Tue, 03 Dec 2024 12:47:13 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=kJJP9djL; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="SB/tBbCT"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733226432; a=rsa-sha256; cv=none; b=QL7eotvpRY+JH0DZUfs5gUpowQ8GF/HQ1OD99oALlhHt94+nOoroVm7SPsulit67pnAxA1 5gRGk27SSKAewVx+Xhob6WMBt2FLEgO/ySUgm3xcEu6lKBigemYUMEUUXRHife89PN8Veb 5FMeK8ucujOTponPTh3r58SVOCOqFlD9G7owQQD4o8+D7zjDFn6voOy4u6GEIeRjuqnVWa ULyOubrxqmThAz61LUGQ5vJrAn66CGdq9Uf6NYBmZwiIK/p36Gs4QMqVI75SNtYWOXP6yi le4xf3xB7C6YMpMZ1kyQgyT6er/KoXs/TyMcqjqB0M2fowBOJfHoWUXRFa/zDQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=kJJP9djL; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="SB/tBbCT"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733226432; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=riQNr9g+DqbhOPxi9tHYRqYy4JglPhTCjl498FFL7Hk=; b=Fct4ZevlkUTSv9TIKkgBi3CLrFhmgMDqs9DbPwlTrlMYv5FKKyoH0l3pTShmUlHVa5D+ah G+OM/DaCSALPTRU0Jl/PCqFVOGZVL9cjnKpzuWMqpQ/duGdfBBiA9ltUeyB1glQk06QHEB 51fx0AyBVWPUhQI7UZFl10xqeysiV3rlRLowMLQQrtZ/5y+blOu54n4KR5q7TZpiwfz1BP IOqpGJ7BQd1nPv6ww5o6ebLQpHAyAJCeBaI8a6Mo+kpb405YuIQNkh+RYRSmniMWw1k0JE y2MWinRghFsuiLh4CCPEMHoRJ0MYGf6DAgPBM0Gra8Yk9scE5gJisqYhzd77ZA== 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 926AE1C027 for ; Tue, 03 Dec 2024 12:47:11 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIRMv-0001sQ-HL; Tue, 03 Dec 2024 06:47:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIRMs-0001s8-Vy for guix-patches@gnu.org; Tue, 03 Dec 2024 06:47:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIRMr-0001x9-R6 for guix-patches@gnu.org; Tue, 03 Dec 2024 06:47:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=riQNr9g+DqbhOPxi9tHYRqYy4JglPhTCjl498FFL7Hk=; b=kJJP9djLXv6TEZAXpohjVZ3LuyVwQWv1M+L7GU08Fdcd0lMJpF5YS2IeRLDyhaAM4nUaoBSBK4WGryjMFc/udQoCbe2OoZEuS1kJbGktUkQT+q+jjmZV2SXBNciCY3s5lZyXzclNTMSdPBlEheI7yZIiiAYwWtN2KErn9f8EqqIyMQYvFly8WSqJPi6vw8sRVLbFlS95kg9RLNwp1oVtmgHsfIjh27cU7UMMcN5C0JWWUW3ctr+ppgFe7AwPwJqF14TyQLNM75X2AVXuAwzEWH3Mcxlsf2VfiDsaYFpMOnL/6wAt+H1XWPungoFhWwkTe3Md5LsHL4oHaRXjkwLzBw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tIRMr-0001V5-Kx; Tue, 03 Dec 2024 06:47:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74668] [PATCH 1/2] build: go-build-system: Relax build verbosity. Resent-From: Sharlatan Hellseher Original-Sender: "Debbugs-submit" Resent-CC: cox.katherine.e+guix@gmail.com, sharlatanus@gmail.com, guix-patches@gnu.org Resent-Date: Tue, 03 Dec 2024 11:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74668 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74668@debbugs.gnu.org Cc: Sharlatan Hellseher , Katherine Cox-Buday , Sharlatan Hellseher X-Debbugs-Original-Xcc: Katherine Cox-Buday , Sharlatan Hellseher Received: via spool by 74668-submit@debbugs.gnu.org id=B74668.17332264015717 (code B ref 74668); Tue, 03 Dec 2024 11:47:01 +0000 Received: (at 74668) by debbugs.gnu.org; 3 Dec 2024 11:46:41 +0000 Received: from localhost ([127.0.0.1]:58474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIRMW-0001U6-UU for submit@debbugs.gnu.org; Tue, 03 Dec 2024 06:46:41 -0500 Received: from mail-wm1-f41.google.com ([209.85.128.41]:55652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIRMU-0001Tx-UD for 74668@debbugs.gnu.org; Tue, 03 Dec 2024 06:46:39 -0500 Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-434a752140eso45394815e9.3 for <74668@debbugs.gnu.org>; Tue, 03 Dec 2024 03:46:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733226338; x=1733831138; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=riQNr9g+DqbhOPxi9tHYRqYy4JglPhTCjl498FFL7Hk=; b=SB/tBbCTPYeBwm6fYdhsBTE6DNg3A7aNu3DOMCSLguKaAzYyDwjDUqL4NRTn6EqZMC CMinrmzvZb11vmhdOwm72fPGwLRt9gM+ZqIXwcChkXQCEZFgZTAostlwoErkxFJ6oU9p EyfovI1FTCX/4UBirdsP/IZ1e7GBWxHcZt/qfCBQmduCxQu/9fFSId1eWMYNeEhyMW9o cCB99u7RMLPsevAXpj215IN4spsSigckbIk/vC0hXTPPfhp687c3G1zPbphuzs00znqq le2quNCVUI6tR/zr0YbzPishN8Pq2MMNjbkow/EyYVaBVK7vyQGkd+p9sSTT/43US6wX Co8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733226338; x=1733831138; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=riQNr9g+DqbhOPxi9tHYRqYy4JglPhTCjl498FFL7Hk=; b=cGbgIy60c7IcunSQhZBeTe2tBRnGuR/dYCjmbsxBuLkjRD2pZ60XwkGX79XY1aYooo 7kmDc3pITjo0S9Am6+KBHIq8q1+5zID73zv1n1Cbn6fCvNyk4H3mtMaTzIOpgI4kKxlb DJAUGHn13hlE1ct4uru74vulHUB2ZYx/Tfce87U1o94bIy+8qoH0OuK7036lq/gDvE3y PCpTjByFpOOXxqUxJdLNggcXk8PveRMCMxXWtED5MSB61qwmWK2eVpCn1arPhdzbm5S3 hcKV8/MUzjCbmfmMvOZSGJlUoZnVDeWMxBxE/VHSlZ3COCl3aY0Yn2Zi5LhJIJYlF1J1 y6mg== X-Gm-Message-State: AOJu0YwxOeuP5t4N1CCd7qxLQWDSzgAPqr9BtW78liQVmr3+GO2zQv5e u1lNuCnUrZ3AKHmLB6p6WYyQzfYt2BxxUSV9+5ThGLLxiHS5omr24kwjjF/M/sQ= X-Gm-Gg: ASbGncsxxGC3GxqZl9HIhxBg2rO0zv+PjyahiZHFhSfJZlmTjDP2RE1ZXfliDwob5JB PibsnNKa1ubrsf8tF+r23CLFgeIuzq9w4i5N5DGN3wmkTKMRhi9IgkWs5oXqCg0wawSsoXiumxx t53Ba3S0Vfu8/26SxdsWJeEWlWB5u/TSQFug/BCEWKuP0WGOQ0y1SAthjgF8SdxzGl9iQnzpz7j NmSjEjISumyQh5RGERNrFXcikh8Q1KOFnqeIN49ohD8l89CAQeDZCP5f9XGPJeOR8XglPo67fKx tDZXX7bbYbu0e2LRvnAzclDCzVXLQCskq0yZDAYGxA== X-Google-Smtp-Source: AGHT+IEAQQMdG/PeJMC6hqvGJuIBiZ0u6N8r0GOFp6rcEQdIRphnRY/eyZziUhPXy+Qt5iH/5YJU0A== X-Received: by 2002:a05:600c:3b1d:b0:431:44fe:fd9f with SMTP id 5b1f17b1804b1-434d0a0549dmr15520615e9.23.1733226337695; Tue, 03 Dec 2024 03:45:37 -0800 (PST) Received: from guxtil.incerto.xyz (cpc100684-bagu15-2-0-cust967.1-3.cable.virginm.net. [86.8.111.200]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434b9a9679bsm152903575e9.13.2024.12.03.03.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 03:45:37 -0800 (PST) From: Sharlatan Hellseher Date: Tue, 3 Dec 2024 11:45:33 +0000 Message-ID: <3ea6c0ae31e373d3eac4212dee0bc6b706765ee2.1733224617.git.sharlatanus@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -1.42 X-Spam-Score: -1.42 X-Migadu-Queue-Id: 926AE1C027 X-Migadu-Scanner: mx12.migadu.com X-TUID: 2Y/DbtELaXmo During the build phase "-x" option forces go compiler to generate quite a noisy build log which does not help too much when the build is failed. This change makes it optional and governed by #:verbosity key passed to `build' procedure. * guix/build/go-build-system.scm (build): Provide a link to online example. Consolidate options in GOFLAGS environment variable, make "-x" optional. Add description for "-trimpath" option. Change-Id: Icf1b03eb79db8a6f79f86f3cc212a53de5aa7c1c --- guix/build/go-build-system.scm | 40 +++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index e53d8cb53c..a463189011 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -283,23 +283,43 @@ (define (go-inputs inputs) (_ #f)) inputs)))) -(define* (build #:key import-path build-flags (parallel-build? #t) +(define* (build #:key + build-flags + import-path + (parallel-build? #t) + (verbosity 1) #:allow-other-keys) "Build the package named by IMPORT-PATH." - (let* ((njobs (if parallel-build? (parallel-job-count) 1))) + (let* ((njobs (if parallel-build? (parallel-job-count) 1)) + ;; Utilizing GOFLAGS for flexible build options passthrough, refer + ;; for more examples to online documentation of Golang + ;; . + (goflags (string-join + (list + ;; Print the name of packages (pathes) as they are compiled. + "-v" + ;; Print each command as it is invoked. When enabled, it + ;; generates a lot of noisy logs which makes identifying + ;; build failures harder to determine. + (if (> verbosity 1) "-x" "") + ;; Respectively, strip the symbol table and debug + ;; information, and the DWARF symbol table. + "-ldflags=-s -w" + ;; Remove all file system paths from the resulting + ;; executable. Instead of absolute file system paths, the + ;; recorded file names will begin either a module + ;; path@version (when using modules), or a plain import + ;; path (when using the standard library, or GOPATH). + "-trimpath") + " "))) + (setenv "GOFLAGS" goflags) (setenv "GOMAXPROCS" (number->string njobs))) (with-throw-handler #t (lambda _ - (apply invoke "go" "install" - "-v" ; print the name of packages as they are compiled - "-x" ; print each command as it is invoked - ;; Respectively, strip the symbol table and debug - ;; information, and the DWARF symbol table. - "-ldflags=-s -w" - "-trimpath" - `(,@build-flags ,import-path))) + (apply invoke "go" "install" `(,@build-flags ,import-path))) + (lambda (key . args) (display (string-append "Building '" import-path "' failed.\n" "Here are the results of `go env`:\n")) -- 2.46.0