Skip to content

Commit

Permalink
port to jbuilder
Browse files Browse the repository at this point in the history
Rearrange the `opam` packages to eliminate optional dependencies,
and have explicit and separate packages for the Lwt, Async and
Mirage implementations.  The `opam` and `ocamlfind` layouts now
have the same names:

- `dns`: the core package
- `dns-lwt`: Lwt implementation
- `dns-lwt-unix`: Lwt Unix, including servers
- `dns-async`: Async implementation (this currently uses Unix)

This layout is not compatible with the older releases which had
ocamlfind subpackages, so an upper bound will be needed in OPAM
for those. However, porting should be relatively straightforward
to the new release, and in return your users will not have to deal
with specifying a myriad of optional dependencies in OPAM.
  • Loading branch information
avsm committed Jun 15, 2017
1 parent 36102f1 commit 195913b
Show file tree
Hide file tree
Showing 40 changed files with 298 additions and 269 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,3 +1,4 @@
*.swp
_build/
dns.install
*.install
.merlin
12 changes: 0 additions & 12 deletions .merlin

This file was deleted.

13 changes: 5 additions & 8 deletions .travis.yml
Expand Up @@ -6,14 +6,11 @@ install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/ma
script: bash ./.travis-docker.sh
env:
global:
- PINS="mirage-dns:."
- PINS="mirage-dns:. dns-async:. dns-lwt:. dns-lwt-unix:."
- PACKAGE="dns"
- DEPOPTS="tcpip lwt async cstruct mirage-types-lwt"
- DEPOPTS="mirage-dns dns-async dns-lwt dns-lwt-unix"
matrix:
- DISTRO=debian-stable OCAML_VERSION=4.03.0 REVDEPS="true"
- DISTRO=debian-testing OCAML_VERSION=4.04.0
- DISTRO=debian-stable OCAML_VERSION=4.03.0
- DISTRO=debian-testing OCAML_VERSION=4.04.1
- DISTRO=ubuntu-16.04 OCAML_VERSION=4.03.0
- DISTRO=centos-6 OCAML_VERSION=4.04.0
- DISTRO=centos-7 OCAML_VERSION=4.03.0
- DISTRO=fedora-24 OCAML_VERSION=4.04.0
- DISTRO=alpine-3.5 OCAML_VERSION=4.04.0
- DISTRO=alpine-3.5 OCAML_VERSION=4.04.1
139 changes: 96 additions & 43 deletions CHANGES.md
@@ -1,14 +1,39 @@
## 0.20.2 (2017-06-01)
v1.0.0
------

Rearrange the `opam` packages to eliminate optional dependencies,
and have explicit and separate packages for the Lwt, Async and
Mirage implementations. The `opam` and `ocamlfind` layouts now
have the same names:

- `dns`: the core package
- `dns-lwt`: Lwt implementation
- `dns-lwt-unix`: Lwt Unix, including servers
- `dns-async`: Async implementation (this currently uses Unix)

This layout is not compatible with the older releases which had
ocamlfind subpackages, so an upper bound will be needed in OPAM
for those. However, porting should be relatively straightforward
to the new release, and in return your users will not have to deal
with specifying a myriad of optional dependencies in OPAM.

This release alsop ports the build to use Jbuilder, which speeds
it up quite a bit and removes boilerplate files.

v0.20.2 2017-06-01
------------------

* Depend explicitly on `Ipaddr_unix` and `Uri_services` modules.
* Add a basic server example which has a static lookup table and
does not use the Trie structure. It is in [examples/server.ml].

## 0.20.1 (2017-05-16)
v0.20.1 2017-05-16
------------------

* Port to lwt >= 3.0 (#136, @djs55)

## 0.20.0 (2017-03-23)
v0.20.0 2017-03-23
------------------

* Remove the `Dns.Buf` module that formerly wrapped Cstruct, now that the
latter is a mature library.
Expand All @@ -20,42 +45,48 @@

All these changes were part of #132 by @hannesm.

## 0.19.1 (2017-02-15)
v0.19.1 2017-02-15
------------------

* Use topkg instead of oasis (#126)
* Do not reverse the order of resource records in the parser (#109)
* Use topkg instead of oasis (#126
* Do not reverse the order of resource records in the parser (#109
* Restrict to OCaml 4.03.0+.
* Fix bug parsing pointers to pointers to DNS name labels (#129)
* Fix bug parsing pointers to pointers to DNS name labels (#129

## 0.19.0 (2017-01-20)
v0.19.0 2017-01-20
------------------

* Port to MirageOS 3 module types.
* Remove runtime dependency on PPX from META file
* Bugfixes and improvements for async backend compilation (#100 by @vbmithr).

## 0.18.1 (2016-04-17)
v0.18.1 2016-04-17
------------------

* Clear AA bit on requests, as some servers will drop these otherwise

## 0.18.0 (2016-03-12)
v0.18.0 2016-03-12
------------------

* Remove dependency on camlp4, switch to ppx

## 0.17.0 (2016-03-11)
v0.17.0 2016-03-11
------------------

* This library now depends on the `hashcons` package rather than
containing a fork of it. Now that there is no LGPL (+ linking exception)
containing a fork of it. Now that there is no LGPL (+ linking exception
code left, clarify that the license is ISC. Previously the `opam`
file claimed a mixture of licenses (#86 via @djs55).
* Add multi-distro Travis testing support.
* Library now depends on OCaml 4.02+

## 0.16.0 (2015-10-21)
v0.16.0 2015-10-21
------------------

* Change source port randomization to avoid overflow in the port range
(#83 from @yomimono).

## Improve mDNS support (#82 from Luke Dunstan)
Improve mDNS support (#82 from Luke Dunstan):

* Add `Dns.Probe` to implement the unique name probing portion of mDNS.
* Expose the `Dns.Name.Set` construct.
Expand All @@ -66,23 +97,27 @@ All these changes were part of #132 by @hannesm.
* Fixed mDNS legacy responses to use TTL <= 10 sec
* Fixed mDNS responses to use RD=0.

## 0.15.3 (2015-07-30)
v0.15.3 2015-07-30
------------------

* Fix regression in 0.15.2 which prevented Dns_server_unix.listen from
* Fix regression in 0.15.2 which prevented `Dns_server_unix.listen` from
answering more than one query (#80 from Magnus Skjegstad)

## 0.15.2 (2015-07-04)
v0.15.2 2015-07-04
------------------

* Fix incorrect mirage dependency on tcpip
* Improve clarity and formatting of Lwt use
* Remove camlp4 dependency
* Now requires lwt >2.4.7

## 0.15.1 (2015-07-02)
v0.15.1 2015-07-02
------------------

* Fix critical DNS resolver timeout bug causing unexpected exceptions

## 0.15.0 (2015-05-14)
v0.15.0 2015-05-14
------------------

* Name.domain_name has been renamed to Name.t and is now abstract
* Name.domain_name_to_string has been renamed to Name.to_string
Expand All @@ -97,9 +132,10 @@ All these changes were part of #132 by @hannesm.
* We now require >= ipaddr.2.6.0 to support Name.of_ipaddr
* uri 1.7.0+ is now required for its uri.services service registry
* Named service lookups are now supported in zone files
* Dig string serializations are now in Dns.Dig (#61 from Heidi Howard)
* Dig string serializations are now in Dns.Dig (#61 from Heidi Howard

## 0.14.1 (2015-03-29)
v0.14.1 2015-03-29
------------------

* Reduce namespace pollution in `name.ml` to avoid breaking with Cstruct 1.6.0+.
* Add a `Dns_server.compose` function to make it easier to build
Expand All @@ -109,16 +145,18 @@ All these changes were part of #132 by @hannesm.
* Split out the experimental Async_resolver into a `Async_kernel` and
Unix libraries. This introduces the `dns.async-unix` library.

## 0.14.0 (2015-01-29)
v0.14.0 2015-01-29
------------------

* Renamed `Packet.QM` to `Packet.Q_Normal` and `QU` to `Q_mDNS_Unicast` for
clarity and added more detailed doc comments. Added constructor function
`Packet.make_question` for convenience. (#41)
* Support `io-page` 1.3.0+ interface. (#40)
`Packet.make_question` for convenience. (#41
* Support `io-page` 1.3.0+ interface. (#40

## 0.13.0 (2015-01-26)
v0.13.0 2015-01-26
------------------

* Add support for multicast DNS (RFC6762) in the trie. (#35 from Luke Dunstan)
* Add support for multicast DNS (RFC6762) in the trie. (#35 from Luke Dunstan
* mDNS doesn't use SOA nor delegation (RFC 6762 section 12), so some minor changes
to Trie are required to handle this.
* mDNS doesn't echo the questions in the response (RFC 6762 section 6), except
Expand All @@ -144,12 +182,13 @@ All these changes were part of #132 by @hannesm.
support efficient service discovery.
* `Trie.iter` was added to support mDNS announcements.
* Switch to `Bytes` instead of `String` for eventual `-safe-string` support.
* Partially remove some error printing to stderr. (#36)
* Partially remove some error printing to stderr. (#36

Unit tests were added for some of the changes above, including a test-only
dependency on `pcap-format`.

## 0.12.0 (2014-12-24)
v0.12.0 2014-12-24
------------------

* Parse and marshal the mDNS unicast-response bit (#29).
* Add OUnit tests for `Dns.Packet.parse` using `pcap` files.
Expand All @@ -158,14 +197,16 @@ dependency on `pcap-format`.
* Switch to `Base64` v2, which uses `B64` as the toplevel module name
to avoid linking conflicts with other community libraries.

## 0.11.0 (2014-11-02)
v0.11.0 2014-11-02
------------------

* Do not depend in Io_page; instead `Dns.Buf.create` now accepts an
optional `alloc` parameter to use a custom allocator such as `Io_page`.
* Add Async DNS resolver modules from @marklrh (#22).
* Add a Dns_resolver_mirage.Static for a static DNS interface.

## 0.10.0 (2014-08-20)
v0.10.0 2014-08-20
------------------

* Add `Dns_resolver_mirage` module for making stub resolution requests
using the Mirage module types.
Expand All @@ -181,24 +222,28 @@ dependency on `pcap-format`.
* Add a local `opam` file for easier pinning.
* Add an `examples/` directory with a DNS forwarder sample (#21).

## 0.9.1 (2014-07-29)
v0.9.1 2014-07-29
------------------

* Fix file descriptor leak in resolver (#15, #16) by expanding `commfn`
with a cleanup function.

## 0.9.0 (2014-06-16)
v0.9.0 2014-06-16
------------------

* Ensure that all `Dns.Buf.t` buffers are page-aligned, via `Io_page`.
* Remove a Unix dependency that snuck into the `Dns_resolver` portable
core, by adding a timeout argument to the `commfn` type.
* Improve ocamldoc in `Dns_resolver_unix`.

## 0.8.1 (2014-04-19)
v0.8.1 2014-04-19
------------------

* Add `process_of_zonebufs` to handle multiple zone files.
* Adapt `Dns_server_unix` to expose multiple zonebuf functions.

## 0.8.0 (2014-02-21)
v0.8.0 2014-02-21
------------------

* Use `Ipaddr.V6` to restore IPv6/AAAA RR support.
* `process_query` now takes an output buffer so it doesn't have to
Expand All @@ -211,7 +256,8 @@ dependency on `pcap-format`.
have shifted into `Dns_resolver_unix` or `Dns_server_unix`, with
the module types for `PROCESSOR` and `CLIENT` unchanged.

## 0.7.0 (2013-08-26)
v0.7.0 2013-08-26
------------------

* Add path argument to `Resolv_conf in Dns_resolver.config.
* `Dns_resolver.t` is now a record type rather than a first-class module.
Expand Down Expand Up @@ -239,35 +285,41 @@ dependency on `pcap-format`.
* Fix reversed multiple TXT parse bug
* Move DNSSEC implementation to <//github.com/dsheets/ocaml-dnssec>

## 0.6.2 (2013-02-13)
v0.6.2 2013-02-13
------------------

* Fix Lwt compilation after switch to `Dns.Names.Map` instead of `Hashtbl`.
* Fix Lwt Makefile detection (`Lwt.unix` instead of `Lwt.ssl`)
* Fix Lwt Makefile detection (`Lwt.unix` instead of `Lwt.ssl`

## 0.6.1 (2013-02-12)
v0.6.1 2013-02-12
------------------

* Improve performance of packet marshalling.
* Add a Mirage `Dns_server` subpackage.

## 0.6.0 (2012-12-31)
v0.6.0 2012-12-31
------------------

* (Very) experimental DNSSEC support.
* Use cstruct-0.6.0 API.
* Improve robustness of `Dns_resolver`.
* Add EDNS0 support for larger packet sizes.

## 0.5.2 (2012-11-28)
v0.5.2 2012-11-28
------------------

* Fix the server interface to be fully asynchronous.
* Correct `q_type`/`q_class` arguments being ignored in the Lwt
Dns_resolver (from Pierre Chambart).

## 0.5.1 (2012-10-05)
v0.5.1 2012-10-05
------------------

* Remain compatible with OCaml-3.12.1 with the more verbose
first-class module syntax.

## 0.5.0 (2012-09-29)
v0.5.0 2012-09-29
------------------

* Add mldig as a full(ish)-featured dig clone, with similar
output format.
Expand All @@ -276,6 +328,7 @@ dependency on `pcap-format`.
* Move the Lwt bits (resolver, server, cmdline client) into
a separate directory, to follow the Cohttp convention.

## 0.4.0 (2012-09-18)
v0.4.0 2012-09-18
------------------

* Initial public release.
4 changes: 2 additions & 2 deletions async/async_dns_resolver.ml
Expand Up @@ -15,8 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)

open Core_kernel.Std
open Async.Std
open Core_kernel
open Async

open Dns
open Operators
Expand Down
5 changes: 2 additions & 3 deletions async/async_dns_resolver.mli
Expand Up @@ -17,9 +17,8 @@

(** Async DNS resolution logic *)

open Core_kernel.Std
open Async.Std

open Core_kernel
open Async
open Dns

type commfn = {
Expand Down
4 changes: 2 additions & 2 deletions async/async_dns_resolver_unix.ml
Expand Up @@ -15,8 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)

open Core.Std
open Async.Std
open Core
open Async

open Dns
open Async_dns_resolver
Expand Down
4 changes: 2 additions & 2 deletions async/async_dns_resolver_unix.mli
Expand Up @@ -17,8 +17,8 @@

(** Async DNS resolution interface on Unix *)

open Core.Std
open Async.Std
open Core
open Async

val gethostbyname :
?log:Log.t ->
Expand Down
1 change: 0 additions & 1 deletion async/dns-async-unix.mllib

This file was deleted.

1 change: 0 additions & 1 deletion async/dns-async.mllib

This file was deleted.

0 comments on commit 195913b

Please sign in to comment.