Skip to content

Read bsc's flags into a typed compile request - #9306

Draft
cknitt wants to merge 1 commit into
validate-compiler-flagsfrom
compile-request
Draft

cknitt wants to merge 1 commit into
validate-compiler-flagsfrom
compile-request

Conversation

@cknitt

@cknitt cknitt commented Nov 14, 2026

Copy link
Copy Markdown
Member

Step 2 of #9303. Stacked on #9304.

bsc's flags set global compiler state as they're parsed, so the only way to describe a compile was a list of strings. This PR adds that description as a record, Compile_request.t:

  • of_argv reads flags into the record. A field holds what the flags gave, and repeatable flags (-open, -w, -I, …) keep their order. Values are checked while reading: jsx version, source-map mode, color, genType module and resolution, experimental feature names, package outputs, warning specs.
  • to_argv writes the record back as flags.
  • apply sets the request's compiler state from the record, on top of what is there. This is how @@config flags still apply on top of the command line.
  • Each flag has a kind: Build_system, Public, Debug or Command. of_argv reads all of them; callers that accept only some kinds check them with kind_of. The build system will decide which public flags it warns about, since it knows its own rescript.json fields.

bsc's command line and @@config now go through the record. The flag table moved from the driver to Compile_request. bsc -help prints the same text as before.

The next PR has the build system build the record directly for in-process compiles.

Behaviour differences

All of these are on bsc's command line or in @@config; the build system's builds are unaffected (the full test suites pass):

  • Invalid values are errors: e.g. -color red, -bs-gentype-module amd, -enable-experimental Unknown. Before, some were silently ignored.
  • Commands (-format, -e, -reprint-source, -v) run after all flags are read, not at their position.
  • The namespace of -bs-ns is opened before the -open modules, whatever the order on the command line. The build system already passes -bs-ns first.
  • -bs-ns given twice: the last one is used. Before, both were opened.
  • An invalid @@config flag applies none of the file's flags. Before, the flags up to the bad one were applied. A command in @@config, such as -v, now counts as invalid instead of running.

Tests

  • tests/ounit_tests/ounit_compile_request_tests.ml:
    • every flag is read back from to_argv, one at a time and all at once;
    • repeated flags keep their order;
    • commands and files stay in order;
    • invalid values are rejected;
    • a base request is extended;
    • key flags have the expected kinds.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kbf3gHAzsdStoCEpBgx2tS

@cknitt
cknitt added this pull request to stack #9307 November 14, 2026 17:00
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Changelog

🏠 Internal

  • Read bsc's flags into a typed request, and reject invalid values such as an unknown experimental feature, color setting or genType module.

Semantic Diff

1 commit · Full page

Read bsc's flags into a typed compile request

2d64e4d · cknitt + Claude · Nov 14, 2026, 10:11 UTC

Why

bsc's flags set global compiler state as they were parsed, so the only way to describe a compile was a list of strings. Compile_request is that description as a record: of_argv reads the flags into it, to_argv writes them back, and apply sets the request's state from it. bsc's command line and a file's @@config flags go through it now; the build system can build the record directly in a next step (#9303).

Each flag has a kind: Build_system, Public, Debug or Command. The record holds what the flags gave, so @@config is applied on top of the command line as before. A round-trip test reads every flag back from to_argv. Bsc_args keeps only the usage text and its exceptions; its old parser and Ext_spec are removed.

Diagnostic added (invalid flag values)

bsc -color red -enable-experimental Unknown A.res

diagnostic

-(the values were ignored)
+Unsupported color setting: red

Other differences, all on bsc's command line: commands such as -format and -e run after every flag is read, not at their position; the namespace of -bs-ns is opened before the -open modules, as the build system passes it anyway; an invalid @@config flag applies none of the file's flags.

Part of #9303

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

⚠️ Compiler benchmarks

Allocated words

In total: 636,523,250 → 637,084,708 (+0.09%).

Generated projects: 629,046,754 → 626,542,543 (-0.40%).

⚠️ Regression: 140 benchmarks allocate more than 1% more.

🎉 Improvement: 1 benchmark allocates more than 1% less.

Benchmark Base Head Change
packages/@rescript/runtime/Primitive_float_extern.res 93,687 96,940 +3.47%
packages/@rescript/runtime/Stdlib_Blob.res 93,905 97,158 +3.46%
packages/@rescript/runtime/Primitive_list.resi 91,887 95,057 +3.45%
packages/@rescript/runtime/Stdlib_File.res 95,714 98,967 +3.40%
packages/@rescript/runtime/Primitive_promise.res 97,062 100,315 +3.35%
packages/@rescript/runtime/Primitive_int_extern.res 97,915 101,168 +3.32%
packages/@rescript/runtime/Stdlib_Iterable.res 98,944 102,231 +3.32%
packages/@rescript/runtime/Stdlib_AsyncIterable.res 99,015 102,302 +3.32%
packages/@rescript/runtime/Primitive_string_extern.res 98,223 101,476 +3.31%
packages/@rescript/runtime/Obj.res 99,164 102,417 +3.28%
227 more changes
Benchmark Base Head Change
packages/@rescript/runtime/Stdlib_Iterable.resi 98,169 101,339 +3.23%
packages/@rescript/runtime/Stdlib_AsyncIterable.resi 98,318 101,488 +3.22%
packages/@rescript/runtime/Primitive_dict.res 102,715 105,968 +3.17%
packages/@rescript/runtime/Primitive_exceptions.resi 100,319 103,489 +3.16%
packages/@rescript/runtime/RescriptTools.res 104,517 107,770 +3.11%
packages/@rescript/runtime/Primitive_hash.resi 102,744 105,914 +3.09%
packages/@rescript/runtime/Primitive_module.resi 103,182 106,352 +3.07%
packages/@rescript/runtime/Stdlib_ArrayBuffer.res 107,537 110,824 +3.06%
packages/@rescript/runtime/Stdlib_TaggedTemplate.resi 106,124 109,294 +2.99%
packages/@rescript/runtime/RescriptTools_ExtractCodeBlocks.res 112,140 115,393 +2.90%
packages/@rescript/runtime/Stdlib_ArrayBuffer.resi 110,989 114,159 +2.86%
packages/@rescript/runtime/Stdlib_TaggedTemplate.res 115,368 118,655 +2.85%
packages/@rescript/runtime/Primitive_array_extern.res 114,220 117,473 +2.85%
packages/@rescript/runtime/Primitive_object_extern.res 114,729 117,982 +2.84%
packages/@rescript/runtime/Stdlib_Lazy.resi 112,434 115,604 +2.82%
packages/@rescript/runtime/Stdlib_Intl_Segments.res 116,601 119,854 +2.79%
packages/@rescript/runtime/Stdlib_Bool.resi 116,818 119,988 +2.71%
packages/@rescript/runtime/Dom_storage2.res 120,182 123,435 +2.71%
packages/@rescript/runtime/Primitive_object.resi 117,125 120,295 +2.71%
packages/@rescript/runtime/Jsx.res 121,738 124,991 +2.67%
packages/@rescript/runtime/Stdlib_WeakSet.res 123,172 126,425 +2.64%
packages/@rescript/runtime/Primitive_option.resi 122,265 125,435 +2.59%
packages/@rescript/runtime/Stdlib_JsExn.resi 122,775 125,945 +2.58%
build/Namespace/clean 84,167,810 82,102,309 -2.45%
packages/@rescript/runtime/Stdlib_WeakMap.res 135,503 138,756 +2.40%
packages/@rescript/runtime/Stdlib_Type.resi 135,946 139,116 +2.33%
packages/@rescript/runtime/Stdlib_Global.res 141,743 145,030 +2.32%
packages/@rescript/runtime/Stdlib_Temporal_Now.res 143,495 146,748 +2.27%
packages/@rescript/runtime/Stdlib_Bool.res 146,012 149,299 +2.25%
packages/@rescript/runtime/Stdlib_Symbol.res 146,511 149,798 +2.24%
packages/@rescript/runtime/Primitive_float.res 146,893 150,146 +2.21%
packages/@rescript/runtime/Primitive_bool.res 147,218 150,471 +2.21%
packages/@rescript/runtime/Stdlib_Ordering.res 152,340 155,593 +2.14%
packages/@rescript/runtime/Stdlib_IterableIterator.resi 149,406 152,576 +2.12%
packages/@rescript/runtime/Stdlib_Intl_Common.res 154,360 157,613 +2.11%
packages/@rescript/runtime/Stdlib_Intl_Segmenter.res 154,540 157,793 +2.10%
packages/@rescript/runtime/Stdlib_Intl_NumberFormat_Grouping.res 159,421 162,674 +2.04%
packages/@rescript/runtime/Primitive_string.res 159,592 162,845 +2.04%
packages/@rescript/runtime/Stdlib_Global.resi 155,548 158,718 +2.04%
packages/@rescript/runtime/Stdlib_RegExp.res 163,713 167,000 +2.01%
packages/@rescript/runtime/Stdlib_Iterator.resi 159,246 162,416 +1.99%
packages/@rescript/runtime/Stdlib_AsyncIterableIterator.resi 159,925 163,095 +1.98%
packages/@rescript/runtime/Stdlib_Symbol.resi 160,141 163,311 +1.98%
packages/@rescript/runtime/Stdlib_Generator.resi 160,547 163,717 +1.97%
packages/@rescript/runtime/Stdlib_Pair.res 165,262 168,515 +1.97%
packages/@rescript/runtime/Dom_storage.res 167,042 170,295 +1.95%
packages/@rescript/runtime/Stdlib_Intl_ListFormat.res 169,825 173,078 +1.92%
packages/@rescript/runtime/Stdlib_AsyncGenerator.resi 165,925 169,095 +1.91%
packages/@rescript/runtime/Stdlib_JsExn.res 173,080 176,367 +1.90%
packages/@rescript/runtime/Primitive_int.res 171,842 175,095 +1.89%
packages/@rescript/runtime/Stdlib_Intl.res 173,862 177,115 +1.87%
packages/@rescript/belt/src/Belt_Int.resi 149,771 152,553 +1.86%
packages/@rescript/belt/src/Belt_Float.resi 151,251 154,033 +1.84%
packages/@rescript/runtime/Stdlib_IterableIterator.res 178,852 182,139 +1.84%
packages/@rescript/runtime/Primitive_bigint.res 177,314 180,567 +1.83%
packages/@rescript/runtime/Stdlib_Intl_Collator.res 178,667 181,920 +1.82%
packages/@rescript/runtime/Stdlib_Intl_RelativeTimeFormat.res 180,464 183,717 +1.80%
packages/@rescript/runtime/Stdlib_AsyncIterator.resi 177,818 180,988 +1.78%
packages/@rescript/belt/src/Belt_Float.res 165,048 167,947 +1.76%
packages/@rescript/belt/src/Belt_Int.res 165,790 168,689 +1.75%
packages/@rescript/runtime/Stdlib_JsError.resi 184,968 188,138 +1.71%
packages/@rescript/runtime/Stdlib_BigInt.resi 186,569 189,739 +1.70%
packages/@rescript/runtime/Primitive_array.res 191,984 195,237 +1.69%
packages/@rescript/belt/src/Belt_internalBucketsType.resi 164,724 167,506 +1.69%
packages/@rescript/runtime/Stdlib_RegExp.resi 187,800 190,970 +1.69%
packages/@rescript/belt/src/Belt_MutableStack.resi 169,281 172,063 +1.64%
packages/@rescript/runtime/Stdlib_Intl_Locale.res 198,068 201,321 +1.64%
packages/@rescript/runtime/Stdlib_Generator.res 200,286 203,573 +1.64%
packages/@rescript/belt/src/Belt_SortArrayString.resi 169,577 172,359 +1.64%
packages/@rescript/belt/src/Belt_SortArrayInt.resi 169,695 172,477 +1.64%
packages/@rescript/runtime/Primitive_exceptions.res 201,232 204,519 +1.63%
packages/@rescript/runtime/Stdlib_Type.res 201,438 204,725 +1.63%
packages/@rescript/runtime/Stdlib_Float.resi 194,292 197,462 +1.63%
packages/@rescript/runtime/Primitive_list.res 203,745 207,032 +1.61%
packages/@rescript/runtime/Stdlib_Intl_PluralRules.res 201,889 205,142 +1.61%
packages/@rescript/runtime/Stdlib_Map.res 205,648 208,935 +1.60%
packages/@rescript/runtime/Stdlib_Nullable.resi 199,672 202,842 +1.59%
packages/@rescript/runtime/Stdlib_BigInt.res 207,074 210,361 +1.59%
packages/@rescript/belt/src/Belt_HashSetString.resi 175,553 178,335 +1.58%
packages/@rescript/belt/src/Belt_HashSetInt.resi 175,666 178,448 +1.58%
packages/@rescript/belt/src/Belt_Range.resi 176,657 179,439 +1.57%
packages/@rescript/runtime/Stdlib_Set.res 210,990 214,277 +1.56%
packages/@rescript/runtime/Stdlib_AsyncGenerator.res 211,156 214,443 +1.56%
packages/@rescript/runtime/Stdlib_Null.resi 204,431 207,601 +1.55%
packages/@rescript/runtime/Stdlib_Int.resi 206,103 209,273 +1.54%
packages/@rescript/belt/src/Belt.res 187,948 190,813 +1.52%
packages/@rescript/runtime/Stdlib_Float.res 218,863 222,150 +1.50%
packages/@rescript/runtime/Stdlib_Lazy.res 221,184 224,471 +1.49%
packages/@rescript/runtime/Stdlib_Map.resi 217,108 220,278 +1.46%
packages/@rescript/runtime/Stdlib_Temporal.res 223,963 227,216 +1.45%
packages/@rescript/runtime/Stdlib_AsyncIterableIterator.res 228,325 231,612 +1.44%
packages/@rescript/belt/src/Belt_internalSetBuckets.resi 194,250 197,032 +1.43%
packages/@rescript/runtime/Stdlib_JsError.res 229,751 233,038 +1.43%
packages/@rescript/runtime/Stdlib_DataView.res 230,306 233,593 +1.43%
packages/@rescript/runtime/Stdlib_Iterator.res 234,922 238,209 +1.40%
packages/@rescript/runtime/Stdlib_Set.resi 228,953 232,123 +1.38%
packages/@rescript/runtime/Pervasives.res 239,805 243,058 +1.36%
packages/@rescript/runtime/Primitive_js_extern.res 239,834 243,087 +1.36%
packages/@rescript/runtime/Stdlib_IteratorObject.resi 234,376 237,546 +1.35%
packages/@rescript/belt/src/Belt_MutableQueue.resi 207,326 210,108 +1.34%
packages/@rescript/runtime/Stdlib_Option.resi 236,507 239,677 +1.34%
packages/@rescript/runtime/Stdlib_JSON.resi 237,027 240,197 +1.34%
packages/@rescript/runtime/Stdlib_Dict.resi 240,779 243,949 +1.32%
packages/@rescript/runtime/Stdlib_Object.res 247,331 250,584 +1.32%
packages/@rescript/runtime/Stdlib_IteratorObject.res 250,722 254,009 +1.31%
packages/@rescript/belt/src/Belt_HashMapString.resi 213,714 216,496 +1.30%
packages/@rescript/belt/src/Belt_HashMapInt.resi 213,828 216,610 +1.30%
packages/@rescript/belt/src/Belt_HashSet.resi 222,778 225,560 +1.25%
packages/@rescript/belt/src/Belt_internalBuckets.resi 223,042 225,824 +1.25%
packages/@rescript/runtime/Stdlib_Temporal_PlainMonthDay.res 268,246 271,499 +1.21%
packages/@rescript/runtime/Stdlib_DataView.resi 268,044 271,214 +1.18%
packages/@rescript/runtime/RescriptTools_Docgen.resi 273,524 276,694 +1.16%
packages/@rescript/belt/src/Belt_Result.resi 240,168 242,950 +1.16%
packages/@rescript/runtime/RescriptTools_Docgen.res 283,791 287,078 +1.16%
packages/@rescript/belt/src/Belt_Option.resi 243,374 246,156 +1.14%
packages/@rescript/runtime/Stdlib_AsyncIterator.res 294,756 298,043 +1.12%
packages/@rescript/runtime/Stdlib_JSON.res 296,903 300,190 +1.11%
packages/@rescript/runtime/Primitive_option.res 297,411 300,698 +1.11%
packages/@rescript/belt/src/Belt_SortArray.resi 253,942 256,724 +1.10%
packages/@rescript/belt/src/Belt_SetString.resi 259,922 262,704 +1.07%
packages/@rescript/belt/src/Belt_SetInt.resi 260,049 262,831 +1.07%
packages/@rescript/runtime/Stdlib_Result.resi 296,377 299,547 +1.07%
packages/@rescript/belt/src/Belt_Id.resi 260,286 263,068 +1.07%
packages/@rescript/runtime/Stdlib_Temporal_Instant.res 307,599 310,852 +1.06%
packages/@rescript/belt/src/Belt_MutableSetString.resi 264,996 267,778 +1.05%
packages/@rescript/belt/src/Belt_MutableSetInt.resi 265,113 267,895 +1.05%
packages/@rescript/runtime/Stdlib_Dict.res 320,111 323,398 +1.03%
packages/@rescript/runtime/Stdlib_Temporal_PlainTime.res 320,257 323,510 +1.02%
packages/@rescript/belt/src/Belt_Range.res 288,346 291,245 +1.01%
packages/@rescript/runtime/Stdlib_Math.res 327,556 330,843 +1.00%
packages/@rescript/belt/src/Belt_Id.res 289,887 292,786 +1.00%
packages/@rescript/runtime/Stdlib_Nullable.res 329,857 333,144 +1.00%
packages/@rescript/belt/src/Belt_internalBucketsType.res 291,615 294,514 +0.99%
packages/@rescript/runtime/Stdlib_Null.res 332,359 335,646 +0.99%
packages/@rescript/runtime/Primitive_module.res 337,540 340,827 +0.97%
packages/@rescript/runtime/Stdlib_Math.resi 328,324 331,494 +0.97%
packages/@rescript/runtime/Stdlib_Int8Array.res 343,494 346,747 +0.95%
packages/@rescript/runtime/Stdlib_Uint8Array.res 343,507 346,760 +0.95%
packages/@rescript/runtime/Stdlib_Float32Array.res 343,614 346,867 +0.95%
packages/@rescript/runtime/Stdlib_Float64Array.res 343,614 346,867 +0.95%
packages/@rescript/runtime/Stdlib_Int16Array.res 343,639 346,892 +0.95%
packages/@rescript/runtime/Stdlib_Int32Array.res 343,641 346,894 +0.95%
packages/@rescript/runtime/Stdlib_Uint16Array.res 343,646 346,899 +0.95%
packages/@rescript/runtime/Stdlib_Uint32Array.res 343,646 346,899 +0.95%
packages/@rescript/runtime/Stdlib_BigInt64Array.res 343,671 346,924 +0.95%
packages/@rescript/runtime/Stdlib_BigUint64Array.res 343,748 347,001 +0.95%
packages/@rescript/runtime/Stdlib_Uint8ClampedArray.res 344,022 347,275 +0.95%
packages/@rescript/belt/src/Belt_HashMap.resi 296,908 299,690 +0.94%
packages/@rescript/runtime/Stdlib_Promise.res 352,778 356,065 +0.93%
packages/@rescript/runtime/Stdlib_Promise.resi 356,017 359,187 +0.89%
packages/@rescript/runtime/Stdlib_Console.res 370,179 373,466 +0.89%
packages/@rescript/runtime/Stdlib_Temporal_Common.res 366,668 369,921 +0.89%
packages/@rescript/belt/src/Belt_MutableMapString.resi 314,993 317,775 +0.88%
packages/@rescript/belt/src/Belt_MutableMapInt.resi 315,111 317,893 +0.88%
packages/@rescript/runtime/Stdlib_Temporal_Duration.res 373,600 376,853 +0.87%
packages/@rescript/runtime/Stdlib_Temporal_PlainYearMonth.res 382,285 385,538 +0.85%
packages/@rescript/runtime/Stdlib_Intl_DateTimeFormat.res 389,599 392,852 +0.83%
packages/@rescript/runtime/Stdlib_Temporal_PlainDate.res 403,907 407,160 +0.81%
packages/@rescript/runtime/Stdlib_Intl_NumberFormat.res 404,810 408,063 +0.80%
packages/@rescript/belt/src/Belt_internalAVLset.resi 354,869 357,651 +0.78%
packages/@rescript/runtime/Stdlib_List.resi 409,863 413,033 +0.77%
packages/@rescript/runtime/Stdlib_Console.resi 411,610 414,780 +0.77%
packages/@rescript/belt/src/Belt_MutableStack.res 387,514 390,413 +0.75%
packages/@rescript/belt/src/Belt_Option.res 389,121 392,020 +0.75%
packages/@rescript/runtime/Stdlib_Temporal_PlainDateTime.res 438,194 441,447 +0.74%
packages/@rescript/runtime/Stdlib_Int.res 455,336 458,623 +0.72%
packages/@rescript/belt/src/Belt_MapString.resi 391,308 394,090 +0.71%
packages/@rescript/belt/src/Belt_MapInt.resi 391,351 394,133 +0.71%
packages/@rescript/belt/src/Belt_Result.res 409,437 412,336 +0.71%
packages/@rescript/belt/src/Belt_MutableMap.resi 395,444 398,226 +0.70%
packages/@rescript/belt/src/Belt_MutableSet.resi 397,546 400,328 +0.70%
packages/@rescript/belt/src/Belt_SetDict.resi 402,680 405,462 +0.69%
packages/@rescript/runtime/Stdlib_String.res 503,934 507,221 +0.65%
packages/@rescript/runtime/Stdlib_String.resi 497,477 500,647 +0.64%
packages/@rescript/belt/src/Belt_Set.resi 437,438 440,220 +0.64%
packages/@rescript/belt/src/Belt_internalAVLtree.resi 452,423 455,205 +0.61%
packages/@rescript/runtime/Stdlib_Date.res 551,778 555,065 +0.60%
packages/@rescript/runtime/Stdlib_Temporal_ZonedDateTime.res 574,181 577,434 +0.57%
packages/@rescript/belt/src/Belt_MapDict.resi 513,298 516,080 +0.54%
packages/@rescript/runtime/Stdlib_Date.resi 614,248 617,418 +0.52%
packages/@rescript/belt/src/Belt_Map.resi 579,471 582,271 +0.48%
packages/@rescript/runtime/Stdlib_Option.res 753,633 756,920 +0.44%
packages/@rescript/runtime/Stdlib_Array.resi 728,603 731,773 +0.44%
packages/@rescript/belt/src/Belt_Array.resi 650,336 653,118 +0.43%
packages/@rescript/belt/src/Belt_internalSetBuckets.res 699,079 702,050 +0.42%
packages/@rescript/runtime/Stdlib_TypedArray.res 785,351 788,604 +0.41%
packages/@rescript/belt/src/Belt_internalSetInt.res 730,723 733,588 +0.39%
packages/@rescript/belt/src/Belt_internalSetString.res 731,914 734,779 +0.39%
packages/@rescript/belt/src/Belt_List.resi 758,744 761,526 +0.37%
packages/@rescript/belt/src/Belt_MutableQueue.res 791,334 794,231 +0.37%
packages/@rescript/belt/src/Belt_Set.res 857,946 860,933 +0.35%
packages/@rescript/belt/src/Belt_HashSetInt.res 850,520 853,419 +0.34%
packages/@rescript/runtime/Primitive_hash.res 964,614 967,901 +0.34%
packages/@rescript/belt/src/Belt_HashSetString.res 850,837 853,736 +0.34%
packages/@rescript/runtime/Stdlib.res 980,476 983,729 +0.33%
packages/@rescript/runtime/Dom.res 1,071,712 1,074,967 +0.30%
packages/@rescript/belt/src/Belt_internalBuckets.res 966,624 969,523 +0.30%
packages/@rescript/belt/src/Belt_HashSet.res 978,208 981,107 +0.30%
packages/@rescript/runtime/JsxEvent.res 1,090,874 1,094,100 +0.30%
packages/@rescript/belt/src/Belt_Map.res 981,236 984,135 +0.30%
packages/@rescript/runtime/Primitive_object.res 1,154,866 1,158,149 +0.28%
packages/@rescript/belt/src/Belt_HashMapInt.res 1,060,707 1,063,606 +0.27%
packages/@rescript/belt/src/Belt_HashMapString.res 1,061,419 1,064,318 +0.27%
packages/@rescript/runtime/Stdlib_Result.res 1,268,255 1,271,542 +0.26%
packages/@rescript/runtime/Stdlib_Array.res 1,281,101 1,284,388 +0.26%
packages/@rescript/belt/src/Belt_MutableMapString.res 1,155,019 1,157,922 +0.25%
packages/@rescript/belt/src/Belt_MutableMapInt.res 1,154,742 1,157,641 +0.25%
packages/@rescript/belt/src/Belt_MapInt.res 1,181,363 1,184,266 +0.25%
packages/@rescript/belt/src/Belt_MapString.res 1,181,899 1,184,798 +0.25%
packages/@rescript/belt/src/Belt_HashMap.res 1,200,049 1,202,950 +0.24%
packages/@rescript/belt/src/Belt_SetInt.res 1,289,624 1,292,527 +0.23%
packages/@rescript/belt/src/Belt_SetString.res 1,290,353 1,293,252 +0.22%
packages/@rescript/belt/src/Belt_MutableMap.res 1,302,290 1,305,195 +0.22%
packages/@rescript/belt/src/Belt_SortArrayString.res 1,344,225 1,347,124 +0.22%
packages/@rescript/belt/src/Belt_SortArrayInt.res 1,342,429 1,345,322 +0.22%
packages/@rescript/belt/src/Belt_SetDict.res 1,445,985 1,448,882 +0.20%
packages/@rescript/belt/src/Belt_SortArray.res 1,447,582 1,450,475 +0.20%
packages/@rescript/belt/src/Belt_MapDict.res 1,630,823 1,633,718 +0.18%
packages/@rescript/belt/src/Belt_MutableSetInt.res 1,664,555 1,667,455 +0.17%
packages/@rescript/belt/src/Belt_MutableSetString.res 1,665,801 1,668,698 +0.17%
packages/@rescript/runtime/JsxDOMStyle.res 1,935,499 1,938,752 +0.17%
packages/@rescript/belt/src/Belt_MutableSet.res 1,902,475 1,905,372 +0.15%
packages/@rescript/belt/src/Belt_Array.res 2,154,235 2,157,201 +0.14%
parse/RedBlackTreeNoComments.res 355,139 355,577 +0.12%
packages/@rescript/runtime/JsxDOM.res 2,663,753 2,667,006 +0.12%
parse/RedBlackTree.res 362,852 363,290 +0.12%
build/WideDeps/clean 371,078,043 370,698,445 -0.10%

Instructions

In total: 9,221,526,116 → 9,223,080,191 (+0.02%).

Benchmark Base Head Change
packages/@rescript/runtime/Stdlib_Math.resi 21,302,587 21,349,376 +0.22%
packages/@rescript/runtime/Stdlib_Temporal_PlainDateTime.res 25,532,820 25,586,059 +0.21%
packages/@rescript/runtime/Stdlib_List.resi 24,530,150 24,575,952 +0.19%
packages/@rescript/runtime/Stdlib_Temporal_ZonedDateTime.res 31,201,980 31,257,538 +0.18%
packages/@rescript/runtime/JsxDOMStyle.res 95,098,057 95,247,866 +0.16%
packages/@rescript/runtime/Stdlib_Temporal_PlainDate.res 24,094,163 24,130,889 +0.15%
packages/@rescript/runtime/Stdlib_Date.resi 34,299,185 34,350,947 +0.15%
packages/@rescript/runtime/Stdlib_String.resi 29,455,576 29,498,920 +0.15%
packages/@rescript/runtime/Stdlib_TypedArray.res 41,313,613 41,364,803 +0.12%
parse/RedBlackTreeNoComments.res 14,491,077 14,507,803 +0.12%
2 more changes
Benchmark Base Head Change
packages/@rescript/belt/src/Belt_List.resi 38,988,840 39,030,859 +0.11%
packages/@rescript/belt/src/Belt_Array.resi 33,720,378 33,756,341 +0.11%

Output size

In total: 25,962,507 → 25,962,510 (±0.00%).

None of the 13 benchmarks changed by 0.1% or more.

Pull request 2d64e4d compared with base b69618a in this run.

@codecov

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.61905% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.29%. Comparing base (b71a28a) to head (2d64e4d).

Files with missing lines Patch % Lines
compiler/driver/compile_request.ml 94.17% 24 Missing ⚠️
compiler/driver/rescript_compiler_driver.ml 64.51% 11 Missing ⚠️
compiler/backend/js_packages_info.ml 70.58% 5 Missing ⚠️
tests/ounit_tests/ounit_compile_request_tests.ml 93.44% 4 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                     @@
##           validate-compiler-flags    #9306      +/-   ##
===========================================================
+ Coverage                    82.20%   82.29%   +0.08%     
===========================================================
  Files                          460      461       +1     
  Lines                        65563    65906     +343     
===========================================================
+ Hits                         53898    54238     +340     
- Misses                       11665    11668       +3     
Files with missing lines Coverage Δ
compiler/backend/bsc_args.ml 100.00% <100.00%> (+21.42%) ⬆️
compiler/backend/js_packages_state.ml 80.00% <100.00%> (+3.52%) ⬆️
compiler/typing/js_config.ml 88.88% <ø> (+7.07%) ⬆️
tests/ounit_tests/ounit_tests_main.ml 100.00% <ø> (ø)
tests/ounit_tests/ounit_compile_request_tests.ml 93.44% <93.44%> (ø)
compiler/backend/js_packages_info.ml 79.24% <70.58%> (+5.33%) ⬆️
compiler/driver/rescript_compiler_driver.ml 72.10% <64.51%> (-7.69%) ⬇️
compiler/driver/compile_request.ml 94.17% <94.17%> (ø)

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cknitt
cknitt force-pushed the compile-request branch 2 times, most recently from 2055f91 to daafede Compare November 20, 2026 21:26
@pkg-pr-new

pkg-pr-new Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

rescript

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

@rescript/belt

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

@rescript/darwin-arm64

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

@rescript/linux-arm64

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

@rescript/linux-x64

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

@rescript/runtime

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

@rescript/win32-x64

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

commit: 2d64e4d

Why:
    bsc's flags set global compiler state as they were parsed, so the only
    way to describe a compile was a list of strings. Compile_request is that
    description as a record: of_argv reads the flags into it, to_argv
    writes them back, and apply sets the request's state from it. bsc's
    command line and a file's @@config flags go through it now; the build
    system can build the record directly in a next step (#9303).

    Each flag has a kind: Build_system, Public, Debug or Command. The
    record holds what the flags gave, so @@config is applied on top of the
    command line as before. A round-trip test reads every flag back from
    to_argv. Bsc_args keeps only the usage text and its exceptions; its
    old parser and Ext_spec are removed.

Diagnostic added (invalid flag values):
Example:
    bsc -color red -enable-experimental Unknown A.res
Before (diagnostic):
    (the values were ignored)
After (diagnostic):
    Unsupported color setting: red

Other differences, all on bsc's command line: commands such as -format
and -e run after every flag is read, not at their position; the namespace
of -bs-ns is opened before the -open modules, as the build system passes
it anyway; an invalid @@config flag applies none of the file's flags.

Part of #9303

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gHAzsdStoCEpBgx2tS
Signed-off-by: Christoph Knittel <ck@cca.io>

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.

1 participant