Skip to content

Commit

Permalink
[Opam] Don't generate the dune-site build part when not needed
Browse files Browse the repository at this point in the history
       Fixes #4849

Signed-off-by: François Bobot <[email protected]>
  • Loading branch information
bobot committed Nov 20, 2021
1 parent 73d7364 commit b0dc3be
Show file tree
Hide file tree
Showing 11 changed files with 544 additions and 36 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Unreleased

- Fix plugins with dot in the name (#5182, @bobot, review @rgrinberg)

- Don't generate the dune-site build part when not needed (#4861, @bobot,
review @kit-ty-kate)

- Fix installation of implementations of virtual libraries (#5150, fix #3636,
@rgrinberg)

Expand Down
31 changes: 20 additions & 11 deletions otherlibs/site/test/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,37 @@ Test embedding of sites locations information

$ mkdir -p a b c

$ for i in a b d; do
$ mkdir -p a

$ cat >a/dune-project <<EOF
> (lang dune 3.0)
> (generate_opam_files true)
> (using dune_site 0.1)
> (name a)
> (version 0.a)
> (package (name a) (sites (share data)))
> EOF

$ for i in b d; do
> mkdir -p $i
> cat >$i/dune-project <<EOF
> (lang dune 2.9)
> (lang dune 3.0)
> (generate_opam_files true)
> (using dune_site 0.1)
> (name $i)
> (version 0.$i)
> (package (name $i) (sites (share data)))
> (package (name $i) (sites (share data)) (depends c))
> EOF
> done

$ for i in c; do
> mkdir -p $i
> cat >$i/dune-project <<EOF
> (lang dune 2.9)
> (lang dune 3.0)
> (generate_opam_files true)
> (using dune_site 0.1)
> (name $i)
> (package (name $i) (sites (share data) (lib plugins)))
> (package (name $i) (sites (share data) (lib plugins)) (depends a))
> EOF
> done

Expand Down Expand Up @@ -139,7 +150,7 @@ Test with an opam like installation
opam-version: "2.0"
version: "0.a"
depends: [
"dune" {>= "2.9"}
"dune" {>= "3.0"}
"odoc" {with-doc}
]
build: [
Expand All @@ -159,9 +170,7 @@ Test with an opam like installation
["dune" "install" "-p" name "--create-install-files" name]
]

$ dune subst

$ dune build -p a --promote-install-files=false @install @runtest @doc
$ dune build -p a --promote-install-files=false @install

$ test -e a/a.install
[1]
Expand Down Expand Up @@ -378,11 +387,11 @@ Test %{version:installed-pkg}
$ for i in f; do
> mkdir -p $i
> cat >$i/dune-project <<EOF
> (lang dune 2.9)
> (lang dune 3.0)
> (using dune_site 0.1)
> (name $i)
> (version 0.$i)
> (package (name $i) (sites (share data) (lib plugins)))
> (package (name $i) (sites (share data) (lib plugins)) (allow_empty))
> EOF
> done

Expand Down
Loading

0 comments on commit b0dc3be

Please sign in to comment.