Repository navigation
Compile in-process on OCaml domains in OCaml rewatch #8781
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
Merged
+1,916
−1,538
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
f927d70
Identify bsc builds by a digest of the compiler sources
cknitt c0a581a
Compile OCaml rewatch jobs on parallel domains
cknitt 71b4f77
Format in-process and drop bsc subprocess plumbing in OCaml rewatch
cknitt 345a118
Remove the unused sequential in-process task kind from OCaml rewatch
cknitt 5b249ce
Capture in-process compiler output in text mode
cknitt e2e462e
Add a changelog fragment for in-process compilation
cknitt 79243ad
Stream standalone bsc output and keep captured output on failure
cknitt e0011c7
Exit at once on a second termination signal in OCaml rewatch
cknitt c87b119
Accept either signal's status in the second-signal test
cknitt 54ac037
Remove temporary PPX files when a PPX fails
cknitt 10a1fb0
Test that an exception escaping the compiler fails only its module
cknitt cfd38bf
Test that a second build waits for an in-process build's lock
cknitt 8bba68b
Ignore repeated termination signals and damaged AST headers in OCaml …
cknitt 47f6a31
Make in-process compilation robust against temp-directory and decodin…
cknitt 206b175
Compile namespace maps on the worker domains in OCaml rewatch
cknitt eb7aae6
Tighten and restore OCaml rewatch tests for in-process compilation
cknitt 7833621
Note in the changelog that rescript ignores RESCRIPT_BSC_EXE
cknitt 6b7651d
Publish artifacts on the worker domain that compiled them
cknitt 38fe81c
Give OCaml rewatch's worker domains a 2M-word minor heap
cknitt 95eab5a
Remove dead code left by in-process compilation in OCaml rewatch
cknitt 4a7f01b
Test that bsc -verbose prints a PPX's command before its output
cknitt 4329b95
Record the platform package's bsc.exe from a development build
cknitt e15e006
Check a published AST's dependency length before allocating it
cknitt de1bf35
List the damaged-AST recovery among the differences from Rust rewatch
cknitt 2155125
Report a crashed worker before a failure to cancel the other work
cknitt 6d0571e
Remove the unused REWATCH_GC_STATS_FILE reporter
cknitt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - Speed up `rescript` builds by compiling modules inside the build system on several CPU cores, instead of starting `bsc` for every file. https://github.com/rescript-lang/rescript/pull/8781 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - `rescript` compiles with its embedded compiler and ignores `RESCRIPT_BSC_EXE`, which now only affects `rescript-rust`. https://github.com/rescript-lang/rescript/pull/8781 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| let () = | ||
| let relevant file = | ||
| Filename.basename file = "dune" | ||
| || List.exists (Filename.check_suffix file) [".ml"; ".mli"; ".c"; ".h"] | ||
| in | ||
| let files = | ||
| Array.to_list Sys.argv |> List.tl |> List.filter relevant | ||
| |> List.sort String.compare | ||
| in | ||
| let normalize path = | ||
| String.map | ||
| (function | ||
| | '\\' -> '/' | ||
| | character -> character) | ||
| path | ||
| in | ||
| let has_suffix suffix = | ||
| List.exists | ||
| (fun file -> Filename.check_suffix (normalize file) suffix) | ||
| files | ||
| in | ||
| [ | ||
| "/flow_parser/parser/expression_parser.ml"; | ||
| "/ext/ext_platform_primitives_stubs.c"; | ||
| "/ext/platform/native/ext_platform_primitives.ml"; | ||
| "/core/platform/native/js_name_of_module_id.ml"; | ||
| "/syntax/src/res_driver.ml"; | ||
| "/syntax/src/dune"; | ||
| ] | ||
| |> List.iter (fun suffix -> | ||
| if not (has_suffix suffix) then | ||
| failwith ("compiler identity is missing required input " ^ suffix)); | ||
| let digest = | ||
| files | ||
| |> List.map (fun file -> file ^ "\000" ^ Digest.file file) | ||
| |> String.concat "\000" |> Digest.string | ||
| in | ||
| Printf.printf "let value = %S\n" (Digest.to_hex digest) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| type t = {dependencies: string list; source: string option} | ||
| (** Published AST headers are read without deserializing the compiler's full AST. | ||
| Cleanup needs the original source path, while graph construction needs only | ||
| dependency names; keeping one reader prevents those wire-format rules from | ||
| drifting. *) | ||
| dependency names. The encoded dependency byte length separates those names | ||
| from either an absolute or a relative source path and the marshalled AST. *) | ||
|
|
||
| val read : string -> t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.