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.