Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

melange: set min version to 3.8 #7665

Merged
merged 7 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions src/dune_rules/dune_file.ml
Original file line number Diff line number Diff line change
Expand Up @@ -536,23 +536,7 @@ module Library = struct
let expected_version = (3, 8) in
if dune_version >= expected_version then
Mode_conf.Lib.Set.decode_osl ~stanza_loc project
else
(* Old behavior: if old parser succeeds, return that. Otherwise, if
parsing the ordered set language succeeds, ask the user to upgrade to
a supported version. Otherwise, fail with the first error. *)
try_
(Mode_conf.Lib.Set.decode >>| fun modes -> `Modes modes)
(fun exn ->
try_
( Mode_conf.Lib.Set.decode_osl ~stanza_loc project >>| fun modes ->
if dune_version >= expected_version then `Modes modes
else `Upgrade )
(fun _ -> raise exn))
>>| function
| `Modes modes -> modes
| `Upgrade ->
Syntax.Error.since stanza_loc Stanza.syntax expected_version
~what:"Ordered set language for modes"
else Mode_conf.Lib.Set.decode
end

type visibility =
Expand Down
2 changes: 1 addition & 1 deletion src/dune_rules/melange/melange_stanzas.ml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ end
let syntax =
Dune_lang.Syntax.create ~name:Dune_project.Melange_syntax.name
~desc:"support for Melange compiler"
[ ((0, 1), `Since (3, 7)) ]
[ ((0, 1), `Since (3, 8)) ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause a slightly confusing message for users of melange upgrading to 3.8.0, but that's probably OK given the status of the support. (just a heads-up)


let () =
Dune_project.Extension.register_simple syntax
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test that the target directory exists

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/aliases.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test alias field on melange.emit stanzas

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/basic-install.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test that we can install melange mode libraries

$ cat >dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (package (name foo))
> (using melange 0.1)
> EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Example using melange.emit, copy_files and include_subdirs
> EOF

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Example showing melange.emit and copy_files, where the files are copied
into the melange.emit target folder

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/copy-files-simple.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test simple interactions between melange.emit and copy_files

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
6 changes: 3 additions & 3 deletions test/blackbox-tests/test-cases/melange/depend-on-installed.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Test dependency on installed package
$ mkdir a b prefix app

$ cat > a/dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (package (name a))
> (using melange 0.1)
> EOF
Expand Down Expand Up @@ -34,7 +34,7 @@ Test dependency on installed package
Installing $TESTCASE_ROOT/prefix/lib/a/melange/a__Foo.cmt

$ cat >b/dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (package (name b))
> (using melange 0.1)
> EOF
Expand Down Expand Up @@ -80,7 +80,7 @@ Test dependency on installed package
Installing $TESTCASE_ROOT/prefix/lib/b/melange/b__Foo.cmt

$ cat >app/dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (package (name app))
> (using melange 0.1)
> EOF
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(lang dune 3.7)
(lang dune 3.8)

(using melange 0.1)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ form `foo.bar.baz`

$ mkdir a app
$ cat > a/dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (package (name a))
> (using melange 0.1)
> EOF
Expand Down Expand Up @@ -39,7 +39,7 @@ form `foo.bar.baz`
(source (path Foo) (impl (path sub/foo.ml))))))

$ cat >app/dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 3.7)
(lang dune 3.8)

(package
(name pkg2))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 3.7)
(lang dune 3.8)

(package
(name pkg1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Test dependency on installed package
$ mkdir a b c prefix

$ cat > a/dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (package (name a))
> (using melange 0.1)
> EOF
Expand Down Expand Up @@ -39,7 +39,7 @@ Test dependency on installed package
Installing $TESTCASE_ROOT/prefix/lib/a/melange/a__Foo.cmt

$ cat >b/dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand All @@ -65,7 +65,7 @@ Test dependency on installed package
foo

$ cat >c/dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/melange/emit-installed.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Test dependency on installed package
$ mkdir -p lib-a lib-a/sub b prefix

$ cat > lib-a/dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (package (name a))
> (using melange 0.1)
> EOF
Expand Down Expand Up @@ -43,7 +43,7 @@ Test dependency on installed package
Installing $TESTCASE_ROOT/prefix/lib/a/sub/sub.ml

$ cat >b/dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/emit-private.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test dependency on a private library in the same package as melange.emit

$ cat >dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (package (name a))
> (using melange 0.1)
> EOF
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/emit-select.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using `(select ...)` in melange.emit

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF
$ cat >bar.melange.ml <<EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Test dependency on installed package
$ mkdir xyz

$ cat > xyz/dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (package (name aa_fe))
> (using melange 0.1)
> EOF
Expand All @@ -19,12 +19,12 @@ Test dependency on installed package
> EOF

$ cat >dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

$ cat >dune-workspace <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> EOF

$ cat > dune <<EOF
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test (modules) field can be left empty

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/empty-entries.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test (modules) field can be left empty

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/flags.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test flags and compile_flags fields on melange.emit stanza

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/melange/gh7020.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Reproduce github #7020
$ dir=_to-install
$ mkdir $dir
$ cat >$dir/dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> (package
> (name dummyfoo))
Expand Down Expand Up @@ -35,7 +35,7 @@ Reproduce github #7020
$ export OCAMLPATH=$PWD/$dir/_install/lib

$ cat >dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(lang dune 3.7)
(lang dune 3.8)

(using melange 0.1)
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/intfonly-entries.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Entry points should not allow mli only modules as entry points.

$ cat >dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(lang dune 3.7)
(lang dune 3.8)

(using melange 0.1)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Show that the merlin config knows about melange.compile_flags

$ cat >dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/merlin.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$ export BUILD_PATH_PREFIX_MAP="/MELC_STDLIB=$(ocamlfind query melange):$BUILD_PATH_PREFIX_MAP"

$ cat >dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/missing-melc.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test cases when melc is not available

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/mli.t/dune-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 3.7)
(lang dune 3.8)

(using melange 0.1)

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/module-systems.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Parses the full form (<module-system> <extension>)

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 3.7)
(lang dune 3.8)

(using melange 0.1)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Make sure an error is returned if trying to nest `melange.emit` stanzas

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF
$ mkdir -p a/output/b
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/ocaml-flags.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test melange.compile_flags, ocamlc_flags and ocamlopt_flags fields on melange.emit stanza

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/melange/preprocess.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test (preprocess) field on melange.emit stanza

$ cat > dune-project <<EOF
> (lang dune 3.7)
> (lang dune 3.8)
> (using melange 0.1)
> EOF

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(lang dune 3.7)
(lang dune 3.8)

(using melange 0.1)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(lang dune 3.7)
(lang dune 3.8)

(using melange 0.1)
Loading