From 05d5468a04c72bfd63a44046ac7977039f1d12c1 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 11 Sep 2023 12:01:40 +0100 Subject: [PATCH] fix: remove check for [.dune] files (#8611) These files are absolutely ancient and there's nobody out there still has them. We were supposed to get rid of this warning in 3.0, but there's no reason to not do it now. Signed-off-by: Rudi Grinberg --- doc/changes/8611.md | 2 ++ src/dune_rules/findlib.ml | 17 ----------------- .../old-dune-subsystem.t/example/dune-project | 1 - .../old-dune-subsystem.t/example/src/dune | 3 --- .../old-dune-subsystem.t/example/src/x.ml | 0 .../install/lib/dune_inline_tests/META | 6 ------ .../dune_inline_tests/dune_inline_tests.dune | 7 ------- .../test-cases/old-dune-subsystem.t/run.t | 17 ----------------- 8 files changed, 2 insertions(+), 51 deletions(-) create mode 100644 doc/changes/8611.md delete mode 100644 test/blackbox-tests/test-cases/old-dune-subsystem.t/example/dune-project delete mode 100644 test/blackbox-tests/test-cases/old-dune-subsystem.t/example/src/dune delete mode 100644 test/blackbox-tests/test-cases/old-dune-subsystem.t/example/src/x.ml delete mode 100644 test/blackbox-tests/test-cases/old-dune-subsystem.t/install/lib/dune_inline_tests/META delete mode 100644 test/blackbox-tests/test-cases/old-dune-subsystem.t/install/lib/dune_inline_tests/dune_inline_tests.dune delete mode 100644 test/blackbox-tests/test-cases/old-dune-subsystem.t/run.t diff --git a/doc/changes/8611.md b/doc/changes/8611.md new file mode 100644 index 00000000000..c34d37aaae7 --- /dev/null +++ b/doc/changes/8611.md @@ -0,0 +1,2 @@ +- Remove warning against `.dune` files generated by pre dune 2.0 (#8611, + @rgrinberg) diff --git a/src/dune_rules/findlib.ml b/src/dune_rules/findlib.ml index 505ea0a275a..aea12959915 100644 --- a/src/dune_rules/findlib.ml +++ b/src/dune_rules/findlib.ml @@ -64,22 +64,6 @@ let hash { stdlib_dir; paths; builtins; ext_lib } = let findlib_predicates_set_by_dune = Ps.of_list [ P.ppx_driver; P.mt; P.mt_posix ] -let check_dot_dune_exists ~dir ~dir_contents name = - match dir_contents with - | Error _ -> () - | Ok fnames -> - let fname = sprintf "%s.dune" (Lib_name.to_string name) in - if List.mem fnames fname ~equal:String.equal - then - User_warning.emit - ~loc:(Loc.in_file (Path.relative dir fname)) - [ Pp.text - ".dune files are ignored since 2.0. Reinstall the library with dune >= 2.0 \ - to get rid of this warning and enable support for the subsystem this \ - library provides." - ] -;; - let has_double_underscore s = let len = String.length s in len >= 2 @@ -98,7 +82,6 @@ let has_double_underscore s = let to_dune_library (t : Findlib.Package.t) ~dir_contents ~ext_lib = let loc = Loc.in_file t.meta_file in let add_loc x = loc, x in - check_dot_dune_exists ~dir:t.dir ~dir_contents t.name; let archives = Findlib.Package.archives t in let obj_dir = Obj_dir.make_external_no_private ~dir:t.dir in let modes : Lib_mode.Map.Set.t = diff --git a/test/blackbox-tests/test-cases/old-dune-subsystem.t/example/dune-project b/test/blackbox-tests/test-cases/old-dune-subsystem.t/example/dune-project deleted file mode 100644 index 81c449d2edc..00000000000 --- a/test/blackbox-tests/test-cases/old-dune-subsystem.t/example/dune-project +++ /dev/null @@ -1 +0,0 @@ -(lang dune 1.5) diff --git a/test/blackbox-tests/test-cases/old-dune-subsystem.t/example/src/dune b/test/blackbox-tests/test-cases/old-dune-subsystem.t/example/src/dune deleted file mode 100644 index 34b65e983ac..00000000000 --- a/test/blackbox-tests/test-cases/old-dune-subsystem.t/example/src/dune +++ /dev/null @@ -1,3 +0,0 @@ -(library - (name example) - (inline_tests (backend dune_inline_tests))) \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/old-dune-subsystem.t/example/src/x.ml b/test/blackbox-tests/test-cases/old-dune-subsystem.t/example/src/x.ml deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/test/blackbox-tests/test-cases/old-dune-subsystem.t/install/lib/dune_inline_tests/META b/test/blackbox-tests/test-cases/old-dune-subsystem.t/install/lib/dune_inline_tests/META deleted file mode 100644 index c72b99109fc..00000000000 --- a/test/blackbox-tests/test-cases/old-dune-subsystem.t/install/lib/dune_inline_tests/META +++ /dev/null @@ -1,6 +0,0 @@ -description = "" -requires = "" -archive(byte) = "simple_tests.cma" -archive(native) = "simple_tests.cmxa" -plugin(byte) = "simple_tests.cma" -plugin(native) = "simple_tests.cmxs" \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/old-dune-subsystem.t/install/lib/dune_inline_tests/dune_inline_tests.dune b/test/blackbox-tests/test-cases/old-dune-subsystem.t/install/lib/dune_inline_tests/dune_inline_tests.dune deleted file mode 100644 index 7d8c5a03145..00000000000 --- a/test/blackbox-tests/test-cases/old-dune-subsystem.t/install/lib/dune_inline_tests/dune_inline_tests.dune +++ /dev/null @@ -1,7 +0,0 @@ -(dune - 2 - ((inline_tests.backend - 1.0 - ((flags :standard) - (generate_runner - (run sed "s/(\\*TEST:\\(.*\\)\\*)/let () = \\1;;/" %{impl-files})))))) \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/old-dune-subsystem.t/run.t b/test/blackbox-tests/test-cases/old-dune-subsystem.t/run.t deleted file mode 100644 index cc30e824df1..00000000000 --- a/test/blackbox-tests/test-cases/old-dune-subsystem.t/run.t +++ /dev/null @@ -1,17 +0,0 @@ -install/lib contains inline tests as defined with the old subsystem. Previously, -#1549 would do the same thing, but it would generate the configuration. Since -new versions of dune will generate dune-package files, we should still make sure -we understand the old files. - - $ env OCAMLPATH=install/lib dune runtest --root example - Entering directory 'example' - File "$TESTCASE_ROOT/install/lib/dune_inline_tests/dune_inline_tests.dune", line 1, characters 0-0: - Warning: .dune files are ignored since 2.0. Reinstall the library with dune - >= 2.0 to get rid of this warning and enable support for the subsystem this - library provides. - File "src/dune", line 3, characters 25-42: - 3 | (inline_tests (backend dune_inline_tests))) - ^^^^^^^^^^^^^^^^^ - Error: dune_inline_tests is not an inline tests backend - Leaving directory 'example' - [1]