-
Notifications
You must be signed in to change notification settings - Fork 471
Use Eio for parallelizing some analysis commands #7840
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
base: master
Are you sure you want to change the base?
Changes from 10 commits
8c01864
951b61d
efec169
ea3636f
4fc600e
63ceb38
2357c2e
58d1393
966836b
b956b14
0663fc5
b265377
1c1e299
97f9e2b
4d74fcc
4352708
8d9d7f0
a72edaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,12 +58,6 @@ jobs: | |
node-target: win32-x64 | ||
rust-target: x86_64-pc-windows-gnu | ||
|
||
# Verify that the compiler still builds with the oldest OCaml version we support. | ||
- os: ubuntu-24.04 | ||
ocaml_compiler: ocaml-variants.4.14.2+options,ocaml-option-static | ||
node-target: linux-x64 | ||
rust-target: x86_64-unknown-linux-musl | ||
|
||
runs-on: ${{matrix.os}} | ||
|
||
env: | ||
|
@@ -102,7 +96,7 @@ jobs: | |
uses: awalsh128/[email protected] | ||
with: | ||
# See https://github.com/ocaml/setup-ocaml/blob/b2105f9/packages/setup-ocaml/src/unix.ts#L9 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The addition of Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you fix this Copilot? |
||
packages: bubblewrap darcs g++-multilib gcc-multilib mercurial musl-tools rsync | ||
packages: bubblewrap darcs g++-multilib gcc-multilib mercurial musl-tools rsync linux-libc-dev dpkg-dev | ||
version: v3 | ||
|
||
- name: Restore rewatch build cache | ||
|
@@ -181,7 +175,13 @@ jobs: | |
|
||
- name: Install OPAM dependencies | ||
if: steps.cache-opam-env.outputs.cache-hit != 'true' | ||
run: opam install . --deps-only --with-test | ||
run: | | ||
if [ "$RUNNER_OS" = "Linux" ]; then | ||
arch=$(dpkg-architecture -qDEB_HOST_MULTIARCH) | ||
C_INCLUDE_PATH="/usr/include:/usr/include/$arch" CPATH="/usr/include:/usr/include/$arch" opam install . --deps-only --with-test | ||
else | ||
opam install . --deps-only --with-test | ||
fi | ||
|
||
- name: Cache OPAM environment | ||
if: steps.cache-opam-env.outputs.cache-hit != 'true' | ||
|
@@ -262,7 +262,9 @@ jobs: | |
|
||
- name: Build compiler (Linux static) | ||
if: runner.os == 'Linux' | ||
run: opam exec -- dune build --display quiet --profile static | ||
run: | | ||
arch=$(dpkg-architecture -qDEB_HOST_MULTIARCH) | ||
C_INCLUDE_PATH="/usr/include:/usr/include/$arch" CPATH="/usr/include:/usr/include/$arch" opam exec -- dune build --display quiet --profile static | ||
|
||
|
||
- name: Delete stable compiler build state | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
(package analysis) | ||
(modes byte exe) | ||
(name main) | ||
(libraries analysis)) | ||
(libraries analysis eio eio_main)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,21 +194,23 @@ let main () = | |
Sys.argv.(len - 1) <- ""; | ||
Reanalyze.cli () | ||
| [_; "references"; path; line; col] -> | ||
Commands.references ~path | ||
~pos:(int_of_string line, int_of_string col) | ||
~debug | ||
Eio_main.run (fun env -> | ||
Commands.references ~env ~path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why does references need to take an env now and not before? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because it's using Eio, and that requires the Eio env. |
||
~pos:(int_of_string line, int_of_string col) | ||
~debug) | ||
| [_; "rename"; path; line; col; newName] -> | ||
Commands.rename ~path | ||
~pos:(int_of_string line, int_of_string col) | ||
~newName ~debug | ||
Eio_main.run (fun env -> | ||
Commands.rename ~env ~path | ||
~pos:(int_of_string line, int_of_string col) | ||
~newName ~debug) | ||
| [_; "semanticTokens"; currentFile] -> | ||
SemanticTokens.semanticTokens ~currentFile | ||
| [_; "createInterface"; path; cmiFile] -> | ||
Printf.printf "\"%s\"" | ||
(Json.escape (CreateInterface.command ~path ~cmiFile)) | ||
| [_; "format"; path] -> | ||
Printf.printf "\"%s\"" (Json.escape (Commands.format ~path)) | ||
| [_; "test"; path] -> Commands.test ~path | ||
| [_; "test"; path] -> Eio_main.run (fun env -> Commands.test ~env ~path) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is used because reference tests require the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The specific tests of commands that use Eio will still use it in the tests as well, but yeah, the tests themselves are sequential. |
||
| [_; "cmt"; rescript_json; cmt_path] -> CmtViewer.dump rescript_json cmt_path | ||
| args when List.mem "-h" args || List.mem "--help" args -> prerr_endline help | ||
| _ -> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was discussed in Discord that it's OK for us to move to
5.3.0+
.