Skip to content

fix(formatting): pass env vars to formatter actions - #15386

Merged
anmonteiro merged 1 commit into
ocaml:mainfrom
anmonteiro:anmonteiro/firx-formatting-anonoymous-actions-regression
Jun 30, 2026
Merged

anmonteiro merged 1 commit into
ocaml:mainfrom
anmonteiro:anmonteiro/firx-formatting-anonoymous-actions-regression

Conversation

@anmonteiro

Copy link
Copy Markdown
Collaborator

No description provided.

@anmonteiro anmonteiro mentioned this pull request Jun 30, 2026
30 tasks done
@anmonteiro
anmonteiro merged commit 95bb1a4 into ocaml:main Jun 30, 2026
29 checks passed
@anmonteiro
anmonteiro deleted the anmonteiro/firx-formatting-anonoymous-actions-regression branch June 30, 2026 15:08
@@ -1 +1,3 @@
-let z = ();
+Sys.argv: ../install/default/bin/refmt enabled/env-vars/reason_file.re
+REFMT_PRINT_WIDTH=120

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a sufficient regression test to ensure the regression does not recur?

@shonfeder

Copy link
Copy Markdown
Member

What is the regression this fixes? I see no issue describing the problem nor any obvious regression tests preventing it from recurring.

@anmonteiro

Copy link
Copy Markdown
Collaborator Author

This was reported to me privately by @jongleb.

I've added the regression test here: #15385

@anmonteiro

Copy link
Copy Markdown
Collaborator Author

@shonfeder more specifically, and please advise on process if I missed anything, the change in #14552 failed to consider environment variables used by the formatter. That's a regression from previous behavior, e.g. in refmt, where you can specify the print width as an environment variable.

@shonfeder

shonfeder commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

Thanks for the details! This will get picked up in the next release. Tho it sounds like we also need a changelog entry? Thanks for the fix!

@anmonteiro

Copy link
Copy Markdown
Collaborator Author

Tho it sounds like we also need a changelog entry?

Ah that's a great point, I will submit one shortly.

This will get picked up in the next release.

Just to confirm, this can be a patch release candidate, given it represents a regression, correct?

Alizter pushed a commit that referenced this pull request Jul 1, 2026
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
Alizter added a commit that referenced this pull request Jul 1, 2026
@shonfeder

Copy link
Copy Markdown
Member

Just to confirm, this can be a patch release candidate, given it represents a regression, correct?

Yes it can. I think we will indeed need a patch release, due to #15409 and the error fixed here.

@shonfeder shonfeder mentioned this pull request Jul 7, 2026
56 tasks done
@Alizter Alizter added this to the 3.25.0 milestone Jul 8, 2026
anmonteiro pushed a commit to anmonteiro/dune that referenced this pull request Jul 17, 2026
anmonteiro pushed a commit to anmonteiro/dune that referenced this pull request Jul 17, 2026
shonfeder added a commit that referenced this pull request Jul 17, 2026
avsm pushed a commit to ocaml/opam-repository that referenced this pull request Jul 23, 2026
CHANGES:

### Fixed

- Fix an internal error (`modules_and_obj_dir: failed lookup`) when generating
  `js_of_ocaml` archive rules for a dune file that defines two libraries with
  the same name distinguished by mutually exclusive `enabled_if` clauses, as
  `ocaml-re` does for `ppx_expect_common` (ocaml/dune#14904, fixes ocaml/dune#14775, @vouillon)

- Fix passing environment variables to formatter actions  (ocaml/dune#15386, @anmonteiro)

- Fix missing source dependency in the sandbox when preprocessing Melange
  sources (ocaml/dune#15395, @anmonteiro)

- Treat OCaml compiler packages version 5.5 or newer as relocatable so their
  installations do not use the toolchain cache (ocaml/dune#15444, fixes ocaml/dune#15443, @Alizter)

- Fix `build_runtime_flags` given in a `js_of_ocaml`/`wasm_of_ocaml` field of
  an executable being silently ignored in separate compilation mode: such
  executables were given the workspace-shared standalone runtime, which is
  built with the default flags. Executables customizing `build_runtime_flags`
  now get their own standalone runtime again. (ocaml/dune#15455, @hhugo)

- Use installed filenames for local package binaries in `%{bin:...}` PATH
  layouts on Windows (ocaml/dune#15518, fixes ocaml/dune#15512, @Alizter)

### Changed

- Revert sandboxing Melange rules by default in the `(library ..)` and
  `(melange.emit ..)` stanzas. In Melange libraries with many modules, sandbox
  creation / destruction dominates build time and adds significant overhead to
  build time (ocaml/dune#15418, @anmonteiro)
craff pushed a commit to craff/opam-repository that referenced this pull request Jul 25, 2026
CHANGES:

### Fixed

- Fix an internal error (`modules_and_obj_dir: failed lookup`) when generating
  `js_of_ocaml` archive rules for a dune file that defines two libraries with
  the same name distinguished by mutually exclusive `enabled_if` clauses, as
  `ocaml-re` does for `ppx_expect_common` (ocaml/dune#14904, fixes ocaml/dune#14775, @vouillon)

- Fix passing environment variables to formatter actions  (ocaml/dune#15386, @anmonteiro)

- Fix missing source dependency in the sandbox when preprocessing Melange
  sources (ocaml/dune#15395, @anmonteiro)

- Treat OCaml compiler packages version 5.5 or newer as relocatable so their
  installations do not use the toolchain cache (ocaml/dune#15444, fixes ocaml/dune#15443, @Alizter)

- Fix `build_runtime_flags` given in a `js_of_ocaml`/`wasm_of_ocaml` field of
  an executable being silently ignored in separate compilation mode: such
  executables were given the workspace-shared standalone runtime, which is
  built with the default flags. Executables customizing `build_runtime_flags`
  now get their own standalone runtime again. (ocaml/dune#15455, @hhugo)

- Use installed filenames for local package binaries in `%{bin:...}` PATH
  layouts on Windows (ocaml/dune#15518, fixes ocaml/dune#15512, @Alizter)

### Changed

- Revert sandboxing Melange rules by default in the `(library ..)` and
  `(melange.emit ..)` stanzas. In Melange libraries with many modules, sandbox
  creation / destruction dominates build time and adds significant overhead to
  build time (ocaml/dune#15418, @anmonteiro)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants