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 to OCaml 4.14.1 #3656

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
os:
- ubuntu-latest
ocaml-compiler:
- 4.14.0
- 4.14.1

runs-on: ${{ matrix.os }}

Expand All @@ -33,7 +33,7 @@ jobs:
dune-cache: false

- name: Install dune
run: opam install dune>=3.4.1
run: opam install dune>=3.6.1

- name: Build HTML book
run: opam exec -- dune build @site
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ FROM ocaml/opam:ubuntu
RUN sudo apt-get update && sudo apt-get -y install python3-pygments tzdata pandoc texlive-full

# update opam
RUN opam switch 4.13
RUN opam switch 4.14
RUN git -C /home/opam/opam-repository pull origin master && opam update -uy

# install non-OCaml dependencies
WORKDIR /home/opam/src
COPY Makefile /home/opam/src/.
COPY rwo.opam /home/opam/src/.
RUN opam pin add -n rwo /home/opam/src && opam depext -y rwo
RUN opam install dune=3.1.1
RUN opam install dune=3.6.1

# compile the project
COPY . /home/opam/src/
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Real World OCaml v2
Real World OCaml v3
-------------------

This is the source code for the Real World OCaml 2nd edition, which is
This is the source code for the Real World OCaml 3rd edition, which is
still a work in progress. The original edition was written by Yaron
Minsky, Anil Madhavapeddy and Jason Hickey, and the revised edition is
being led by Yaron Minsky and Anil Madhavapeddy. There have been
Minsky, Anil Madhavapeddy and Jason Hickey, and the 2nd and subsequent
editions are being led by Yaron Minsky and Anil Madhavapeddy. There have been
significant contributions to the revised tooling from Ashish Agarwal,
Jeremy Yallop, Frederic Bour, and Sander Spies.

Expand All @@ -27,7 +27,7 @@ mdx is used to keep the examples and the chapter's code block in sync.
The `bin/` folder contains the OCaml scripts used to generate the books HTML
and PDF versions.

All of the code and examples are built using OCaml 4.09.0.
All of the code and examples are built using OCaml 4.14.1.

## Building

Expand All @@ -47,8 +47,8 @@ with only `dune` installed to avoid conflicts between the opam and local
libraries. To set up your RWO development environment you can run:

```
opam switch create rwo 4.13.1
opam install dune=3.0.2
opam switch create rwo 4.14.1
opam install dune=3.6.1
```

### Generating the HTML
Expand Down
20 changes: 0 additions & 20 deletions bin/bin/app.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
open Core
open Async
open Rwo
let (/) = Filename.concat

module Params = struct
open Command.Param
Expand All @@ -11,19 +10,6 @@ module Params = struct
let doc = sprintf "dir Root of repository. Default: \"%s\"." default in
flag "-repo-root" (optional_with_default default string) ~doc

let production =
let default = false in
let doc = sprintf
" Set to true to generate file for publication. Default \
is %b, which generates dev version of file."
default
in
flag "-production" (optional_with_default default bool) ~doc

let chapter =
let doc = "N Build HTML version of chapter N." in
flag "-chapter" (required int) ~doc

let out_dir =
let default = "_build" in
let doc = sprintf "DIR Output directory. Default: \"%s\"" default in
Expand All @@ -37,12 +23,6 @@ module Params = struct

let file =
anon ("file" %: string)

let run_nondeterministic =
flag "-run-nondeterministic" no_arg
~doc:" In .mlt files, run code marked [%%expect.nondeterministic ...]. \
By default, they are skipped."

end


Expand Down
3 changes: 0 additions & 3 deletions bin/bin/convert_md.ml
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ let pp_block_md ppf (b:Mdx.Block.t) =
let pp_text_html ppf l =
List.iter (Fmt.pf ppf "%s\n") (List.rev l)

let pp_text_md ppf l =
List.iter (Fmt.pf ppf "%s\n") (List.rev l)

open Astring

let pp_text_latex ppf l =
Expand Down
1 change: 1 addition & 0 deletions bin/examples-rules/examples_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ let print_rule ~dir_name ~path (config : Config.t) =
{|
(rule
(alias %s)
(locks /global)
(deps
(source_tree %s)%s)
(action
Expand Down
2 changes: 1 addition & 1 deletion book/classes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Error: Some type variables are unbound in this type:
method pop : 'b option
method push : 'b -> unit
end
The method pop has type 'a option where 'a is unbound
The method pop has type 'b option where 'b is unbound
```

In general, we need to provide enough constraints so that the compiler will
Expand Down
4 changes: 2 additions & 2 deletions book/classes/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(mdx
(files README.md)
(packages
(libraries
core
mdx
async_unix
ppx_jane)
(preludes prelude.ml))
1 change: 1 addition & 0 deletions book/classes/examples/dune.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

(rule
(alias shapes)
(locks /global)
(deps
(source_tree ./correct/shapes)
(package base)
Expand Down
4 changes: 3 additions & 1 deletion book/command-line-parsing/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
(mdx
(files README.md)
(packages
(locks /global)
(libraries
core
core_unix
mdx
ppx_jane)
(preludes prelude.ml))
15 changes: 15 additions & 0 deletions book/command-line-parsing/examples/dune.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

(rule
(alias cal_add_days)
(locks /global)
(deps
(source_tree ./correct/cal_add_days)
(package core))
Expand All @@ -13,6 +14,7 @@

(rule
(alias cal_add_interactive)
(locks /global)
(deps
(source_tree ./correct/cal_add_interactive)
(package core)
Expand All @@ -26,6 +28,7 @@

(rule
(alias cal_add_interactive2)
(locks /global)
(deps
(source_tree ./correct/cal_add_interactive2)
(package core))
Expand All @@ -38,6 +41,7 @@

(rule
(alias cal_add_sub_days)
(locks /global)
(deps
(source_tree ./correct/cal_add_sub_days)
(package core))
Expand All @@ -50,6 +54,7 @@

(rule
(alias md5)
(locks /global)
(deps
(source_tree ./correct/md5)
(package core))
Expand All @@ -62,6 +67,7 @@

(rule
(alias md5_as_filename)
(locks /global)
(deps
(source_tree ./correct/md5_as_filename)
(package core))
Expand All @@ -74,6 +80,7 @@

(rule
(alias md5_let_syntax)
(locks /global)
(deps
(source_tree ./correct/md5_let_syntax)
(package core))
Expand All @@ -86,6 +93,7 @@

(rule
(alias md5_let_syntax2)
(locks /global)
(deps
(source_tree ./correct/md5_let_syntax2)
(package core))
Expand All @@ -98,6 +106,7 @@

(rule
(alias md5_multiarg)
(locks /global)
(deps
(source_tree ./correct/md5_multiarg)
(package core))
Expand All @@ -110,6 +119,7 @@

(rule
(alias md5_sequence)
(locks /global)
(deps
(source_tree ./correct/md5_sequence)
(package core))
Expand All @@ -122,6 +132,7 @@

(rule
(alias md5_succinct)
(locks /global)
(deps
(source_tree ./correct/md5_succinct)
(package core))
Expand All @@ -134,6 +145,7 @@

(rule
(alias md5_with_custom_arg)
(locks /global)
(deps
(source_tree ./correct/md5_with_custom_arg)
(package core))
Expand All @@ -146,6 +158,7 @@

(rule
(alias md5_with_default_file)
(locks /global)
(deps
(source_tree ./correct/md5_with_default_file)
(package core))
Expand All @@ -158,6 +171,7 @@

(rule
(alias md5_with_flags)
(locks /global)
(deps
(source_tree ./correct/md5_with_flags)
(package core))
Expand All @@ -170,6 +184,7 @@

(rule
(alias md5_with_optional_file)
(locks /global)
(deps
(source_tree ./correct/md5_with_optional_file)
(package core))
Expand Down
4 changes: 2 additions & 2 deletions book/compiler-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ opam provides a compiler switch that compiles OCaml with the frame pointer
activated:

```sh skip
$ opam switch create 4.13+fp ocaml-variants.4.13.1+options ocaml-option-fp
$ opam switch create 4.14+fp ocaml-variants.4.14.1+options ocaml-option-fp
```

Using the frame pointer changes the OCaml calling convention, but opam takes
Expand Down Expand Up @@ -1111,7 +1111,7 @@ To use the debug library, just link your program with the
$ ocamlopt -runtime-variant d -verbose -o hello.native hello.ml
+ as -o 'hello.o' '/tmp/build_cd0b96_dune/camlasmd3c336.s'
+ as -o '/tmp/build_cd0b96_dune/camlstartup9d55d0.o' '/tmp/build_cd0b96_dune/camlstartup2b2cd3.s'
+ gcc -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -Wl,-E -o 'hello.native' '-L/home/yminsky/.opam/rwo-4.13.1/lib/ocaml' '/tmp/build_cd0b96_dune/camlstartup9d55d0.o' '/home/yminsky/.opam/rwo-4.13.1/lib/ocaml/std_exit.o' 'hello.o' '/home/yminsky/.opam/rwo-4.13.1/lib/ocaml/stdlib.a' '/home/yminsky/.opam/rwo-4.13.1/lib/ocaml/libasmrund.a' -lm -ldl
+ gcc -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -Wl,-E -o 'hello.native' '-L/home/yminsky/.opam/rwo-4.14.1/lib/ocaml' '/tmp/build_cd0b96_dune/camlstartup9d55d0.o' '/home/yminsky/.opam/rwo-4.14.1/lib/ocaml/std_exit.o' 'hello.o' '/home/yminsky/.opam/rwo-4.14.1/lib/ocaml/stdlib.a' '/home/yminsky/.opam/rwo-4.14.1/lib/ocaml/libasmrund.a' -lm -ldl
$ ./hello.native
### OCaml runtime: debug mode ###
Initial minor heap size: 256k words
Expand Down
3 changes: 1 addition & 2 deletions book/compiler-backend/dune
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(mdx
(files README.md)
(packages
(libraries
core
mdx
ppx_jane)
(preludes prelude.ml))

Expand Down
3 changes: 2 additions & 1 deletion book/compiler-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1011,10 +1011,11 @@ into a `Hello` library.
```sh dir=examples/packing
$ dune build
$ cat _build/default/hello.ml-gen
(* generated by dune *)

(** @canonical Hello.A *)
module A = Hello__A


(** @canonical Hello.B *)
module B = Hello__B
```
Expand Down
3 changes: 1 addition & 2 deletions book/compiler-frontend/dune
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(mdx
(files README.md)
(packages
(libraries
core
mdx
ppx_jane)
(preludes prelude.ml))

Expand Down
5 changes: 3 additions & 2 deletions book/concurrent-programming/dune
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
(mdx
(files README.md)
(packages
(libraries
async
async_kernel
async_unix
cohttp-async
core
mdx
ppx_jane
textwrap
yojson)
Expand Down
Loading