From 186043860502d599900c1a038473398bf3f06691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dimino?= Date: Mon, 28 May 2018 18:19:30 +0100 Subject: [PATCH] Add a jbuilder transition package (#796) Signed-off-by: Jeremie Dimino --- .travis-ci.sh | 17 +++-------------- bin/dune | 2 ++ doc/dune | 2 ++ doc/dune.inc | 14 ++++++++++++++ doc/update-jbuild.sh | 1 + dune.opam | 1 + jbuilder.descr | 2 ++ jbuilder.opam | 22 ++++++++++++++++++++++ vendor/boot/opamBaseParser.ml | 2 +- 9 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 jbuilder.descr create mode 100644 jbuilder.opam diff --git a/.travis-ci.sh b/.travis-ci.sh index 702158d1..60df3f45 100644 --- a/.travis-ci.sh +++ b/.travis-ci.sh @@ -79,20 +79,9 @@ case "$TARGET" in fi opam list echo "version: \"1.0+dev$DATE\"" >> dune.opam - mkdir -p ../jbuilder - cat > ../jbuilder/jbuilder.opam <"] -homepage: "https://github.com/ocaml/dune" -bug-reports: "https://github.com/ocaml/dune/issues" -dev-repo: "https://github.com/ocaml/dune.git" -license: "Apache-2.0" -depends: [ "dune" ] -EOF - opam pin add dune . --no-action --yes - opam pin add jbuilder ../jbuilder --no-action --yes + echo "depends: [\"dune\"]" >> jbuilder.opam + opam pin add dune . --no-action --yes + opam pin add jbuilder . --no-action --yes opam install utop ppx_driver odoc ocaml-migrate-parsetree js_of_ocaml-ppx js_of_ocaml-compiler --yes echo -en "travis_fold:end:opam.deps\r" fi diff --git a/bin/dune b/bin/dune index 19ffd943..1b8c6a54 100644 --- a/bin/dune +++ b/bin/dune @@ -1,9 +1,11 @@ (executable ((name main) (public_name dune) + (package dune) (libraries (unix dune cmdliner)) (preprocess no_preprocessing))) (install ((section bin) + (package dune) (files ((main.exe as jbuilder))))) diff --git a/doc/dune b/doc/dune index c1429f25..3062470f 100644 --- a/doc/dune +++ b/doc/dune @@ -7,6 +7,7 @@ (install ((section man) + (package dune) (files (dune.1)))) (rule @@ -16,6 +17,7 @@ (install ((section man) + (package dune) (files (dune-config.5)))) (include dune.inc) diff --git a/doc/dune.inc b/doc/dune.inc index 2effc9cd..f3a30a23 100644 --- a/doc/dune.inc +++ b/doc/dune.inc @@ -6,6 +6,7 @@ (install ((section man) + (package dune) (files (dune-build.1)))) (rule @@ -15,6 +16,7 @@ (install ((section man) + (package dune) (files (dune-clean.1)))) (rule @@ -24,6 +26,7 @@ (install ((section man) + (package dune) (files (dune-exec.1)))) (rule @@ -33,6 +36,7 @@ (install ((section man) + (package dune) (files (dune-external-lib-deps.1)))) (rule @@ -42,6 +46,7 @@ (install ((section man) + (package dune) (files (dune-help.1)))) (rule @@ -51,6 +56,7 @@ (install ((section man) + (package dune) (files (dune-install.1)))) (rule @@ -60,6 +66,7 @@ (install ((section man) + (package dune) (files (dune-installed-libraries.1)))) (rule @@ -69,6 +76,7 @@ (install ((section man) + (package dune) (files (dune-printenv.1)))) (rule @@ -78,6 +86,7 @@ (install ((section man) + (package dune) (files (dune-promote.1)))) (rule @@ -87,6 +96,7 @@ (install ((section man) + (package dune) (files (dune-rules.1)))) (rule @@ -96,6 +106,7 @@ (install ((section man) + (package dune) (files (dune-runtest.1)))) (rule @@ -105,6 +116,7 @@ (install ((section man) + (package dune) (files (dune-subst.1)))) (rule @@ -114,6 +126,7 @@ (install ((section man) + (package dune) (files (dune-uninstall.1)))) (rule @@ -123,5 +136,6 @@ (install ((section man) + (package dune) (files (dune-utop.1)))) diff --git a/doc/update-jbuild.sh b/doc/update-jbuild.sh index 929af205..f4315926 100755 --- a/doc/update-jbuild.sh +++ b/doc/update-jbuild.sh @@ -17,6 +17,7 @@ for cmd in $CMDS; do (install ((section man) + (package dune) (files (dune-$cmd.1)))) EOF done diff --git a/dune.opam b/dune.opam index dade3abc..8f7d0071 100644 --- a/dune.opam +++ b/dune.opam @@ -12,3 +12,4 @@ build: [ ["./boot.exe" "-j" jobs] ] available: [ ocaml-version >= "4.02.3" ] +conflicts: [ "jbuilder" {!= "transition"} ] diff --git a/jbuilder.descr b/jbuilder.descr new file mode 100644 index 00000000..20fc285c --- /dev/null +++ b/jbuilder.descr @@ -0,0 +1,2 @@ +This is a transition package, jbuilder is now named dune. Use the dune +package instead. diff --git a/jbuilder.opam b/jbuilder.opam new file mode 100644 index 00000000..e2dd5674 --- /dev/null +++ b/jbuilder.opam @@ -0,0 +1,22 @@ +opam-version: "1.2" +version: "transition" +maintainer: "opensource@janestreet.com" +authors: ["Jane Street Group, LLC "] +homepage: "https://github.com/ocaml/dune" +bug-reports: "https://github.com/ocaml/dune/issues" +dev-repo: "https://github.com/ocaml/dune.git" +license: "MIT" +build: ["dune" "--version"] +# CR-soon diml: uncomment this once we have a dune package in opam. +# We have to wait otherwise "opam pin add jbuilder --dev" fails with +# an error that is hard to understand. +# depends: ["dune"] +post-messages: [ + "Jbuilder has been renamed and the jbuilder package is now a transition" + "package. Use the dune package instead." + "" + "If you want to try the development version of Dune before the 1.0.0 is" + "released, run the following command:" + "" + "$ opam pin add dune https://github.com/ocaml/dune.git" +] diff --git a/vendor/boot/opamBaseParser.ml b/vendor/boot/opamBaseParser.ml index b9078575..f136125b 100644 --- a/vendor/boot/opamBaseParser.ml +++ b/vendor/boot/opamBaseParser.ml @@ -1,6 +1,6 @@ open OpamParserTypes let main _lex _lexbuf fn = - assert (fn = "dune.opam"); + assert (fn = "dune.opam" || fn = "jbuilder.opam"); { file_contents = [] ; file_name = fn }