From patchwork Wed Apr 13 12:00:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Attila Lendvai X-Patchwork-Id: 38556 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 15E1127BBEA; Wed, 13 Apr 2022 13:03:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9D59A27BBE9 for ; Wed, 13 Apr 2022 13:03:11 +0100 (BST) Received: from localhost ([::1]:44006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nebiI-0004h4-Og for patchwork@mira.cbaines.net; Wed, 13 Apr 2022 08:03:10 -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 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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)