Skip to content

Make the build system's output wording, labels and colors consistent - #9250

Open
cknitt wants to merge 1 commit into
rewatch-format-fixesfrom
rewatch-output-wording
Open

cknitt wants to merge 1 commit into
rewatch-format-fixesfrom
rewatch-output-wording

Conversation

@cknitt

@cknitt cknitt commented Nov 6, 2026

Copy link
Copy Markdown
Member

Closes #9244. Stacked on the format fixes.

Rust-era output conventions replaced with the simplest consistent form:

  • Counts: singular for one (Parsed 1 source file, Compiled 1 module). The cleanup step says Cleaned N stale modules; the /total part is gone, along with the counter that only fed it.
  • Failure line: Build failed: see the errors above. (or … could not parse the source files above.) replaces Incremental build failed. Error: \e[2K\r Failed to Compile. See Errors Above.
  • Completion line: a redirected one-shot build ends with Finished compilation, like watch mode.
  • Labels: inline, as warning: …, debug: …, trace: …, instead of ERROR:/WARN:/DEBUG:/TRACE: on their own line. A missing dependency source folder is a warning (the build succeeds). The duplicate-package and orphan-interface warnings carry the label too, and the orphan one loses its line-clear sequence.
  • Parse errors: no Error in <package>: header, like type errors.
  • Colors: compiler errors and warnings are printed without colors when colors are off (redirected, NO_COLOR); .compiler.log keeps them for editors.
  • Smaller fixes:
    • "ReScript 12's new build system" becomes "the ReScript build system";
    • Rescript becomes ReScript;
    • config diagnostics are separated by one blank line;
    • clean with no in-source output says "generated files".

Left as is: config diagnostics are still printed after the progress lines; moving them would restructure the report.

The integration snapshots in rewatch/tests/snapshots were converted mechanically: colors stripped and the wording above applied. The local suite cannot run past the file-casing packages on this machine's Docker-for-Mac mount, so CI is the first full run of those snapshots.

New test: output_tests covers the singular counts and uncolored compiler output. The other updates are snapshot and expectation changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kbf3gGBR9g3DD93vrWbYzU

@cknitt
cknitt added this pull request to stack #9251 November 6, 2026 21:14
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Changelog

💅 Polish

  • The build system's messages read more consistently:
    • counts use the singular for one (Parsed 1 source file, Compiled 1 module), and the cleanup step reports Cleaned N stale modules;
    • a failed build ends with Build failed: see the errors above., without a terminal escape sequence when redirected;
    • a redirected one-shot build ends with Finished compilation, like watch mode;
    • warnings and verbose logs are labeled inline (warning: …, debug: …, trace: …), and a missing source folder is a warning;
    • parse errors no longer get an Error in <package>: header;
    • compiler errors and warnings are uncolored when output is redirected or NO_COLOR is set.

Semantic Diff

1 commit · Full page

Make the build system's output wording, labels and colors consistent

4c7e3d1 · cknitt + Claude · Nov 06, 2026, 21:08 UTC

Why

The build system's messages still followed the Rust implementation's output, which the OCaml one had to match exactly (#9244).

Output modified (redirected rescript build)

text

-Cleaned 0/0
-Parsed 1 source files
-Compiled 1 modules
-Incremental build failed. Error: \e[2K\r  Failed to Compile. See Errors Above
+Cleaned 0 stale modules
+Parsed 1 source file
+Compiled 1 module
+Build failed: see the errors above.

Diagnostic modified (labels and wording)

text

-ERROR:
-Could not read folder: "nosuch". Specified in dependency: dep, located "<path>"...
-WARN:
-Package 'dep' has not defined any sources, …
-Duplicated package: a ./node_modules/a (chosen) vs … in ./node_modules/b
-\e[2K\r No implementation file found for interface file (skipping): src/B.resi
-Error in pkg:
-DEBUG:
-Compiling file: A
-compile dirty: A
-TRACE:
-Compiled 2 out of 2 in the universe
-… is not supported by ReScript 12's new build system.
-Could not start Rescript build: …
+warning: source folder "nosuch" of package dep (<path>) does not exist or is not a folder
+warning: package 'dep' has not defined any sources, …
+warning: duplicated package: a ./node_modules/a (chosen) vs … in ./node_modules/b
+warning: no implementation file found for interface file (skipping): src/B.resi
+(no header before parse errors)
+debug: Compiling file: A
+trace: compile dirty: A
+trace: compiled 2 of the 2 modules to check
+… is not supported by the ReScript build system.
+Could not start ReScript build: …

The other changes: - a redirected one-shot build ends with Finished compilation, like watch; - compiler errors and warnings are printed without colors when colors are off (redirected output, NO_COLOR); .compiler.log keeps them for editors; - config diagnostics are separated by one blank line; - rescript clean labels its second step "generated files" when no output is in-source, instead of an empty suffix list; - the cleanup step no longer counts the previous ASTs, which only the Cleaned N/M line printed.

Review

  • Why are config diagnostics still printed after the progress lines? Moving them before would restructure the report for little gain; only their spacing changes.

@cknitt

cknitt commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T22:21:31.626859Z 4c7e3d1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: abe9a7461d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rewatch-ocaml/build_report.ml Resolved
Why:
    The build system's messages still followed the Rust implementation's
    output, which the OCaml one had to match exactly (#9244).

Output modified (redirected rescript build):
Before (text):
    Cleaned 0/0
    Parsed 1 source files
    Compiled 1 modules
    Incremental build failed. Error: \e[2K\r  Failed to Compile. See Errors Above
After (text):
    Cleaned 0 stale modules
    Parsed 1 source file
    Compiled 1 module
    Build failed: see the errors above.

Diagnostic modified (labels and wording):
Before (text):
    ERROR:
    Could not read folder: "nosuch". Specified in dependency: dep, located "<path>"...
    WARN:
    Package 'dep' has not defined any sources, …
    Duplicated package: a ./node_modules/a (chosen) vs … in ./node_modules/b
    \e[2K\r No implementation file found for interface file (skipping): src/B.resi
    Error in pkg:
    DEBUG:
    Compiling file: A
    compile dirty: A
    TRACE:
    Compiled 2 out of 2 in the universe
    … is not supported by ReScript 12's new build system.
    Could not start Rescript build: …
After (text):
    warning: source folder "nosuch" of package dep (<path>) does not exist or is not a folder
    warning: package 'dep' has not defined any sources, …
    warning: duplicated package: a ./node_modules/a (chosen) vs … in ./node_modules/b
    warning: no implementation file found for interface file (skipping): src/B.resi
    (no header before parse errors)
    debug: Compiling file: A
    trace: compile dirty: A
    trace: compiled 2 of the 2 modules to check
    … is not supported by the ReScript build system.
    Could not start ReScript build: …

The other changes:
- a redirected one-shot build ends with Finished compilation, like watch;
- compiler errors and warnings are printed without colors when colors are
  off (redirected output, NO_COLOR); .compiler.log keeps them for editors;
- config diagnostics are separated by one blank line;
- rescript clean labels its second step "generated files" when no output
  is in-source, instead of an empty suffix list;
- the cleanup step no longer counts the previous ASTs, which only the
  Cleaned N/M line printed.

Review: Why are config diagnostics still printed after the progress lines? Moving them before would restructure the report for little gain; only their spacing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gGBR9g3DD93vrWbYzU
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt
cknitt force-pushed the rewatch-output-wording branch from abe9a74 to 4c7e3d1 Compare November 6, 2026 21:31
@pkg-pr-new

pkg-pr-new Bot commented Nov 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@9250

@rescript/belt

npm i https://pkg.pr.new/@rescript/belt@9250

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@9250

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@9250

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@9250

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@9250

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@9250

commit: 4c7e3d1

@cknitt

cknitt commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 4c7e3d1454

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cknitt
cknitt marked this pull request as ready for review November 7, 2026 06:18
@cknitt
cknitt requested a review from cristianoc November 7, 2026 06:18

This branch has not been deployed

No deployments
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.

Build system: make output wording and labels consistent

1 participant