guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guix wiki


From: Attila Lendvai
Subject: Re: Guix wiki
Date: Wed, 13 Apr 2022 15:01:17 +0000

> 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?


i'm afraid i can't answer that without further experiments. an immediate 
concern of mine is that i've seen wild fluctuations in the dependencies of 
different versions of the same go modules.

this is a great idea, though. thanks, noted!

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“When, among a hundred men one man dominates ninety-nine, it is iniquity and 
despotism. When ten dominate ninety, it is injustice and oligarchy. When 
fifty-one dominate forty-nine (and this only theoretically, for, in reality, 
among these fifty-one there are ten or twelve masters), then it is justice and 
liberty. Could anyone imagine anything more ridiculous and absurd than this 
reasoning?”
        — Leo Tolstoy (1828–1910), 'The Law of Love and the Law of Violence' 
(1908)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]