From c6f64e62678930d4fbe13991a5720b8da002b8f7 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Sun, 5 May 2019 21:16:00 +0800 Subject: [PATCH] Fix #2123 by reverting #2041 Signed-off-by: Rudi Grinberg --- CHANGES.md | 2 ++ src/file_binding.ml | 7 +++---- src/file_binding.mli | 2 +- src/install_rules.ml | 3 +-- test/blackbox-tests/dune.inc | 18 +++++++++--------- .../blackbox-tests/test-cases/github2123/run.t | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f673554de7c0..62d3a6f8486c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -38,6 +38,8 @@ unreleased `findlib.dynload` with Dune would have to add `(special_builtin_support findlib_dynload)` to trigger the special behavior. (#2115, @diml) +- Fix `.install` files not being generated (#2124, fixes #2123, @rgrinberg) + 1.9.2 (02/05/2019) ------------------ diff --git a/src/file_binding.ml b/src/file_binding.ml index bb50c21d9d9b..4267a3eb03a0 100644 --- a/src/file_binding.ml +++ b/src/file_binding.ml @@ -6,7 +6,7 @@ type ('src, 'dst) t = } module Expanded = struct - type nonrec t = (Loc.t * Path.t, Loc.t * Path.Local.t) t + type nonrec t = (Loc.t * Path.t, Loc.t * string) t let src t = snd t.src let dst t = Option.map ~f:snd t.dst @@ -21,10 +21,9 @@ module Expanded = struct let basename = Path.basename src in String.drop_suffix basename ~suffix:".exe" |> Option.value ~default:basename - |> Path.Local.of_string let dst_path t ~dir = - Path.append_local dir (dst_basename t) + Path.relative dir (dst_basename t) end module Unexpanded = struct @@ -54,7 +53,7 @@ module Unexpanded = struct ; dst = let f sw = let (loc, p) = f sw in - (loc, Path.Local.of_string p) + (loc, p) in Option.map ~f t.dst } diff --git a/src/file_binding.mli b/src/file_binding.mli index da6e4895bb23..48d70a6dedc1 100644 --- a/src/file_binding.mli +++ b/src/file_binding.mli @@ -4,7 +4,7 @@ module Expanded : sig type t val src : t -> Path.t - val dst : t -> Path.Local.t option + val dst : t -> string option val src_loc : t -> Loc.t diff --git a/src/install_rules.ml b/src/install_rules.ml index 4bc549543e63..a53b5b866b08 100644 --- a/src/install_rules.ml +++ b/src/install_rules.ml @@ -352,8 +352,7 @@ let get_install_entries package = List.map files ~f:(fun fb -> let loc = File_binding.Expanded.src_loc fb in let src = File_binding.Expanded.src fb in - let dst = Option.map ~f:Path.Local.to_string - (File_binding.Expanded.dst fb) in + let dst = File_binding.Expanded.dst fb in ( Some loc , Install.Entry.make section src ?dst ))) diff --git a/test/blackbox-tests/dune.inc b/test/blackbox-tests/dune.inc index 23fa444d5bda..94bd4ed432b1 100644 --- a/test/blackbox-tests/dune.inc +++ b/test/blackbox-tests/dune.inc @@ -620,19 +620,19 @@ (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))) (alias - (name github2123) - (deps (package dune) (source_tree test-cases/github2123)) + (name github2061) + (deps (package dune) (source_tree test-cases/github2061)) (action (chdir - test-cases/github2123 + test-cases/github2061 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))) (alias - (name github2061) - (deps (package dune) (source_tree test-cases/github2061)) + (name github2123) + (deps (package dune) (source_tree test-cases/github2123)) (action (chdir - test-cases/github2061 + test-cases/github2123 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))) (alias @@ -1512,8 +1512,8 @@ (alias github1946) (alias github20) (alias github2033) - (alias github2123) (alias github2061) + (alias github2123) (alias github24) (alias github25) (alias github534) @@ -1683,8 +1683,8 @@ (alias github1946) (alias github20) (alias github2033) - (alias github2123) (alias github2061) + (alias github2123) (alias github24) (alias github25) (alias github534) @@ -1766,4 +1766,4 @@ (alias (name runtest-js) (deps (alias js_of_ocaml))) -(alias (name runtest-coq) (deps (alias coq))) +(alias (name runtest-coq) (deps (alias coq))) \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/github2123/run.t b/test/blackbox-tests/test-cases/github2123/run.t index 7fc8b4324b92..1c4dc1500c96 100644 --- a/test/blackbox-tests/test-cases/github2123/run.t +++ b/test/blackbox-tests/test-cases/github2123/run.t @@ -1,3 +1,3 @@ $ dune build @install - Path outside the workspace: ../pkgconfig/mirage-xen.pc from . - [1] + $ cat foo.install | grep mirage-xen + "_build/install/default/lib/pkgconfig/mirage-xen.pc" {"../pkgconfig/mirage-xen.pc"}