Semantic Diff

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

1 commit

84940e72bc23ecda4da21f8b5f7f6f43707e78d6..pr-9306

6e04d8ab9 · cknitt + Claude · Nov 14, 2026, 10:11 UTC

Read bsc's flags into a typed compile request

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.

addedDiagnostic invalid flag values

bsc -color red -enable-experimental Unknown A.res
diagnostic
Before
After
(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