all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Strange behavior with package input rewriting
@ 2021-10-20  6:19 goshib
  0 siblings, 0 replies; only message in thread
From: goshib @ 2021-10-20  6:19 UTC (permalink / raw)
  To: guix-devel

Hello, everyone.

I'm new to Guix and Guile and recently started to tinker with package variants.
But I have bumped into some strange guix behavior.  I'm not sure, if this is
a bug or my misconfiguration.

Everything started after I had built the full chain of rust compilers from the
very beginning (mrust) to the latest version 1.52.  It took me several days or
weeks.  To save disk space, I removed all the previous versions.  But then
discovered, that packages can depend on previous rust versions.  To avoid this
heavy recompilation, I decided, that this is the case for `--with-input=`
package input rewriting.

So, strange behavior #1:

	guix build jami-gnome --with-input=rust=rust

seems to do what I want, but

	guix install jami-gnome --with-input=rust=rust

tries to build all rust packages up to rust@1.45.2 anyway.  Generally speaking,
all `guix package` commands do not comply with my `--with-input=rust=rust` or
`--with-input=rust=rust@1.52` argument.

So, I cannot install this jami version directly, but can build it and then
install its /gnu/store/... output.  But that breaks my package upgrades -- guix
will try to reinstall the standand jami-gnome.  So I decided to write this
package input rewriting in guile, first in a package manifest, then in my own
package module.  This is where I stuck.

So, I have an exported GUIX_PACKAGE_PATH environment variable and some working
modules with package variants: bc with readline support (copied from some issue
on issues.guix.info) and glibc-utf8-locales with a modified locales list.  I write
`(package (inherit <orig>) ...` and then just modify the needed package
parameters.  `guix package -A` and `guix show` show both the original and my
modified versions, `guix build` and `guix install` work and use the modified
versions.

But when I tried to use the construct

	(package
	  (inherit ((options->transformation '((with-input . "rust=rust@1.52")))
	            jami-gnome)))

from Guix documentation, it didn't work.

It seems that `guix package -A jami-gnome` shows both the original and my
modified versions, but guix show/build/install doesn't see the modified version
and tries to build the full rust chain.

Then I discovered, that using package-input-rewriting instead of
options->transformation works.  This also works:

	(package-input-rewriting/spec `(("rust" . ,(const rust-1.52))))

Looking in guix sources I found that procedure find-packages-by-name doesn't
work. So, poking around it, I created a short example module, that works:

	(define-module (bc)
	  #:use-module (guix packages)
	  #:use-module (gnu packages)
	  #:use-module (gnu packages algebra))
	
	(define-public bc2
	  (package
	    (inherit bc)
	    (version "2.test")))
	
	(define var (find-packages-by-name "git"))

But if you put the last line before the bc2 package definition, it stops working
normally: `guix package -A '^bc$'` shows both versions, but all other guix
commands do not see the "2.test" version.

So the question: is this a guix bug, or am I writing wrong in Guile?


-- 
Sent with https://mailfence.com  
Secure and private email


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-20 12:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-20  6:19 Strange behavior with package input rewriting goshib

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.