I think you got it right, I've used thas in the past. Maybe your cli options are out of order? Instead of -f -d, try -D -f. Do you even have d1 or d3 in your current shell? Could they come from outside?

Le 14 novembre 2022 19:41:58 GMT+01:00, Andy Tai <atai@atai.org> a écrit :
Hi, guix allows setting up an environment containing all the
dependencies for development of a package; this can be done via a
guix.scm file containing the package definition.

My question is, if I am developing a package which has dependencies
with newer versions than what is available in the guix repo, how can I
use the guix.scm file to bring in the new version of the dependencies?
As an example:

Say my package "my-package" has dependencies d1, d2, d3
where d2 in the current guix package repo is at version 0.1.2 but I
need a later release version 0.1.4; so I tried something like this:

----guix.scm---
(use-modules (guix packages)
....)

(define-public d2-0.1.4
(package
(name "d2")
(version "0.1.4")

...
)


(define-public my-package
(package
(name "my-package")
(version "0.1")
...


(input (list d1 d2-0.1.4 d3...)
....
))

my-package

---end guix.scm---


and if I use

guix shell -f -d ./guix.scm

this does not seem to generate an environment that contains the new
dependency, that is d2 version 0.1.4

I wonder how can this made to work? Ideally no need to create a
private channel or such.. Thanks for info on this.