···11-opam-version: "2.0"
22-maintainer: "martin@mjambon.com"
33-authors: ["Martin Jambon"]
44-55-homepage: "https://github.com/mjambon/atd"
66-bug-reports: "https://github.com/mjambon/atd/issues"
77-dev-repo: "git://github.com/mjambon/atd.git"
88-99-build: [
1010- ["jbuilder" "subst" "-p" name] {pinned}
1111- ["jbuilder" "build" "-p" name "-j" jobs]
1212-]
1313-1414-# Restore when https://github.com/mjambon/atd/issues/121 is resolved.
1515-# build-test: [
1616-# ["jbuilder" "runtest" "-p" name]
1717-# ]
1818-1919-depends: [
2020- "ocaml" {>= "4.03.0"}
2121- "jbuilder"
2222- "menhir" {build}
2323- "easy-format"
2424-]
2525-synopsis: "Parser for the ATD data format description language"
2626-description: """
2727-ATD is the OCaml library providing a parser for the ATD language and
2828-various utilities. ATD stands for Adjustable Type Definitions in
2929-reference to its main property of supporting annotations that allow a
3030-good fit with a variety of data formats."""
3131-url {
3232- src: "https://github.com/mjambon/atd/releases/download/2.0.0/atd-2.0.0.tbz"
3333- checksum: "md5=14e47609397c524ea0eae7c3f14f7ccf"
3434-}
···11-opam-version: "2.0"
22-maintainer: "martin@mjambon.com"
33-authors: ["Martin Jambon"]
44-55-homepage: "https://github.com/mjambon/atd"
66-bug-reports: "https://github.com/mjambon/atd/issues"
77-dev-repo: "git://github.com/mjambon/atd.git"
88-99-build: [
1010- ["jbuilder" "subst" "-p" name] {pinned}
1111- ["jbuilder" "build" "-p" name "-j" jobs]
1212-]
1313-1414-# Restore when https://github.com/mjambon/atd/issues/121 is resolved.
1515-# build-test: [
1616-# ["jbuilder" "runtest" "-p" name]
1717-# ]
1818-1919-depends: [
2020- "ocaml" {>= "4.03.0"}
2121- "jbuilder"
2222- "atd" {>= "2.0.0"}
2323- "atdgen-runtime" {>= "2.0.0"}
2424- "biniou" {>= "1.0.6"}
2525- "yojson" {>= "1.2.1"}
2626-]
2727-synopsis:
2828- "Generates efficient JSON serializers, deserializers and validators"
2929-description: """
3030-Atdgen is a command-line program that takes as input type definitions in the
3131-ATD syntax and produces OCaml code suitable for data serialization and
3232-deserialization.
3333-3434-Two data formats are currently supported, these are biniou and JSON.
3535-Atdgen-biniou and Atdgen-json will refer to Atdgen used in one context or the
3636-other.
3737-3838-Atdgen was designed with efficiency and durability in mind. Software authors
3939-are encouraged to use Atdgen directly and to write tools that may reuse part of
4040-Atdgen’s source code."""
4141-url {
4242- src: "https://github.com/mjambon/atd/releases/download/2.0.0/atd-2.0.0.tbz"
4343- checksum: "md5=14e47609397c524ea0eae7c3f14f7ccf"
4444-}
-6
esy.lock/opam/base-threads.base/opam
···11-opam-version: "2.0"
22-maintainer: "https://github.com/ocaml/opam-repository/issues"
33-description: """
44-Threads library distributed with the OCaml compiler
55-"""
66-
-6
esy.lock/opam/base-unix.base/opam
···11-opam-version: "2.0"
22-maintainer: "https://github.com/ocaml/opam-repository/issues"
33-description: """
44-Unix library distributed with the OCaml compiler
55-"""
66-
-45
esy.lock/opam/biniou.1.2.1/opam
···11-opam-version: "2.0"
22-build: [
33- ["dune" "subst"] {pinned}
44- ["dune" "build" "-p" name "-j" jobs]
55- ["dune" "runtest" "-p" name "-j" jobs] {with-test}
66- ["dune" "build" "-p" name "@doc"] {with-doc}
77-]
88-maintainer: ["martin@mjambon.com"]
99-authors: ["Martin Jambon"]
1010-bug-reports: "https://github.com/mjambon/biniou/issues"
1111-homepage: "https://github.com/mjambon/biniou"
1212-doc: "https://mjambon.github.io/biniou/"
1313-license: "BSD-3-Clause"
1414-dev-repo: "git+https://github.com/mjambon/biniou.git"
1515-synopsis:
1616- "Binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve"
1717-description: """
1818-1919-Biniou (pronounced "be new") is a binary data format designed for speed, safety,
2020-ease of use and backward compatibility as protocols evolve. Biniou is vastly
2121-equivalent to JSON in terms of functionality but allows implementations several
2222-times faster (4 times faster than yojson), with 25-35% space savings.
2323-2424-Biniou data can be decoded into human-readable form without knowledge of type
2525-definitions except for field and variant names which are represented by 31-bit
2626-hashes. A program named bdump is provided for routine visualization of biniou
2727-data files.
2828-2929-The program atdgen is used to derive OCaml-Biniou serializers and deserializers
3030-from type definitions.
3131-3232-Biniou format specification: mjambon.github.io/atdgen-doc/biniou-format.txt"""
3333-depends: [
3434- "easy-format"
3535- "dune" {>= "1.10"}
3636- "ocaml" {>= "4.02.3"}
3737-]
3838-url {
3939- src:
4040- "https://github.com/mjambon/biniou/releases/download/1.2.1/biniou-1.2.1.tbz"
4141- checksum: [
4242- "sha256=35546c68b1929a8e6d27a3b39ecd17b38303a0d47e65eb9d1480c2061ea84335"
4343- "sha512=82670cc77bf3e869ee26e5fbe5a5affa45a22bc8b6c4bd7e85473912780e0111baca59b34a2c14feae3543ce6e239d7fddaeab24b686a65bfe642cdb91d27ebf"
4444- ]
4545-}
···11-opam-version: "2.0"
22-maintainer: "martin@mjambon.com"
33-authors: "Martin Jambon"
44-license: "BSD-3-Clause"
55-homepage: "http://mjambon.com/cppo.html"
66-doc: "https://ocaml-community.github.io/cppo/"
77-bug-reports: "https://github.com/ocaml-community/cppo/issues"
88-depends: [
99- "ocaml" {>= "4.03"}
1010- "dune" {>= "1.0"}
1111- "base-unix"
1212-]
1313-build: [
1414- ["dune" "subst"] {pinned}
1515- ["dune" "build" "-p" name "-j" jobs]
1616- ["dune" "runtest" "-p" name "-j" jobs] {with-test}
1717-]
1818-dev-repo: "git+https://github.com/ocaml-community/cppo.git"
1919-synopsis: "Code preprocessor like cpp for OCaml"
2020-description: """
2121-Cppo is an equivalent of the C preprocessor for OCaml programs.
2222-It allows the definition of simple macros and file inclusion.
2323-2424-Cppo is:
2525-2626-* more OCaml-friendly than cpp
2727-* easy to learn without consulting a manual
2828-* reasonably fast
2929-* simple to install and to maintain
3030-"""
3131-url {
3232- src: "https://github.com/ocaml-community/cppo/releases/download/v1.6.6/cppo-v1.6.6.tbz"
3333- checksum: [
3434- "sha256=e7272996a7789175b87bb998efd079794a8db6625aae990d73f7b4484a07b8a0"
3535- "sha512=44ecf9d225d9e45490a2feac0bde04865ca398dba6c3579e3370fcd1ea255707b8883590852af8b2df87123801062b9f3acce2455c092deabf431f9c4fb8d8eb"
3636- ]
3737-}
-51
esy.lock/opam/dune.2.1.2/opam
···11-opam-version: "2.0"
22-synopsis: "Fast, portable, and opinionated build system"
33-description: """
44-55-dune is a build system that was designed to simplify the release of
66-Jane Street packages. It reads metadata from "dune" files following a
77-very simple s-expression syntax.
88-99-dune is fast, has very low-overhead, and supports parallel builds on
1010-all platforms. It has no system dependencies; all you need to build
1111-dune or packages using dune is OCaml. You don't need make or bash
1212-as long as the packages themselves don't use bash explicitly.
1313-1414-dune supports multi-package development by simply dropping multiple
1515-repositories into the same directory.
1616-1717-It also supports multi-context builds, such as building against
1818-several opam roots/switches simultaneously. This helps maintaining
1919-packages across several versions of OCaml and gives cross-compilation
2020-for free.
2121-"""
2222-maintainer: ["Jane Street Group, LLC <opensource@janestreet.com>"]
2323-authors: ["Jane Street Group, LLC <opensource@janestreet.com>"]
2424-license: "MIT"
2525-homepage: "https://github.com/ocaml/dune"
2626-doc: "https://dune.readthedocs.io/"
2727-bug-reports: "https://github.com/ocaml/dune/issues"
2828-depends: [
2929- "ocaml" {>= "4.07"}
3030- "base-unix"
3131- "base-threads"
3232-]
3333-conflicts: [
3434- "odoc" {< "1.3.0"}
3535- "dune-release" {< "1.3.0"}
3636- "jbuilder" {= "transition"}
3737-]
3838-dev-repo: "git+https://github.com/ocaml/dune.git"
3939-build: [
4040- # opam 2 sets OPAM_SWITCH_PREFIX, so we don't need a hardcoded path
4141- ["ocaml" "configure.ml" "--libdir" lib] {opam-version < "2"}
4242- ["ocaml" "bootstrap.ml" "-j" jobs]
4343- ["./dune.exe" "build" "-p" name "--profile" "dune-bootstrap" "-j" jobs]
4444-]
4545-url {
4646- src: "https://github.com/ocaml/dune/releases/download/2.1.2/dune-2.1.2.tbz"
4747- checksum: [
4848- "sha256=9c3278ebb3ec14dc4b1880671371985edcd6cbb979260dd403f28acabbcc5faf"
4949- "sha512=ab2d4a3817fbbe80de6a1fd8052c607e6f08489dd8f3b1f18f2a79260c8793472b4dfbfec232fc517d473f1d893ac3f797fdf35366c2d031c899a7db07097ee6"
5050- ]
5151-}
-46
esy.lock/opam/easy-format.1.3.2/opam
···11-opam-version: "2.0"
22-build: [
33- ["dune" "subst"] {pinned}
44- ["dune" "build" "-p" name "-j" jobs]
55- ["dune" "runtest" "-p" name "-j" jobs] {with-test}
66- ["dune" "build" "-p" name "@doc"] {with-doc}
77-]
88-maintainer: ["martin@mjambon.com" "rudi.grinberg@gmail.com"]
99-authors: ["Martin Jambon"]
1010-bug-reports: "https://github.com/mjambon/easy-format/issues"
1111-homepage: "https://github.com/mjambon/easy-format"
1212-doc: "https://mjambon.github.io/easy-format/"
1313-license: "BSD-3-Clause"
1414-dev-repo: "git+https://github.com/mjambon/easy-format.git"
1515-synopsis:
1616- "High-level and functional interface to the Format module of the OCaml standard library"
1717-description: """
1818-1919-This module offers a high-level and functional interface to the Format module of
2020-the OCaml standard library. It is a pretty-printing facility, i.e. it takes as
2121-input some code represented as a tree and formats this code into the most
2222-visually satisfying result, breaking and indenting lines of code where
2323-appropriate.
2424-2525-Input data must be first modelled and converted into a tree using 3 kinds of
2626-nodes:
2727-2828-* atoms
2929-* lists
3030-* labelled nodes
3131-3232-Atoms represent any text that is guaranteed to be printed as-is. Lists can model
3333-any sequence of items such as arrays of data or lists of definitions that are
3434-labelled with something like "int main", "let x =" or "x:"."""
3535-depends: [
3636- "dune" {>= "1.10"}
3737- "ocaml" {>= "4.02.3"}
3838-]
3939-url {
4040- src:
4141- "https://github.com/mjambon/easy-format/releases/download/1.3.2/easy-format-1.3.2.tbz"
4242- checksum: [
4343- "sha256=3440c2b882d537ae5e9011eb06abb53f5667e651ea4bb3b460ea8230fa8c1926"
4444- "sha512=e39377a2ff020ceb9ac29e8515a89d9bdbc91dfcfa871c4e3baafa56753fac2896768e5d9822a050dc1e2ade43c8967afb69391a386c0a8ecd4e1f774e236135"
4545- ]
4646-}
-39
esy.lock/opam/jbuilder.1.0+beta20.2/opam
···11-opam-version: "2.0"
22-maintainer: "opensource@janestreet.com"
33-authors: ["Jane Street Group, LLC <opensource@janestreet.com>"]
44-homepage: "https://github.com/ocaml/dune"
55-bug-reports: "https://github.com/ocaml/dune/issues"
66-dev-repo: "git+https://github.com/ocaml/dune.git"
77-license: "Apache-2.0"
88-build: [
99- ["ocaml" "configure.ml" "--libdir" lib]
1010- ["ocaml" "bootstrap.ml"]
1111- ["./boot.exe" "--subst"] {pinned}
1212- ["./boot.exe" "-j" jobs]
1313-]
1414-synopsis: "Fast, portable and opinionated build system"
1515-description: """
1616-jbuilder is a build system that was designed to simplify the release
1717-of Jane Street packages. It reads metadata from "jbuild" files
1818-following a very simple s-expression syntax.
1919-2020-jbuilder is fast, it has very low-overhead and support parallel builds
2121-on all platforms. It has no system dependencies, all you need to build
2222-jbuilder and packages using jbuilder is OCaml. You don't need or make
2323-or bash as long as the packages themselves don't use bash explicitely.
2424-2525-jbuilder supports multi-package development by simply dropping multiple
2626-repositories into the same directory.
2727-2828-It also supports multi-context builds, such as building against
2929-several opam roots/switches simultaneously. This helps maintaining
3030-packages across several versions of OCaml and gives cross-compilation
3131-for free."""
3232-depends: [
3333- "ocaml" {>= "4.02.3"}
3434-]
3535-url {
3636- src:
3737- "https://github.com/ocaml/dune/releases/download/1.0%2Bbeta20.2/jbuilder-1.0+beta20.2.tbz"
3838- checksum: "md5=fbe8c3b1facb206cac3fb8932b5dd5d9"
3939-}
···11-opam-version: "2.0"
22-maintainer: "Frederic Bour <frederic.bour@lakaban.net>"
33-authors: "Frederic Bour <frederic.bour@lakaban.net>"
44-homepage: "https://github.com/let-def/merlin-extend"
55-bug-reports: "https://github.com/let-def/merlin-extend"
66-license: "MIT"
77-dev-repo: "git+https://github.com/let-def/merlin-extend.git"
88-build: [
99- ["dune" "subst"] {pinned}
1010- ["dune" "build" "-p" name "-j" jobs]
1111-]
1212-depends: [
1313- "dune" {>= "1.0"}
1414- "cppo" {build}
1515- "ocaml" {>= "4.02.3"}
1616-]
1717-synopsis: "A protocol to provide custom frontend to Merlin"
1818-description: """
1919-This protocol allows to replace the OCaml frontend of Merlin.
2020-It extends what used to be done with the `-pp' flag to handle a few more cases."""
2121-doc: "https://let-def.github.io/merlin-extend"
2222-url {
2323- src:
2424- "https://github.com/let-def/merlin-extend/releases/download/v0.5/merlin-extend-v0.5.tbz"
2525- checksum: [
2626- "sha256=ca3a38c360c7d4827eb4789abf7a6aa4b6e3b4e3c3ef69a5be64dce4601ec227"
2727- "sha512=55c5a3637337abb8ca8db679128a81ca8ccce567bc214d55b2e6444dc0e905b74c64d629bdea2457d0fe4be5306414feefcdbc4d4761fdafd59aa107550936b6"
2828- ]
2929-}
-71
esy.lock/opam/merlin.3.3.3/opam
···11-opam-version: "2.0"
22-maintainer: "defree@gmail.com"
33-authors: "The Merlin team"
44-homepage: "https://github.com/ocaml/merlin"
55-bug-reports: "https://github.com/ocaml/merlin/issues"
66-dev-repo: "git+https://github.com/ocaml/merlin.git"
77-build: [
88- ["dune" "subst"] {pinned}
99- ["dune" "build" "-p" name "-j" jobs]
1010- ["dune" "runtest" "-p" name "-j" jobs] {with-test}
1111-]
1212-depends: [
1313- "ocaml" {>= "4.02.1" & < "4.10"}
1414- "dune" {>= "1.8.0"}
1515- "ocamlfind" {>= "1.5.2"}
1616- "yojson" {>= "1.6.0"}
1717- "mdx" {with-test & >= "1.3.0"}
1818- "conf-jq" {with-test}
1919-]
2020-synopsis:
2121- "Editor helper, provides completion, typing and source browsing in Vim and Emacs"
2222-description:
2323- "Merlin is an assistant for editing OCaml code. It aims to provide the features available in modern IDEs: error reporting, auto completion, source browsing and much more."
2424-post-messages: [
2525- "merlin installed.
2626-2727-Quick setup for VIM
2828--------------------
2929-Append this to your .vimrc to add merlin to vim's runtime-path:
3030- let g:opamshare = substitute(system('opam config var share'),'\\n$','','''')
3131- execute \"set rtp+=\" . g:opamshare . \"/merlin/vim\"
3232-3333-Also run the following line in vim to index the documentation:
3434- :execute \"helptags \" . g:opamshare . \"/merlin/vim/doc\"
3535-3636-Quick setup for EMACS
3737--------------------
3838-Add opam emacs directory to your load-path by appending this to your .emacs:
3939- (let ((opam-share (ignore-errors (car (process-lines \"opam\" \"config\" \"var\" \"share\")))))
4040- (when (and opam-share (file-directory-p opam-share))
4141- ;; Register Merlin
4242- (add-to-list 'load-path (expand-file-name \"emacs/site-lisp\" opam-share))
4343- (autoload 'merlin-mode \"merlin\" nil t nil)
4444- ;; Automatically start it in OCaml buffers
4545- (add-hook 'tuareg-mode-hook 'merlin-mode t)
4646- (add-hook 'caml-mode-hook 'merlin-mode t)
4747- ;; Use opam switch to lookup ocamlmerlin binary
4848- (setq merlin-command 'opam)))
4949-5050-Take a look at https://github.com/ocaml/merlin for more information
5151-5252-Quick setup with opam-user-setup
5353---------------------------------
5454-5555-Opam-user-setup support Merlin.
5656-5757- $ opam user-setup install
5858-5959-should take care of basic setup.
6060-See https://github.com/OCamlPro/opam-user-setup
6161-"
6262- {success & !user-setup:installed}
6363-]
6464-url {
6565- src:
6666- "https://github.com/ocaml/merlin/releases/download/v3.3.3/merlin-v3.3.3.tbz"
6767- checksum: [
6868- "sha256=72909ef47eea1f6fca13b4109a34dccf8fe3923a3c026f1ed1db9eb5ee9aae15"
6969- "sha512=2a5f39d966be56c1322982effc05bc98fd5f66cd12f1f76953f8daa9eca74a58c92a186854f4e601e2f0bb038720691446e7591b4613982accded3e579fedb23"
7070- ]
7171-}
-37
esy.lock/opam/ocaml-migrate-parsetree.1.5.0/opam
···11-opam-version: "2.0"
22-maintainer: "frederic.bour@lakaban.net"
33-authors: [
44- "Frédéric Bour <frederic.bour@lakaban.net>"
55- "Jérémie Dimino <jeremie@dimino.org>"
66-]
77-license: "LGPL-2.1 with OCaml linking exception"
88-homepage: "https://github.com/ocaml-ppx/ocaml-migrate-parsetree"
99-bug-reports: "https://github.com/ocaml-ppx/ocaml-migrate-parsetree/issues"
1010-dev-repo: "git+https://github.com/ocaml-ppx/ocaml-migrate-parsetree.git"
1111-doc: "https://ocaml-ppx.github.io/ocaml-migrate-parsetree/"
1212-tags: [ "syntax" "org:ocamllabs" ]
1313-build: [
1414- ["dune" "build" "-p" name "-j" jobs]
1515-]
1616-depends: [
1717- "result"
1818- "ppx_derivers"
1919- "dune" {>= "1.9.0"}
2020- "ocaml" {>= "4.02.3"}
2121-]
2222-synopsis: "Convert OCaml parsetrees between different versions"
2323-description: """
2424-Convert OCaml parsetrees between different versions
2525-2626-This library converts parsetrees, outcometree and ast mappers between
2727-different OCaml versions. High-level functions help making PPX
2828-rewriters independent of a compiler version.
2929-"""
3030-url {
3131- src:
3232- "https://github.com/ocaml-ppx/ocaml-migrate-parsetree/releases/download/v1.5.0/ocaml-migrate-parsetree-v1.5.0.tbz"
3333- checksum: [
3434- "sha256=7f56679c9561552762666de5b6b81c8e4cc2e9fd92272e2269878a2eb534e3c0"
3535- "sha512=87fdccafae83b0437f1ccd4f3cfbc49e699bc0804596480e0df88510ba33410f31d48c7f677fe72800ed3f442a3a586d82d86aee1d12a964f79892833847b16a"
3636- ]
3737-}
···11-opam-version: "2.0"
22-maintainer: "opensource@janestreet.com"
33-authors: ["Jane Street Group, LLC <opensource@janestreet.com>"]
44-homepage: "https://github.com/janestreet/result"
55-dev-repo: "git+https://github.com/janestreet/result.git"
66-bug-reports: "https://github.com/janestreet/result/issues"
77-license: "BSD-3-Clause"
88-build: [["dune" "build" "-p" name "-j" jobs]]
99-depends: [
1010- "ocaml"
1111- "dune" {>= "1.0"}
1212-]
1313-synopsis: "Compatibility Result module"
1414-description: """
1515-Projects that want to use the new result type defined in OCaml >= 4.03
1616-while staying compatible with older version of OCaml should use the
1717-Result module defined in this library."""
1818-url {
1919- src:
2020- "https://github.com/janestreet/result/archive/1.4.tar.gz"
2121- checksum: "md5=d3162dbc501a2af65c8c71e0866541da"
2222-}
-4
esy.lock/opam/seq.base/files/META.seq
···11-name="seq"
22-version="[distributed with OCaml 4.07 or above]"
33-description="dummy backward-compatibility package for iterators"
44-requires=""
···11-opam-version: "2.0"
22-maintainer: "martin@mjambon.com"
33-authors: ["Martin Jambon"]
44-homepage: "https://github.com/ocaml-community/yojson"
55-bug-reports: "https://github.com/ocaml-community/yojson/issues"
66-dev-repo: "git+https://github.com/ocaml-community/yojson.git"
77-doc: "https://ocaml-community.github.io/yojson/"
88-build: [
99- ["dune" "subst"] {pinned}
1010- ["dune" "build" "-p" name "-j" jobs]
1111-]
1212-run-test: [["dune" "runtest" "-p" name "-j" jobs]]
1313-depends: [
1414- "ocaml" {>= "4.02.3"}
1515- "dune"
1616- "cppo" {build}
1717- "easy-format"
1818- "biniou" {>= "1.2.0"}
1919- "alcotest" {with-test & >= "0.8.5"}
2020-]
2121-synopsis:
2222- "Yojson is an optimized parsing and printing library for the JSON format"
2323-description: """
2424-Yojson is an optimized parsing and printing library for the JSON format.
2525-2626-It addresses a few shortcomings of json-wheel including 2x speedup,
2727-polymorphic variants and optional syntax for tuples and variants.
2828-2929-ydump is a pretty-printing command-line program provided with the
3030-yojson package.
3131-3232-The program atdgen can be used to derive OCaml-JSON serializers and
3333-deserializers from type definitions."""
3434-url {
3535- src:
3636- "https://github.com/ocaml-community/yojson/releases/download/1.7.0/yojson-1.7.0.tbz"
3737- checksum: "md5=b89d39ca3f8c532abe5f547ad3b8f84d"
3838-}
···11---- ./Makefile
22-+++ ./Makefile
33-@@ -213,7 +213,7 @@
44- rm -f man/ocamlbuild.1
55-66- man/options_man.byte: src/ocamlbuild_pack.cmo
77-- $(OCAMLC) $^ -I src man/options_man.ml -o man/options_man.byte
88-+ $(OCAMLC) -I +unix unix.cma $^ -I src man/options_man.ml -o man/options_man.byte
99-1010- clean::
1111- rm -f man/options_man.cm*
1212---- ./src/command.ml
1313-+++ ./src/command.ml
1414-@@ -148,9 +148,10 @@
1515- let self = string_of_command_spec_with_calls call_with_tags call_with_target resolve_virtuals in
1616- let b = Buffer.create 256 in
1717- (* The best way to prevent bash from switching to its windows-style
1818-- * quote-handling is to prepend an empty string before the command name. *)
1919-+ * quote-handling is to prepend an empty string before the command name.
2020-+ * space seems to work, too - and the ouput is nicer *)
2121- if Sys.os_type = "Win32" then
2222-- Buffer.add_string b "''";
2323-+ Buffer.add_char b ' ';
2424- let first = ref true in
2525- let put_space () =
2626- if !first then
2727-@@ -260,7 +261,7 @@
2828-2929- let execute_many ?(quiet=false) ?(pretend=false) cmds =
3030- add_parallel_stat (List.length cmds);
3131-- let degraded = !*My_unix.is_degraded || Sys.os_type = "Win32" in
3232-+ let degraded = !*My_unix.is_degraded in
3333- let jobs = !jobs in
3434- if jobs < 0 then invalid_arg "jobs < 0";
3535- let max_jobs = if jobs = 0 then None else Some jobs in
3636---- ./src/findlib.ml
3737-+++ ./src/findlib.ml
3838-@@ -66,9 +66,6 @@
3939- (fun command -> lexer & Lexing.from_string & run_and_read command)
4040- command
4141-4242--let run_and_read command =
4343-- Printf.ksprintf run_and_read command
4444--
4545- let rec query name =
4646- try
4747- Hashtbl.find packages name
4848-@@ -135,7 +132,8 @@
4949- with Not_found -> s
5050-5151- let list () =
5252-- List.map before_space (split_nl & run_and_read "%s list" ocamlfind)
5353-+ let cmd = Shell.quote_filename_if_needed ocamlfind ^ " list" in
5454-+ List.map before_space (split_nl & run_and_read cmd)
5555-5656- (* The closure algorithm is easy because the dependencies are already closed
5757- and sorted for each package. We only have to make the union. We could also
5858---- ./src/main.ml
5959-+++ ./src/main.ml
6060-@@ -162,6 +162,9 @@
6161- Tags.mem "traverse" tags
6262- || List.exists (Pathname.is_prefix path_name) !Options.include_dirs
6363- || List.exists (Pathname.is_prefix path_name) target_dirs)
6464-+ && ((* beware: !Options.build_dir is an absolute directory *)
6565-+ Pathname.normalize !Options.build_dir
6666-+ <> Pathname.normalize (Pathname.pwd/path_name))
6767- end
6868- end
6969- end
7070---- ./src/my_std.ml
7171-+++ ./src/my_std.ml
7272-@@ -271,13 +271,107 @@
7373- try Array.iter (fun x -> if x = basename then raise Exit) a; false
7474- with Exit -> true
7575-7676-+let command_plain = function
7777-+| [| |] -> 0
7878-+| margv ->
7979-+ let rec waitpid a b =
8080-+ match Unix.waitpid a b with
8181-+ | exception (Unix.Unix_error(Unix.EINTR,_,_)) -> waitpid a b
8282-+ | x -> x
8383-+ in
8484-+ let pid = Unix.(create_process margv.(0) margv stdin stdout stderr) in
8585-+ let pid', process_status = waitpid [] pid in
8686-+ assert (pid = pid');
8787-+ match process_status with
8888-+ | Unix.WEXITED n -> n
8989-+ | Unix.WSIGNALED _ -> 2 (* like OCaml's uncaught exceptions *)
9090-+ | Unix.WSTOPPED _ -> 127
9191-+
9292-+(* can't use Lexers because of circular dependency *)
9393-+let split_path_win str =
9494-+ let rec aux pos =
9595-+ try
9696-+ let i = String.index_from str pos ';' in
9797-+ let len = i - pos in
9898-+ if len = 0 then
9999-+ aux (succ i)
100100-+ else
101101-+ String.sub str pos (i - pos) :: aux (succ i)
102102-+ with Not_found | Invalid_argument _ ->
103103-+ let len = String.length str - pos in
104104-+ if len = 0 then [] else [String.sub str pos len]
105105-+ in
106106-+ aux 0
107107-+
108108-+let windows_shell = lazy begin
109109-+ let rec iter = function
110110-+ | [] -> [| "bash.exe" ; "--norc" ; "--noprofile" |]
111111-+ | hd::tl ->
112112-+ let dash = Filename.concat hd "dash.exe" in
113113-+ if Sys.file_exists dash then [|dash|] else
114114-+ let bash = Filename.concat hd "bash.exe" in
115115-+ if Sys.file_exists bash = false then iter tl else
116116-+ (* if sh.exe and bash.exe exist in the same dir, choose sh.exe *)
117117-+ let sh = Filename.concat hd "sh.exe" in
118118-+ if Sys.file_exists sh then [|sh|] else [|bash ; "--norc" ; "--noprofile"|]
119119-+ in
120120-+ split_path_win (try Sys.getenv "PATH" with Not_found -> "") |> iter
121121-+end
122122-+
123123-+let prep_windows_cmd cmd =
124124-+ (* workaround known ocaml bug, remove later *)
125125-+ if String.contains cmd '\t' && String.contains cmd ' ' = false then
126126-+ " " ^ cmd
127127-+ else
128128-+ cmd
129129-+
130130-+let run_with_shell = function
131131-+| "" -> 0
132132-+| cmd ->
133133-+ let cmd = prep_windows_cmd cmd in
134134-+ let shell = Lazy.force windows_shell in
135135-+ let qlen = Filename.quote cmd |> String.length in
136136-+ (* old versions of dash had problems with bs *)
137137-+ try
138138-+ if qlen < 7_900 then
139139-+ command_plain (Array.append shell [| "-ec" ; cmd |])
140140-+ else begin
141141-+ (* it can still work, if the called command is a cygwin tool *)
142142-+ let ch_closed = ref false in
143143-+ let file_deleted = ref false in
144144-+ let fln,ch =
145145-+ Filename.open_temp_file
146146-+ ~mode:[Open_binary]
147147-+ "ocamlbuildtmp"
148148-+ ".sh"
149149-+ in
150150-+ try
151151-+ let f_slash = String.map ( fun x -> if x = '\\' then '/' else x ) fln in
152152-+ output_string ch cmd;
153153-+ ch_closed:= true;
154154-+ close_out ch;
155155-+ let ret = command_plain (Array.append shell [| "-e" ; f_slash |]) in
156156-+ file_deleted:= true;
157157-+ Sys.remove fln;
158158-+ ret
159159-+ with
160160-+ | x ->
161161-+ if !ch_closed = false then
162162-+ close_out_noerr ch;
163163-+ if !file_deleted = false then
164164-+ (try Sys.remove fln with _ -> ());
165165-+ raise x
166166-+ end
167167-+ with
168168-+ | (Unix.Unix_error _) as x ->
169169-+ (* Sys.command doesn't raise an exception, so run_with_shell also won't
170170-+ raise *)
171171-+ Printexc.to_string x ^ ":" ^ cmd |> prerr_endline;
172172-+ 1
173173-+
174174- let sys_command =
175175-- match Sys.os_type with
176176-- | "Win32" -> fun cmd ->
177177-- if cmd = "" then 0 else
178178-- let cmd = "bash --norc -c " ^ Filename.quote cmd in
179179-- Sys.command cmd
180180-- | _ -> fun cmd -> if cmd = "" then 0 else Sys.command cmd
181181-+ if Sys.win32 then run_with_shell
182182-+ else fun cmd -> if cmd = "" then 0 else Sys.command cmd
183183-184184- (* FIXME warning fix and use Filename.concat *)
185185- let filename_concat x y =
186186---- ./src/my_std.mli
187187-+++ ./src/my_std.mli
188188-@@ -69,3 +69,6 @@
189189-190190- val split_ocaml_version : (int * int * int * string) option
191191- (** (major, minor, patchlevel, rest) *)
192192-+
193193-+val windows_shell : string array Lazy.t
194194-+val prep_windows_cmd : string -> string
195195---- ./src/ocamlbuild_executor.ml
196196-+++ ./src/ocamlbuild_executor.ml
197197-@@ -34,6 +34,8 @@
198198- job_stdin : out_channel;
199199- job_stderr : in_channel;
200200- job_buffer : Buffer.t;
201201-+ job_pid : int;
202202-+ job_tmp_file: string option;
203203- mutable job_dying : bool;
204204- };;
205205-206206-@@ -76,6 +78,61 @@
207207- in
208208- loop 0
209209- ;;
210210-+
211211-+let open_process_full_win cmd env =
212212-+ let (in_read, in_write) = Unix.pipe () in
213213-+ let (out_read, out_write) = Unix.pipe () in
214214-+ let (err_read, err_write) = Unix.pipe () in
215215-+ Unix.set_close_on_exec in_read;
216216-+ Unix.set_close_on_exec out_write;
217217-+ Unix.set_close_on_exec err_read;
218218-+ let inchan = Unix.in_channel_of_descr in_read in
219219-+ let outchan = Unix.out_channel_of_descr out_write in
220220-+ let errchan = Unix.in_channel_of_descr err_read in
221221-+ let shell = Lazy.force Ocamlbuild_pack.My_std.windows_shell in
222222-+ let test_cmd =
223223-+ String.concat " " (List.map Filename.quote (Array.to_list shell)) ^
224224-+ "-ec " ^
225225-+ Filename.quote (Ocamlbuild_pack.My_std.prep_windows_cmd cmd) in
226226-+ let argv,tmp_file =
227227-+ if String.length test_cmd < 7_900 then
228228-+ Array.append
229229-+ shell
230230-+ [| "-ec" ; Ocamlbuild_pack.My_std.prep_windows_cmd cmd |],None
231231-+ else
232232-+ let fln,ch = Filename.open_temp_file ~mode:[Open_binary] "ocamlbuild" ".sh" in
233233-+ output_string ch (Ocamlbuild_pack.My_std.prep_windows_cmd cmd);
234234-+ close_out ch;
235235-+ let fln' = String.map (function '\\' -> '/' | c -> c) fln in
236236-+ Array.append
237237-+ shell
238238-+ [| "-c" ; fln' |], Some fln in
239239-+ let pid =
240240-+ Unix.create_process_env argv.(0) argv env out_read in_write err_write in
241241-+ Unix.close out_read;
242242-+ Unix.close in_write;
243243-+ Unix.close err_write;
244244-+ (pid, inchan, outchan, errchan,tmp_file)
245245-+
246246-+let close_process_full_win (pid,inchan, outchan, errchan, tmp_file) =
247247-+ let delete tmp_file =
248248-+ match tmp_file with
249249-+ | None -> ()
250250-+ | Some x -> try Sys.remove x with Sys_error _ -> () in
251251-+ let tmp_file_deleted = ref false in
252252-+ try
253253-+ close_in inchan;
254254-+ close_out outchan;
255255-+ close_in errchan;
256256-+ let res = snd(Unix.waitpid [] pid) in
257257-+ tmp_file_deleted := true;
258258-+ delete tmp_file;
259259-+ res
260260-+ with
261261-+ | x when tmp_file <> None && !tmp_file_deleted = false ->
262262-+ delete tmp_file;
263263-+ raise x
264264-+
265265- (* ***)
266266- (*** execute *)
267267- (* XXX: Add test for non reentrancy *)
268268-@@ -130,10 +187,16 @@
269269- (*** add_job *)
270270- let add_job cmd rest result id =
271271- (*display begin fun oc -> fp oc "Job %a is %s\n%!" print_job_id id cmd; end;*)
272272-- let (stdout', stdin', stderr') = open_process_full cmd env in
273273-+ let (pid,stdout', stdin', stderr', tmp_file) =
274274-+ if Sys.win32 then open_process_full_win cmd env else
275275-+ let a,b,c = open_process_full cmd env in
276276-+ -1,a,b,c,None
277277-+ in
278278- incr jobs_active;
279279-- set_nonblock (doi stdout');
280280-- set_nonblock (doi stderr');
281281-+ if not Sys.win32 then (
282282-+ set_nonblock (doi stdout');
283283-+ set_nonblock (doi stderr');
284284-+ );
285285- let job =
286286- { job_id = id;
287287- job_command = cmd;
288288-@@ -143,7 +206,9 @@
289289- job_stdin = stdin';
290290- job_stderr = stderr';
291291- job_buffer = Buffer.create 1024;
292292-- job_dying = false }
293293-+ job_dying = false;
294294-+ job_tmp_file = tmp_file;
295295-+ job_pid = pid }
296296- in
297297- outputs := FDM.add (doi stdout') job (FDM.add (doi stderr') job !outputs);
298298- jobs := JS.add job !jobs;
299299-@@ -199,6 +264,7 @@
300300- try
301301- read fd u 0 (Bytes.length u)
302302- with
303303-+ | Unix.Unix_error(Unix.EPIPE,_,_) when Sys.win32 -> 0
304304- | Unix.Unix_error(e,_,_) ->
305305- let msg = error_message e in
306306- display (fun oc -> fp oc
307307-@@ -241,14 +307,19 @@
308308- decr jobs_active;
309309-310310- (* PR#5371: we would get EAGAIN below otherwise *)
311311-- clear_nonblock (doi job.job_stdout);
312312-- clear_nonblock (doi job.job_stderr);
313313--
314314-+ if not Sys.win32 then (
315315-+ clear_nonblock (doi job.job_stdout);
316316-+ clear_nonblock (doi job.job_stderr);
317317-+ );
318318- do_read ~loop:true (doi job.job_stdout) job;
319319- do_read ~loop:true (doi job.job_stderr) job;
320320- outputs := FDM.remove (doi job.job_stdout) (FDM.remove (doi job.job_stderr) !outputs);
321321- jobs := JS.remove job !jobs;
322322-- let status = close_process_full (job.job_stdout, job.job_stdin, job.job_stderr) in
323323-+ let status =
324324-+ if Sys.win32 then
325325-+ close_process_full_win (job.job_pid, job.job_stdout, job.job_stdin, job.job_stderr, job.job_tmp_file)
326326-+ else
327327-+ close_process_full (job.job_stdout, job.job_stdin, job.job_stderr) in
328328-329329- let shown = ref false in
330330-331331---- ./src/ocamlbuild_unix_plugin.ml
332332-+++ ./src/ocamlbuild_unix_plugin.ml
333333-@@ -48,12 +48,22 @@
334334- end
335335-336336- let run_and_open s kont =
337337-+ let s_orig = s in
338338-+ let s =
339339-+ (* Be consistent! My_unix.run_and_open uses My_std.sys_command and
340340-+ sys_command uses bash. *)
341341-+ if Sys.win32 = false then s else
342342-+ let l = match Lazy.force My_std.windows_shell |> Array.to_list with
343343-+ | hd::tl -> (Filename.quote hd)::tl
344344-+ | _ -> assert false in
345345-+ "\"" ^ (String.concat " " l) ^ " -ec " ^ Filename.quote (" " ^ s) ^ "\""
346346-+ in
347347- let ic = Unix.open_process_in s in
348348- let close () =
349349- match Unix.close_process_in ic with
350350- | Unix.WEXITED 0 -> ()
351351- | Unix.WEXITED _ | Unix.WSIGNALED _ | Unix.WSTOPPED _ ->
352352-- failwith (Printf.sprintf "Error while running: %s" s) in
353353-+ failwith (Printf.sprintf "Error while running: %s" s_orig) in
354354- let res = try
355355- kont ic
356356- with e -> (close (); raise e)
357357---- ./src/options.ml
358358-+++ ./src/options.ml
359359-@@ -174,11 +174,24 @@
360360- build_dir := Filename.concat (Sys.getcwd ()) s
361361- else
362362- build_dir := s
363363-+
364364-+let slashify =
365365-+ if Sys.win32 then fun p -> String.map (function '\\' -> '/' | x -> x) p
366366-+ else fun p ->p
367367-+
368368-+let sb () =
369369-+ match Sys.os_type with
370370-+ | "Win32" ->
371371-+ (try set_binary_mode_out stdout true with _ -> ());
372372-+ | _ -> ()
373373-+
374374-+
375375- let spec = ref (
376376- let print_version () =
377377-+ sb ();
378378- Printf.printf "ocamlbuild %s\n%!" Ocamlbuild_config.version; raise Exit_OK
379379- in
380380-- let print_vnum () = print_endline Ocamlbuild_config.version; raise Exit_OK in
381381-+ let print_vnum () = sb (); print_endline Ocamlbuild_config.version; raise Exit_OK in
382382- Arg.align
383383- [
384384- "-version", Unit print_version , " Display the version";
385385-@@ -257,8 +270,8 @@
386386- "-build-dir", String set_build_dir, "<path> Set build directory (implies no-links)";
387387- "-install-lib-dir", Set_string Ocamlbuild_where.libdir, "<path> Set the install library directory";
388388- "-install-bin-dir", Set_string Ocamlbuild_where.bindir, "<path> Set the install binary directory";
389389-- "-where", Unit (fun () -> print_endline !Ocamlbuild_where.libdir; raise Exit_OK), " Display the install library directory";
390390-- "-which", String (fun cmd -> print_endline (find_tool cmd); raise Exit_OK), "<command> Display path to the tool command";
391391-+ "-where", Unit (fun () -> sb (); print_endline (slashify !Ocamlbuild_where.libdir); raise Exit_OK), " Display the install library directory";
392392-+ "-which", String (fun cmd -> sb (); print_endline (slashify (find_tool cmd)); raise Exit_OK), "<command> Display path to the tool command";
393393- "-ocamlc", set_cmd ocamlc, "<command> Set the OCaml bytecode compiler";
394394- "-plugin-ocamlc", set_cmd plugin_ocamlc, "<command> Set the OCaml bytecode compiler \
395395- used when building myocamlbuild.ml (only)";
396396---- ./src/pathname.ml
397397-+++ ./src/pathname.ml
398398-@@ -84,6 +84,26 @@
399399- | x :: xs -> x :: normalize_list xs
400400-401401- let normalize x =
402402-+ let x =
403403-+ if Sys.win32 = false then
404404-+ x
405405-+ else
406406-+ let len = String.length x in
407407-+ let b = Bytes.create len in
408408-+ for i = 0 to pred len do
409409-+ match x.[i] with
410410-+ | '\\' -> Bytes.set b i '/'
411411-+ | c -> Bytes.set b i c
412412-+ done;
413413-+ if len > 1 then (
414414-+ let c1 = Bytes.get b 0 in
415415-+ let c2 = Bytes.get b 1 in
416416-+ if c2 = ':' && c1 >= 'a' && c1 <= 'z' &&
417417-+ ( len = 2 || Bytes.get b 2 = '/') then
418418-+ Bytes.set b 0 (Char.uppercase_ascii c1)
419419-+ );
420420-+ Bytes.unsafe_to_string b
421421-+ in
422422- if Glob.eval not_normal_form_re x then
423423- let root, paths = split x in
424424- join root (normalize_list paths)
425425---- ./src/shell.ml
426426-+++ ./src/shell.ml
427427-@@ -24,12 +24,26 @@
428428- | 'a'..'z' | 'A'..'Z' | '0'..'9' | '.' | '-' | '/' | '_' | ':' | '@' | '+' | ',' -> loop (pos + 1)
429429- | _ -> false in
430430- loop 0
431431-+
432432-+let generic_quote quotequote s =
433433-+ let l = String.length s in
434434-+ let b = Buffer.create (l + 20) in
435435-+ Buffer.add_char b '\'';
436436-+ for i = 0 to l - 1 do
437437-+ if s.[i] = '\''
438438-+ then Buffer.add_string b quotequote
439439-+ else Buffer.add_char b s.[i]
440440-+ done;
441441-+ Buffer.add_char b '\'';
442442-+ Buffer.contents b
443443-+let unix_quote = generic_quote "'\\''"
444444-+
445445- let quote_filename_if_needed s =
446446- if is_simple_filename s then s
447447- (* We should probably be using [Filename.unix_quote] except that function
448448- * isn't exported. Users on Windows will have to live with not being able to
449449- * install OCaml into c:\o'caml. Too bad. *)
450450-- else if Sys.os_type = "Win32" then Printf.sprintf "'%s'" s
451451-+ else if Sys.os_type = "Win32" then unix_quote s
452452- else Filename.quote s
453453- let chdir dir =
454454- reset_filesys_cache ();
455455-@@ -37,7 +51,7 @@
456456- let run args target =
457457- reset_readdir_cache ();
458458- let cmd = String.concat " " (List.map quote_filename_if_needed args) in
459459-- if !*My_unix.is_degraded || Sys.os_type = "Win32" then
460460-+ if !*My_unix.is_degraded then
461461- begin
462462- Log.event cmd target Tags.empty;
463463- let st = sys_command cmd in
···11-module Types = Wonka_types
22-33-include Wonka_sources
44-include Wonka_operators
55-include Wonka_sinks
66-77-#if BS_NATIVE then
88- #if BSB_BACKEND = "js" then
99- include WonkaJs
1010- #end
1111-#else
1212- include WonkaJs
1313-#end
-15
src/Wonka.ts
···11-export * from './helpers/pipe';
22-33-export * from './Wonka_sources.gen';
44-export * from './Wonka_operators.gen';
55-export * from './Wonka_sinks.gen';
66-export * from './web/WonkaJs.gen';
77-88-export {
99- sinkT as Sink,
1010- sourceT as Source,
1111- operatorT as Operator,
1212- subscriptionT as Subscription,
1313- observerT as Observer,
1414- subjectT as Subject
1515-} from './Wonka_types.gen';
···11-/* A sink has the signature: `signalT('a) => unit`
22- * A source thus has the signature: `sink => unit`, or `(signalT('a) => unit) => unit`
33- *
44- * Effectively a sink is a callback receiving signals as its first argument.
55- * - Start(talkback) will be carrying a talkback using which the sink can attempt
66- * to pull values (Pull) or request the source to end its stream (End)
77- * - Push(payload) carries a value that the source sends to the sink.
88- * This can happen at any time, since a source can be both pullable or
99- * merely listenable.
1010- * - End signifies the end of the source stream, be it because of a talkback (End)
1111- * or because the source is exhausted.
1212- *
1313- * In detail, a talkback is simply a callback that receives a talkback signal as
1414- * its first argument. It's thus typically anonymously created by the source.
1515- *
1616- * A source is a factory that accepts a sink. Calling a source with a sink will
1717- * instantiate and initiate the source's stream, after which the source sends the sink
1818- * a talkback (Start(talkback)). This is called the "handshake".
1919- *
2020- * Typically an operator factory won't call the source with a sink it receives
2121- * immediately—because this would cause the operator to simply be a noop—but instead
2222- * it will create an intermediate sink with the same signature to perform its own
2323- * logic.
2424- *
2525- * At that point the operator can for instance intercept the talkback for its own
2626- * purposes, or call the actual sink as it sees fit.
2727- */
2828-2929-[@genType.import "./shims/Js.shim"]
3030-type talkbackT =
3131- | Pull
3232- | Close;
3333-3434-[@genType.import "./shims/Js.shim"]
3535-type signalT('a) =
3636- | Start((. talkbackT) => unit)
3737- | Push('a)
3838- | End;
3939-4040-[@genType]
4141-type sinkT('a) = (. signalT('a)) => unit;
4242-4343-[@genType]
4444-type sourceT('a) = sinkT('a) => unit;
4545-4646-[@genType]
4747-type operatorT('a, 'b) = sourceT('a) => sourceT('b);
4848-4949-[@genType]
5050-type teardownT = (. unit) => unit;
5151-5252-[@genType]
5353-type subscriptionT = {unsubscribe: unit => unit};
5454-5555-[@genType]
5656-type observerT('a) = {
5757- next: 'a => unit,
5858- complete: unit => unit,
5959-};
6060-6161-[@genType]
6262-type subjectT('a) = {
6363- source: sourceT('a),
6464- next: 'a => unit,
6565- complete: unit => unit,
6666-};
6767-6868-/* Sinks and sources need to explicitly be their own callbacks;
6969- * This means that currying needs to be forced for Bucklescript
7070- * not to optimise them away
7171- */
7272-external curry: 'a => 'a = "%identity";
···11-#if BS_NATIVE then
22- #if BSB_BACKEND = "js" then
33- include Rebel_js
44- #else
55- include Rebel_native
66- #end
77-#else
88- include Rebel_js
99-#end