From 86070590ac37feab9143348507b59a73b9ff284b Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Mon, 11 Feb 2019 10:15:17 +0000 Subject: [PATCH] Deprecate no_keep_locs Fixes #1816 Signed-off-by: Jeremie Dimino --- CHANGES.md | 4 ++++ doc/dune-files.rst | 5 +++-- src/dune_file.ml | 1 + .../test-cases/syntax-versioning/dune-project | 1 - .../test-cases/syntax-versioning/run.t | 15 +++++++++++++++ 5 files changed, 23 insertions(+), 3 deletions(-) delete mode 100644 test/blackbox-tests/test-cases/syntax-versioning/dune-project diff --git a/CHANGES.md b/CHANGES.md index fd40b498117..accda779cfc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -130,6 +130,10 @@ unreleased - Add `DUNE_PROFILE` environment variable to easily set the profile. (#1806, @rgrinberg) +- Deprecate the undocumented `(no_keep_locs)` field. It was only + necessary until virtual libraries were supported (#1822, fix #1816, + @diml) + 1.6.2 (05/12/2018) ------------------ diff --git a/doc/dune-files.rst b/doc/dune-files.rst index d60b6d05cf5..a00e4cfede1 100644 --- a/doc/dune-files.rst +++ b/doc/dune-files.rst @@ -200,8 +200,9 @@ to use the :ref:`include_subdirs` stanza. - ``(allow_overlapping_dependencies)`` allows external dependencies to overlap with libraries that are present in the workspace -- ``(no_keep_locs)`` undocumented, it is a necessary hack until this - is implemented: https://github.com/ocaml/dune/issues/921 +- ``(no_keep_locs)`` does nothing. It used to be a necessary hack when + we were waiting for proper support for virtual libraries. Do not use + in new code, it will be deleted in dune 2.0 Note that when binding C libraries, dune doesn't provide special support for tools such as ``pkg-config``, however it integrates easily with configurator_ by diff --git a/src/dune_file.ml b/src/dune_file.ml index 535f0ef13af..b88169c1b7f 100644 --- a/src/dune_file.ml +++ b/src/dune_file.ml @@ -837,6 +837,7 @@ module Library = struct located (field "self_build_stubs_archive" (option string) ~default:None) and no_dynlink = field_b "no_dynlink" and no_keep_locs = field_b "no_keep_locs" + ~check:(Syntax.deprecated_in Stanza.syntax (1, 7)) and sub_systems = return () >>= fun () -> Sub_system_info.record_parser () diff --git a/test/blackbox-tests/test-cases/syntax-versioning/dune-project b/test/blackbox-tests/test-cases/syntax-versioning/dune-project deleted file mode 100644 index b2559fa0581..00000000000 --- a/test/blackbox-tests/test-cases/syntax-versioning/dune-project +++ /dev/null @@ -1 +0,0 @@ -(lang dune 1.0) \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/syntax-versioning/run.t b/test/blackbox-tests/test-cases/syntax-versioning/run.t index a383b0c0440..914d7538b79 100644 --- a/test/blackbox-tests/test-cases/syntax-versioning/run.t +++ b/test/blackbox-tests/test-cases/syntax-versioning/run.t @@ -1,3 +1,5 @@ + $ echo '(lang dune 1.0)' > dune-project + $ echo '(jbuild_version 1)' > dune $ dune build File "dune", line 1, characters 0-18: @@ -35,3 +37,16 @@ ... %{x} ... [1] $ rm -f dune + + $ echo '(lang dune 1.7)' > dune-project + $ cat > dune < (library + > (name foo) + > (no_keep_locs)) + > EOF + $ dune build + File "dune", line 3, characters 1-15: + 3 | (no_keep_locs)) + ^^^^^^^^^^^^^^ + Warning: 'no_keep_locs' was deprecated in version 1.7 of the dune language + $ rm -f dune