-
Notifications
You must be signed in to change notification settings - Fork 464
Closed
ocaml/opam-repository
#17967Description
Background to this is assembling a project which vendors the Dune repository in order to have configurator in a "Duniverse"-style build.
Taking the configurator example from the manual as a minimum setup, in a switch which just has an OCaml compiler:
git clone https://github.com/ocaml/dune dune-repo
git clone https://github.com/janestreet/result
git clone https://github.com/ocaml-dune/csexp
cd dune-repo ; ocaml bootstrap.ml ; cd ..Create discover.ml with the example from the manual:
module C = Configurator.V1
let clock_gettime_code = {|
#include <time.h>
int main()
{
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
return 0;
}
|}
let () =
C.main ~name:"foo" (fun c ->
let has_clock_gettime = C.c_test c clock_gettime_code ~link_flags:["-lrt"] in
C.C_define.gen_header_file c ~fname:"config.h"
[ "HAS_CLOCK_GETTIME", Switch has_clock_gettime ]);and create a dune file for assembling just this strange project:
(vendored_dirs csexp result dune-repo)
(executable
(name discover)
(libraries dune.configurator))
(rule
(targets config.h)
(action (run ./discover.exe)))
(install
(section share)
(files config.h))
Now run dune-repo/dune.exe build @install and you will be presented with this error:
File "dune-repo/test/blackbox-tests/test-cases/dialects.t/bad1/dune-project", line 9, characters 1-74:
9 | (name d)
10 | (implementation (extension foo2))
11 | (interface (extension bar2)))
Error: dialect "d" is already defined
There are two possible fixes:
- Remove
dune-repofrom thevendored_dirsstanza (but that now means that@installbuilds everything) - Add
(subdir dune-repo (data_only_dirs test))to thedunefile
It doesn't feel like either should be required, but I'm not sure what's causing Dune to start reading tests when the repo is part of a vendored_dirs stanza.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels