From edf8c7aa1675573501421ae9e79635e8e52485d0 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 | 5 +++++ src/file_binding.ml | 7 +++---- src/file_binding.mli | 2 +- src/install_rules.ml | 3 +-- test/blackbox-tests/test-cases/github2123/run.t | 4 ++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9689c308ab4..f72f658d210 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +1.9.3 (06/05/2019) +------------------ + +- 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 f71c3f8fce1..184e6997ee1 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 @@ -47,7 +46,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 b6187d990b3..498dcf71561 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 df35ec4655a..8970f8e6146 100644 --- a/src/install_rules.ml +++ b/src/install_rules.ml @@ -365,8 +365,7 @@ let init_binary_artifacts sctx 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/test-cases/github2123/run.t b/test/blackbox-tests/test-cases/github2123/run.t index 7fc8b4324b9..1c4dc1500c9 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"}