Skip to content

Commit f665c49

Browse files
committed
Merge main into toolchains
2 parents ebfbd69 + d43d011 commit f665c49

File tree

143 files changed

+2648
-1061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+2648
-1061
lines changed

.github/workflows/binaries.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Binaries
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
binary:
8+
name: Create
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
- os: macos-13
14+
name: mac-intel
15+
installable: .#
16+
- os: macos-14
17+
name: mac-arm
18+
installable: .#
19+
- os: ubuntu-22.04
20+
name: linux-intel
21+
installable: .#
22+
- os: ubuntu-22.04
23+
name: linux-intel-static
24+
installable: .#dune-static
25+
runs-on: ${{ matrix.os }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: cachix/install-nix-action@v22
29+
- run: nix build ${{ installable }}
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
path: result/bin/dune
33+
name: dune-${{ matrix.name }}
34+
combine:
35+
runs-on: ubuntu-latest
36+
needs: binary
37+
steps:
38+
- uses: actions/upload-artifact/merge@v4
39+
with:
40+
separate-directories: true

.github/workflows/workflow.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- 4.14.x
3535
include:
3636
# OCaml trunk:
37-
- ocaml-compiler: ocaml-variants.5.2.0+trunk
37+
- ocaml-compiler: ocaml-variants.5.3.0+trunk
3838
os: ubuntu-latest
3939
skip_test: true
4040
# OCaml 5:
@@ -44,6 +44,10 @@ jobs:
4444
- ocaml-compiler: 5.1.x
4545
os: macos-latest
4646
skip_test: true
47+
# macOS x86_64 (Intel)
48+
- ocaml-compiler: 4.14.x
49+
os: macos-13
50+
skip_test: true
4751
# OCaml 4:
4852
- ocaml-compiler: 4.13.x
4953
os: ubuntu-latest

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ install-ocamlformat:
7474
dev-depext:
7575
opam depext -y $(TEST_DEPS)
7676

77+
# v4-414-dev
7778
.PHONY: melange
7879
melange:
79-
opam pin add -n melange.dev https://github.com/melange-re/melange.git#v4-414-dev
80+
opam pin add -n melange.dev https://github.com/melange-re/melange.git#24e21cc42
8081

8182
.PHONY: dev-deps
8283
dev-deps: melange

bench/bench.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,7 @@ let () =
365365
Dune_engine.Clflags.display := Quiet;
366366
{ Scheduler.Config.concurrency = 10
367367
; stats = None
368-
; insignificant_changes = `React
369-
; signal_watcher = `No
368+
; print_ctrl_c_warning = false
370369
; watch_exclusions = []
371370
}
372371
in

bench/micro/dune_bench/scheduler_bench.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ let config =
88
Dune_engine.Clflags.display := Short;
99
{ Scheduler.Config.concurrency = 1
1010
; stats = None
11-
; insignificant_changes = `React
12-
; signal_watcher = `No
11+
; print_ctrl_c_warning = false
1312
; watch_exclusions = []
1413
}
1514
;;

bin/common.ml

-8
Original file line numberDiff line numberDiff line change
@@ -1047,14 +1047,6 @@ let rpc t =
10471047
| `Allow rpc -> `Allow (Lazy.force rpc)
10481048
;;
10491049

1050-
let signal_watcher t =
1051-
match t.rpc with
1052-
| `Allow _ -> `Yes
1053-
| `Forbid_builds ->
1054-
(* if we aren't building anything, then we don't mind interrupting dune immediately *)
1055-
`No
1056-
;;
1057-
10581050
let watch_exclusions t = t.builder.watch_exclusions
10591051
let stats t = t.stats
10601052

bin/common.mli

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ val rpc
1414
| `Forbid_builds (** Promise not to build anything. For now, this isn't checked *)
1515
]
1616

17-
val signal_watcher : t -> [ `Yes | `No ]
1817
val watch_exclusions : t -> string list
1918
val stats : t -> Dune_stats.t option
2019
val print_metrics : t -> bool

bin/describe/describe.ml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ let subcommands =
1919
; Aliases_targets.Aliases_cmd.command
2020
; Package_entries.command
2121
; Describe_pkg.command
22+
; Describe_contexts.command
2223
]
2324
;;
2425

bin/describe/describe_contexts.ml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
open Import
2+
3+
let term =
4+
let+ builder = Common.Builder.term in
5+
let common, config = Common.init builder in
6+
Scheduler.go ~common ~config
7+
@@ fun () ->
8+
let open Fiber.O in
9+
let* setup = Import.Main.setup () in
10+
let+ setup = Memo.run setup in
11+
let ctxts =
12+
List.map
13+
~f:(fun (name, _) -> Context_name.to_string name)
14+
(Context_name.Map.to_list setup.scontexts)
15+
in
16+
List.iter ctxts ~f:print_endline
17+
;;
18+
19+
let command =
20+
let doc = "List the build contexts available in the workspace." in
21+
let info = Cmd.info ~doc "contexts" in
22+
Cmd.v info term
23+
;;

bin/describe/describe_contexts.mli

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
open Import
2+
3+
(** Dune command to print out the available build contexts.*)
4+
val command : unit Cmd.t

bin/describe/describe_pkg.ml

+15-15
Original file line numberDiff line numberDiff line change
@@ -145,21 +145,21 @@ module List_locked_dependencies = struct
145145
Pp.concat
146146
~sep:Pp.cut
147147
(List.map lock_dirs_by_path ~f:(fun (lock_dir_path, lock_dir) ->
148-
match Package_universe.create local_packages lock_dir with
149-
| Error e -> raise (User_error.E e)
150-
| Ok package_universe ->
151-
Pp.vbox
152-
(Pp.concat
153-
~sep:Pp.cut
154-
[ Pp.hbox
155-
(Pp.textf
156-
"Dependencies of local packages locked in %s"
157-
(Path.Source.to_string_maybe_quoted lock_dir_path))
158-
; Pp.enumerate
159-
(Package_name.Map.keys local_packages)
160-
~f:(package_deps_in_lock_dir_pp package_universe ~transitive)
161-
|> Pp.box
162-
])))
148+
let package_universe =
149+
Package_universe.create local_packages lock_dir |> User_error.ok_exn
150+
in
151+
Pp.vbox
152+
(Pp.concat
153+
~sep:Pp.cut
154+
[ Pp.hbox
155+
(Pp.textf
156+
"Dependencies of local packages locked in %s"
157+
(Path.Source.to_string_maybe_quoted lock_dir_path))
158+
; Pp.enumerate
159+
(Package_name.Map.keys local_packages)
160+
~f:(package_deps_in_lock_dir_pp package_universe ~transitive)
161+
|> Pp.box
162+
])))
163163
|> Pp.vbox
164164
in
165165
Console.print [ pp ]

bin/describe/describe_workspace.ml

+21-12
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,13 @@ module Sanitize_for_tests = struct
274274
let fake_workspace = lazy (Path.External.of_string "/WORKSPACE_ROOT")
275275

276276
let sanitize_with_findlib ~findlib_paths path =
277+
let path = Path.external_ path in
277278
List.find_map findlib_paths ~f:(fun candidate ->
278279
let open Option.O in
279280
let* candidate = Path.as_external candidate in
280281
(* if the path to rename is an external path, try to find the
281282
OCaml root inside, and replace it with a fixed string *)
282-
let+ without_prefix = Path.External.drop_prefix ~prefix:candidate path in
283+
let+ without_prefix = Path.drop_prefix ~prefix:(Path.external_ candidate) path in
283284
(* we have found the OCaml root path: let's replace it with a
284285
constant string *)
285286
Path.External.append_local (Lazy.force fake_findlib) without_prefix)
@@ -371,7 +372,9 @@ module Crawl = struct
371372

372373
(* Builds the list of modules *)
373374
let modules ~obj_dir ~deps_of modules_ : Descr.Mod.t list Memo.t =
374-
Modules.fold_no_vlib ~init:(Memo.return []) modules_ ~f:(fun m macc ->
375+
modules_
376+
|> Modules.With_vlib.drop_vlib
377+
|> Modules.fold ~init:(Memo.return []) ~f:(fun m macc ->
375378
let* acc = macc in
376379
let deps = deps_of m in
377380
let+ { Ocaml.Ml_kind.Dict.intf = deps_for_intf; impl = deps_for_impl }, _ =
@@ -389,11 +392,14 @@ module Crawl = struct
389392
Scope.DB.find_by_project (Super_context.context sctx |> Context.name) project
390393
in
391394
let* modules_, obj_dir =
392-
Dir_contents.get sctx ~dir
393-
>>= Dir_contents.ocaml
394-
>>= Ml_sources.modules_and_obj_dir
395-
~libs:(Scope.libs scope)
396-
~for_:(Exe { first_exe })
395+
let+ modules_, obj_dir =
396+
Dir_contents.get sctx ~dir
397+
>>= Dir_contents.ocaml
398+
>>= Ml_sources.modules_and_obj_dir
399+
~libs:(Scope.libs scope)
400+
~for_:(Exe { first_exe })
401+
in
402+
Modules.With_vlib.modules modules_, obj_dir
397403
in
398404
let* pp_map =
399405
let+ version =
@@ -454,11 +460,14 @@ module Crawl = struct
454460
let* libs =
455461
Scope.DB.find_by_dir (Path.as_in_build_dir_exn src_dir) >>| Scope.libs
456462
in
457-
Dir_contents.get sctx ~dir:(Path.as_in_build_dir_exn src_dir)
458-
>>= Dir_contents.ocaml
459-
>>= Ml_sources.modules_and_obj_dir
460-
~libs
461-
~for_:(Library (Lib_info.lib_id info |> Lib_id.to_local_exn))
463+
let+ modules_, obj_dir_ =
464+
Dir_contents.get sctx ~dir:(Path.as_in_build_dir_exn src_dir)
465+
>>= Dir_contents.ocaml
466+
>>= Ml_sources.modules_and_obj_dir
467+
~libs
468+
~for_:(Library (Lib_info.lib_id info |> Lib_id.to_local_exn))
469+
in
470+
Modules.With_vlib.modules modules_, obj_dir_
462471
in
463472
let* pp_map =
464473
let+ version =

bin/import.ml

+2-6
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,11 @@ module Scheduler = struct
189189
let go ~(common : Common.t) ~config:dune_config f =
190190
let stats = Common.stats common in
191191
let config =
192-
let signal_watcher = Common.signal_watcher common in
193192
let watch_exclusions = Common.watch_exclusions common in
194193
Dune_config.for_scheduler
195194
dune_config
196195
stats
197-
~insignificant_changes:`Ignore
198-
~signal_watcher
196+
~print_ctrl_c_warning:true
199197
~watch_exclusions
200198
in
201199
let f =
@@ -218,13 +216,11 @@ module Scheduler = struct
218216
in
219217
let stats = Common.stats common in
220218
let config =
221-
let signal_watcher = Common.signal_watcher common in
222219
let watch_exclusions = Common.watch_exclusions common in
223220
Dune_config.for_scheduler
224221
dune_config
225222
stats
226-
~insignificant_changes:`Ignore
227-
~signal_watcher
223+
~print_ctrl_c_warning:true
228224
~watch_exclusions
229225
in
230226
let file_watcher = Common.file_watcher common in

bin/monitor.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,7 @@ let command =
282282
Dune_config.for_scheduler
283283
config
284284
stats
285-
~insignificant_changes:`Ignore
286-
~signal_watcher:`Yes
285+
~print_ctrl_c_warning:true
287286
~watch_exclusions:[]
288287
in
289288
Scheduler.Run.go

0 commit comments

Comments
 (0)