From: Thomas Schwinge <tschwinge@baylibre.com>
To: guix-devel@gnu.org
Cc: help-guix@gnu.org
Subject: Re: 'guix build [P]' followed by 'guix install /gnu/store/[...]' vs. 'guix install [P]'
Date: Thu, 07 Nov 2024 15:50:34 +0100 [thread overview]
Message-ID: <87ttcj2j45.fsf@euler.schwinge.ddns.net> (raw)
In-Reply-To: <87cyjc5jlj.fsf@euler.schwinge.ddns.net>
Hi!
A few days ago, I had posted this to <help-guix@gnu.org>, but not yet
gotten any response -- I understand everyone's busy, of course ;-) -- and
this morning had a quick chat on Guix IRC (see below), but as that also
wasn't really conclusive, I'd like to re-post on <guix-devel@gnu.org>:
On 2024-11-03T18:10:32+0100, I wrote:
> I was under the impression that 'guix build [P]' followed by
> 'guix install /gnu/store/[...]' would produce equivalent results to
> 'guix install [P]' -- but evidently that's not generally the case? With
> up-to-date Guix:
>
> $ guix build gcc-toolchain@4.8.5
> [...]
> /gnu/store/zq67w51hf6vpk3s2nriwnl7658biq9dz-gcc-toolchain-4.8.5-debug
> /gnu/store/lahbqdidl3ynasd0vzxz2i0dmgh0v16i-gcc-toolchain-4.8.5
> /gnu/store/82i6qfdqspg43rkphw0hhafny76z5bbr-gcc-toolchain-4.8.5-static
> $ guix install -p bi /gnu/store/lahbqdidl3ynasd0vzxz2i0dmgh0v16i-gcc-toolchain-4.8.5
> [...]
>
> ..., where '/gnu/store/[...]-gcc-toolchain-4.8.5' is the main ("out")
> output, which should -- per my understanding -- correspond to directly
> 'guix install'ing:
>
> $ guix install -p i gcc-toolchain@4.8.5
> [...]
>
> But now compare the two installations:
>
> $ diff -ru bi/ i/
> diff -ru bi/etc/profile i/etc/profile
> --- bi/etc/profile 1970-01-01 01:00:01.000000000 +0100
> +++ i/etc/profile 1970-01-01 01:00:01.000000000 +0100
> @@ -8,4 +8,10 @@
> # When GUIX_PROFILE is undefined, the various environment variables refer
> # to this specific profile generation.
>
> -export PATH="${GUIX_PROFILE:-/gnu/store/fh258i84wjshhaxnv4bb2qm6xipfxsnl-profile}/bin:${GUIX_PROFILE:-/gnu/store/fh258i84wjshhaxnv4bb2qm6xipfxsnl-profile}/sbin${PATH:+:}$PATH"
> +export PATH="${GUIX_PROFILE:-/gnu/store/2vk4q0ffg4621pz4jd9pprscpm9dfiwf-profile}/bin:${GUIX_PROFILE:-/gnu/store/2vk4q0ffg4621pz4jd9pprscpm9dfiwf-profile}/sbin${PATH:+:}$PATH"
> +export GUIX_LOCPATH="${GUIX_PROFILE:-/gnu/store/2vk4q0ffg4621pz4jd9pprscpm9dfiwf-profile}/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH"
> +export LIBRARY_PATH="${GUIX_PROFILE:-/gnu/store/2vk4q0ffg4621pz4jd9pprscpm9dfiwf-profile}/lib${LIBRARY_PATH:+:}$LIBRARY_PATH"
> +export OBJCPLUS_INCLUDE_PATH="${GUIX_PROFILE:-/gnu/store/2vk4q0ffg4621pz4jd9pprscpm9dfiwf-profile}/include/c++:${GUIX_PROFILE:-/gnu/store/2vk4q0ffg4621pz4jd9pprscpm9dfiwf-profile}/include${OBJCPLUS_INCLUDE_PATH:+:}$OBJCPLUS_INCLUDE_PATH"
> +export OBJC_INCLUDE_PATH="${GUIX_PROFILE:-/gnu/store/2vk4q0ffg4621pz4jd9pprscpm9dfiwf-profile}/include${OBJC_INCLUDE_PATH:+:}$OBJC_INCLUDE_PATH"
> +export CPLUS_INCLUDE_PATH="${GUIX_PROFILE:-/gnu/store/2vk4q0ffg4621pz4jd9pprscpm9dfiwf-profile}/include/c++:${GUIX_PROFILE:-/gnu/store/2vk4q0ffg4621pz4jd9pprscpm9dfiwf-profile}/include${CPLUS_INCLUDE_PATH:+:}$CPLUS_INCLUDE_PATH"
> +export C_INCLUDE_PATH="${GUIX_PROFILE:-/gnu/store/2vk4q0ffg4621pz4jd9pprscpm9dfiwf-profile}/include${C_INCLUDE_PATH:+:}$C_INCLUDE_PATH"
> diff -ru bi/manifest i/manifest
> --- bi/manifest 1970-01-01 01:00:01.000000000 +0100
> +++ i/manifest 1970-01-01 01:00:01.000000000 +0100
> @@ -9,4 +9,40 @@
> (("gcc-toolchain"
> "4.8.5"
> "out"
> - "/gnu/store/lahbqdidl3ynasd0vzxz2i0dmgh0v16i-gcc-toolchain-4.8.5"))))
> + "/gnu/store/lahbqdidl3ynasd0vzxz2i0dmgh0v16i-gcc-toolchain-4.8.5"
> + (search-paths
> + (("C_INCLUDE_PATH" ("include") ":" directory #f)
> + ("CPLUS_INCLUDE_PATH"
> + ("include/c++" "include")
> + ":"
> + directory
> + #f)
> + ("OBJC_INCLUDE_PATH"
> + ("include")
> + ":"
> + directory
> + #f)
> + ("OBJCPLUS_INCLUDE_PATH"
> + ("include/c++" "include")
> + ":"
> + directory
> + #f)
> + ("LIBRARY_PATH" ("lib" "lib64") ":" directory #f)
> + ("GUIX_LOCPATH" ("lib/locale") ":" directory #f)
> + ("TZDIR" ("share/zoneinfo") #f directory #f)))
> + (properties
> + ((provenance
> + (repository
> + (version 0)
> + (url "https://git.savannah.gnu.org/git/guix.git")
> + (branch "master")
> + (commit
> + "8964dfdb84f7d21dbc89c217ca4f4546a15990af")
> + (name guix)
> + (introduction
> + (channel-introduction
> + (version 0)
> + (commit
> + "9edb3f66fd807b096b48283debdcddccfea34bad")
> + (signer
> + "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))))))))))
>
> This means that the 'bi' installation isn't usable.
>
> Where is the error in (very likely) my thinking?
Same behavior, by the way, for more recent versions of 'gcc-toolchain',
including current 'gcc-toolchain', so it's not a problem specific to
ancient 'gcc-toolchain@4.8.5'.
Guix IRC, 2024-11-07:
[...]
11:15:47 <tschwinge> Anybody got any opinion on
<https://lists.gnu.org/archive/html/help-guix/2024-11/msg00017.html>
"'guix build [P]' followed by 'guix install /gnu/store/[...]'
vs. 'guix install [P]'"?
11:16:56 <Rutherther> tschwinge: hi. I mean I would expect that. The
search paths are stored with the definition of the package. You
don't know the package definition from the store path. So the
information about search paths is lost. I am mainly quite surprised
guix even allows guix install directly on gnu store paths
[...]
11:28:43 <tschwinge> Rutherther: Interesting, thanks for looking into
this.
11:29:32 <tschwinge> So, what then is the right way of doing 'guix
install --system=i686-linux gcc-toolchain@4.8.5' on a x86_64-linux
system? ('guix install' doesn't support '--system=[...]'.)
11:34:07 <futurile> I do that all the time, so it might be a bug.
11:35:03 <yelninei> tschwinge: Does it work with guix shell (for a
workaround)?
[...]
11:50:42 <tschwinge> futurile: What is "that" in your sentence?
11:50:46 <tschwinge> yelninei: Yes, 'guix shell --system=i686-linux
[...]' works as expected -- but I'll have to think how to fiddle
that into my non-interactive workflow/build scripts.
11:51:35 <tschwinge> ..., or should I "just" try to make
'--system=[...]' work for 'guix install'/'guix package'? ;-)
11:52:00 <Rutherther> tschwinge: ideally you could package the build
scripts so they just use correct dependencies. Or you an also give
them shebang with guix shell to provide the dependencies
[...]
11:58:45 <yelninei> tschwinge: You can pass a command to run in the
new shell after a -- which should also work non-interactively
[...]
So, the workarounds aside, what is the expected behavior?
Further on:
> How do I, by the way, programmatically get from the 'guix build' list of
> (here: three) outputs to the main ("out") output? Via
> '/gnu/store/*-gcc-toolchain-4.8.5.drv' (as produced by
> 'guix build --derivations [...]'), I suppose, but what's the standard
> way? Or, is there even a way to instruct 'guix build' to only produce
> the main ("out") output, for example?
>
>
> All this came up in context of wanting to install '--system=i686-linux'
> packages on '--system=x86_64-linux', and I'm not able to just
> 'guix install --system=i686-linux gcc-toolchain@4.8.5' there.
>
> (Is there a fundamental reason for not allowing that, or just not yet
> implemented?)
Grüße
Thomas
next prev parent reply other threads:[~2024-11-07 14:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-03 17:10 'guix build [P]' followed by 'guix install /gnu/store/[...]' vs. 'guix install [P]' Thomas Schwinge
2024-11-07 14:50 ` Thomas Schwinge [this message]
2024-11-07 18:21 ` Rutherther
2024-11-09 23:31 ` Ludovic Courtès
2024-11-10 10:02 ` Thomas Schwinge
2024-11-14 10:00 ` Ludovic Courtès
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=87ttcj2j45.fsf@euler.schwinge.ddns.net \
--to=tschwinge@baylibre.com \
--cc=guix-devel@gnu.org \
--cc=help-guix@gnu.org \
/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.
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).