Skip to content

Commit

Permalink
address jbuilder code review issues
Browse files Browse the repository at this point in the history
1. remove unused files; TODO, _opam, bad_packages

2. fix library description (thread->promise) in discover.ml

3. update .gitignore

4. remove jbuilder line in readme

5. update opam file post install message and remove
   ocaml-migrate-parsetree dep, revert post install message

6. get build to work without presence of camlp4

according to ocaml/dune#51 we need to move the 3 camlp4
packages into seperate directories.

I note a general opam packing issue where if a system installed
camlp4 is in the PATH when ocamlfind is installed, it adds a META
file which pretends those packages are available and compatible with
any current OPAM switch, which it is not!

I think this is an upstream camlp4 packaging issue

7. Add a custom META file

This is only to support the correct syntax predicates for camlp4
and ocamlfind.

Also requires various exists_if clauses
  • Loading branch information
andrewray committed Jun 7, 2017
1 parent b120197 commit ddc6330
Show file tree
Hide file tree
Showing 23 changed files with 158 additions and 377 deletions.
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
_build
setup.data
setup.log
setup.exe
setup-dev.exe
_opam
src/unix/lwt_config

# Coverage analysis.
bisect*.out
Expand All @@ -12,6 +8,7 @@ _coverage/
# For local work, tests, etc.
scratch/

# Autogenerated by jbuider
.merlin
*.install

9 changes: 0 additions & 9 deletions .merlin

This file was deleted.

135 changes: 135 additions & 0 deletions META.lwt.template
Original file line number Diff line number Diff line change
@@ -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"
)

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 0 additions & 10 deletions TODO.jbuild

This file was deleted.

69 changes: 0 additions & 69 deletions _opam-files/META.lwt.template

This file was deleted.

26 changes: 0 additions & 26 deletions _opam-files/lwt-camlp4.opam

This file was deleted.

24 changes: 0 additions & 24 deletions _opam-files/lwt-core.opam

This file was deleted.

24 changes: 0 additions & 24 deletions _opam-files/lwt-log.opam

This file was deleted.

28 changes: 0 additions & 28 deletions _opam-files/lwt-ppx.opam

This file was deleted.

26 changes: 0 additions & 26 deletions _opam-files/lwt-preemptive.opam

This file was deleted.

Loading

0 comments on commit ddc6330

Please sign in to comment.