From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eNf+H6kAEWGdpAAAgWs5BA (envelope-from ) for ; Mon, 09 Aug 2021 12:17:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 6GWbG6kAEWFJRwAAB5/wlQ (envelope-from ) for ; Mon, 09 Aug 2021 10:17:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0C9571B966 for ; Mon, 9 Aug 2021 12:17:13 +0200 (CEST) Received: from localhost ([::1]:37312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mD2LH-000170-Lc for larch@yhetil.org; Mon, 09 Aug 2021 06:17:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mD2L9-00016X-9X for guix-patches@gnu.org; Mon, 09 Aug 2021 06:17:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44300) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mD2L9-0005Po-2s for guix-patches@gnu.org; Mon, 09 Aug 2021 06:17:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mD2L8-0002Mv-VP for guix-patches@gnu.org; Mon, 09 Aug 2021 06:17:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49950] [PATCH] Update opam and dune Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Aug 2021 10:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49950 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller , 49950@debbugs.gnu.org Received: via spool by 49950-submit@debbugs.gnu.org id=B49950.16285041769024 (code B ref 49950); Mon, 09 Aug 2021 10:17:02 +0000 Received: (at 49950) by debbugs.gnu.org; 9 Aug 2021 10:16:16 +0000 Received: from localhost ([127.0.0.1]:55842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mD2KJ-0002LP-7W for submit@debbugs.gnu.org; Mon, 09 Aug 2021 06:16:16 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:43452 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mD2KE-0002Kj-Ov for 49950@debbugs.gnu.org; Mon, 09 Aug 2021 06:16:09 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1628504157; bh=s3EJm1PuGMJl97PBkKGzBYQcMJ1R/371i+A4eA1Zx0k=; h=From:To:Subject:In-Reply-To:References:Date; b=TgYFgMdlNqFRbSuZnqXRn490ZMZuac6LTM5OBgftHptHy+GYoQplVWMujmZ6fd+/D webkGj9k0uAaMj2TXpLDuqvCdpdTVubeRK5zwV2iWVi8wzVx+impyIocuOAxUaauSe kR5F7am79repS+sLaOIqx8aXBUZtRwB8grubbZPk= In-Reply-To: <20210809041444.613748a7@tachikoma.lepiller.eu> References: <20210809041444.613748a7@tachikoma.lepiller.eu> Date: Mon, 09 Aug 2021 12:15:56 +0200 Message-ID: <87fsviq5yb.fsf@yoctocell.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628504233; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=cZunoX5/IhBv3G5x5a40RqLb02G6sWPAKU8ASCBNJGo=; b=NzQdp7H8q7z9izEp8jNAp2CQC8lK1LIEEQUFKPUYMc36vXi8OZRgZanRF+gc0sFeXUlsaT Q5TJLua1MscdirMTQE9jQJIPfqxwq4TCf3qRfAR4aR0PB1d11SRGx/dSlobc7g+rZI9uaL xHDZA0BOft6Zh/Fs2a/vSSaWc32C2kyBEZasW9xr+GuLIzRqt/I4tuXLWstMQCJJN9CbZb fv7BrN2VhBydwU1mJoSMbO0XowGc0vJi0JJA/CBNllRjm71L5InhGfGFP9iME3j3gzh/GQ AXtPEmJMdE1tNotLlkyXsfi0GlSrVM6YumGq8jJ8lZxxCySlrTng66DLeF15Bg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628504233; a=rsa-sha256; cv=none; b=ufcrK9ag66kgouqGKSiiOZP6Lro1CZwNdAXpvFCPfFXoxqw8mmPbigGBMiicL5/THa2fOz sqKLYP4qPufZ5hG6zDwCUL4YlpjIqCMCdtZbEMtsE0ZzkuQ536+F/l1KvfH8QDzC8dAqV5 SlfURbhs2VEmc9JsM3a/6As3Pbmd5OTUza7SornZmtA1QpZp9E6xP7YhP/L5zJxXAXZgMt 5DYbg8exEO2ZaO8uBTJ7QWYhrujeiipXtl0cyaji/XcraKlPMwtx2y7hUmDzLPPpZ7S2hU VcY5HF1b6YAGajNiOBwDvu6IdcVUmzV7ms9O66H1qNqfYpxdiB1IhlTXkVS2kg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=TgYFgMdl; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.41 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=TgYFgMdl; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 0C9571B966 X-Spam-Score: -3.41 X-Migadu-Scanner: scn1.migadu.com X-TUID: VX6OV4oF9Pil --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Aug 09 2021, Julien Lepiller wrote: > Hi Guix! > > This small series updates opam and dune. Opam was surprisingly > difficult to update, after the switch to dune, but I had to update it > because the previous version we had doesn't build with the new dune. > > The most difficult part was making the tests pass, as they require > network access. For some of them, I was able to download the files in > advance (see opam-repo in the inputs), and change the tests to use > that, fix shebangs, ... I still had to disable three tests: one that > runs opam and let it clone a git repository, one that fails only > because of a difference in text formating (it's expected to be on one > line, but actually is nicely formated), and one that compares a > generated dune file with the one that was just modified. > > also ocaml-markup fails with the new dune, so I updated it to the > latest version. > From 8b17bf14e9892b26b049c530365c6a41b1231838 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Mon, 9 Aug 2021 03:57:38 +0200 > Subject: [PATCH 1/4] gnu: ocaml-markup: Update to 1.0.2. > > * gnu/packages/ocaml.scm (ocaml-markup): Update to 1.0.2. > --- > gnu/packages/ocaml.scm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm > index 112751ddec..923d7b1704 100644 > --- a/gnu/packages/ocaml.scm > +++ b/gnu/packages/ocaml.scm > @@ -6432,7 +6432,7 @@ the full Core is not available, such as in Javascri= pt.") > (define-public ocaml-markup > (package > (name "ocaml-markup") > - (version "1.0.0") > + (version "1.0.2") > (home-page "https://github.com/aantron/markup.ml") > (source > (origin > @@ -6443,7 +6443,7 @@ the full Core is not available, such as in Javascri= pt.") > (file-name (git-file-name name version)) > (sha256 > (base32 > - "09hkrf9pw6hpb9j06p5bddklpnjwdjpqza3bx2179l970yl67an9")))) > + "1kvqwrrcrys5d0kzdwxcj66jpi6sdhfas4pcg02pixx92q87vhqm")))) > (build-system dune-build-system) > (arguments > `(#:package "markup")) > --=20 > 2.32.0 > > From d76314465a79fe531c05f3849f5e609c175362aa Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Mon, 9 Aug 2021 03:24:08 +0200 > Subject: [PATCH 2/4] gnu: ocaml-opam-file-format: Update to 2.1.3. > > * gnu/packages/ocaml.scm (ocaml-opam-file-format): Update to 2.1.3. > --- > gnu/packages/ocaml.scm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm > index 923d7b1704..11f7eff267 100644 > --- a/gnu/packages/ocaml.scm > +++ b/gnu/packages/ocaml.scm > @@ -747,7 +747,7 @@ let () =3D String.split_on_char ':' (Sys.getenv \"OCA= MLPATH\") > (define-public ocaml-opam-file-format > (package > (name "ocaml-opam-file-format") > - (version "2.0.0") > + (version "2.1.3") > (source (origin > (method git-fetch) > (uri (git-reference > @@ -756,7 +756,7 @@ let () =3D String.split_on_char ':' (Sys.getenv \"OCA= MLPATH\") > (file-name (git-file-name name version)) > (sha256 > (base32 > - "0fqb99asnair0043hhc8r158d6krv5nzvymd0xwycr5y72yrp0hv"))= )) > + "1fxhppdmrysr2nb5z3c448h17np48f3ga9jih33acj78r4rdblcs"))= )) > (build-system ocaml-build-system) > (arguments > `(#:tests? #f; No tests > --=20 > 2.32.0 > > From 66cc97fb59324387a3d829e1dbe7382e5511fe6a Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Mon, 9 Aug 2021 03:20:06 +0200 > Subject: [PATCH 3/4] gnu: opam: Update to 2.1.0. > > * gnu/packages/ocaml.scm (opam): Update to 2.1.0. > --- > gnu/packages/ocaml.scm | 158 +++++++++++++++++++++++------------------ > 1 file changed, 89 insertions(+), 69 deletions(-) > > diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm > index 11f7eff267..230d9d1e03 100644 > --- a/gnu/packages/ocaml.scm > +++ b/gnu/packages/ocaml.scm > @@ -77,6 +77,7 @@ > #:use-module (gnu packages texinfo) > #:use-module (gnu packages time) > #:use-module (gnu packages tls) > + #:use-module (gnu packages version-control) > #:use-module (gnu packages virtualization) > #:use-module (gnu packages web) > #:use-module (gnu packages web-browsers) > @@ -775,7 +776,7 @@ the opam file format.") > (define-public opam > (package > (name "opam") > - (version "2.0.8") > + (version "2.1.0") > (source (origin > (method git-fetch) > (uri (git-reference > @@ -784,78 +785,97 @@ the opam file format.") > (file-name (git-file-name name version)) > (sha256 > (base32 > - "1z0ls6xxa4ws5xw0am5gxmh5apnmyhgkcphrncp53w34j8sfydsj"))= )) > - (build-system ocaml-build-system) > + "12l7l4pbzy71k1yc7ym5aczajszvc9bqkdnfg8xhqc8ch8j1h1lj"))= )) > + (build-system dune-build-system) > (arguments > - `(#:configure-flags > - (list (string-append "SHELL=3D" > - (assoc-ref %build-inputs "bash") > - "/bin/sh")) > + `(#:test-target "." > + #:phases > + (modify-phases %standard-phases > + (add-before 'build 'pre-build > + (lambda* (#:key inputs make-flags #:allow-other-keys) > + (let ((bash (assoc-ref inputs "bash")) > + (bwrap (string-append (assoc-ref inputs "bubblewrap") > + "/bin/bwrap"))) > + (substitute* "src/core/opamSystem.ml" > + (("\"/bin/sh\"") > + (string-append "\"" bash "/bin/sh\"")) > + (("getconf") > + (which "getconf"))) > + ;; Use bwrap from the store directly. > + (substitute* "src/state/shellscripts/bwrap.sh" > + (("-v bwrap") (string-append "-v " bwrap)) > + (("exec bwrap") (string-append "exec " bwrap)) > + ;; Mount /gnu and /run/current-system in the > + ;; isolated environment when building with opam. > + ;; This is necessary for packages to find external > + ;; dependencies, such as a C compiler, make, etc... > + (("^add_sys_mounts /usr") > + "add_sys_mounts /gnu /run/current-system /usr")) /gnu should be replaced by (%store-directory) (from (gnu build utils)), in case the store isn=E2=80=99t mounted at /gnu/store. :-) > + (substitute* "src/client/opamInitDefaults.ml" > + (("\"bwrap\"") (string-append "\"" bwrap "\"")))))) > + (add-before 'check 'prepare-checks > + (lambda* (#:key inputs #:allow-other-keys) > + ;; Opam tests need to run an isolated environment from a wr= itable > + ;; home directory. > + (mkdir-p "test-home") > + (setenv "HOME" (string-append (getcwd) "/test-home")) >=20=20 > - ;; For some reason, 'ocp-build' needs $TERM to be set. > - #:make-flags > - (list "TERM=3Dscreen" > - (string-append "SHELL=3D" > - (assoc-ref %build-inputs "bash") > - "/bin/sh")) > - > - #:test-target "tests" > - > - #:phases (modify-phases %standard-phases > - (add-before 'build 'pre-build > - (lambda* (#:key inputs make-flags #:allow-other-keys) > - (let ((bash (assoc-ref inputs "bash")) > - (bwrap (string-append (assoc-ref inputs "bubb= lewrap") > - "/bin/bwrap"))) > - (substitute* "src/core/opamSystem.ml" > - (("\"/bin/sh\"") > - (string-append "\"" bash "/bin/sh\"")) > - (("getconf") > - (which "getconf"))) > - ;; Use bwrap from the store directly. > - (substitute* "src/state/shellscripts/bwrap.sh" > - (("-v bwrap") (string-append "-v " bwrap)) > - (("exec bwrap") (string-append "exec " bwrap)) > - ;; Mount /gnu and /run/current-system in the > - ;; isolated environment when building with opam. > - ;; This is necessary for packages to find exter= nal > - ;; dependencies, such as a C compiler, make, et= c... > - (("^add_sys_mounts /usr") > - "add_sys_mounts /gnu /run/current-system /usr"= )) > - (substitute* "src/client/opamInitDefaults.ml" > - (("\"bwrap\"") (string-append "\"" bwrap "\""))) > - ;; Generating the documentation needs write access > - (for-each > - (lambda (f) (chmod f #o644)) > - (find-files "doc" ".")) > - #t))) > - (add-before 'check 'pre-check > - (lambda _ > - ;; The "repo" test attempts to open some of these f= iles O_WRONLY > - ;; and fails with a bogus "OpamSystem.File_not_foun= d" otherwise. > - (for-each > - (lambda (f) (chmod f #o644)) > - (find-files "tests/packages" "\\.opam$")) > - > - (substitute* "tests/Makefile" > - (("/usr/bin/printf") > - (which "printf")) > - ;; By default tests run twice: once with a "local= " repository > - ;; and once with a git repository: disable the gi= t tests to > - ;; avoid the dependency. > - (("all: local git") > - "all: local")) > - #t))))) > + ;; Opam tests require data from opam-repository. Instead of > + ;; downloading them with wget from the guix environment, co= py the > + ;; content to the expected directory. > + (substitute* "tests/reftests/dune.inc" > + (("tar -C.*opam-archive-([0-9a-f]*)[^)]*" _ commit) > + (string-append "rmdir %{targets}) (run cp -r " > + (assoc-ref inputs (string-append "opam-re= po-" commit)) > + "/ %{targets}) (run chmod +w -R %{targets= }")) > + (("wget[^)]*") "touch %{targets}") > + ;; Disable a failing test because of different line wrapp= ing > + (("diff cli-versioning.test cli-versioning.out") "run tru= e") > + ;; Disable a failing test because it tries to clone a git > + ;; repository from inside bwrap > + (("diff upgrade-format.test upgrade-format.out") "run tru= e")) > + (substitute* "tests/reftests/dune" > + ;; Because of our changes to the previous file, we cannot= check > + ;; it can be regenerated > + (("diff dune.inc dune.inc.gen") "run true")) > + ;; Ensure we can run the generated build.sh (no /bin/sh) > + (substitute* '("tests/reftests/legacy-local.test" > + "tests/reftests/legacy-git.test") > + (("#! ?/bin/sh") (string-append "#!" (assoc-ref inputs "b= ash") > + "/bin/sh"))) > + (substitute* "tests/reftests/testing-env" > + (("OPAMSTRICT=3D1") > + (string-append "OPAMSTRICT=3D1\nLIBRARY_PATH=3D" > + (assoc-ref inputs "libc") "/lib")))))))) > (native-inputs > - `(("dune" ,dune) > - ("ocaml-cppo" ,ocaml-cppo) > + (let ((opam-repo (lambda (commit hash) > + (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/ocaml/opam-re= pository") > + (commit commit))) > + (file-name (git-file-name "opam-repo" commit)) > + (sha256 (base32 hash)))))) > + `(("dune" ,dune) > + ("ocaml-cppo" ,ocaml-cppo) >=20=20 > - ;; For tests. > - ("openssl" ,openssl) > - ("python" ,python-wrapper) > - ("rsync" ,rsync) > - ("unzip" ,unzip) > - ("which" ,which))) > + ;; For tests. > + ("git" ,git) Maybe =E2=80=98git-minimal=E2=80=99 would be enough. The rest LGTM, I am not super familiar with Opam, though. Thank you for working on this! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmERAFwVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5ClUQAKqo9E3rnD+7Ns/YD3G7tvhFNlN/ I5w882o5eDM05XPki0TIiRBeAt3zER13lamp+KYzi9RRTlPH6WKej9GReTfndY9p RklsiUQrAPCzbyOj7d+WBLjuCjEvRCeTUFrUGrmUqH6ThTnW+FAYJXMvkWrNpzIh T0lZiFpQtCzi9gp6ckIGjKPGDGOlM6DyW9y+q5Nt30fSXtHU4PiyeLbXGpewKa8G EhmmvYxAgr/+e+MqW25ewvvXLK9A9y55RWowrXSPoN3o6tCVnYgmKr0vU6hxg1WJ AnAEIODHEwpSGosfjLQ8g99PKFHTh3l8/TV0Lo7lI4nR2bNo1RJCPthrJrto3Z4/ Ch3DvI8aLKYgLU8n2hLsUIDa5uT6jiNhr5H+3sfczhhxUMZSkO2Vv/uSOIkJOvNv 9T8c473fia8FhaOMYseYRVR+4NGyH1GXMkWEoC7gMHg/CXurwnmM8nHDtNx3tJbb E4ZF2Vex0rIDx1fxSYc3Hi5ABowaCIDVDCc1TPL1znIErZ72DCBMHMXb//y2zrfF rjH1idQLer/V7TZ2yz7GyWuh/PnRejJikKRYbA03X7v6tJBX1SQpx2qRI7EM465S M6dCZpcckETvgcWGHt2aVud/sCHJpve3BldlnH+8U91OKQBp5u4QaEZtIV8f9sRo fEYVH79EH1LUhlD+ =1BZw -----END PGP SIGNATURE----- --=-=-=--