From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <help-guix-bounces+larch=yhetil.org@gnu.org>
Received: from mp10.migadu.com ([2001:41d0:403:58f0::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms8.migadu.com with LMTPS
	id oDCoLK7WQ2XFAgAAG6o9tA:P1
	(envelope-from <help-guix-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Thu, 02 Nov 2023 18:04:46 +0100
Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp10.migadu.com with LMTPS
	id oDCoLK7WQ2XFAgAAG6o9tA
	(envelope-from <help-guix-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Thu, 02 Nov 2023 18:04:46 +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 3A48139BAF
	for <larch@yhetil.org>; Thu,  2 Nov 2023 18:04:46 +0100 (CET)
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=gmail.com header.s=20230601 header.b=Md7u2DpR;
	dmarc=pass (policy=none) header.from=gmail.com;
	spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698944686; a=rsa-sha256; cv=none;
	b=BzIcr52v3jFM8HUq7fhUn+j+cyfd+VkINMhQlEabXPGeFRp5i1zIxmdO1pPYAwyLzT2lBd
	RZxUvei0w8BkxzWnARySXm0DrXszMfxbWvb6c2jv7himPD5Va1UvF49hnGIr56bsvRC8LO
	kQsIH6wjuHf10b5+tfk7B4Fm7eouX6RFGvC81SfHqoc1r6hYIzKD/eWgCWB3YibbKgzYty
	UFk4LxSQghd+ljOuIvcTHmlnu1HLPObBX2iGhMmx23jRAbfy+o/py8NKi/C7lNMq9Rhwzf
	ctuv5JZmidsL3lWnRkrN3fG/oF3BG2l6zOumjdx+wLiUVusAox2ie7zL0AMYTw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1698944686;
	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:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=9GRD6zMZXKzxdZ5bd/rmDEYCj4GgTixdB23RpheC4+M=;
	b=GgqDndYINCZZiuQ6IRXV7ArFRP84BM7glADkZRHE533+pF44Qip93D0mAFYw238NCuZbm9
	BFWAWXhuCfBLpRnUXBWQb9Fg/8BfB6qvtFtZtZfZDelCiOa9MeRQfgjb2nxc2f/Kt5FzSF
	9Gsn9TghcNUtV+5bWGl6Dqpq0uANPwR4/AI2EWpst5xQBSjSzOqxqbCDDoCLi3VG3/I2CX
	nbuqQhfRUgIoVw6WJFgIUFpvkaqvEfCFiVqXUSTUVDFHhdkmS5aikmr/Kdf0OGa9l8oAfT
	3qByQpjZb65dCQWQ1O77KhOmMOvTJ4bpX4uY54O+yydLwR3YGn09nxO4kVTAaA==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=gmail.com header.s=20230601 header.b=Md7u2DpR;
	dmarc=pass (policy=none) header.from=gmail.com;
	spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <help-guix-bounces@gnu.org>)
	id 1qyb5a-0002bx-Hq; Thu, 02 Nov 2023 13:02:38 -0400
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 <zimon.toutoune@gmail.com>)
 id 1qyb5Y-0002az-Bl
 for help-guix@gnu.org; Thu, 02 Nov 2023 13:02:36 -0400
Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <zimon.toutoune@gmail.com>)
 id 1qyb5W-0003ZD-7T
 for help-guix@gnu.org; Thu, 02 Nov 2023 13:02:36 -0400
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2c506d1798eso3928881fa.0
 for <help-guix@gnu.org>; Thu, 02 Nov 2023 10:02:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1698944552; x=1699549352; darn=gnu.org;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=9GRD6zMZXKzxdZ5bd/rmDEYCj4GgTixdB23RpheC4+M=;
 b=Md7u2DpRkrD21whtt/2B+i6CPiPBGOKRJB12jMYwTA1zjUHFRQK2gIW2/hCgXfCV6o
 avJC7D8fnADvpBldBgZPMA9tndyZr26Iq0jmzROXYsFor6kdrymX55iBg6YfA4gMFJpf
 /4lxeI4k05KNHlZT5zyqreBrgI3q5MrSlZbMBDGWJuPg/pjb8he14bR/uDLVhNplOcHq
 DrACql9t2zSR+GDFGqH/R6gc/L7alRECsIpLBUJEXqdwsdvQ/D2Csz4gYRzZ+ZWXmdds
 tniILDYb9Um9xjIGnPV6RNODYUsKt7vnH8aIh8af6GIUD0al0YCIdctjgi5ZPuycyhVY
 jAkg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1698944552; x=1699549352;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=9GRD6zMZXKzxdZ5bd/rmDEYCj4GgTixdB23RpheC4+M=;
 b=b6oOHnedZVuX7diE8+aC2FbXO0Tj2YncznF1AReAYDUCzXI7uCFJyLlzZ923qpuOat
 L4H4YUF3+EPO4/Spkf20kp0+q96MFbltG3LaOKo6vrfMg+ZlweIpT8UZjgBT8IfpSIya
 csbBr+w25P4IuVWx+UQCsG71hcQ1sK78bVq8A6/k2OjmtlLi2BCzpOTsaLfPe85GMqDv
 SK3eIvB1p2JMsA+W1KOhusA5ySJB7EmBrpUO9cE7Dplpl+7rnB55SPZuk8V4Go/7GRfP
 Xybt1B4mL0zE3wf/hUmAe99LxzKyoFCnkvmwtOcefBvB8sBl+Mtr0I1zrq/M9qsRq5Kd
 aftg==
X-Gm-Message-State: AOJu0YwpsDHKmCVjGkv7eKsN5vHTVF7fes2YzbzLSHTk/+nA86Z9JAEK
 EkcmeJ69h3ZkiObeb22MZ9CAJ8qNJgM=
X-Google-Smtp-Source: AGHT+IGHYm2LmfRXGbt+iCg6RJ1ZWEKc5QJqh/5ouuevfnjIR2AKA42r7RZmlAolOvjqV6Diqvj94A==
X-Received: by 2002:a05:651c:1a0e:b0:2c5:d49:ee9f with SMTP id
 by14-20020a05651c1a0e00b002c50d49ee9fmr16857228ljb.1.1698944551787; 
 Thu, 02 Nov 2023 10:02:31 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id
 p21-20020a05600c431500b00405d9a950a2sm3475259wme.28.2023.11.02.10.02.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 02 Nov 2023 10:02:31 -0700 (PDT)
From: Simon Tournier <zimon.toutoune@gmail.com>
To: Suhail <suhail@bayesians.ca>
Cc: Suhail <suhail@bayesians.ca>, Felix Lechner via <help-guix@gnu.org>,
 Julien Lepiller <julien@lepiller.eu>, Felix Lechner
 <felix.lechner@lease-up.com>
Subject: Re: Turning off tests leads to a different store item
In-Reply-To: <87r0l818ka.fsf@>
References: 
Date: Thu, 02 Nov 2023 18:02:18 +0100
Message-ID: <86y1fgm6lh.fsf@gmail.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2a00:1450:4864:20::233;
 envelope-from=zimon.toutoune@gmail.com; helo=mail-lj1-x233.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: help-guix@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <help-guix.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-guix>,
 <mailto:help-guix-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/help-guix>
List-Post: <mailto:help-guix@gnu.org>
List-Help: <mailto:help-guix-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-guix>,
 <mailto:help-guix-request@gnu.org?subject=subscribe>
Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org
Sender: help-guix-bounces+larch=yhetil.org@gnu.org
X-Migadu-Flow: FLOW_IN
X-Migadu-Country: US
X-Migadu-Scanner: mx11.migadu.com
X-Spam-Score: -9.42
X-Migadu-Queue-Id: 3A48139BAF
X-Migadu-Spam-Score: -9.42
X-TUID: 1o+K2qkUOONs

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi,

On Thu, 02 Nov 2023 at 15:25, Suhail <suhail@bayesians.ca> wrote:

> It certainly seems to be the case. Would you know the specific place(s)
> in the source code (in addition to guix/derivations.scm and
> guix/store.scm) that would be relevant for this discussion?

I guess all the build systems: guix/build/*.scm and
guix/build-system/*/scm too.


> On a related note, is Dolstra's phd thesis relevant for these aspects,
> or do you know if Guix diverges from Nix in some areas?

I do not know.


> Yes, with the test derivation being something like a "fixed-output
> derivation". [[info:guix#Derivations][From the manual]]:

No, it cannot be a =E2=80=9Cfixed-output=E2=80=9D derivation=E2=80=A6

> #+begin_quote
> Operations such as file downloads and version-control checkouts for
> which the expected content hash is known in advance are modeled as
> fixed-output derivations. Unlike regular derivations, the outputs of a
> fixed-output derivation are independent of its inputs=E2=80=94e.g., a sou=
rce
> code download produces the same result regardless of the download method
> and tools being used.
> #+end_quote

=E2=80=A6because we cannot know in advance the expected content hash of the
tests output.


> Perhaps not all. The thing that sets the "check" phase (#:tests?) apart
> from the rest is that it's an identity transform with a
> side-effect. i.e., it simply reports on the state of its input (i.e.,
> the build artifact) leaving the build artifact unchanged. The only other
> phase in the gnu-build-system that is similar to the "check phase" is
> the "validate-runpath phase".

I am not sure to follow.

Well, I wrote earlier:

        Well, from my understanding, get the same the store path for the sa=
me
        package built with or without its tests ...  would mean to have a
        derivation for building and another derivation =E2=80=93 referring =
to the
        former =E2=80=93 for testing.

And from my understanding, one solution would be to have something as
below.  One =E2=80=9Cobject=E2=80=9D for building and another =E2=80=9Cobje=
ct=E2=80=9D for testing.

    ( Here, I am using the same object namely <package> for the both;
just to make concrete the discussion. :-) )

The point is: we have two derivations; one for the build (without tests)
and another for the tests (without build).

--8<---------------cut here---------------start------------->8---
$ guix build -L . hi-test --no-grafts -K

The following derivations will be built:
  /gnu/store/=E2=80=A6-hi-test-2.10.drv
  /gnu/store/=E2=80=A6-hi-build-2.10.drv

building /gnu/store/=E2=80=A6-hi-build-2.10.drv...
starting phase `set-SOURCE-DATE-EPOCH'
phase `set-SOURCE-DATE-EPOCH' succeeded after 0.0 seconds
starting phase `set-paths'
phase `set-paths' succeeded after 0.0 seconds
starting phase `install-locale'
phase `install-locale' succeeded after 0.0 seconds
starting phase `unpack'
phase `unpack' succeeded after 0.0 seconds
starting phase `bootstrap'
phase `bootstrap' succeeded after 0.0 seconds
starting phase `patch-usr-bin-file'
phase `patch-usr-bin-file' succeeded after 0.1 seconds
starting phase `patch-source-shebangs'
phase `patch-source-shebangs' succeeded after 0.0 seconds
starting phase `configure'
phase `configure' succeeded after 14.8 seconds
starting phase `patch-generated-file-shebangs'
phase `patch-generated-file-shebangs' succeeded after 0.0 seconds

starting phase `build'

 =E2=80=A6 do stuff =E2=80=A6
=20
phase `build' succeeded after 1.2 seconds

starting phase `install'
phase `install' succeeded after 0.5 seconds
starting phase `patch-shebangs'
phase `patch-shebangs' succeeded after 0.0 seconds
starting phase `strip'
phase `strip' succeeded after 0.0 seconds
starting phase `validate-runpath'
phase `validate-runpath' succeeded after 0.0 seconds
starting phase `validate-documentation-location'
phase `validate-documentation-location' succeeded after 0.0 seconds
starting phase `delete-info-dir-file'
phase `delete-info-dir-file' succeeded after 0.0 seconds
starting phase `patch-dot-desktop-files'
phase `patch-dot-desktop-files' succeeded after 0.0 seconds
starting phase `make-dynamic-linker-cache'
starting phase `install-license-files'
phase `install-license-files' succeeded after 0.0 seconds
starting phase `reset-gzip-timestamps'
phase `reset-gzip-timestamps' succeeded after 0.0 seconds
starting phase `compress-documentation'
phase `compress-documentation' succeeded after 0.0 seconds
successfully built /gnu/store/=E2=80=A6-hi-build-2.10.drv


building /gnu/store/gnjj4hq5pk890l211b28nkd1dwx4z09k-hi-test-2.10.drv...
starting phase `set-SOURCE-DATE-EPOCH'
phase `set-SOURCE-DATE-EPOCH' succeeded after 0.0 seconds
starting phase `set-paths'
phase `set-paths' succeeded after 0.0 seconds
starting phase `install-locale'
phase `install-locale' succeeded after 0.0 seconds
starting phase `unpack'
phase `unpack' succeeded after 0.0 seconds
starting phase `bootstrap'
phase `bootstrap' succeeded after 0.0 seconds
starting phase `patch-usr-bin-file'
phase `patch-usr-bin-file' succeeded after 0.0 seconds
starting phase `patch-source-shebangs'
phase `patch-source-shebangs' succeeded after 0.0 seconds
starting phase `configure'
phase `configure' succeeded after 8.9 seconds
starting phase `patch-generated-file-shebangs'
phase `patch-generated-file-shebangs' succeeded after 0.0 seconds

starting phase `check'
[...]

=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=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
Testsuite summary for GNU Hello 2.10
=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=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
# TOTAL: 5
# PASS:  4
# SKIP:  1
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
=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=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
phase `check' succeeded after 0.4 seconds

starting phase `install'
phase `install' succeeded after 0.3 seconds
successfully built /gnu/store/gnjj4hq5pk890l211b28nkd1dwx4z09k-hi-test-2.10=
.drv

/gnu/store/7fc3933yqq9hnp4rrxp84gxdpg270k7v-hi-build-2.10
/gnu/store/7fc3933yqq9hnp4rrxp84gxdpg270k7v-hi-test-2.10
--8<---------------cut here---------------end--------------->8---

with the file attached.


--=-=-=
Content-Type: text/plain
Content-Disposition: inline; filename=hello.scm
Content-Description: hello.scm

(define-module (hello)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (guix licenses)
  #:use-module (gnu packages gawk))

(define-public hi
  (package
    (name "hi-build")
    (version "2.10")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/hello/hello-" version
                                  ".tar.gz"))
              (sha256
               (base32
                "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"))))
    (build-system gnu-build-system)
    (arguments
     `(#:configure-flags '("--enable-silent-rules")
       #:phases
       (modify-phases %standard-phases
         (delete 'check))))
    (inputs (list gawk))
    (synopsis "Hello, GNU world: An example GNU package")
    (description "Guess what GNU Hello prints!")
    (home-page "https://www.gnu.org/software/hello/")
    (license gpl3+)))

(define-public hi-test
  (package/inherit hi
    (name "hi-test")
    (build-system gnu-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (delete 'build)

         (delete 'patch-shebangs)
         (delete 'strip)
         (delete 'validate-runpath)
         (delete 'reset-gzip-timestamps)
         (delete 'validate-documentation-location)
         (delete 'delete-info-dir-file)
         (delete 'patch-dot-desktop-files)
         (delete 'make-dynamic-linker-cache)
         (delete 'install-license-files)
         (delete 'compress-documentation))))
    (inputs (list hi))))

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


Somehow, we could have a =E2=80=9Cbuild=E2=80=9D build-system and a =E2=80=
=9Ctest=E2=80=9D build-system.
And the =E2=80=9Cbuild object=E2=80=9D would be an inputs of the =E2=80=9Ct=
est object=E2=80=9C.  Well,
somehow perhaps some revamp of the <package> record.

Hum, I do not know=E2=80=A6 I am not convinced by my own words. :-)

Cheers,
simon

--=-=-=--