v2.28.1 - Binary AST CLI fixes
Fixed: compile <file> --target=ast silently compiled to Wasm
An option written after the source file was not parsed at all. The
source-file commands shared a parser built with allowTrailingOptions: false,
so apollovm compile foo.dart --target=ast left the flag sitting in the
leftover positional arguments, --target kept its wasm default, and the
command compiled to WebAssembly without saying that it had ignored anything.
It surfaced as an unrelated Wasm codegen crash — UnimplementedError: Wasm maps with value type dynamic are not supported yet — for a program that was
never meant to reach the Wasm backend. 2.28.0's own compile --help showed
that exact ordering.
Trailing options are now parsed for compile and translate, whose only
positional argument is the source file, so both orderings work. run keeps
them unparsed, because everything after the file there belongs to the program
being executed and must reach it untouched — including arguments that look
like apollovm's own flags.
A leftover positional argument is now reported rather than ignored:
apollovm compile foo.dart oops fails with Unexpected argument after the source file: oops.
compile: target inferred from the output extension, and -t
--output now selects the target when --target is omitted, so naming the
file is enough:
apollovm compile foo.dart -o foo.avma # binary AST
apollovm compile foo.dart -o foo.wasm # WebAssembly.avma means the AST target and .wasm means Wasm; any other extension falls
back to the wasm default as before. An explicit --target always wins, so
-t ast -o out.bin still writes an image under that name. The extension is
read from the final path segment, so a . in a parent directory
(build.v2/out) is not mistaken for it.
--target also gained the abbreviation -t, on both compile and
translate.