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

Update melange install #3

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
4cfff5d
fix(melange): run melc ppx with merlin (#6476)
jchavarri Nov 30, 2022
1e835d9
fix: link time code gen (#6606)
rgrinberg Nov 30, 2022
e11bcae
coq: more resilient config query
Alizter Nov 23, 2022
9587bc5
doc(README): rewrap paragraphs and cleanup links
Alizter Dec 2, 2022
3b58cf7
doc: cleanup status badges in README.md (#6618)
Alizter Dec 2, 2022
f244a6e
test: add a repro case for #6607 (#6612)
emillon Dec 2, 2022
65a96bc
doc: tighten wording in README.md
Alizter Dec 2, 2022
9b344b8
refactor(stdune): Add Appendable_list.cons (#6624)
rgrinberg Dec 3, 2022
70def21
test: depend on utop (#6627)
rgrinberg Dec 3, 2022
9dac54c
refactor: improve style of utop rules (#6628)
rgrinberg Dec 3, 2022
8779f66
test: dune utop for (subdir ..) (#6629)
rgrinberg Dec 3, 2022
fc133af
test(cache): test output of man pages
Alizter Dec 4, 2022
3d3cb17
doc: how we write `to_dyn` and `equal` (#6621)
emillon Dec 5, 2022
f6c0e39
Target hints: only load targets from subdir (#6603)
emillon Dec 5, 2022
ab19b38
test(melange): add rescript_syntax dependency (#6635)
rgrinberg Dec 5, 2022
0a66f65
refactor(cache): use cmdliner groups in dune cache commands
Alizter Dec 1, 2022
f54e69c
fix: load rules under subdir (#6631)
rgrinberg Dec 6, 2022
fb085c0
feature: enable (include_subdirs qualified) (#6594)
rgrinberg Dec 6, 2022
54eeca4
test: transitive deps and link time code gen (#6641)
rgrinberg Dec 6, 2022
670b7fb
fix: link time code gen + implicit transtive deps (#6642)
rgrinberg Dec 6, 2022
6128d8d
test: inline tests, jsoo, whole program compilation
hhugo Dec 6, 2022
e716e2f
fix: inline tests, jsoo, whole program compilation
hhugo Dec 6, 2022
74d698a
test: add jsoo dependencies (#6649)
rgrinberg Dec 7, 2022
49082b7
chore(nix): update flakes (#6636)
rgrinberg Dec 7, 2022
59d23e7
test(melange): cover flag ordering in merlin tests
jchavarri Dec 6, 2022
fb1abd5
fix(melange): change ppx order in merlin files
jchavarri Dec 6, 2022
fb9c6d2
doc: Add note about ignored let bindings to hacking.rst
Alizter Dec 6, 2022
00ffecb
refactor(fiber): move to otherlibs
rgrinberg Dec 7, 2022
1798cc6
refactor(dune-rpc): remove some pointless aliases
rgrinberg Dec 7, 2022
69cea2d
Merge 3.6.1 changelog (#6651)
emillon Dec 8, 2022
61aa82d
refactor(rpc): remove some signature duplication
rgrinberg Dec 8, 2022
79392de
refactor(rpc): purify notification sending
rgrinberg Dec 8, 2022
c507378
refactor(rpc): clean up versioning
rgrinberg Dec 8, 2022
2c39969
refactor(rpc): improve scopes
rgrinberg Dec 8, 2022
937d569
refactor(rpc): remove pointless aliases
rgrinberg Dec 8, 2022
3360b6b
refactor(rpc): make menus abstract
rgrinberg Dec 8, 2022
2ed1b11
refactor(rpc): use Fun.id
rgrinberg Dec 9, 2022
89c0c9e
refactor(rpc): group method name and version
rgrinberg Dec 9, 2022
a648316
refactor: use method/version functions
rgrinberg Dec 9, 2022
2f4c8da
fix(rpc): improve error handling
rgrinberg Dec 9, 2022
f4ee265
refactor: move [Sub] to own module
rgrinberg Dec 9, 2022
130365b
fix(rpc): clean termination on server error
rgrinberg Dec 9, 2022
dd08f6f
refactor: use Method.{Name,Version}.t aliases
rgrinberg Dec 11, 2022
b6952ed
test: demonstrate alerts failing to parse
rgrinberg Dec 12, 2022
5ba060e
chore: code coverage support (#6620)
Alizter Dec 12, 2022
d03171a
melange: add test to show flags passed from env
jchavarri Dec 8, 2022
4dff505
refactor flags test to make it clearer
jchavarri Dec 12, 2022
865547e
feature(dune-rpc): bidirectional communication (#6672)
rgrinberg Dec 12, 2022
3c8f5d8
test: re-enable stray-proces test on macos (#6677)
rgrinberg Dec 12, 2022
445005f
test(melange): virtual libraries (#6681)
rgrinberg Dec 12, 2022
7f28e1d
refactor(csexp_rpc): remove dune_engine dep (#6661)
rgrinberg Dec 13, 2022
08a2904
feature: Redirect_to_parent improved (#6637)
rgrinberg Dec 13, 2022
82d2518
fix(ocamlc_loc): parse alerts (#6678)
rgrinberg Dec 13, 2022
617ad4b
feature: italicise "Hint" in User_message (#6685)
Alizter Dec 13, 2022
3f910d0
test(melange): virtual library tests (#6683)
rgrinberg Dec 13, 2022
b358d47
refactor(melange): simplify module handling (#6682)
rgrinberg Dec 13, 2022
6eac88b
refactor(rpc): do not write errors to stderr direct (#6676)
rgrinberg Dec 13, 2022
eff5776
test(ocamlc_loc): multiple errors (#6686)
rgrinberg Dec 13, 2022
e56fb2c
Fix missing parenthesis in docs (#6690)
Leonidas-from-XIV Dec 13, 2022
ae0be96
fix(ocamlc_loc): remove leading space from alert (#6692)
rgrinberg Dec 13, 2022
4fe1818
test(ocamlc_loc): fatal alerts (#6687)
rgrinberg Dec 13, 2022
60127df
fix(User_message): put a box around the location Pp.t (#6684)
Alizter Dec 13, 2022
239dee4
Update URL to dune-release (#6691)
Leonidas-from-XIV Dec 13, 2022
289d17a
refactor(ansi_color): Make Ansi_color.t into a variant (#6688)
Alizter Dec 13, 2022
a6aa757
refactor(stdune): introduce [Env_path] (#6696)
rgrinberg Dec 13, 2022
ab8bd03
fix(melange): virtual library support (#6693)
rgrinberg Dec 14, 2022
ab7d530
refactor(dune_engine): move [Display] (#6699)
rgrinberg Dec 14, 2022
831f6eb
refactor(stdune): optimize color handling (#6697)
rgrinberg Dec 14, 2022
8e7b919
refactor(stdune): high performance tty detection (#6695)
rgrinberg Dec 14, 2022
09d807e
refactor(ocamlc_loc): uniform handling of codes (#6694)
rgrinberg Dec 14, 2022
0aef782
refactor: remove optional arguments from lib (#6703)
rgrinberg Dec 15, 2022
d1ed7de
refactor: remove pointless alias (#6704)
rgrinberg Dec 15, 2022
f3ed7a8
Merge branch 'main' into jchavarri/melange-install
jchavarri Dec 15, 2022
4224f26
use Path.Build.L.relative
jchavarri Dec 15, 2022
27905d1
simplify cmt_files calculation
jchavarri Dec 15, 2022
21de584
add test for private libs with package
jchavarri Dec 15, 2022
0e7225a
fix test for private libs with package
jchavarri Dec 16, 2022
a936818
repro bug with 2 dune projects
jchavarri Dec 16, 2022
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
34 changes: 34 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,40 @@ jobs:
- uses: cachix/install-nix-action@v18
- run: nix develop .#fmt -c make fmt

coverage:
name: Coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ocaml-compiler:
- 4.14.x
steps:
- uses: actions/checkout@v3
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-depext: false

- name: Set git user
run: |
git config --global user.name github-actions[bot]
git config --global user.email github-actions[bot]@users.noreply.github.com

# Install ocamlfind-secondary and ocaml-secondary-compiler, if needed
- run: opam install ./dune.opam --deps-only --with-test

- name: Install deps on Unix
run: |
opam install . --deps-only
opam exec -- make coverage-deps dev-deps
- run: opam exec -- make test-coverage
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_NUMBER: ${{ github.event.number }}

doc:
name: Documentation
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
_opam
_build
/_boot
_boot
_perf
_coverage
*.install

# vim swap files
Expand Down
34 changes: 28 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
Unreleased
----------

- Fix the parsing of alerts. They will now show up in diagnostics correctly.
(#6678, @rginberg)

- Fix the compilation of modules generated at link time when
`implicit_transitive_deps` is enabled (#6642, @rgrinberg)

- Allow `$ dune utop` to load libraries defined in data only directories
defined using `(subdir ..)` (#6631, @rgrinberg)

- Format dune files when they are named `dune-file`. This occurs when we enable
the alternative file names project option. (#6566, @rgrinberg)

- Do not shadow library interface modules (#6549, fixes #6545, @rgrinberg)

- Move `$ dune ocaml-merlin -dump-config=$dir` to `$ dune ocaml merlin
dump-config $dir`. (#6547, @rgrinberg)

- Allow compilation rules to be impacted by `(env ..)` stanzas that modify the
environment or set binaries. (#6527, @rgrinberg)

- Fix status line enabled when ANSI colors are forced. (#6503, @MisterDA)

- Coq native mode is now automatically detected by Dune starting with Coq lang
0.7. `(mode native)` has been deprecated in favour of detection from the
configuration of Coq. (#6409, @Alizter)
Expand All @@ -24,8 +29,6 @@ Unreleased
- Allow `$ dune ocaml dump-dot-merlin` to run in watch mode. Also this command
shouldn't print "Entering Directory" mesages. (#6497, @rgrinberg)

- Fix build with MSVC compiler (#6517, @nojb)

- `dune clean` should no longer fail under Windows due to the inability to
remove the `.lock` file. Also, bring the implementation of the global lock
under Windows closer to that of Unix. (#6523, @nojb)
Expand All @@ -40,6 +43,25 @@ Unreleased
- Fix missing dependencies when detecting the kind of C compiler we're using
(#6610, fixes #6415, @emillon)

- Allow `(include_subdirs qualified)` for OCaml projects. (#6594, fixes #1084,
@rgrinberg)

- Accurately determine merlin configuration for all sources selected with
`copy#` and `copy_files#`. The old heuristic of looking for a module in
parent directories is removed (#6594, @rgrinberg)

- Fix inline tests with js_of_ocaml and whole program compilation mode enabled
(#6645, @hhugo)

3.6.1 (2022-11-24)
------------------

- Fix status line enabled when ANSI colors are forced. (#6503, @MisterDA)

- Fix build with MSVC compiler (#6517, @nojb)

- Do not shadow library interface modules (#6549, fixes #6545, @rgrinberg)

3.6.0 (2022-11-14)
------------------

Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,14 @@ melange:
opam pin add melange-compiler-libs https://github.com/melange-re/melange-compiler-libs.git#426463a77d0b70ecf0108c98e6a86d325cd01472
opam pin add melange https://github.com/melange-re/melange.git#685e546e290d317a884a4d48c7835467422c6426

.PHONY: dev-deps
dev-deps: melange
opam install -y $(TEST_DEPS)

.PHONY: coverage-deps
coverage-deps:
opam install -y bisect_ppx

.PHONY: dev-deps-sans-melange
dev-deps-sans-melange:
opam install -y $(TEST_DEPS)
Expand Down Expand Up @@ -114,6 +119,10 @@ test-all: $(BIN)
test-all-sans-melange: $(BIN)
$(BIN) build @runtest @runtest-js @runtest-coq

test-coverage: $(BIN)
- $(BIN) build --instrument-with bisect_ppx --force @runtest
bisect-ppx-report send-to Coveralls

.PHONY: check
check: $(BIN)
@$(BIN) build @check
Expand Down
132 changes: 62 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
Dune - A Composable Build System
================================

Dune is a build system designed for OCaml/Reason projects only. It
focuses on providing the user with a consistent experience and takes
care of most low-level details of OCaml compilations. It's merely necessary
to provide a description of your project, and Dune will
do the rest.

It implements a scheme that's inspired from the one used inside Jane
Street and adapted to the open source world. It has matured over a
long time and is used daily by hundreds of developers, meaning
it's highly tested and productive.

Dune comes with a [manual][manual]. If you want to get started
without reading too much, look at the [quick start
guide][quick-start] or watch [this introduction video][video].

The [example][example] directory contains examples of projects using
dune.

[![Main workflow](https://github.com/ocaml/dune/actions/workflows/workflow.yml/badge.svg)](https://github.com/ocaml/dune/actions/workflows/workflow.yml)
[![AppVeyor status][appveyor-img]][appveyor]
[![Main workflow][workflow-badge]][workflow]
[![Release][release-img]][release]
[![Coverage Status][coverall-badge]][coverall]

Dune is a build system for OCaml. It provides a consistent experience and takes
care of the low-level details of OCaml compilation. You need only to provide a
description of your project, and Dune will do the rest.

Dune implements a scheme that's inspired from the one used inside Jane Street
and adapted to the open source world. It has matured over a long time and is
used daily by hundreds of developers, meaning it's highly tested and productive.

Dune comes with a [manual][manual]. If you want to get started without reading
too much, look at the [quick start guide][quick-start] or watch [this
introduction video][video].

The [example][example] directory contains examples of projects using Dune.

[manual]: https://dune.readthedocs.io/en/latest/
[quick-start]: https://dune.readthedocs.io/en/latest/quick-start.html
[example]: https://github.com/ocaml/dune/tree/master/example
[appveyor]: https://ci.appveyor.com/project/diml/dune/branch/master
[appveyor-img]: https://ci.appveyor.com/api/projects/status/rsxayce22e8f2jkp?svg=true
[release]: https://github.com/ocaml/dune/releases
[release-img]: https://img.shields.io/github/release/ocaml/dune.svg
[merlin]: https://github.com/ocaml/merlin
[opam]: https://opam.ocaml.org
[issues]: https://github.com/ocaml/dune/issues
Expand All @@ -39,76 +31,70 @@ dune.
Overview
--------

Dune reads project metadata from `dune` files, which are either
static files in a simple S-expression syntax or OCaml scripts. It uses
this information to setup build rules, generate configuration files
for development tools such as [Merlin][merlin], handle installation,
etc.
Dune reads project metadata from `dune` files, which are static files with a
simple S-expression syntax. It uses this information to setup build rules,
generate configuration files for development tools such as [Merlin][merlin],
handle installation, etc.

Dune itself is fast, has very low overhead, and supports parallel
builds on all platforms. It has no system dependencies. OCaml is all you need
to build Dune and packages using Dune. You don't need
`make` or `bash`, as long as the packages themselves don't use `bash`
explicitly.
Dune itself is fast, has very little overhead, and supports parallel builds on
all platforms. It has no system dependencies. OCaml is all you need to build
Dune and packages using Dune.

In particular, one can install OCaml on Windows with a binary installer
and then use only the Windows Console to build Dune and packages
using Dune.
In particular, one can install OCaml on Windows with a binary installer and then
use only the Windows Console to build Dune and packages using Dune.

Strengths
---------

### Composable

Take *n* repositories that use Dune and arrange them in any way on the
file system. The result is still a single repository that Dune
knows how to build at once.
Dune is composable, meaning that multiple Dune projects can be arranged
together, leading to a single build that Dune knows how to execute. This allows
for monorepos of projects.

This make simultaneous development on multiple packages trivial.
Dune makes simultaneous development on multiple packages a trivial task.

### Gracefully Handles Multi-Package Repositories

Dune knows how to handle repositories containing several
packages. When building via [Opam][opam], it is able to correctly use
libraries that were previously installed, even if they are already
present in the source tree.
Dune knows how to handle repositories containing several packages. When building
via [opam][opam], it is able to correctly use libraries that were previously
installed, even if they are already present in the source tree.

The magic invocation is:

```sh
$ dune build --only-packages <package-name> @install
```

### Building Against Several Configurations at Once

Dune can build a given source code repository against
several configurations simultaneously. This helps maintaining packages
across several versions of OCaml, as you can test them all at once
without hassle.
Dune can build a given source code repository against several configurations
simultaneously. This helps maintaining packages across several versions of
OCaml, as you can test them all at once without hassle.

In particular, this makes it easy to handle [cross-compilation](https://dune.readthedocs.io/en/latest/cross-compilation.html).
In particular, this makes it easy to handle
[cross-compilation][cross-compilation]. This feature requires [opam][opam].

This feature requires [Opam][opam].
[cross-compilation]: https://dune.readthedocs.io/en/latest/cross-compilation.html

Requirements
------------

Dune requires OCaml version 4.08.0 to build itself and can build OCaml
projects using OCaml 4.02.3 or greater.
Dune requires OCaml version 4.08.0 to build itself and can build OCaml projects
using OCaml 4.02.3 or greater.

Installation
------------

We recommended installing Dune via the [Opam package manager][opam]:
We recommended installing Dune via the [opam package manager][opam]:

```sh
$ opam install dune
```

If you are new to Opam, make sure to run `eval $(opam config env)` to
make `dune` available in your `PATH`. The `dune` binary is self-contained
and relocatable, so you can safely copy it somewhere else to
make it permanently available.
If you are new to opam, make sure to run `eval $(opam config env)` to make
`dune` available in your `PATH`. The `dune` binary is self-contained and
relocatable, so you can safely copy it somewhere else to make it permanently
available.

You can also build it manually with:

Expand All @@ -125,22 +111,21 @@ $ ./dune.exe build -p dune --profile dune-bootstrap
$ ./dune.exe install dune
```

The first command builds the `dune.exe` binary. The second builds the
additional files installed by Dune, such as the *man* pages, and
the last simply installs all of that on the system.
The first command builds the `dune.exe` binary. The second builds the additional
files installed by Dune, such as the *man* pages, and the last simply installs
all of that on the system.

**Please note**: unless you ran the optional `./configure` script, you can
simply copy `dune.exe` anywhere and it will just work. `dune` is
fully relocatable and discovers its environment at runtime rather than
hard-coding it at compilation time.
simply copy `dune.exe` anywhere and it will just work. `dune` is fully
relocatable and discovers its environment at runtime rather than hard-coding it
at compilation time.

Support
-------

If you have questions about Dune, you can send an email to
[email protected] or [open a ticket on GitHub][issues].


Migration from Jbuilder
-----------------------

Expand All @@ -150,7 +135,14 @@ described in the [manual](http://dune.readthedocs.io/en/latest/migration.html).
Status
------

Dune is fairly stable and used by the majority of packages on
Opam. Note that Dune retains backward compatibility with Jbuilder, and
in particular, existing Jbuilder projects will continue to be buildable
with Dune.
Dune is fairly stable and used by the majority of packages on opam. Note that
Dune retains backward compatibility with Jbuilder, and in particular, existing
Jbuilder projects will continue to be buildable with Dune.

[workflow-badge]: https://github.com/ocaml/dune/actions/workflows/workflow.yml/badge.svg
[workflow]: https://github.com/ocaml/dune/actions/workflows/workflow.yml
[coverall-badge]: https://coveralls.io/repos/github/ocaml/dune/badge.svg?branch=main
[coverall]: https://coveralls.io/github/ocaml/dune?branch=main

[release]: https://github.com/ocaml/dune/releases
[release-img]: https://img.shields.io/github/release/ocaml/dune.svg
2 changes: 1 addition & 1 deletion bench/micro/dune_bench/scheduler_bench.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let setup =
(Path.set_root (Path.External.cwd ());
Path.Build.set_build_dir (Path.Outside_build_dir.of_string "_build"))

let prog = Option.value_exn (Bin.which ~path:(Env.path Env.initial) "true")
let prog = Option.value_exn (Bin.which ~path:(Env_path.path Env.initial) "true")

let run () = Process.run ~env:Env.initial Strict prog []

Expand Down
Loading