Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
#### :rocket: New Feature

- Add support for Set, Map, WeakSet and WeakMap to `@unboxed`. https://github.com/rescript-lang/rescript/pull/8009

- Reanalyze: add reactive incremental analysis (`-reactive`, `-runs`, `-churn`) and Mermaid pipeline dumping (`-mermaid`). https://github.com/rescript-lang/rescript/pull/8092

#### :bug: Bug fix

- Fix rewatch swallowing parse warnings (%todo). https://github.com/rescript-lang/rescript/pull/8135

#### :memo: Documentation

#### :nail_care: Polish
Expand Down
10 changes: 7 additions & 3 deletions rewatch/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,10 @@ pub fn incremental_build(
let result_asts = parse::generate_asts(build_state, || pb.inc(1));
let timing_ast_elapsed = timing_ast.elapsed();

match result_asts {
Ok(_ast) => {
let parse_warnings = match result_asts {
Ok(warnings) => {
pb.finish();
warnings
}
Err(err) => {
logs::finalize(&build_state.packages);
Expand All @@ -285,7 +286,7 @@ pub fn incremental_build(
plain_output,
});
}
}
};
let deleted_modules = build_state.deleted_modules.clone();
deps::get_deps(build_state, &deleted_modules);
let timing_parse_total = timing_parse_start.elapsed();
Expand All @@ -304,6 +305,9 @@ pub fn incremental_build(
);
}
}
if helpers::contains_ascii_characters(&parse_warnings) {
println!("{}", &parse_warnings);
}

mark_modules_with_expired_deps_dirty(build_state);
mark_modules_with_deleted_deps_dirty(&mut build_state.build_state);
Expand Down
27 changes: 15 additions & 12 deletions tests/build_tests/build_warn_as_error/input.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import * as assert from "node:assert";
import { setup } from "#dev/process";

const { execBuildLegacy, execCleanLegacy } = setup(import.meta.dirname);
const { execBuild, execClean } = setup(import.meta.dirname);

const o1 = await execBuildLegacy();
const o1 = await execBuild();

const first_message = o1.stdout
// biome-ignore lint/suspicious/noControlCharactersInRegex: strip ANSI color codes from output
const stripAnsi = s => s.replace(/\x1b\[[0-9;]*m/g, "");

const first_message = stripAnsi(o1.stdout)
.split("\n")
.map(s => s.trim())
.find(s => s === "Warning number 110");
Expand All @@ -14,10 +17,10 @@ if (!first_message) {
assert.fail(o1.stdout);
}

// Second build using -warn-error +110
const o2 = await execBuildLegacy(["-warn-error", "+110"]);
// Second build using --warn-error +110
const o2 = await execBuild(["--warn-error", "+110"]);

const second_message = o2.stdout
const second_message = stripAnsi(o2.stdout)
.split("\n")
.map(s => s.trim())
.find(s => s === "Warning number 110 (configured as error)");
Expand All @@ -26,17 +29,17 @@ if (!second_message) {
assert.fail(o2.stdout);
}

// Third build, without -warn-error +110
// Third build, without --warn-error +110
// The result should not be a warning as error
const o3 = await execBuildLegacy();
const o3 = await execBuild();

const third_message = o3.stdout
const third_message = stripAnsi(o3.stdout)
.split("\n")
.map(s => s.trim())
.find(s => s === "Dependency Finished");
.find(s => s === "Warning number 110 (configured as error)");

if (!third_message) {
if (o3.status !== 0 || third_message) {
assert.fail(o3.stdout);
}

await execCleanLegacy();
await execClean();
Loading