Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to jbuilder #374

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
dbb4963
almost working ppx for jbuilder; just cant get linkall to apply...
andrewray May 22, 2017
0fa50d2
magic cmxs ocamlbuild rule courtest @jdimino
andrewray May 22, 2017
68b161f
1st pass at jbuilder
andrewray May 23, 2017
30b8a80
add configurator dep
andrewray May 23, 2017
de3d931
opinionated reorganisation of packages
andrewray May 23, 2017
291f605
add lwt.ppx to lwt. notes on a few bad package builds
andrewray May 23, 2017
e721933
add parsing of ocamlc -config to discover.ml
andrewray May 23, 2017
a988946
rename syntax to camlp4. Add -p to opam test commands
andrewray May 23, 2017
a384933
missed a syntax->camlp4 conversion in META
andrewray May 23, 2017
2da8764
add proper configuration for glib
andrewray May 24, 2017
e9f0907
add flag detection for lwt-unix
andrewray May 24, 2017
512d277
new package lwt-xxx, map to old name lwt.xxx
andrewray May 24, 2017
e13bac7
remove old build system
andrewray May 24, 2017
7b6d9d0
add synopsis fields
andrewray May 24, 2017
94383e4
use exists_if in lwt META to only shadow installed packages
andrewray May 24, 2017
b28726b
note build problems on 4.03
andrewray May 24, 2017
b825120
Refact libraries to match current lwt configuration
andrewray May 25, 2017
d99fb6d
Remove dependancy on Base and Stdio
andrewray May 25, 2017
6c1705f
fix ppx so it builds on 4.02..04
andrewray May 25, 2017
ffffdea
fixup opam files and test across a few ocaml versions
andrewray May 25, 2017
a926624
Fix top-level configuration
andrewray May 26, 2017
3b29534
fix lwt.opam typo
andrewray May 26, 2017
49d909a
fix error message in discover.ml
andrewray May 26, 2017
cd1e12c
add workspace file. works with current jbuilder master
andrewray May 26, 2017
5a044c6
have a go at updating the travis script
andrewray May 26, 2017
a17ec27
try to fix travis script (part 2 of many...)
andrewray May 26, 2017
c13e28a
try to fix appveyor
andrewray May 26, 2017
20a979d
try to fix appveyor script
andrewray May 26, 2017
358f333
set os_type correctly in discover.ml
andrewray May 26, 2017
4973a51
and finally link with ws2_32 library
andrewray May 26, 2017
353f501
for appveryor, run the tests through opam instead.
andrewray May 27, 2017
b9ff5dc
add jbuilder odoc target, disable 4.05 on travis
andrewray May 27, 2017
890ccc2
print each tests to see whats failing on travis
andrewray May 27, 2017
d827388
add makefile for wikidoc and ocamldoc generation
andrewray May 27, 2017
ef6021c
jenkins documentation build
andrewray May 28, 2017
b120197
install uchar and ocamlbuild deps for jenkins
andrewray May 28, 2017
ddc6330
address jbuilder code review issues
andrewray Jun 7, 2017
b0551ea
work around for camlp4 issue.
andrewray Jun 7, 2017
67a34ac
add configuration check to makefile
andrewray Jun 8, 2017
455fe57
didn't mean to remove the install target from the Makefile
andrewray Jun 8, 2017
c075a63
Fix up lwt_react, lwt_ssl, lwt_glib opam files
aantron Jun 8, 2017
dacbef8
Fix up lwt.opam
aantron Jun 8, 2017
0a33c49
Revert change to README.md
aantron Jun 8, 2017
7ca76aa
More fixing up of lwt_react, lwt_ssl, lwt_glib
aantron Jun 8, 2017
e0077c3
Nits: remove some trailing whitespace
aantron Jun 8, 2017
9fb2f5d
One last trailing whitespace nit!
aantron Jun 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
_build
src/unix/lwt_config.ml
src/unix/lwt_config.h
src/unix/lwt_unix_jobs_generated.ml
src/unix/jobs-unix/
setup.data
setup.log
setup.exe
setup-dev.exe
_opam
src/unix/lwt_config
src/jbuild-ignore

# Coverage analysis.
bisect*.out
_coverage/

# For local work, tests, etc.
scratch/

# Autogenerated by jbuider
.merlin
*.install
9 changes: 6 additions & 3 deletions .jenkins.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
opam pin add --no-action lwt .
opam install camlp4
opam install ssl lablgtk react conf-libev
opam install ocamlbuild uchar
opam install --deps-only lwt
opam install --verbose lwt

do_build_doc () {
rm -rf _build/lwt-api.wikidocdir
./setup-dev.exe -build lwt-api.wikidocdir/index.wiki
rm -rf doc/api
# generate wikidoc documentation
make doc-api-wiki
# copy manual pages and api documentation
cp -Rf doc/*.wiki ${MANUAL_SRC_DIR}
cp -Rf _build/lwt-api.wikidocdir/*.wiki ${API_DIR}
cp -Rf doc/api/wiki/*.wiki ${API_DIR}
}

do_remove () {
Expand Down
9 changes: 0 additions & 9 deletions .merlin

This file was deleted.

4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ matrix:
env: COMPILER=4.03
- os: linux
env: COMPILER=4.04
- os: linux
env: COMPILER=4.05
#- os: linux
# env: COMPILER=4.05
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find any discussion in the jbuilder repo about 4.05. Do you or anyone have a link? This doesn't block the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the bug may actually be related to a problem with 4.05+beta3, and it will work with 4.05+trunk

- os: linux
env: COMPILER=4.04 FLAMBDA=yes
- os: linux
Expand Down
134 changes: 134 additions & 0 deletions META.lwt.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#
# 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"
)
84 changes: 41 additions & 43 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,70 +9,68 @@
OCAMLFIND_IGNORE_DUPS_IN = $(shell ocamlfind query compiler-libs)
export OCAMLFIND_IGNORE_DUPS_IN

# Set to setup.exe for the release
SETUP := setup-dev.exe

# Default rule
default: build

# Setup for the development version
setup-dev.exe: _oasis setup.ml
grep -v '^#' setup.ml > setup_dev.ml
ocamlfind ocamlopt -o $@ -linkpkg -package ocamlbuild,oasis.dynrun setup_dev.ml || \
ocamlfind ocamlc -o $@ -linkpkg -package ocamlbuild,oasis.dynrun setup_dev.ml || true
rm -f setup_dev.*

# Setup for the release
setup.exe: setup.ml
ocamlopt.opt -o $@ $< || ocamlopt -o $@ $< || ocamlc -o $@ $<
rm -f setup.cmx setup.cmi setup.o setup.obj setup.cmo
# build the usual development packages
build: check-config
jbuilder build \
--only-packages lwt \
@install

setup: $(SETUP)
# build everything
all: check-config
jbuilder build @install

build: $(SETUP) setup.data
./$(SETUP) -build $(BUILDFLAGS)
# run all tests
test: check-config
jbuilder runtest

doc: $(SETUP) setup.data build
./$(SETUP) -doc $(DOCFLAGS)
# configuration
check-config:
@[ -f src/jbuild-ignore ] && [ -f src/unix/lwt_config ] && echo "LWT configuration OK" || cat src/util/config-warn

doc-api: $(SETUP) setup.data build
./$(SETUP) -build lwt-api.docdir/index.html
default-config:
ocaml src/util/configure.ml -use-libev false -use-camlp4 false

test: $(SETUP) setup.data build clean-coverage
./$(SETUP) -test $(TESTFLAGS)
# Use jbuilder/odoc to generate static html documentation.
# Currenty requires ocaml 4.03.0 to install odoc.
doc:
jbuilder build @doc

all: $(SETUP)
./$(SETUP) -all $(ALLFLAGS)
# Build HTML documentation with ocamldoc
doc-api-html: all
make -C doc api/html/index.html

install: $(SETUP) setup.data
./$(SETUP) -install $(INSTALLFLAGS)
# Build wiki documentation with wikidoc
# requires ocaml 4.03.0 and pinning the repo
# https://github.com/ocsigen/wikidoc
doc-api-wiki: all
make -C doc api/wiki/index.wiki

uninstall: $(SETUP) setup.data
./$(SETUP) -uninstall $(UNINSTALLFLAGS)
install:
jbuilder install

reinstall: $(SETUP) setup.data
./$(SETUP) -reinstall $(REINSTALLFLAGS)
uninstall:
jbuilder uninstall

clean: $(SETUP) clean-coverage
./$(SETUP) -clean $(CLEANFLAGS)
reinstall:
jbuilder uninstall
jbuilder install

distclean: $(SETUP)
./$(SETUP) -distclean $(DISTCLEANFLAGS)
rm -rf setup*.exe
clean:
rm -fr _build
rm -f *.install
rm -fr doc/api
rm -f src/jbuild-ignore src/unix/lwt_config

clean-coverage:
rm -rf bisect*.out
rm -rf _coverage/

configure: $(SETUP)
./$(SETUP) -configure $(CONFIGUREFLAGS)

setup.data: $(SETUP)
./$(SETUP) -configure $(CONFIGUREFLAGS)

coverage: test
bisect-ppx-report -I _build/ -html _coverage/ bisect*.out
bisect-ppx-report -text - -summary-only bisect*.out
@echo See _coverage/index.html

.PHONY: default setup build doc test all install uninstall reinstall clean distclean configure coverage
.PHONY: default build doc test all install uninstall reinstall clean coverage
Loading