File tree Expand file tree Collapse file tree
test/blackbox-tests/test-cases/pkg/pin-stanza Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ let is_supported_archive t = Option.is_some (Archive_driver.choose_for_filename
3333
3434let classify url loc =
3535 match (url : t ).backend with
36- | `rsync when is_local url -> `Path (Path. of_string url.path)
36+ | `rsync when is_local url -> `Path (Path. of_string_allow_outside_workspace url.path)
3737 | `git -> `Git
3838 | `http when is_supported_archive url -> `Archive
3939 | `rsync | `http | `darcs | `hg ->
Original file line number Diff line number Diff line change @@ -308,7 +308,11 @@ let source_kind (source : Dune_pkg.Source.t) =
308308 let loc, url = source.url in
309309 if OpamUrl. is_local url && url.backend = `rsync
310310 then (
311- let path = Path.External. of_string url.path in
311+ let path =
312+ Path. of_string_allow_outside_workspace url.path
313+ |> Path. to_absolute_filename
314+ |> Path.External. of_string
315+ in
312316 Fs_memo. path_kind (External path)
313317 >> | function
314318 | Error (ENOENT, _ , _ ) ->
Original file line number Diff line number Diff line change 1- Demonstrate that you can 't use a relative path referring outside the workspace
2- in the pin stanza:
1+ Demonstrate that relative paths outside the workspace work in pin stanzas:
32
43Make a package containing a library:
54 $ mkdir foo
@@ -49,7 +48,7 @@ Lock and build the second package to demonstrate that everything works so far:
4948 $ dune exec ./ bar. exe
5049 foo
5150
52- Now change the pin to use a relative path:
51+ Now change the pin to use a relative path (this should also work) :
5352 $ cat > dune-project << EOF
5453 > (lang dune 3.14 )
5554 > (pin
@@ -60,10 +59,10 @@ Now change the pin to use a relative path:
6059 > (depends foo))
6160 > EOF
6261
63- Solving the project now results in an error, though it's still possible to build the project :
62+ Solving the project works with relative paths outside the workspace :
6463 $ dune clean
6564 $ dune_pkg_lock_normalized
66- Error : path outside the workspace : .. / foo from .
67- [ 1 ]
65+ Solution for dune . lock :
66+ - foo . dev
6867 $ dune exec ./ bar. exe
6968 foo
You can’t perform that action at this time.
0 commit comments