[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guix wiki
From: |
Maxime Devos |
Subject: |
Re: Guix wiki |
Date: |
Mon, 11 Apr 2022 10:42:31 +0200 |
User-agent: |
Evolution 3.38.3-1 |
Attila Lendvai schreef op ma 11-04-2022 om 06:49 [+0000]:
> if someone wants to use guix as a platform for reproducible builds
> of go projects (independent of guix revisions), then a package
> definitions is needed that refers to specific versions of its
> dependencies.
>
> currently it's not possible to open a new isolated scheme module,
> and algorithmically define/import the entire transitive closure of
> the dependencies of a go project, because they may clash in the
> package-name namespace with projects already defined elsewhere in
> guix.
Suggestion: clashing names is not a problem, as long as the final
package to build actually has an unambigious name. Also, it is not
necessary to actually give these intermediate packages a variable name,
maybe do something like
(define-module (gnu packages ...))
(define-public foo [... a conventional guix package definition ...])
(define-module (my-reproducibility-test)
#:use-module (gnu packages ...))
(define %version-pins ; <-- TODO: teach "guix import go --pin-versions" to
produce this kind of structure?
;; package name / version / hash
'(("go-github-com-operatorfoundation-shapeshifter-transports" "0.1.2"
"0f1hzhk3q2fgqdg14zlg3z0s0ib1y9xwj89qnjk95b37zbgqjgsb")
[...]))
(define pin-input
(match-lambda
((label package . rest)
(cons* label (pin package) rest))))
(define pin
(mlambda (package)
If the package name does not occur in %version-pins --> return package
unchanged.
Otherwise, return
(package
(inherit package)
(version the new version)
(source (origin (inherit (package-source package))
an appropriately adjusted commit
the new hash))
;; TODO: other versions of dependencies might need extra dependencies
(inputs (map pin-input package))
(native-inputs (map pin-input package))
(propagated-inputs (map pin-input package))))
(define-public my-reproducibility-test-foo
(package
(inherit (pin foo))
(name "foo-as-found-elsewhere")))
Does that suit your purposes?
Greetings,
Maxime.
signature.asc
Description: This is a digitally signed message part