From ab6bb0d5f75e08ef7293f4c4fe5cf51bb713db76 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 10 Jul 2018 17:23:56 +0700 Subject: [PATCH] Fix workspace lookup in cojnuction with --root The workspace is specified to the initial CWD hence we must convert it a path relative to it Signed-off-by: Rudi Grinberg --- bin/main.ml | 3 ++- test/blackbox-tests/test-cases/workspaces/run.t | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/main.ml b/bin/main.ml index 9e0add62..29c03360 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -84,7 +84,8 @@ module Main = struct setup ~log ?workspace_file:( - Option.map common.workspace_file ~f:Path.of_string) + Option.map common.workspace_file + ~f:Path.of_filename_relative_to_initial_cwd) ?only_packages:common.only_packages ?external_lib_deps_mode ?x:common.x diff --git a/test/blackbox-tests/test-cases/workspaces/run.t b/test/blackbox-tests/test-cases/workspaces/run.t index 5ca2dd04..dc2f12a9 100644 --- a/test/blackbox-tests/test-cases/workspaces/run.t +++ b/test/blackbox-tests/test-cases/workspaces/run.t @@ -25,7 +25,8 @@ analogously, jbuilder will ignore it specifying the workspace file is possible: $ dune build --root custom-workspace --workspace custom-workspace/dune-workspace.dev - Error: workspace file custom-workspace/dune-workspace.dev does not exist + File "/Users/rgrinberg/reps/dune/_build/default/test/blackbox-tests/test-cases/workspaces/custom-workspace/dune-workspace.dev", line 2, characters 10-24: + Error: Unknown constructor does-not-exist [1] Workspaces let you set custom profiles