* [bug#42735] [PATCH] pre-inst-env: don't use GUIX_PACKAGE_PATH
@ 2020-08-07 2:21 Denis 'GNUtoo' Carikli
2020-08-07 3:46 ` Brett Gilio
2020-08-07 8:41 ` Mathieu Othacehe
0 siblings, 2 replies; 7+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2020-08-07 2:21 UTC (permalink / raw)
To: 42735; +Cc: Denis 'GNUtoo' Carikli
./pre-inst-env is supposed to use only the packages definitions that are in
the guix source tree and not the host packages.
However if GUIX_PACKAGE_PATH is set, it will use host packages as well.
In addition, when packages are defined in both the guix source tree and in
GUIX_PACKAGE_PATH, GUIX_PACKAGE_PATH will take the precedence and guix
will print warnings like that:
guix build: warning: ambiguous package specification `libsamsung-ipc'
guix build: warning: choosing libsamsung-ipc@0.1 from
/home/[...]/.config/guix/local/replicant.scm:31:2
That situation can happen when working in a new package in
GUIX_PACKAGE_PATH and then importing the package in the guix source tree to
add it upstream.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
build-aux/pre-inst-env.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/build-aux/pre-inst-env.in b/build-aux/pre-inst-env.in
index e0aa7fe868..698a7994fb 100644
--- a/build-aux/pre-inst-env.in
+++ b/build-aux/pre-inst-env.in
@@ -59,4 +59,8 @@ export NIX_HASH
GUIX_UNINSTALLED=1
export GUIX_UNINSTALLED
+# Make sure we don't use local package definitions
+GUIX_PACKAGE_PATH=""
+export GUIX_PACKAGE_PATH
+
exec "$@"
--
2.28.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [bug#42735] [PATCH] pre-inst-env: don't use GUIX_PACKAGE_PATH
2020-08-07 2:21 [bug#42735] [PATCH] pre-inst-env: don't use GUIX_PACKAGE_PATH Denis 'GNUtoo' Carikli
@ 2020-08-07 3:46 ` Brett Gilio
2020-08-07 6:02 ` Denis 'GNUtoo' Carikli
2020-08-07 8:41 ` Mathieu Othacehe
1 sibling, 1 reply; 7+ messages in thread
From: Brett Gilio @ 2020-08-07 3:46 UTC (permalink / raw)
To: Denis 'GNUtoo' Carikli; +Cc: 42735
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> writes:
>
> +# Make sure we don't use local package definitions
> +GUIX_PACKAGE_PATH=""
> +export GUIX_PACKAGE_PATH
> +
> exec "$@"
Wouldn't it make more sense to use `unset` instead of defining an empty
variable?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#42735] [PATCH] pre-inst-env: don't use GUIX_PACKAGE_PATH
2020-08-07 2:21 [bug#42735] [PATCH] pre-inst-env: don't use GUIX_PACKAGE_PATH Denis 'GNUtoo' Carikli
2020-08-07 3:46 ` Brett Gilio
@ 2020-08-07 8:41 ` Mathieu Othacehe
2020-08-09 9:09 ` Denis 'GNUtoo' Carikli
2020-08-14 11:16 ` [bug#42735] " Ricardo Wurmus
1 sibling, 2 replies; 7+ messages in thread
From: Mathieu Othacehe @ 2020-08-07 8:41 UTC (permalink / raw)
To: Denis 'GNUtoo' Carikli; +Cc: 42735
Hello Denis,
> ./pre-inst-env is supposed to use only the packages definitions that are in
> the guix source tree and not the host packages.
>
> However if GUIX_PACKAGE_PATH is set, it will use host packages as well.
Let say you have a custom my-hello package inheriting from hello, and
you want to build it on top of a recent Guix checkout, then you probably
want GUIX_PACKAGE_PATH to cooperate with pre-inst-env.
Same goes if you have a manifest mixing Guix packages and custom
packages accessed by GUIX_PACKAGE_PATH, and you want to test your
manifest on top of a Guix checkout using pre-inst-env.
Thanks,
Mathieu
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#42735] [PATCH] pre-inst-env: don't use GUIX_PACKAGE_PATH
2020-08-07 8:41 ` Mathieu Othacehe
@ 2020-08-09 9:09 ` Denis 'GNUtoo' Carikli
2020-08-14 10:00 ` bug#42735: " Oleg Pykhalov
2020-08-14 11:16 ` [bug#42735] " Ricardo Wurmus
1 sibling, 1 reply; 7+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2020-08-09 9:09 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: 42735
[-- Attachment #1: Type: text/plain, Size: 1683 bytes --]
On Fri, 07 Aug 2020 10:41:52 +0200
Mathieu Othacehe <othacehe@gnu.org> wrote:
> Let say you have a custom my-hello package inheriting from hello, and
> you want to build it on top of a recent Guix checkout, then you
> probably want GUIX_PACKAGE_PATH to cooperate with pre-inst-env.
>
> Same goes if you have a manifest mixing Guix packages and custom
> packages accessed by GUIX_PACKAGE_PATH, and you want to test your
> manifest on top of a Guix checkout using pre-inst-env.
Thanks for the explanation.
What would be the way for both use cases to be addressed?
Should a warning be emitted when packages come from GUIX_PACKAGE_PATH
with ./pre-inst-env ?
What about something that would look like that:
> guix build: warning: GUIX_PACKAGE_PATH is set
> guix build: warning: choosing my-hello@0.1 from
> /home/[...]/.config/guix/local/custom.scm:31:2
> guix build: warning: If you don't want to use
> packages from GUIX_PACKAGE_PATH you can run
> 'unset GUIX_PACKAGE_PATH' before running
> pre-inst-env
The issue is if it picks dependencies from GUIX_PACKAGE_PATH which are
not in Guix source code yet. In that case it might be more complicated
to make sure that people will see the warning as it might be hidden in
the huge build log.
Another option which can also be combined with the previous one would be
to warn people in the manual.
Note that I'm also fine with the status quo, but if it's not too
complicated to improve the situation in a way that doesn't break
existing use cases it would probably make sense to do it.
Denis.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#42735: [PATCH] pre-inst-env: don't use GUIX_PACKAGE_PATH
2020-08-09 9:09 ` Denis 'GNUtoo' Carikli
@ 2020-08-14 10:00 ` Oleg Pykhalov
0 siblings, 0 replies; 7+ messages in thread
From: Oleg Pykhalov @ 2020-08-14 10:00 UTC (permalink / raw)
To: Denis 'GNUtoo' Carikli; +Cc: 42735-done
[-- Attachment #1: Type: text/plain, Size: 2240 bytes --]
Hi,
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> writes:
[…]
> Should a warning be emitted when packages come from GUIX_PACKAGE_PATH
> with ./pre-inst-env ?
I don't think a user needs another warning for an environment variable
which he setted by himself. Also, user could use ‘-L’ flag instead of
‘GUIX_PACKAGE_PATH’.
Currently,
with ‘hello’ package in GUIX_PACKAGE_PATH:
--8<---------------cut here---------------start------------->8---
oleg@guixsd ~/src/guix-master$ GUIX_PACKAGE_PATH=/home/oleg/src/guix-wigust/guix ./pre-inst-env guix build --no-grafts --no-offload hello
guix build: warning: ambiguous package specification `hello'
guix build: warning: choosing hello@2.10 from /home/oleg/src/guix-wigust/guix/wigust/packages/games.scm:174:2
/gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10
--8<---------------cut here---------------end--------------->8---
without ‘hello’ package in GUIX_PACKAGE_PATH:
--8<---------------cut here---------------start------------->8---
oleg@guixsd ~/src/guix-master$ GUIX_PACKAGE_PATH=/home/oleg/src/guix-wigust/guix ./pre-inst-env guix build --no-grafts --no-offload hello
/gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10
--8<---------------cut here---------------end--------------->8---
> The issue is if it picks dependencies from GUIX_PACKAGE_PATH which are
> not in Guix source code yet. In that case it might be more complicated
> to make sure that people will see the warning as it might be hidden in
> the huge build log.
>
> Another option which can also be combined with the previous one would be
> to warn people in the manual.
It's already documented, isn't it?
https://www.gnu.org/software/guix/manual/html_node/Package-Modules.html
--8<---------------cut here---------------start------------->8---
-- Environment Variable: GUIX_PACKAGE_PATH
This is a colon-separated list of directories to search for
additional package modules. Directories listed in this variable
take precedence over the own modules of the distribution.
--8<---------------cut here---------------end--------------->8---
I'll close the bug. Feel free to reopen if I miss something.
Regards,
Oleg.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#42735] [PATCH] pre-inst-env: don't use GUIX_PACKAGE_PATH
2020-08-07 8:41 ` Mathieu Othacehe
2020-08-09 9:09 ` Denis 'GNUtoo' Carikli
@ 2020-08-14 11:16 ` Ricardo Wurmus
1 sibling, 0 replies; 7+ messages in thread
From: Ricardo Wurmus @ 2020-08-14 11:16 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: 42735, GNUtoo
Mathieu Othacehe <othacehe@gnu.org> writes:
> Hello Denis,
>
>> ./pre-inst-env is supposed to use only the packages definitions that are in
>> the guix source tree and not the host packages.
>>
>> However if GUIX_PACKAGE_PATH is set, it will use host packages as well.
>
> Let say you have a custom my-hello package inheriting from hello, and
> you want to build it on top of a recent Guix checkout, then you probably
> want GUIX_PACKAGE_PATH to cooperate with pre-inst-env.
That’s primarily how I use GUIX_PACKAGE_PATH: for development. If you
have GUIX_PACKAGE_PATH set for any other reasons you should consider
using channels instead.
--
Ricardo
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-08-14 11:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-07 2:21 [bug#42735] [PATCH] pre-inst-env: don't use GUIX_PACKAGE_PATH Denis 'GNUtoo' Carikli
2020-08-07 3:46 ` Brett Gilio
2020-08-07 6:02 ` Denis 'GNUtoo' Carikli
2020-08-07 8:41 ` Mathieu Othacehe
2020-08-09 9:09 ` Denis 'GNUtoo' Carikli
2020-08-14 10:00 ` bug#42735: " Oleg Pykhalov
2020-08-14 11:16 ` [bug#42735] " Ricardo Wurmus
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).