diff --git a/.gitignore b/.gitignore index 6413f53e41..c7a96983b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,5 @@ _build -setup.data -setup.log -setup.exe -setup-dev.exe -_opam +src/unix/lwt_config # Coverage analysis. bisect*.out @@ -12,6 +8,7 @@ _coverage/ # For local work, tests, etc. scratch/ +# Autogenerated by jbuider .merlin *.install diff --git a/.merlin b/.merlin deleted file mode 100644 index eea11d3a18..0000000000 --- a/.merlin +++ /dev/null @@ -1,9 +0,0 @@ -S src/** - -B _build/** - -S tests/ -S doc/examples/ - -PKG result -PKG bytes diff --git a/META.lwt.template b/META.lwt.template new file mode 100644 index 0000000000..9769199b7d --- /dev/null +++ b/META.lwt.template @@ -0,0 +1,135 @@ +# +# This file has been copied from _build/default/META.lwt then +# modified to add exists_if clauses to support optional +# compilation and the camlp4 syntax extension packages have +# been given appropriate predicates. +# + +version = "dev" +description = "Monadic promises and concurrent I/O" +requires = "bytes result" +archive(byte) = "lwt.cma" +archive(native) = "lwt.cmxa" +plugin(byte) = "lwt.cma" +plugin(native) = "lwt.cmxs" +package "log" ( + directory = "log" + version = "dev" + description = "Logger for Lwt" + requires = "bytes lwt result" + archive(byte) = "lwt_log.cma" + archive(native) = "lwt_log.cmxa" + plugin(byte) = "lwt_log.cma" + plugin(native) = "lwt_log.cmxs" + exists_if = "lwt_log.cma" +) +package "ppx" ( + directory = "ppx" + version = "dev" + description = "Lwt PPX syntax extension" + requires(ppx_driver) = "compiler-libs + compiler-libs.common + ocaml-migrate-parsetree + ppx_tools_versioned" + archive(ppx_driver,byte) = "ppx_lwt.cma" + archive(ppx_driver,native) = "ppx_lwt.cmxa" + plugin(ppx_driver,byte) = "ppx_lwt.cma" + plugin(ppx_driver,native) = "ppx_lwt.cmxs" + exists_if = "ppx_lwt.cma" + # This is what jbuilder uses to find out the runtime dependencies of + # a preprocessor + ppx_runtime_deps = "bytes lwt result" + # This line makes things transparent for people mixing preprocessors + # and normal dependencies + requires(-ppx_driver) = "lwt.ppx.deprecated-ppx-method" + package "deprecated-ppx-method" ( + version = "dev" + description = "glue package for the deprecated method of using ppx" + requires = "bytes lwt result" + ppx(-ppx_driver,-custom_ppx) = "./ppx.exe --as-ppx" + exists_if = "ppx_lwt.cma" + ) +) +package "preemptive" ( + directory = "preemptive" + version = "dev" + description = "Preemptive thread support for Lwt" + requires = "bigarray + bytes + lwt + lwt.log + lwt.unix + result + threads + threads.posix + unix" + archive(byte) = "lwt_preemptive.cma" + archive(native) = "lwt_preemptive.cmxa" + plugin(byte) = "lwt_preemptive.cma" + plugin(native) = "lwt_preemptive.cmxs" + exists_if = "lwt_preemptive.cma" +) +package "simple-top" ( + directory = "simple-top" + version = "dev" + description = "Lwt-OCaml top level integration (deprecated; use utop)" + requires = "bigarray + bytes + compiler-libs + compiler-libs.common + lwt + lwt.log + lwt.unix + result + unix" + archive(byte) = "lwt_simple_top.cma" + archive(native) = "lwt_simple_top.cmxa" + plugin(byte) = "lwt_simple_top.cma" + plugin(native) = "lwt_simple_top.cmxs" + exists_if = "lwt_simple_top.cma" +) +package "syntax" ( + directory = "syntax" + version = "dev" + description = "Camlp4 syntax for Lwt (deprecated; use lwt.ppx)" + requires = "camlp4 lwt.syntax.options" + archive(syntax, preprocessor) = "lwt_syntax.cma" + archive(syntax, toploop) = "lwt_syntax.cma" + archive(syntax, preprocessor, native) = "lwt_syntax.cmxa" + archive(syntax, preprocessor, native, plugin) = "lwt_syntax.cmxs" + exists_if = "lwt_syntax.cma" + package "log" ( + directory = "log" + version = "dev" + description = "Camlp4 syntax for Lwt logging (deprecated; use lwt.ppx)" + requires = "camlp4 lwt.syntax.options" + archive(syntax, preprocessor) = "lwt_syntax_log.cma" + archive(syntax, toploop) = "lwt_syntax_log.cma" + archive(syntax, preprocessor, native) = "lwt_syntax_log.cmxa" + archive(syntax, preprocessor, native, plugin) = "lwt_syntax_log.cmxs" + exists_if = "lwt_syntax_log.cma" + ) + package "options" ( + directory = "options" + version = "dev" + description = "Options for Lwt Camlp4 syntax extension (deprecated; use lwt.ppx)" + requires = "camlp4" + archive(syntax, preprocessor) = "lwt_syntax_options.cma" + archive(syntax, toploop) = "lwt_syntax_options.cma" + archive(syntax, preprocessor, native) = "lwt_syntax_options.cmxa" + archive(syntax, preprocessor, native, plugin) = "lwt_syntax_options.cmxs" + exists_if = "lwt_syntax_options.cma" + ) +) +package "unix" ( + directory = "unix" + version = "dev" + description = "Unix support for Lwt" + requires = "bigarray bytes lwt lwt.log result unix" + archive(byte) = "lwt_unix.cma" + archive(native) = "lwt_unix.cmxa" + plugin(byte) = "lwt_unix.cma" + plugin(native) = "lwt_unix.cmxs" + exists_if = "lwt_unix.cma" +) + diff --git a/README.md b/README.md index b89a10a866..680833010f 100644 --- a/README.md +++ b/README.md @@ -119,8 +119,6 @@ version, opam source --dev-repo --pin lwt ``` -This will also install the development dependency jbuilder. - A list of [project suggestions][projects] and a [roadmap][roadmap] can be found on the wiki. diff --git a/TODO.jbuild b/TODO.jbuild deleted file mode 100644 index 50a04bd380..0000000000 --- a/TODO.jbuild +++ /dev/null @@ -1,10 +0,0 @@ -- Internal modules exposed in lwt-unit - -- lwt-unix configuration params passed to discover.exe; - - use_libev (currently forced to true) - - how do we depend on an external opam package with no findlib library? - - android-target? - -- multi-workspace builds dont work - - jbuilder build --workspace jbuild-workspace.dev @install @runtest --only-packages lwt - - problem with ppx diff --git a/_opam-files/META.lwt.template b/_opam-files/META.lwt.template deleted file mode 100644 index 1f73fa3354..0000000000 --- a/_opam-files/META.lwt.template +++ /dev/null @@ -1,69 +0,0 @@ -# JBUILDER_GEN - -version = "dev" -description = "[compatibility] maps to lwt-core" -requires = "lwt-core" - -package "unix" ( - requires = "lwt-unix" - description = "[compatibility] maps to lwt-unix" - exists_if = "../lwt-unix/lwt_unix.cma" -) - -package "log" ( - requires = "lwt-log" - description = "[compatibility] maps to lwt-log" - exists_if = "../lwt-log/lwt_log.cma" -) - -package "ppx" ( - requires = "lwt-ppx" - description = "[compatibility] maps to lwt-ppx" - exists_if = "../lwt-ppx/ppx_lwt.cma" -) - -package "preemptive" ( - requires = "lwt-preemptive" - description = "[compatibility] maps to lwt-preemptive" - exists_if = "../lwt-preemptive/lwt_preemptive.cma" -) - -package "simple-top" ( - requires = "lwt-simple-top" - description = "[compatibility] maps to lwt-simple-top" - exists_if = "../lwt-simple-top/lwt_simple_top.cma" -) - -package "glib" ( - requires = "lwt-glib" - description = "[compatibility] maps to lwt-glib" - exists_if = "../lwt-glib/lwt_glib.cma" -) - -package "ssl" ( - requires = "lwt-ssl" - description = "[compatibility] maps to lwt-ssl" - exists_if = "../lwt-ssl/lwt_ssl.cma" -) - -package "react" ( - requires = "lwt-react" - description = "[compatibility] maps to lwt-react" - exists_if = "../lwt-react/lwt_react.cma" -) - -package "syntax" ( - requires = "camlp4 lwt-camlp4 lwt.camlp4.options" - exists_if = "../lwt-camlp4/lwt_camlp4.cma" - - package "options" ( - requires = "lwt-camlp4.options" - exists_if = "../lwt-camlp4/lwt_camlp4.cma" - ) - - package "log" ( - requires = "lwt-camlp4.log" - exists_if = "../lwt-camlp4/lwt_camlp4.cma" - ) -) - diff --git a/_opam-files/lwt-camlp4.opam b/_opam-files/lwt-camlp4.opam deleted file mode 100644 index e092308cc0..0000000000 --- a/_opam-files/lwt-camlp4.opam +++ /dev/null @@ -1,26 +0,0 @@ -opam-version: "1.2" -name: "lwt" -version: "dev" -maintainer: [ - "Anton Bachin " - "Mauricio Fernandez " - "Simon Cruanes " -] -authors: [ - "Jérôme Vouillon" - "Jérémie Dimino" -] -homepage: "https://github.com/ocsigen/lwt" -doc: "https://ocsigen.org/lwt/manual/" -bug-reports: "https://github.com/ocsigen/lwt/issues" -license: "LGPL with OpenSSL linking exception" -dev-repo: "https://github.com/ocsigen/lwt.git" -build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] ] -build-test: [ [ "jbuilder" "runtest" "-p" name ] ] -depends: [ - "jbuilder" { build & >= "1.0+beta9" } - "lwt-core" - "camlp4" -] - - diff --git a/_opam-files/lwt-core.opam b/_opam-files/lwt-core.opam deleted file mode 100644 index 3bb8ca7f5a..0000000000 --- a/_opam-files/lwt-core.opam +++ /dev/null @@ -1,24 +0,0 @@ -opam-version: "1.2" -name: "lwt" -version: "dev" -maintainer: [ - "Anton Bachin " - "Mauricio Fernandez " - "Simon Cruanes " -] -authors: [ - "Jérôme Vouillon" - "Jérémie Dimino" -] -homepage: "https://github.com/ocsigen/lwt" -doc: "https://ocsigen.org/lwt/manual/" -bug-reports: "https://github.com/ocsigen/lwt/issues" -license: "LGPL with OpenSSL linking exception" -dev-repo: "https://github.com/ocsigen/lwt.git" -build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] ] -build-test: [ [ "jbuilder" "runtest" "-p" name ] ] -depends: [ - "jbuilder" { build & >= "1.0+beta9" } - "result" -] - diff --git a/_opam-files/lwt-log.opam b/_opam-files/lwt-log.opam deleted file mode 100644 index a88cb97267..0000000000 --- a/_opam-files/lwt-log.opam +++ /dev/null @@ -1,24 +0,0 @@ -opam-version: "1.2" -name: "lwt" -version: "dev" -maintainer: [ - "Anton Bachin " - "Mauricio Fernandez " - "Simon Cruanes " -] -authors: [ - "Jérôme Vouillon" - "Jérémie Dimino" -] -homepage: "https://github.com/ocsigen/lwt" -doc: "https://ocsigen.org/lwt/manual/" -bug-reports: "https://github.com/ocsigen/lwt/issues" -license: "LGPL with OpenSSL linking exception" -dev-repo: "https://github.com/ocsigen/lwt.git" -build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] ] -build-test: [ [ "jbuilder" "runtest" "-p" name ] ] -depends: [ - "jbuilder" { build & >= "1.0+beta9" } - "lwt-core" -] - diff --git a/_opam-files/lwt-ppx.opam b/_opam-files/lwt-ppx.opam deleted file mode 100644 index 8ecb89fbe8..0000000000 --- a/_opam-files/lwt-ppx.opam +++ /dev/null @@ -1,28 +0,0 @@ -opam-version: "1.2" -name: "lwt" -version: "dev" -maintainer: [ - "Anton Bachin " - "Mauricio Fernandez " - "Simon Cruanes " -] -authors: [ - "Jérôme Vouillon" - "Jérémie Dimino" -] -homepage: "https://github.com/ocsigen/lwt" -doc: "https://ocsigen.org/lwt/manual/" -bug-reports: "https://github.com/ocsigen/lwt/issues" -license: "LGPL with OpenSSL linking exception" -dev-repo: "https://github.com/ocsigen/lwt.git" -build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] ] -build-test: [ [ "jbuilder" "runtest" "-p" name ] ] -depends: [ - "jbuilder" { build & >= "1.0+beta9" } - "lwt-core" # not needed to build, but is required at runtime - "ppx_tools_versioned" - "ocaml-migrate-parsetree" -] - - - diff --git a/_opam-files/lwt-preemptive.opam b/_opam-files/lwt-preemptive.opam deleted file mode 100644 index 81f9860a83..0000000000 --- a/_opam-files/lwt-preemptive.opam +++ /dev/null @@ -1,26 +0,0 @@ -opam-version: "1.2" -name: "lwt" -version: "dev" -maintainer: [ - "Anton Bachin " - "Mauricio Fernandez " - "Simon Cruanes " -] -authors: [ - "Jérôme Vouillon" - "Jérémie Dimino" -] -homepage: "https://github.com/ocsigen/lwt" -doc: "https://ocsigen.org/lwt/manual/" -bug-reports: "https://github.com/ocsigen/lwt/issues" -license: "LGPL with OpenSSL linking exception" -dev-repo: "https://github.com/ocsigen/lwt.git" -build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] ] -build-test: [ [ "jbuilder" "runtest" "-p" name ] ] -depends: [ - "jbuilder" { build & >= "1.0+beta9" } - "lwt-unix" - "base-threads" -] - - diff --git a/_opam-files/lwt-simple-top.opam b/_opam-files/lwt-simple-top.opam deleted file mode 100644 index 920be447d4..0000000000 --- a/_opam-files/lwt-simple-top.opam +++ /dev/null @@ -1,26 +0,0 @@ -opam-version: "1.2" -name: "lwt" -version: "dev" -maintainer: [ - "Anton Bachin " - "Mauricio Fernandez " - "Simon Cruanes " -] -authors: [ - "Jérôme Vouillon" - "Jérémie Dimino" -] -homepage: "https://github.com/ocsigen/lwt" -doc: "https://ocsigen.org/lwt/manual/" -bug-reports: "https://github.com/ocsigen/lwt/issues" -license: "LGPL with OpenSSL linking exception" -dev-repo: "https://github.com/ocsigen/lwt.git" -build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] ] -build-test: [ [ "jbuilder" "runtest" "-p" name ] ] -depends: [ - "jbuilder" { build & >= "1.0+beta9" } - "lwt-core" - "lwt-unix" -] - - diff --git a/_opam-files/lwt-unix.opam b/_opam-files/lwt-unix.opam deleted file mode 100644 index 5dff4ab22c..0000000000 --- a/_opam-files/lwt-unix.opam +++ /dev/null @@ -1,31 +0,0 @@ -opam-version: "1.2" -name: "lwt" -version: "dev" -maintainer: [ - "Anton Bachin " - "Mauricio Fernandez " - "Simon Cruanes " -] -authors: [ - "Jérôme Vouillon" - "Jérémie Dimino" -] -homepage: "https://github.com/ocsigen/lwt" -doc: "https://ocsigen.org/lwt/manual/" -bug-reports: "https://github.com/ocsigen/lwt/issues" -license: "LGPL with OpenSSL linking exception" -dev-repo: "https://github.com/ocsigen/lwt.git" -build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] ] -build-test: [ [ "jbuilder" "runtest" "-p" name ] ] -depends: [ - "jbuilder" { build & >= "1.0+beta9" } - "cppo" { build } - "base" { build } # needed for discover.ml - "stdio" { build } # ...but only to write the sexps - "base-unix" - "lwt-core" - "lwt-log" -] -depopts: [ - "conf-libev" -] diff --git a/_opam-files/lwt.opam b/_opam-files/lwt.opam deleted file mode 100644 index 6cd2681fda..0000000000 --- a/_opam-files/lwt.opam +++ /dev/null @@ -1,30 +0,0 @@ -opam-version: "1.2" -name: "lwt" -version: "dev" -maintainer: [ - "Anton Bachin " - "Mauricio Fernandez " - "Simon Cruanes " -] -authors: [ - "Jérôme Vouillon" - "Jérémie Dimino" -] -homepage: "https://github.com/ocsigen/lwt" -doc: "https://ocsigen.org/lwt/manual/" -bug-reports: "https://github.com/ocsigen/lwt/issues" -license: "LGPL with OpenSSL linking exception" -dev-repo: "https://github.com/ocsigen/lwt.git" -build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] ] -depends: [ - "jbuilder" { build & >= "1.0+beta9" } - "lwt-core" - "lwt-log" - "lwt-unix" - "lwt-preemptive" - "lwt-simple-top" - "lwt-ppx" -] -post-messages: [ - "Lwt+jbuilder has some major breaking changes!!!" -] diff --git a/bad_packages.md b/bad_packages.md deleted file mode 100644 index 76b3c874ea..0000000000 --- a/bad_packages.md +++ /dev/null @@ -1,43 +0,0 @@ -A few errors found by randomly installing some lwt packages. - -All seem to point to libraries using lwt.unix but only linking to lwt. - -# irmin_watcher - -``` -# File "src/irmin_watcher_polling.ml", line 94, characters 28-42: -# Error: Unbound module Lwt_unix -# Command exited with code 2. -``` - -# biocaml - -``` -# + ocamlfind ocamlc -annot -bin-annot -c -g -I lib -I lib/lwt -o lib/lwt/future_lwt.cmi -short-paths -thread -w A-4-33-41-42-44-45-48 -package camlzip,cfstream,core_kernel,lwt,lwt.ppx,ppx_compare,ppx_sexp_conv,re.perl,uri,xmlm lib/lwt/future_lwt.mli -# findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /home/andyman/.opam/4.04.0/lib/ocaml/compiler-libs, /home/andyman/.opam/4.04.0/lib/ocaml -# File "lib/lwt/future_lwt.mli", line 7, characters 22-42: -# Error: Unbound module Lwt_io -``` - -# mirage-profile - -``` -# File "lwt/dns_resolver_unix.ml", line 35, characters 2-10: -# Error: Unbound module Lwt_unix -# Command exited with code 2. -``` - -# dns - -``` -# File "lwt/dns_resolver_unix.ml", line 35, characters 2-10: -# Error: Unbound module Lwt_unix -``` - -# markup - -``` -# + ocamlfind ocamlc -c -g -w +A-4-9-44-45-48 -warn-error +A-3 -bin-annot -safe-string -package lwt -package uutf -I src -I doc -I test -I test/performance -I test/dependency -I test/js_of_ocaml -I test/pages -o src/markup_lwt_unix.cmi src/markup_lwt_unix.mli -# File "src/markup_lwt_unix.mli", line 20, characters 14-41: -# Error: Unbound module Lwt_io -``` diff --git a/lwt.opam b/lwt.opam index 5bd124e6e4..cbde34ef79 100644 --- a/lwt.opam +++ b/lwt.opam @@ -23,7 +23,6 @@ build-test: [ [ "jbuilder" "runtest" "-p" name ] ] depends: [ "ocamlfind" { build & >= "1.5.0" } "jbuilder" { build & >= "1.0+beta9" } - "ocaml-migrate-parsetree" "ppx_tools_versioned" "cppo" { build } "result" @@ -43,5 +42,6 @@ messages: [ {react:installed & !lwt_react:installed} ] post-messages: [ - "Lwt+jbuilder has some major breaking changes!!!" + "Lwt 3.0.0 made some minor breaking changes, announced in 2.7.0. See + https://github.com/ocsigen/lwt/issues/308" ] diff --git a/src/camlp4/jbuild b/src/camlp4/jbuild index 5c17abab76..b788341034 100644 --- a/src/camlp4/jbuild +++ b/src/camlp4/jbuild @@ -1,28 +1,8 @@ -(library - ((name lwt_syntax_options) - (public_name lwt.syntax.options) - (synopsis "Options for Lwt Camlp4 syntax extension (deprecated; use lwt.ppx)") - (optional) - (modules pa_lwt_options) - (wrapped false) - (libraries (camlp4)))) - (library ((name lwt_syntax) (public_name lwt.syntax) (synopsis "Camlp4 syntax for Lwt (deprecated; use lwt.ppx)") (optional) - (modules pa_lwt) - (wrapped false) - (libraries (camlp4 lwt.syntax.options)) - (preprocess (action (run camlp4oof ${<}))))) - -(library - ((name lwt_syntax_log) - (public_name lwt.syntax.log) - (synopsis "Camlp4 syntax for Lwt logging (deprecated; use lwt.ppx)") - (optional) - (modules pa_lwt_log) (wrapped false) (libraries (camlp4 lwt.syntax.options)) (preprocess (action (run camlp4oof ${<}))))) diff --git a/src/camlp4/log/jbuild b/src/camlp4/log/jbuild new file mode 100644 index 0000000000..778fe749c9 --- /dev/null +++ b/src/camlp4/log/jbuild @@ -0,0 +1,10 @@ +(library + ((name lwt_syntax_log) + (public_name lwt.syntax.log) + (synopsis "Camlp4 syntax for Lwt logging (deprecated; use lwt.ppx)") + (optional) + (wrapped false) + (libraries (camlp4 lwt.syntax.options)) + (preprocess (action (run camlp4oof ${<}))))) + + diff --git a/src/camlp4/pa_lwt_log.ml b/src/camlp4/log/pa_lwt_log.ml similarity index 100% rename from src/camlp4/pa_lwt_log.ml rename to src/camlp4/log/pa_lwt_log.ml diff --git a/src/camlp4/pa_lwt_log.mli b/src/camlp4/log/pa_lwt_log.mli similarity index 100% rename from src/camlp4/pa_lwt_log.mli rename to src/camlp4/log/pa_lwt_log.mli diff --git a/src/camlp4/options/jbuild b/src/camlp4/options/jbuild new file mode 100644 index 0000000000..c22926740c --- /dev/null +++ b/src/camlp4/options/jbuild @@ -0,0 +1,8 @@ +(library + ((name lwt_syntax_options) + (public_name lwt.syntax.options) + (synopsis "Options for Lwt Camlp4 syntax extension (deprecated; use lwt.ppx)") + (optional) + (wrapped false) + (libraries (camlp4)))) + diff --git a/src/camlp4/pa_lwt_options.ml b/src/camlp4/options/pa_lwt_options.ml similarity index 100% rename from src/camlp4/pa_lwt_options.ml rename to src/camlp4/options/pa_lwt_options.ml diff --git a/src/unix/config/discover.ml b/src/unix/config/discover.ml index 6b62ac8cb9..3781396d2d 100644 --- a/src/unix/config/discover.ml +++ b/src/unix/config/discover.ml @@ -1,6 +1,5 @@ -(* Lightweight thread library for OCaml +(* OCaml promise library * http://www.ocsigen.org/lwt - * Program discover * Copyright (C) 2010 Jérémie Dimino * * This program is free software; you can redistribute it and/or modify