unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: "Attila Lendvai" <attila@lendvai.name>, "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Guix wiki
Date: Mon, 11 Apr 2022 10:42:31 +0200	[thread overview]
Message-ID: <2d93cd88e2ff348cf2c47460c29ff62024c135f9.camel@telenet.be> (raw)
In-Reply-To: <CXWlIh8oX1hV7qJErPnli4LGEy-VuUO8hXEJPjP3naOwZY1iUtohQlddTOB1bOuCcCr5i0MxKdZM1cReEjHECqzJSOcjaqGdyTS2tN8X6bo=@lendvai.name>

[-- Attachment #1: Type: text/plain, Size: 2143 bytes --]

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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2022-04-11  8:43 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-09 21:14 Guix wiki Matt
2022-01-09 21:32 ` Vagrant Cascadian
2022-01-11 13:02   ` Matt
2022-01-11 18:29   ` Jonathan McHugh
2022-04-13 14:46   ` Aurora
2022-01-09 23:55 ` Vincent Legoll
2022-01-11 13:31   ` Matt
2022-01-11 15:17     ` Ricardo Wurmus
2022-01-12  2:52       ` Matt
2022-01-11 15:30     ` Tobias Geerinckx-Rice
2022-01-11 17:15       ` zimoun
2022-01-11 17:27         ` Tobias Geerinckx-Rice
2022-01-11 18:21           ` André A. Gomes
2022-01-11 18:50           ` zimoun
2022-01-12  2:06             ` Tobias Geerinckx-Rice
2022-01-12  8:55               ` zimoun
2022-01-12  9:22                 ` André A. Gomes
2022-01-12  3:51       ` Matt
2022-01-12 15:26         ` Luis Felipe
2022-01-11 16:48     ` Luis Felipe
2022-01-11 21:03     ` Attila Lendvai
2022-01-11 23:18       ` Ricardo Wurmus
2022-01-12  3:28         ` Matt
2022-01-18 14:34           ` Ludovic Courtès
2022-04-11  6:49             ` Attila Lendvai
2022-04-11  8:42               ` Maxime Devos [this message]
2022-04-13 15:01                 ` Attila Lendvai
2022-04-11  8:47               ` Maxime Devos
2022-01-12 11:19         ` Attila Lendvai
2022-01-12 11:52           ` Ricardo Wurmus
2022-01-12 12:00           ` André A. Gomes
2022-01-10  8:29 ` Josua Stingelin
2022-01-12  1:57   ` Matt
2022-01-12  9:19     ` Ricardo Wurmus
2024-01-10  9:55 ` Attila Lendvai
2024-01-17 19:17   ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d93cd88e2ff348cf2c47460c29ff62024c135f9.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=attila@lendvai.name \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).