all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
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
Date: Thu, 02 Nov 2023 18:02:18 +0100	[thread overview]
Message-ID: <86y1fgm6lh.fsf@gmail.com> (raw)
In-Reply-To: <87r0l818ka.fsf@>

[-- Attachment #1: Type: text/plain, Size: 6167 bytes --]

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 “fixed-output” derivation…

> #+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—e.g., a source
> code download produces the same result regardless of the download method
> and tools being used.
> #+end_quote

…because 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 same
        package built with or without its tests ...  would mean to have a
        derivation for building and another derivation – referring to the
        former – for testing.

And from my understanding, one solution would be to have something as
below.  One “object” for building and another “object” 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/…-hi-test-2.10.drv
  /gnu/store/…-hi-build-2.10.drv

building /gnu/store/…-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'

 … do stuff …
 
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/…-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'
[...]

============================================================================
Testsuite summary for GNU Hello 2.10
============================================================================
# TOTAL: 5
# PASS:  4
# SKIP:  1
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
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.


[-- Attachment #2: hello.scm --]
[-- Type: text/plain, Size: 1572 bytes --]

(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))))

[-- Attachment #3: Type: text/plain, Size: 301 bytes --]


Somehow, we could have a “build” build-system and a “test” build-system.
And the “build object” would be an inputs of the “test object“.  Well,
somehow perhaps some revamp of the <package> record.

Hum, I do not know… I am not convinced by my own words. :-)

Cheers,
simon

  reply	other threads:[~2023-11-02 17:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02 15:25 Turning off tests leads to a different store item Suhail
2023-11-02 17:02 ` Simon Tournier [this message]
2023-11-02 17:46   ` Simon Tournier
2023-11-03 13:08 ` Tomas Volf
2023-11-03 20:44   ` Suhail
     [not found] <6543bf92.d40a0220.bbcd0.1118SMTPIN_ADDED_BROKEN@mx.google.com>
2023-11-02 16:03 ` Greg Hogan
  -- strict thread matches above, loose matches on Subject: below --
2023-11-02 17:25 Suhail
2023-11-02 18:54 Suhail
2023-11-03  9:33 ` Simon Tournier
2023-11-03 14:13 Suhail
2023-11-05 12:07 ` Simon Tournier
     [not found] <65429087.0c0a0220.5908c.4d60SMTPIN_ADDED_BROKEN@mx.google.com>
2023-11-07 18:58 ` Maxim Cournoyer
2023-11-07 21:58   ` Csepp
2023-11-08  2:53   ` Felix Lechner via
2023-11-08 14:45     ` Maxim Cournoyer
2023-11-08 17:07       ` Felix Lechner via
2023-11-08 18:18         ` Vagrant Cascadian
2023-11-08 19:20           ` Saku Laesvuori
2023-11-08 22:21             ` Simon Tournier
2023-11-09  3:17               ` Maxim Cournoyer
2023-11-09  7:37                 ` Simon Tournier
2023-11-09 15:04                   ` Maxim Cournoyer
2023-11-16  9:31                     ` Simon Tournier
2023-11-18  4:38                       ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86y1fgm6lh.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=felix.lechner@lease-up.com \
    --cc=help-guix@gnu.org \
    --cc=julien@lepiller.eu \
    --cc=suhail@bayesians.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.