From: Simon Tournier <zimon.toutoune@gmail.com>
To: "Clément Lassieur" <clement@lassieur.org>,
"Christopher Baines" <mail@cbaines.net>
Cc: guix-devel@gnu.org
Subject: G-expressions and chroot environment? (was Re: branch master updated: gnu: Add passff.)
Date: Fri, 03 Nov 2023 19:46:00 +0100 [thread overview]
Message-ID: <87y1feu13r.fsf@gmail.com> (raw)
In-Reply-To: <87a5s2bxeg.fsf@lassieur.org>
Hi,
On Sat, 28 Oct 2023 at 17:05, Clément Lassieur <clement@lassieur.org> wrote:
>> ./pre-inst-env guix show passff-host
>> name: passff-host
>> version: 1.2.3
>> outputs:
>> + out: everything
>> systems: x86_64-linux mips64el-linux aarch64-linux powerpc64le-linux riscv64-linux
>> + i686-linux armhf-linux i586-gnu powerpc-linux
>> dependencies:
>
> I imagine it's a bug in `guix show`?
It is not a bug of ’guix show’ because ’guix show’ accesses to the
fields of the package record. And Clément’s patch is an “abuse” of the
G-expressions machinery. :-)
> As doc says:
>
> • Gexps carry information about the packages or derivations they
> refer to, and these dependencies are automatically added as inputs
> to the build processes that use them.
Well, this is correct from my understanding. ;-)
However, there is still something that I am missing. The derivations
tracks all and that’s expected; thanks G-expression machinery. :-)
However, I miss how the builder works with the chrooted environment if
nothing is passed to it.
The derivation reads,
--8<---------------cut here---------------start------------->8---
Derive
([("out","/gnu/store/0amanwyzx3jylyw7bz5nmszpybxll8ww-passff-host-1.2.3","","")]
,[("/gnu/store/070vbkzbs0dn6w9mhz0xw8fi5hfp92rg-make-4.3.drv",["out"])
,("/gnu/store/2i4781y3mmnm2jlx3awa4mwbqam2ar80-python-3.10.7.drv",["out"])
,("/gnu/store/ax7wdlbxhcz7w8nfyrxkb1pqai80niw6-sed-4.8.drv",["out"])
,("/gnu/store/gb247cil5nlnx175dhqmgg67q7ng7n2h-which-2.21.drv",["out"])
,("/gnu/store/ghwl0z5ci5sssbrzixxji8l0x3j9i3dv-bash-minimal-5.1.16.drv",["out"])
,("/gnu/store/mqmnsly3nm0a7hj46apf2hfm7j8wk56h-module-import-compiled.drv",["out"])
,("/gnu/store/raay3plnbzadwqc0yv8yw8pjr929pkqd-coreutils-9.1.drv",["out"])
,("/gnu/store/rnphhzpwkz82zf1il1cg52041myvp3d4-password-store-1.7.4.drv",["out"])
,("/gnu/store/y6871hl8lklcslvw57wj4bnyysxlv2np-passff-host-1.2.3-checkout.drv",["out"])
,("/gnu/store/y9l0jnyxssx1glbyg3cav78js2fm7j50-grep-3.8.drv",["out"])
,("/gnu/store/zraigp7miin3vzr5dcbr4i9rvds0i07r-guile-3.0.9.drv",["out"])]
,["/gnu/store/8nam67byqnpvbfn4anpgg5pb2qrqhs3v-passff-host-1.2.3-builder","/gnu/store/pj751v3199vmv6i6sf0szp185ryzcfdg-module-import"]
,"x86_64-linux","/gnu/store/g8p09w6r78hhkl2rv1747pcp9zbk6fxv-guile-3.0.9/bin/guile",["--no-auto-compile","-L","/gnu/store/pj751v3199vmv6i6sf0szp185ryzcfdg-module-import","-C","/gnu/store/2gbsk55kwag577skxwsxrfy3l4cl03xh-module-import-compiled","/gnu/store/8nam67byqnpvbfn4anpgg5pb2qrqhs3v-passff-host-1.2.3-builder"]
,[("out","/gnu/store/0amanwyzx3jylyw7bz5nmszpybxll8ww-passff-host-1.2.3")])
--8<---------------cut here---------------end--------------->8---
However the builder reads,
--8<---------------cut here---------------start------------->8---
(begin
(define %build-inputs
(quote
(("source" . "/gnu/store/fjnkcv14qb61623lm16kq1mgb4bsxivl-passff-host-1.2.3-checkout"))))
(define %outputs
(list
(cons "out"
((@
(guile)
getenv)
"out"))))
(define %output
(assoc-ref %outputs "out"))
(begin
(use-modules
(guix build utils))
(setenv "PATH"
(string-join
(list "/gnu/store/yr39rh6wihd1wv6gzf7w4w687dwzf3vb-coreutils-9.1/bin" "/gnu/store/ixr7c3jadiqg640b8pz3njqhhm5zzmvj-grep-3.8/bin" "/gnu/store/sj794a2709pxsi4mgvi619qdpi1g32aa-password-store-1.7.4/bin" "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/bin" "/gnu/store/fyy3wkjkix16sb1ginqw2kbji74cwl2b-sed-4.8/bin" "/gnu/store/6vxk0i5j9w8mik4l6gx3cbw33f9x4l24-which-2.21/bin")
":"))
(copy-recursively "/gnu/store/fjnkcv14qb61623lm16kq1mgb4bsxivl-passff-host-1.2.3-checkout" ".")
(substitute* "src/install_host_app.sh"
(("#!/usr/bin/env sh")
"/gnu/store/9vw5slrffp27rzy2i2plnw7xfqjyk7m4-bash-minimal-5.1.16/bin/sh")
(("(TARGET_DIR_FIREFOX=).*" all var)
(string-append var
((@
(guile)
getenv)
"out")
"/lib/icecat/native-messaging-hosts")))
(invoke "/gnu/store/vq4g8390wbz2434m678v010mkpnkjb2w-make-4.3/bin/make"
(string-append "VERSION=" "1.2.3")
"install-unix")))
--8<---------------cut here---------------end--------------->8---
and I would have expect that it fails because of the isolated
environment.
How is it possible that the builder script is able to run that?
For another example using the gnu-build system.
--8<---------------cut here---------------start------------->8---
(define-module (appendix)
#:use-module (guix packages)
#:use-module (gnu packages base)
#:use-module (guix utils)
#:use-module (guix gexp)
#:use-module (gnu packages emacs))
(define-public bye
(package
(inherit hello)
(name "bye")
(arguments
(list
#:phases
#~(modify-phases %standard-phases
(add-after 'install 'do-something-with-emacs
(lambda _
(invoke #$(file-append emacs-minimal
"/bin/emacs") "--version"))))))))
--8<---------------cut here---------------end--------------->8---
Considering the builder of this, I miss how, in an isolated environment,
’gnu-build’ access to the store item ’emacs-minimal’ if it is not listed
in ’%build-inputs’.
Is it a bug? Or someone could help me to understand what I miss with
the chrooted environment.
Cheers,
simon
next prev parent reply other threads:[~2023-11-03 18:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <169826674567.18633.11885829962706141651@vcs2.savannah.gnu.org>
2023-10-28 14:35 ` branch master updated: gnu: Add passff Christopher Baines
2023-10-28 15:05 ` Clément Lassieur
2023-10-28 17:53 ` Kaelyn
2023-10-30 14:23 ` Clément Lassieur
2023-11-01 3:33 ` Clément Lassieur
2023-10-31 2:48 ` John Kehayias
2023-10-31 19:33 ` Clément Lassieur
2023-11-01 3:36 ` Clément Lassieur
2023-11-03 18:46 ` Simon Tournier [this message]
2023-11-06 15:19 ` G-expressions and chroot environment? (was Re: branch master updated: gnu: Add passff.) Simon Tournier
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y1feu13r.fsf@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=clement@lassieur.org \
--cc=guix-devel@gnu.org \
--cc=mail@cbaines.net \
/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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).