Skip to content

Commit

Permalink
Fix detecting odig files for installation
Browse files Browse the repository at this point in the history
These files are relative to the package rather than the context. Otherwise, they
will not be included in the .install file in composed builds.

Signed-off-by: Rudi Grinberg <[email protected]>
  • Loading branch information
rgrinberg committed May 27, 2019
1 parent 74c1a38 commit 781d1d1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ unreleased
- Run `ocamlformat` relative to the context root. This improves the locations of
errors. (#2196, fixes #1370, @rgrinberg)

- Fix detection of `README`, `LICENSE`, `CHANGE`, and `HISTORY` files. These
would be undetected whenever the project was nested in another workspace.
(#2194, @rgrinberg)

1.9.3 (06/05/2019)
------------------

Expand Down
6 changes: 3 additions & 3 deletions src/local_package.ml
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ module Of_sctx = struct
Super_context.packages sctx
|> Package.Name.Map.map ~f:(fun (pkg : Package.t) ->
let odig_files =
let files =
Super_context.source_files sctx ~src_path:Path.Source.root in
let files = Super_context.source_files sctx ~src_path:pkg.path in
let pkg_dir = Path.Build.append_source ctx_build_dir pkg.path in
String.Set.fold files ~init:[] ~f:(fun fn acc ->
if is_odig_doc_file fn then
Path.Build.relative ctx_build_dir fn :: acc
Path.Build.relative pkg_dir fn :: acc
else
acc)
in
Expand Down
3 changes: 3 additions & 0 deletions test/blackbox-tests/test-cases/odig-files-workspace/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ Odig files should be detected relative to the package directory
"_build/install/default/lib/foobar/META"
"_build/install/default/lib/foobar/dune-package"
]
doc: [
"_build/install/default/doc/foobar/LICENSE"
]

0 comments on commit 781d1d1

Please sign in to comment.