From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
To: Simon Tournier <zimon.toutoune@gmail.com>
Cc: Adrien 'neox' Bourmault <neox@gnu.org>, help-guix@gnu.org
Subject: Re: License compliance when redistributing images built with 'guix system'.
Date: Mon, 18 Nov 2024 09:41:41 +0100 [thread overview]
Message-ID: <20241118094141.44e5487c@primary_laptop> (raw)
In-Reply-To: <20240930221134.405ecf9e@primary_laptop>
[-- Attachment #1: Type: text/plain, Size: 4125 bytes --]
Hi again,
In the previous approach I tried to get the manifest and it failed to
get some source like the ath9k firmware.
Parsing the system definition approach:
---------------------------------------
I then tried to parse the system definition better and I could extract
it from the firmware field for instance and then I pass the resulting
package name to guix build --source=transitive:
> ;;; Copyright © 2024 Denis 'GNUtoo' Carikli
> ;;; <GNUtoo@cyberdimension.org>
> ;;; This file is free software; you can redistribute it and/or modify
> ;;; it under the terms of the GNU General Public License as
> ;;; published by the Free Software Foundation; either version 3 of
> ;;; the License, or (at your option) any later version.
> ;;;
> ;;; GNU Guix is distributed in the hope that it will be useful, but
> ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> ;;; GNU General Public License for more details.
> (use-modules (gnu bootloader))
> (use-modules (gnu system))
> (use-modules (guix packages))
> (use-modules (minimal-system))
>
> ;; List all the OS packages but not its dependencies. This can then be
> ;; fed to guix build --sources=transitive to provide the packages
> source code.
>
> (let ((os minimal-operating-system))
> (map
> (lambda (p)
> (display (string-append (package-name p) "\n")))
> (append
> (operating-system-packages os)
> (list (operating-system-kernel os))
> (operating-system-firmware os)
> (operating-system-locale-libcs os)
> (list
> (bootloader-package
> (bootloader-configuration-bootloader
> (operating-system-bootloader os)))))))
But then in /gnu/store of the image I have
/gnu/store/sriajy9dya89gmfaix5n7ypc3li0lmcq-libx11-1.7.3.1
And the code above doesn't list that.
Reading the derivations and filtering the result approach:
----------------------------------------------------------
So I tried again another approach and it seems to print the right paths.
I can run it with:
> guix time-machine --commit=v1.4.0 -- repl read-derivations.scm \
> $(guix gc --derivers
> /gnu/store/5rhwm44nwvc4b3ww48b8w0i6f4l0bh1c-system/)
And it produces the ath9k source, and also
/gnu/[...]-libX11-1.7.3.1.tar.xz
Here's the code:
> ;;; Copyright © 2024 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
> ;;;
> ;;; GNU Guix is free software; you can redistribute it and/or modify it
> ;;; under the terms of the GNU General Public License as published by
> ;;; the Free Software Foundation; either version 3 of the License, or (at
> ;;; your option) any later version.
> ;;;
> ;;; GNU Guix is distributed in the hope that it will be useful, but
> ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> ;;; GNU General Public License for more details.
> (use-modules (guix derivations))
>
> (let ((drv-from-file (read-derivation-from-file (list-ref (program-arguments) 1))))
> (map
> (lambda (drv-prerequisite)
> (map
> (lambda (drv-output)
> (if (derivation-output-hash (cdr drv-output))
> ((lambda _
> (display
> (string-append
> (derivation-output-path (cdr drv-output))
> "\n"))))))
> (derivation-outputs (derivation-input-derivation drv-prerequisite))))
> (derivation-prerequisites drv-from-file)))
But now I have another problem: some of the paths don't exist. For
instance the code above lists
/gnu/[...]-ath9k-htc-firmware-1.4.0-checkout which doesn't exist.
With the previous code that parsed the system definition, it produced a
different path for the system definition which existed. And running
'guix time-machine --commit=v1.4.0 -- build --system=i686-linux --source
ath9k-htc-firmware' with and without --system also produce the same
path than the code that parsed the system definition.
I'm unsure where the issue could come from. Does someone has some
hypothesis / ideas that I could look into?
Denis.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-11-18 8:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-23 0:09 License compliance when redistributing images built with 'guix system' Denis 'GNUtoo' Carikli
2024-07-17 17:26 ` Simon Tournier
2024-07-28 17:20 ` Denis 'GNUtoo' Carikli
2024-09-30 20:11 ` Denis 'GNUtoo' Carikli
2024-11-18 8:41 ` Denis 'GNUtoo' Carikli [this message]
2024-11-18 12:38 ` Denis 'GNUtoo' Carikli
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=20241118094141.44e5487c@primary_laptop \
--to=gnutoo@cyberdimension.org \
--cc=help-guix@gnu.org \
--cc=neox@gnu.org \
--cc=zimon.toutoune@gmail.com \
/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.