Skip to content

Commit

Permalink
Merge pull request #3647 from kit-ty-kate/subst-opam-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrinberg authored Jul 26, 2020
2 parents 180ba0b + 36d75ce commit e161637
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ next
individual executables when they're part of an `executables` stanza group
(#3644, @rgrinberg)

- Use `{dev}` rather than `{pinned}` in the generated `.opam` file. (#3647,
@kit-ty-kate)

2.6.1 (02/07/2020)
------------------

Expand Down
2 changes: 1 addition & 1 deletion dune-action-plugin.opam
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ depends: [
]
dev-repo: "git+https://github.com/ocaml/dune.git"
build: [
["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"
Expand Down
2 changes: 1 addition & 1 deletion dune-build-info.opam
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ depends: [
]
dev-repo: "git+https://github.com/ocaml/dune.git"
build: [
["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"
Expand Down
2 changes: 1 addition & 1 deletion dune-configurator.opam
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ depends: [
]
dev-repo: "git+https://github.com/ocaml/dune.git"
build: [
["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"
Expand Down
2 changes: 1 addition & 1 deletion dune-glob.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ depends: [
]
dev-repo: "git+https://github.com/ocaml/dune.git"
build: [
["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"
Expand Down
2 changes: 1 addition & 1 deletion dune-private-libs.opam
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ depends: [
]
dev-repo: "git+https://github.com/ocaml/dune.git"
build: [
["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"
Expand Down
2 changes: 1 addition & 1 deletion dune-private-libs.opam.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build: [
["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"
Expand Down
24 changes: 20 additions & 4 deletions src/dune/opam_create.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let default_build_command =
[ "dune" "build" "-p" name "@doc"] {with-doc}
]
|}))
and from_1_11 =
and from_1_11_before_2_7 =
lazy
(Opam_file.parse_value
(Lexbuf.from_string ~fname:"<internal>"
Expand All @@ -26,14 +26,30 @@ let default_build_command =
"@doc" {with-doc}
]
]
|}))
and from_2_7 =
lazy
(Opam_file.parse_value
(Lexbuf.from_string ~fname:"<internal>"
{|
[
[ "dune" "subst" ] {dev}
[ "dune" "build" "-p" name "-j" jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
|}))
in
fun project ->
Lazy.force
( if Dune_project.dune_version project < (1, 11) then
before_1_11
else
from_1_11 )
before_1_11
else if Dune_project.dune_version project < (2, 7) then
from_1_11_before_2_7
else
from_2_7 )

let package_fields
{ Package.synopsis
Expand Down
27 changes: 27 additions & 0 deletions test/blackbox-tests/test-cases/dune-project-meta/main/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,30 @@ Same with version of the language >= 2.6, we now add the constraint:
depends: [
"dune" {>= "2.6"}
]

When the version of the language >= 2.7 we use dev instead of pinned
when calling dune subst:

$ cat > dune-project <<EOF
> (lang dune 2.7)
> (name foo)
> (generate_opam_files true)
> (package (name foo))
> EOF

$ dune build foo.opam
$ grep -A13 ^build: foo.opam
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]

0 comments on commit e161637

Please sign in to comment.