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

Use virtual_modules in Dune 1.7 #59

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
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: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/ma
script: bash -ex ./.travis-docker.sh
env:
global:
- PINS="io-page:. io-page-unix:. io-page-xen:."
- PINS="io-page.dev:. io-page-unix.dev:. io-page-xen.dev:. io-page-js.dev:."
- PACKAGE=io-page
- DEPOPTS="io-page-unix io-page-xen io-page-js"
matrix:
- DISTRO="debian-stable" OCAML_VERSION=4.04 PACKAGE="io-page"
- DISTRO="debian-stable" OCAML_VERSION=4.04 PACKAGE="io-page-unix"
- DISTRO="debian-stable" OCAML_VERSION=4.04 PACKAGE="io-page-xen"
- DISTRO="alpine" OCAML_VERSION=4.06 PACKAGE="io-page"
- DISTRO="alpine" OCAML_VERSION=4.07 PACKAGE="io-page"
- DISTRO="alpine" OCAML_VERSION=4.08 PACKAGE="io-page"
- DISTRO="debian-stable" OCAML_VERSION=4.04
- DISTRO="debian-stable" OCAML_VERSION=4.05
- DISTRO="alpine" OCAML_VERSION=4.06
- DISTRO="alpine" OCAML_VERSION=4.07
- DISTRO="alpine" OCAML_VERSION=4.08
18 changes: 18 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## v3.0.0

* Use `virtual_modules` in Dune 1.7 to allow use of the interface
file separately from the implementations.

We now provide separate implementations that use dune variants
so that they can be found via a variants tag search:

- `unix` (Unix or Windows)
- `js` (JavaScript)
- `xen` (Xen)

This cleans up the utop toplevel support as well to work by
default now. (@avsm, fixes #50)
Copy link
Member

Choose a reason for hiding this comment

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

awesome!


* Use implicit transitive dependencies, which will become the
default in dune 2.0

## v2.3.0 (2019-06-20)
* Hook in the JavaScript stubs to dune (#55 @jonludlam)
* Remove unnecessary dependency on `configurator`, which pulled
Expand Down
4 changes: 1 addition & 3 deletions META.io-page-xen.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# JBUILDER_GEN

# DUNE_GEN
xen_linkopts = "-lio_page_xen_stubs"

12 changes: 0 additions & 12 deletions META.io-page.template

This file was deleted.

4 changes: 3 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
(lang dune 1.0)
(lang dune 1.7)
(name io-page)
(using library_variants 0.1)
(implicit_transitive_deps false)
25 changes: 25 additions & 0 deletions io-page-js.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
opam-version: "2.0"
maintainer: "anil@recoil.org"
authors: ["Anil Madhavapeddy" "Dave Scott" "Thomas Gazagnaire"]
license: "ISC"
tags: "org:mirage"
homepage: "https://github.com/mirage/io-page"
bug-reports: "https://github.com/mirage/io-page/issues"
doc: "https://mirage.github.io/io-page/"
depends: [
"ocaml" {>= "4.02.3"}
"dune" {>="1.7"}
"io-page" {=version}
]
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
dev-repo: "git+https://github.com/mirage/io-page.git"
synopsis: "Support for efficient handling of I/O memory pages"
description: """
IO pages are page-aligned, and wrapped in the `Cstruct` library to avoid
copying the data contained within the page. This is the JavaScript
implementation.
"""

29 changes: 0 additions & 29 deletions lib/dune

This file was deleted.

File renamed without changes.
7 changes: 7 additions & 0 deletions lib/intf/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(library
(name io_page)
(public_name io-page)
(virtual_modules io_page)
(wrapped false)
(default_implementation unix)
(libraries cstruct bigarray-compat))
File renamed without changes.
Empty file removed lib/io_page_unix_dummy.ml
Empty file.
2 changes: 0 additions & 2 deletions lib/io_page_xen_dummy.ml

This file was deleted.

9 changes: 9 additions & 0 deletions lib/js/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(copy_files ../impl/io_page.ml)

(library
(name io_page_js)
(public_name io-page-js)
(libraries bigarray-compat cstruct)
(implements io-page)
(js_of_ocaml (javascript_files io-page.js))
(variant js))
File renamed without changes.
1 change: 0 additions & 1 deletion lib/stub_alloc_pages_xen.c

This file was deleted.

1 change: 0 additions & 1 deletion lib/stub_get_addr_xen.c

This file was deleted.

10 changes: 10 additions & 0 deletions lib/unix/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(copy_files ../*.c)
(copy_files ../impl/io_page.ml)

(library
(name io_page_unix)
(public_name io-page-unix)
(implements io-page)
(libraries bigarray-compat cstruct)
(c_names stub_alloc_pages stub_get_addr)
(variant unix))
16 changes: 16 additions & 0 deletions lib/xen/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(copy_files ../*.c)
(copy_files ../impl/io_page.ml)

(library
(name io_page_xen)
(public_name io-page-xen)
(implements io-page)
(libraries bigarray-compat cstruct)
(c_names stub_alloc_pages stub_get_addr)
(c_flags (:include c_flags_xen.sexp))
(variant xen))

(rule
(targets c_flags_xen.sexp)
(deps ../config/discover.exe)
(action (run %{deps})))