From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UMIqOwC8VmIwBAEAgWs5BA (envelope-from ) for ; Wed, 13 Apr 2022 14:03:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gFCnNwC8VmKEGQEAauVa8A (envelope-from ) for ; Wed, 13 Apr 2022 14:03:12 +0200 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 8A99326752 for ; Wed, 13 Apr 2022 14:03:12 +0200 (CEST) Received: from localhost ([::1]:44006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nebiJ-0004h4-IC for larch@yhetil.org; Wed, 13 Apr 2022 08:03:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nebiA-0004e1-Cn for guix-patches@gnu.org; Wed, 13 Apr 2022 08:03:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nebiA-0007d5-3F for guix-patches@gnu.org; Wed, 13 Apr 2022 08:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nebiA-00069Y-0o for guix-patches@gnu.org; Wed, 13 Apr 2022 08:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54906] [PATCH] build: go-build-system: Add support for #:skip-build? #t. Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 13 Apr 2022 12:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54906 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54906@debbugs.gnu.org Cc: Attila Lendvai X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164985132922317 (code B ref -1); Wed, 13 Apr 2022 12:03:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Apr 2022 12:02:09 +0000 Received: from localhost ([127.0.0.1]:51916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nebhJ-0005nd-9d for submit@debbugs.gnu.org; Wed, 13 Apr 2022 08:02:09 -0400 Received: from lists.gnu.org ([209.51.188.17]:58252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nebhG-0005lX-V8 for submit@debbugs.gnu.org; Wed, 13 Apr 2022 08:02:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nebhG-0003dj-Mk for guix-patches@gnu.org; Wed, 13 Apr 2022 08:02:06 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:41902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nebhB-0007Px-Ol for guix-patches@gnu.org; Wed, 13 Apr 2022 08:02:03 -0400 Received: by mail-ed1-x52d.google.com with SMTP id c6so2063688edn.8 for ; Wed, 13 Apr 2022 05:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JeSI6fuPGKZJDCgIekHd9o7xcsKQGehtEk2/PFCu+/o=; b=TI5P91nbtBSE1POLU3JkM4OWT1h9JZDGeORLeC9K/7rafms0k4EWB4skynDnrDp1ic C6mUX/KGLUXwyCwy/AMJkc8lk6boE9c45YU/g0O5wdE08f+ZkyEdlolRHjVmbaKhIVta HZrRg9A0AkKs45aYzjkXJpzozxlVQlHoW4inL/DPlnwKJejp292xtdi1qLHOsBiNOWIq HEwosrrsC2MRi/EgkUFweCMFcVQOtppXdnpfkwauDbqnPFqgEgVCglGLQY5WqWzY1D0K Hf0/xWDMdRSonB4VZ2GV0QzpGsd/VLNR6UzIspDSxuvNOL2GsYi0v5taHjiOeIXKWxmc mb/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=JeSI6fuPGKZJDCgIekHd9o7xcsKQGehtEk2/PFCu+/o=; b=DosXvzd/8EISKGU1KOjU0u3XgKdIyWVQs4/pb74jKtExbY2rioSFmUSjuZ6UKuhNvv vRlZIwNBVx68s6gTS7uc9umQn0SS8bCr0Gpa4ejj9bycO3T8tR93wzWkf2qHdIlwEeEy cfbteLIS/dc/orUnesTWQd50DbyodNKgl4oN+nBkiadtNIHQ3pYTbrSIxIxtilb02a3I djrmFw3exTefLicBQzwk213cPkqP2vwk/HzE95drUKzgmbA8DW/7FGS5CgUX3iQShqI1 7vZBkJ6SlAxnm7/9E3cu3niPsaNwj4C6EN8GTXdBjHC2QE8pRfg82oNtZvDIq7AsH4XO QF4Q== X-Gm-Message-State: AOAM5330cuI/9D1J/vyo1Pn9oTYxBRGQoY/9lK0NW8xJG/C5MySHQsWH 5lHpM+OeUa6ej0YQMXAvozvQAqRcfM0= X-Google-Smtp-Source: ABdhPJy4qSwP381G/TclHJCqfLoiB2X0LOvfPHHJsC/sxkSbB/jzvvDpvrydhbYaDMKL+GEd6kaVyA== X-Received: by 2002:a05:6402:f1c:b0:41d:8bc7:cd26 with SMTP id i28-20020a0564020f1c00b0041d8bc7cd26mr9938368eda.47.1649851319669; Wed, 13 Apr 2022 05:01:59 -0700 (PDT) Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu. [89.132.245.188]) by smtp.gmail.com with ESMTPSA id d19-20020a170906c21300b006e7f0730353sm11019882ejz.101.2022.04.13.05.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Apr 2022 05:01:58 -0700 (PDT) From: Attila Lendvai Date: Wed, 13 Apr 2022 14:00:42 +0200 Message-Id: <20220413120052.25602-1-attila@lendvai.name> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=attila.lendvai@gmail.com; helo=mail-ed1-x52d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1649851392; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=JeSI6fuPGKZJDCgIekHd9o7xcsKQGehtEk2/PFCu+/o=; b=DFmUAXd2ZANmytMcyhcNBEX1fPIyeCj++PbDd55/du9gwxiNBotdjynzQUBawwWvaQ8VOE tWKxFEvmudAOxfcBpqFd1nhtQiHAlyfveqdcg3eBcmp8LhH2aPswmUewXteNro5vGXLG+L CR87RhAEpi++cLbyQzEt+mwbv/COfr8FtSW87FyhL5Bty2kvF8jGZ0TnzNVDH120Uq29Yt ySXaSbu2zIjVJ2wKIzuncnOK7Yib+inkttFz2xl08HnDovRgRBSGxZau/EiGBkOwwcNHPQ iN0M5u7iFZNzbtg1dLsEO8IJwMzG6IaLN5tx/URNSoAvOiNmT1EzjC6wUi2MWg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1649851392; a=rsa-sha256; cv=none; b=jgo3B1kkTDm+LLxnsNCdgZmAfuSPPYmLrGc7OHhNB9spRMQGiJydTcp6SOXuUv+ysFFKAQ pC1uOUtrn/o4tu6XXNZNbR/eXuQy8JN6uuVfeLAMCROerYZ/Ay+fDXH+A32BnZvytuzY3k 3zZgO2n5cNtpRS8AgiVMHxw9CXmilJY2i+mx5a2Y6CPMtDyKQMIBZEfrxr03sK24BVxAjL cLbr+DOxh/s+Eyp+Tvw2nNyNmSAK08hT8fnSHPoG9mrP+FZyCeWkF3eZVJRxEecFDjMcR5 iEl3nPQiVuF8elLBCc4WDg+Vnsami0/4EJBNBBP8OfoFFe3MClriR9nx6ke/mw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=TI5P91nb; dmarc=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: 2.45 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=TI5P91nb; dmarc=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: 8A99326752 X-Spam-Score: 2.45 X-Migadu-Scanner: scn0.migadu.com X-TUID: eKSBwalR1TtR This mimics the same feature of the cargo-build-system. * guix/build-system/go.scm (go-build): Add skip-build? keyword param and propagate it. * guix/build/go-build-system.scm (build): Add skip-build? keyword param. --- guix/build-system/go.scm | 4 +++- guix/build/go-build-system.scm | 31 ++++++++++++++++--------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm index 5e0e5bbad3..6bcb3656be 100644 --- a/guix/build-system/go.scm +++ b/guix/build-system/go.scm @@ -175,6 +175,7 @@ (define* (go-build name inputs (import-path "") (unpack-path "") (build-flags ''()) + (skip-build? #f) (tests? #t) (allow-go-reference? #f) (system (%current-system)) @@ -205,7 +206,8 @@ (define builder #:import-path #$import-path #:unpack-path #$unpack-path #:build-flags #$build-flags - #:tests? #$tests? + #:skip-build? #$skip-build? + #:tests? #$(and tests? (not skip-build?)) #:allow-go-reference? #$allow-go-reference? #:inputs #$(input-tuples->gexp inputs))))) diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index 7f25e05d0d..637d66a6f1 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -254,22 +254,23 @@ (define (go-inputs inputs) (_ #f)) inputs)))) -(define* (build #:key import-path build-flags #:allow-other-keys) +(define* (build #:key skip-build? import-path build-flags #:allow-other-keys) "Build the package named by IMPORT-PATH." - (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" - `(,@build-flags ,import-path))) - (lambda (key . args) - (display (string-append "Building '" import-path "' failed.\n" - "Here are the results of `go env`:\n")) - (invoke "go" "env")))) + (or skip-build? + (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" + `(,@build-flags ,import-path))) + (lambda (key . args) + (display (string-append "Building '" import-path "' failed.\n" + "Here are the results of `go env`:\n")) + (invoke "go" "env"))))) ;; Can this also install commands??? (define* (check #:key tests? import-path #:allow-other-keys) -- 2.35.1