Skip to content

Commit

Permalink
lib collision: update test
Browse files Browse the repository at this point in the history
Signed-off-by: Javier Chávarri <javier.chavarri@gmail.com>
  • Loading branch information
jchavarri committed Feb 2, 2024
1 parent 857ec39 commit 548fabd
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dune_rules/lib_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ let cctx (lib : Library.t) ~sctx ~source_modules ~dir ~expander ~scope ~compile_

let library_rules
(lib : Library.t)
~local_lib:_
~local_lib
~cctx
~source_modules
~dir_contents
Expand Down Expand Up @@ -607,7 +607,7 @@ let library_rules
~requires:requires_compile
~dir_contents
~vlib_stubs_o_files)
(* and+ () = Odoc.setup_library_odoc_rules cctx local_lib *)
and+ () = Odoc.setup_library_odoc_rules cctx local_lib
and+ () =
Sub_system.gen_rules
{ super_context = sctx; dir; stanza = lib; scope; source_modules; compile_info }
Expand Down
87 changes: 87 additions & 0 deletions test/blackbox-tests/test-cases/workspaces/library-name-collision.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,90 @@ Showcase that using same library name in two workspaces is not possible at the m
> EOF

$ dune build
Internal error, please report upstream including the contents of _build/log.
Description:
("[gen_rules] returned rules in a directory that is not a descendant of the directory it was called for",
{ dir = In_build_dir "alt-context/a"
; example =
Alias
{ dir = In_build_dir "alt-context/b/.foo.objs/byte"
; name = ".odoc-all"
}
})
Raised at Stdune__Code_error.raise in file
"otherlibs/stdune/src/code_error.ml", line 10, characters 30-62
Called from
Dune_engine__Load_rules.Load_rules.Normal.make_rules_gen_result.(fun) in
file "src/dune_engine/load_rules.ml", line 549, characters 10-51
Called from Fiber__Core.O.(>>|).(fun) in file "vendor/fiber/src/core.ml",
line 253, characters 36-41
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
line 76, characters 8-11
Re-raised at Stdune__Exn.raise_with_backtrace in file
"otherlibs/stdune/src/exn.ml", line 38, characters 27-56
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
line 76, characters 8-11
Re-raised at Stdune__Exn.raise_with_backtrace in file
"otherlibs/stdune/src/exn.ml", line 38, characters 27-56
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
line 76, characters 8-11
Re-raised at Stdune__Exn.raise_with_backtrace in file
"otherlibs/stdune/src/exn.ml", line 38, characters 27-56
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
line 76, characters 8-11
Re-raised at Stdune__Exn.raise_with_backtrace in file
"otherlibs/stdune/src/exn.ml", line 38, characters 27-56
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
line 76, characters 8-11
-> required by ("<unnamed>", ())
-> required by ("load-dir", In_build_dir "alt-context/a")
-> required by ("<unnamed>", ())
-> required by
("build-alias", { dir = In_build_dir "alt-context"; name = "default" })
-> required by ("toplevel", ())

I must not crash. Uncertainty is the mind-killer. Exceptions are the
little-death that brings total obliteration. I will fully express my cases.
Execution will pass over me and through me. And when it has gone past, I
will unwind the stack along its path. Where the cases are handled there will
be nothing. Only I will remain.
Internal error, please report upstream including the contents of _build/log.
Description:
("[gen_rules] returned rules in a directory that is not a descendant of the directory it was called for",
{ dir = In_build_dir "default/b"
; example =
Alias
{ dir = In_build_dir "default/a/.foo.objs/byte"; name = ".odoc-all" }
})
Raised at Stdune__Code_error.raise in file
"otherlibs/stdune/src/code_error.ml", line 10, characters 30-62
Called from
Dune_engine__Load_rules.Load_rules.Normal.make_rules_gen_result.(fun) in
file "src/dune_engine/load_rules.ml", line 549, characters 10-51
Called from Fiber__Core.O.(>>|).(fun) in file "vendor/fiber/src/core.ml",
line 253, characters 36-41
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
line 76, characters 8-11
Re-raised at Stdune__Exn.raise_with_backtrace in file
"otherlibs/stdune/src/exn.ml", line 38, characters 27-56
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
line 76, characters 8-11
Re-raised at Stdune__Exn.raise_with_backtrace in file
"otherlibs/stdune/src/exn.ml", line 38, characters 27-56
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
line 76, characters 8-11
Re-raised at Stdune__Exn.raise_with_backtrace in file
"otherlibs/stdune/src/exn.ml", line 38, characters 27-56
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
line 76, characters 8-11
Re-raised at Stdune__Exn.raise_with_backtrace in file
"otherlibs/stdune/src/exn.ml", line 38, characters 27-56
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
line 76, characters 8-11
-> required by ("<unnamed>", ())
-> required by ("load-dir", In_build_dir "default/b")
-> required by ("<unnamed>", ())
-> required by
("build-alias", { dir = In_build_dir "default"; name = "default" })
-> required by ("toplevel", ())
[1]

0 comments on commit 548fabd

Please sign in to comment.