[PATCH] gnu: ocaml-merlin: Added tests

  • Done
  • quality assurance status badge
Details
5 participants
  • Gabriel Hondet
  • Julien Lepiller
  • pukkamustard
  • swedebugia
  • zimoun
Owner
unassigned
Submitted by
Gabriel Hondet
Severity
normal
G
G
Gabriel Hondet wrote on 10 Feb 2019 14:36
(address . guix-patches@gnu.org)
877ee74v93.fsf@gmail.com
* gnu/packages/ocaml.scm (ocaml-merlin): Added tests
---
gnu/packages/ocaml.scm | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)

Toggle diff (51 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 07fcf92ae..0b33c257a 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -66,6 +66,7 @@
#:use-module (gnu packages version-control)
#:use-module (gnu packages virtualization)
#:use-module (gnu packages web-browsers)
+ #:use-module (gnu packages web)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
#:use-module (guix build-system dune)
@@ -4785,6 +4786,11 @@ format}. @code{craml} is released as a single binary (called @code{craml}).")
(url "https://github.com/ocaml/merlin.git")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; fix a dune file calling missing dependencies
+ (substitute* "tests/locate/partial-cmt/dune"
+ (("a.ml a.mli") ""))))
(sha256
(base32
"15ssgmwdxylbwhld9p1cq8x6kadxyhll5bfyf11dddj6cldna3hb"))))
@@ -4794,9 +4800,22 @@ format}. @code{craml} is released as a single binary (called @code{craml}).")
("ocaml-yojson" ,ocaml-yojson)
("ocaml-easy-format" ,ocaml-easy-format)))
(native-inputs
- `(("ocaml-findlib" ,ocaml-findlib)))
+ `(("ocaml-findlib" ,ocaml-findlib)
+ ("ocaml-craml" ,ocaml-craml)
+ ("jq" ,jq)))
(arguments
- '(#:tests? #f)) ;; Errors in tests in version 3.2.2
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-before 'check 'remove-failing
+ (lambda _
+ (delete-file-recursively "tests/warnings/")
+ (delete-file-recursively ;fail because of shebang patching
+ "tests/locate/context-detection/")
+ #t))
+ (replace 'check
+ (lambda _
+ (invoke "make" "test")
+ #t)))))
(synopsis "Context sensitive completion for OCaml in Vim and Emacs")
(description "Merlin is an editor service that provides modern IDE
features for OCaml. Emacs and Vim support is provided out-of-the-box.
--
2.20.1
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE5ercJXBcjd3P1FcAMbyBBfZZ1CUFAlxgKcgACgkQMbyBBfZZ
1CUsOxAAlUJXBUPn8RlU7Y0lgK0FH2JVP2ijGIoZ/dKKVtisCE4o2AXpUvgBfiBI
oO2agUvgerKbX2li7+zULVDTjEo8n3QDkvLlfMJQVAAHmiW0dSyX1gHgIIO0oyOp
AgKRXTLRutovDG+ClI/CWv8UGeTRMqCaQKgRGUxEPN39eLbn6yLw+dyYMINTWbJD
RvufzZlMSoT8xl4aVI6a73+AmgnizWIr+pPjWeY19DzHXvlfFGupymCDtZO6RMRX
UgqeHoRI5BUjuHLa9GpJhaBUYtGmQ/1ehusNU8dlGExOSayY/fLsh+DmBkG9EpO8
FWnFVldXI6b9WVfeucCHmvS6o3v56nFL0cNJxCXp21L0kJIoOSADta9o0KGt0L4O
c8mTdxLxxvcWxjKhM9GK+h1mUwjgSw4cjagKoclEMrUhToLKlQjXc4RI3Szbr+UM
HphQ8yk9gpINdgDqokLtUdLPA5LLAClLRfBE70Y8+GzPmkTBRDoZGM18x8MWJsc7
vGou9UeMuw5Rp7FQDPSkPe2t3fm0PSmhQvJNDCJi2QAaANwSPbb8nmC8gsdodVYD
V+GCPcxwbmH/S3sWG34sx7NKkpPh7rNzt8ABVUK75REWMbOsluYT/cTSJidQ1i/1
3guv0hXO2K99INjBIXY4S0cG2XGlz3mict4JoowrFwIkAwQ4x+o=
=SbZd
-----END PGP SIGNATURE-----

S
S
swedebugia wrote on 28 Jun 2019 07:41
(address . guix-patches@gnu.org)
b30ce794-44a6-a689-c469-0e989210f0d4@riseup.net
On 2019-02-10 14:36, Gabriel Hondet wrote:
Toggle quote (57 lines)
> * gnu/packages/ocaml.scm (ocaml-merlin): Added tests
> ---
> gnu/packages/ocaml.scm | 23 +++++++++++++++++++++--
> 1 file changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
> index 07fcf92ae..0b33c257a 100644
> --- a/gnu/packages/ocaml.scm
> +++ b/gnu/packages/ocaml.scm
> @@ -66,6 +66,7 @@
> #:use-module (gnu packages version-control)
> #:use-module (gnu packages virtualization)
> #:use-module (gnu packages web-browsers)
> + #:use-module (gnu packages web)
> #:use-module (gnu packages xml)
> #:use-module (gnu packages xorg)
> #:use-module (guix build-system dune)
> @@ -4785,6 +4786,11 @@ format}. @code{craml} is released as a single binary (called @code{craml}).")
> (url"https://github.com/ocaml/merlin.git")
> (commit (string-append "v" version))))
> (file-name (git-file-name name version))
> + (modules '((guix build utils)))
> + (snippet '(begin
> + ;; fix a dune file calling missing dependencies
> + (substitute* "tests/locate/partial-cmt/dune"
> + (("a.ml a.mli") ""))))
> (sha256
> (base32
> "15ssgmwdxylbwhld9p1cq8x6kadxyhll5bfyf11dddj6cldna3hb"))))
> @@ -4794,9 +4800,22 @@ format}. @code{craml} is released as a single binary (called @code{craml}).")
> ("ocaml-yojson" ,ocaml-yojson)
> ("ocaml-easy-format" ,ocaml-easy-format)))
> (native-inputs
> - `(("ocaml-findlib" ,ocaml-findlib)))
> + `(("ocaml-findlib" ,ocaml-findlib)
> + ("ocaml-craml" ,ocaml-craml)
> + ("jq" ,jq)))
> (arguments
> - '(#:tests? #f)) ;; Errors in tests in version 3.2.2
> + '(#:phases
> + (modify-phases %standard-phases
> + (add-before 'check 'remove-failing
> + (lambda _
> + (delete-file-recursively "tests/warnings/")
> + (delete-file-recursively ;fail because of shebang patching
> + "tests/locate/context-detection/")
> + #t))
> + (replace 'check
> + (lambda _
> + (invoke "make" "test")
> + #t)))))
> (synopsis "Context sensitive completion for OCaml in Vim and Emacs")
> (description "Merlin is an editor service that provides modern IDE
> features for OCaml. Emacs and Vim support is provided out-of-the-box.
> -- 2.20.1
>

This has slipped through the cracks. Could you rebase to current master
and send an updated patch?

--
Cheers Swedebugia
J
J
Julien Lepiller wrote on 28 Jun 2019 08:17
670267B2-5EA9-44E4-85DB-D48206DBED4A@lepiller.eu
Sorry for not having seen that!

Le 28 juin 2019 07:41:38 GMT+02:00, swedebugia <swedebugia@riseup.net> a écrit :
Toggle quote (51 lines)
>On 2019-02-10 14:36, Gabriel Hondet wrote:
>> * gnu/packages/ocaml.scm (ocaml-merlin): Added tests
>> ---
>> gnu/packages/ocaml.scm | 23 +++++++++++++++++++++--
>> 1 file changed, 21 insertions(+), 2 deletions(-)
>>
>> diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
>> index 07fcf92ae..0b33c257a 100644
>> --- a/gnu/packages/ocaml.scm
>> +++ b/gnu/packages/ocaml.scm
>> @@ -66,6 +66,7 @@
>> #:use-module (gnu packages version-control)
>> #:use-module (gnu packages virtualization)
>> #:use-module (gnu packages web-browsers)
>> + #:use-module (gnu packages web)
>> #:use-module (gnu packages xml)
>> #:use-module (gnu packages xorg)
>> #:use-module (guix build-system dune)
>> @@ -4785,6 +4786,11 @@ format}. @code{craml} is released as a single
>binary (called @code{craml}).")
>> (url"https://github.com/ocaml/merlin.git")
>> (commit (string-append "v" version))))
>> (file-name (git-file-name name version))
>> + (modules '((guix build utils)))
>> + (snippet '(begin
>> + ;; fix a dune file calling missing dependencies
>> + (substitute* "tests/locate/partial-cmt/dune"
>> + (("a.ml a.mli") ""))))
>> (sha256
>> (base32
>> "15ssgmwdxylbwhld9p1cq8x6kadxyhll5bfyf11dddj6cldna3hb"))))
>> @@ -4794,9 +4800,22 @@ format}. @code{craml} is released as a single
>binary (called @code{craml}).")
>> ("ocaml-yojson" ,ocaml-yojson)
>> ("ocaml-easy-format" ,ocaml-easy-format)))
>> (native-inputs
>> - `(("ocaml-findlib" ,ocaml-findlib)))
>> + `(("ocaml-findlib" ,ocaml-findlib)
>> + ("ocaml-craml" ,ocaml-craml)
>> + ("jq" ,jq)))
>> (arguments
>> - '(#:tests? #f)) ;; Errors in tests in version 3.2.2
>> + '(#:phases
>> + (modify-phases %standard-phases
>> + (add-before 'check 'remove-failing
>> + (lambda _
>> + (delete-file-recursively "tests/warnings/")
>> + (delete-file-recursively ;fail because of shebang
>patching
>> + "tests/locate/context-detection/")

Can we try and fix the shebang then?

Toggle quote (6 lines)
>> + #t))
>> + (replace 'check
>> + (lambda _
>> + (invoke "make" "test")
>> + #t)))))

I think #:test-target "test" would be enough, no?

Toggle quote (12 lines)
>> (synopsis "Context sensitive completion for OCaml in Vim and
>Emacs")
>> (description "Merlin is an editor service that provides modern
>IDE
>> features for OCaml. Emacs and Vim support is provided
>out-of-the-box.
>> -- 2.20.1
>>
>
>This has slipped through the cracks. Could you rebase to current master
>
>and send an updated patch?
P
P
pukkamustard wrote on 28 Dec 2020 13:40
[PATCH 00/12] Add ocaml-merlin.
(address . guix-patches@gnu.org)
20201228124017.24295-1-pukkamustard@posteo.net
Hi Guix,

This adds ocaml-merlin, a development tool for OCaml (and dependencies).

Some notes and questions:

- ocaml4.07-merlin is already available (version 3.2.2). This version has not
been updated (but changed to inherit from ocaml-merlin).

- There are many ocaml4.07-* packages in Guix. The reason for this is that
some packages need to be built with OCaml 4.07 but some newer versions of
libraries do no longer support OCaml 4.07 (or the old version of dune),
requiring older versions of the same packages. See also commit message
9ada1555.

This is quite cumbersome as two trees of OCaml packages need to be
maintained.

A nice solution would be to upgrade packages requiring OCaml 4.07 to also
build with the default OCaml (4.11). Packages that are not dependencies of
other packages that require OCaml 4.07 seem to be: `bap`, `ocaml-earley` and
`pplacer`. Maybe this should be opened as an issue?

- Some OCaml libraries have dependencies in `inputs` that seem to be required
from packages using the libraries. E.g. `ocaml-yojson` depends on
`ocaml-biniou`. Packages depending on `ocaml-yojson` need to manually add
`ocaml-biniou` to their inputs. Would it work/make sense to add
`ocaml-biniou` to `propagated-inputs` of `ocaml-yojson`?

- Test for ocaml-merlin (version 3.4.2) work. This resolves issue #34412
(alltough ocaml4.07-merlin still can not run tests).

Thanks!
-pukkamustard

pukkamustard (12):
gnu: Remove ocaml-js-build-tools.
gnu: Add ocaml-sexplib.
gnu: Add ocaml-base.
gnu: Add ocaml-parsexp.
gnu: Add ocaml-sexplib.
gnu: Add ocaml-ounit2.
gnu: ocaml-tyxml: Update to 4.4.0.
gnu: ocaml-markup: Update to 1.0.0.
gnu: Add ocaml-odoc.
gnu: Add ocaml-version.
gnu: Add ocaml-mdx.
gnu: Add ocaml-merlin.

gnu/packages/ocaml.scm | 527 ++++++++++++++++++++++++++++-------------
1 file changed, 359 insertions(+), 168 deletions(-)

--
2.29.2
J
J
Julien Lepiller wrote on 28 Dec 2020 15:06
(name . pukkamustard)(address . pukkamustard@posteo.net)
20201228150655.101e4704@tachikoma.lepiller.eu
Le Mon, 28 Dec 2020 13:40:17 +0100,
pukkamustard <pukkamustard@posteo.net> a écrit :

Toggle quote (5 lines)
> Hi Guix,
>
> This adds ocaml-merlin, a development tool for OCaml (and
> dependencies).

Thanks for the patches!

Toggle quote (12 lines)
>
> Some notes and questions:
>
> - ocaml4.07-merlin is already available (version 3.2.2). This version
> has not been updated (but changed to inherit from ocaml-merlin).
>
> - There are many ocaml4.07-* packages in Guix. The reason for this is
> that some packages need to be built with OCaml 4.07 but some newer
> versions of libraries do no longer support OCaml 4.07 (or the old
> version of dune), requiring older versions of the same packages. See
> also commit message 9ada1555.

Have you tried updating dune to the latest version that builds with
ocaml 4.07?

Toggle quote (4 lines)
>
> This is quite cumbersome as two trees of OCaml packages need to be
> maintained.

Actually 3, there are ocaml 4.07, 4.09 and 4.11 currently. I'm working
on a bootstrap for ocaml 4.07 (ocaml builds from a binary version of
itself), so I don't think it'll disappear soon, but at least we can try
and make ocaml4.07-* packages disappear :)

Toggle quote (7 lines)
>
> A nice solution would be to upgrade packages requiring OCaml 4.07
> to also build with the default OCaml (4.11). Packages that are not
> dependencies of other packages that require OCaml 4.07 seem to be:
> `bap`, `ocaml-earley` and `pplacer`. Maybe this should be opened as
> an issue?

pretty sure they build with at least ocaml-4.09 now, I'll see what I
can do :)

Toggle quote (7 lines)
>
> - Some OCaml libraries have dependencies in `inputs` that seem to be
> required from packages using the libraries. E.g. `ocaml-yojson`
> depends on `ocaml-biniou`. Packages depending on `ocaml-yojson` need
> to manually add `ocaml-biniou` to their inputs. Would it work/make
> sense to add `ocaml-biniou` to `propagated-inputs` of `ocaml-yojson`?

Yeah, could you provide an additional patch for that?

Toggle quote (7 lines)
>
> - Test for ocaml-merlin (version 3.4.2) work. This resolves issue
> #34412 (alltough ocaml4.07-merlin still can not run tests).
>
> Thanks!
> -pukkamustard

Thank you! I've sent some remarks to your patches, but generally LGTM :)

Toggle quote (19 lines)
>
> pukkamustard (12):
> gnu: Remove ocaml-js-build-tools.
> gnu: Add ocaml-sexplib.
> gnu: Add ocaml-base.
> gnu: Add ocaml-parsexp.
> gnu: Add ocaml-sexplib.
> gnu: Add ocaml-ounit2.
> gnu: ocaml-tyxml: Update to 4.4.0.
> gnu: ocaml-markup: Update to 1.0.0.
> gnu: Add ocaml-odoc.
> gnu: Add ocaml-version.
> gnu: Add ocaml-mdx.
> gnu: Add ocaml-merlin.
>
> gnu/packages/ocaml.scm | 527
> ++++++++++++++++++++++++++++------------- 1 file changed, 359
> insertions(+), 168 deletions(-)
>
J
J
Julien Lepiller wrote on 8 Oct 2021 04:57
Re: [PATCH] gnu: ocaml-merlin: Added tests
(address . 34412@debbugs.gnu.org)
20211008045716.6836bd2a@tachikoma.lepiller.eu
Hi!

So, since we have ocaml-merlin now, and since ocaml4.07-merlin is not
required by any other package, should we get rid of it? Or do we still
have a use for it?
Z
Z
zimoun wrote on 11 Oct 2021 13:35
Re: [bug#34412] [PATCH] gnu: ocaml-merlin: Added tests
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 34412@debbugs.gnu.org)
CAJ3okZ3DDffWYP+-MQsvUR4HWGk3vtZxJ+UJ1eU-5uy58+T6dQ@mail.gmail.com
Hi Julien

What is the plan for removing ocaml4.07 packages?

BTW, this patch submission could be closed, IMHO. Because as you
said, ocaml-merlin is in and ocaml4.07-merlin is not required by any
other package.

Cheers,
simon
Z
Z
zimoun wrote on 7 Apr 2022 14:14
Re: bug#34412: [PATCH] gnu: ocaml-merlin: Added tests
(name . Gabriel Hondet)(address . gabrielhondet@gmail.com)(address . 34412-done@debbugs.gnu.org)
86tub52iqj.fsf@gmail.com
Hi,

Thanks for your contribution with patch#34412 [1]. The ’ocaml-merlin’
contains this:

Toggle snippet (7 lines)
(modify-phases %standard-phases
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(invoke "dune" "runtest" "-p" "merlin,dot-merlin-reader")))))))

added by 980c33bd3f16e44a123ef21408a56e59ebb76373. And the package
’ocaml4.07-merlin’ had been removed by
188e3e2e6878346b0bdc8b46084f458abe86826c.

Therefore, closing.


Cheers,
simon


Closed
?