From 34d521031bdcf651c35c198714007dc8dc75f1fd Mon Sep 17 00:00:00 2001 From: ArthurW Date: Fri, 10 Jan 2025 09:46:02 +0100 Subject: [PATCH] Default maintenance_intent to (latest) --- otherlibs/dune-site/test/run.t | 1 + otherlibs/dune-site/test/run_2_9.t | 1 + src/dune_config_file/dune_config_file.ml | 2 +- src/dune_rules/opam_create.ml | 5 ++++- test/blackbox-tests/test-cases/describe/describe.t | 1 + test/blackbox-tests/test-cases/dune-init.t/run.t | 2 ++ test/blackbox-tests/test-cases/dune-package.t/run.t | 1 + .../test-cases/dune-project-meta/dune-dep.t | 3 +++ .../test-cases/dune-project-meta/github2927.t | 1 + .../test-cases/dune-project-meta/v11-1.t | 1 + test/blackbox-tests/test-cases/opam-constraints.t | 1 + .../dune_config_file/dune_config_test.ml | 12 ++++++------ 12 files changed, 23 insertions(+), 8 deletions(-) diff --git a/otherlibs/dune-site/test/run.t b/otherlibs/dune-site/test/run.t index c34efe5a72a..f4b8f5b2cc3 100644 --- a/otherlibs/dune-site/test/run.t +++ b/otherlibs/dune-site/test/run.t @@ -169,6 +169,7 @@ Test with an opam like installation ] ["dune" "install" "-p" name "--create-install-files" name] ] + x-maintenance-intent: ["(latest)"] $ dune build -p a --promote-install-files=false @install diff --git a/otherlibs/dune-site/test/run_2_9.t b/otherlibs/dune-site/test/run_2_9.t index 688fb2f3dfd..f62ff0c063e 100644 --- a/otherlibs/dune-site/test/run_2_9.t +++ b/otherlibs/dune-site/test/run_2_9.t @@ -157,6 +157,7 @@ Test with an opam like installation ] ["dune" "install" "-p" name "--create-install-files" name] ] + x-maintenance-intent: ["(latest)"] $ dune build -p a --promote-install-files="false" @install diff --git a/src/dune_config_file/dune_config_file.ml b/src/dune_config_file/dune_config_file.ml index a0dae525bce..e5a349d0273 100644 --- a/src/dune_config_file/dune_config_file.ml +++ b/src/dune_config_file/dune_config_file.ml @@ -365,7 +365,7 @@ module Dune_config = struct ; project_defaults = { authors = Some [ "Author Name " ] ; maintainers = Some [ "Maintainer Name " ] - ; maintenance_intent = Some [ "(latest)" ] + ; maintenance_intent = None ; license = Some [ "LICENSE" ] } ; experimental = [] diff --git a/src/dune_rules/opam_create.ml b/src/dune_rules/opam_create.ml index de970468d51..b1a116b7140 100644 --- a/src/dune_rules/opam_create.ml +++ b/src/dune_rules/opam_create.ml @@ -228,7 +228,10 @@ let opam_fields project (package : Package.t) = in let list_fields = [ "maintainer", Package_info.maintainers info - ; "x-maintenance-intent", Package_info.maintenance_intent info + ; ( "x-maintenance-intent" + , match Package_info.maintenance_intent info with + | None -> Some [ "(latest)" ] + | x -> x ) ; "authors", Package_info.authors info ; ( "license" , match Package_info.license info with diff --git a/test/blackbox-tests/test-cases/describe/describe.t b/test/blackbox-tests/test-cases/describe/describe.t index d283af9e5f1..4b5457ebd87 100644 --- a/test/blackbox-tests/test-cases/describe/describe.t +++ b/test/blackbox-tests/test-cases/describe/describe.t @@ -1373,4 +1373,5 @@ opam file listing \"@doc\" {with-doc} ] ] + x-maintenance-intent: [\"(latest)\"] ")) diff --git a/test/blackbox-tests/test-cases/dune-init.t/run.t b/test/blackbox-tests/test-cases/dune-init.t/run.t index 3fe686d4b53..0b05931b954 100644 --- a/test/blackbox-tests/test-cases/dune-init.t/run.t +++ b/test/blackbox-tests/test-cases/dune-init.t/run.t @@ -403,6 +403,7 @@ And the opam file will be generated as expected ] ] dev-repo: "git+https://github.com/username/reponame.git" + x-maintenance-intent: ["(latest)"] We can build and run the resulting executable: @@ -513,6 +514,7 @@ And the opam file will be generated as expected ] ] dev-repo: "git+https://github.com/username/reponame.git" + x-maintenance-intent: ["(latest)"] And we we can run the tests: diff --git a/test/blackbox-tests/test-cases/dune-package.t/run.t b/test/blackbox-tests/test-cases/dune-package.t/run.t index 86a6025e497..51514ceb218 100644 --- a/test/blackbox-tests/test-cases/dune-package.t/run.t +++ b/test/blackbox-tests/test-cases/dune-package.t/run.t @@ -177,6 +177,7 @@ Install as opam does "@doc" {with-doc} ] ] + x-maintenance-intent: ["(latest)"] $ (cd a; "dune" "build" "-p" a "@install") diff --git a/test/blackbox-tests/test-cases/dune-project-meta/dune-dep.t b/test/blackbox-tests/test-cases/dune-project-meta/dune-dep.t index 6cc883a8a9f..a1c95b9e97c 100644 --- a/test/blackbox-tests/test-cases/dune-project-meta/dune-dep.t +++ b/test/blackbox-tests/test-cases/dune-project-meta/dune-dep.t @@ -191,6 +191,7 @@ the doc dependencies: ] ["dune" "install" "-p" name "--create-install-files" name] ] + x-maintenance-intent: ["(latest)"] $ cat > dune-project < (lang dune 3.0) @@ -215,6 +216,7 @@ the doc dependencies: "@doc" {with-doc} ] ] + x-maintenance-intent: ["(latest)"] $ cat > dune-project < (lang dune 3.0) @@ -240,3 +242,4 @@ the doc dependencies: "@doc" {with-doc} ] ] + x-maintenance-intent: ["(latest)"] diff --git a/test/blackbox-tests/test-cases/dune-project-meta/github2927.t b/test/blackbox-tests/test-cases/dune-project-meta/github2927.t index 10e36eb31b9..571842c5690 100644 --- a/test/blackbox-tests/test-cases/dune-project-meta/github2927.t +++ b/test/blackbox-tests/test-cases/dune-project-meta/github2927.t @@ -30,3 +30,4 @@ Reproduction case for #2927 "@doc" {with-doc} ] ] + x-maintenance-intent: ["(latest)"] diff --git a/test/blackbox-tests/test-cases/dune-project-meta/v11-1.t b/test/blackbox-tests/test-cases/dune-project-meta/v11-1.t index 7c96631b931..415ecc1a293 100644 --- a/test/blackbox-tests/test-cases/dune-project-meta/v11-1.t +++ b/test/blackbox-tests/test-cases/dune-project-meta/v11-1.t @@ -29,3 +29,4 @@ Generation of opam files with lang dune >= 1.11 "@doc" {with-doc} ] ] + x-maintenance-intent: ["(latest)"] diff --git a/test/blackbox-tests/test-cases/opam-constraints.t b/test/blackbox-tests/test-cases/opam-constraints.t index ce993818d7b..315b4c3d6e7 100644 --- a/test/blackbox-tests/test-cases/opam-constraints.t +++ b/test/blackbox-tests/test-cases/opam-constraints.t @@ -67,3 +67,4 @@ constraints. "@doc" {with-doc} ] ] + x-maintenance-intent: ["(latest)"] diff --git a/test/expect-tests/dune_config_file/dune_config_test.ml b/test/expect-tests/dune_config_file/dune_config_test.ml index 357061ca376..e2635090d6c 100644 --- a/test/expect-tests/dune_config_file/dune_config_test.ml +++ b/test/expect-tests/dune_config_file/dune_config_test.ml @@ -30,12 +30,12 @@ let%expect_test "cache-check-probability 0.1" = ; project_defaults = { authors = Some [ "Author Name " ] ; maintainers = Some [ "Maintainer Name " ] - ; maintenance_intent = Some [ "(latest)" ] + ; maintenance_intent = None ; license = Some [ "LICENSE" ] } ; experimental = [] } - |}] + |}] ;; let%expect_test "cache-storage-mode copy" = @@ -54,12 +54,12 @@ let%expect_test "cache-storage-mode copy" = ; project_defaults = { authors = Some [ "Author Name " ] ; maintainers = Some [ "Maintainer Name " ] - ; maintenance_intent = Some [ "(latest)" ] + ; maintenance_intent = None ; license = Some [ "LICENSE" ] } ; experimental = [] } - |}] + |}] ;; let%expect_test "cache-storage-mode hardlink" = @@ -78,10 +78,10 @@ let%expect_test "cache-storage-mode hardlink" = ; project_defaults = { authors = Some [ "Author Name " ] ; maintainers = Some [ "Maintainer Name " ] - ; maintenance_intent = Some [ "(latest)" ] + ; maintenance_intent = None ; license = Some [ "LICENSE" ] } ; experimental = [] } - |}] + |}] ;;