You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d67eb97
Browse filesBrowse the repository at this point in the historyBrowse files
Guard the tool against printf and test it under Native AOT in CI
printf specializes its formatters at runtime, which a Native AOT build
cannot do, and whether a given format survives depends on what the AOT
compiler happened to generate. The previous commits took printf off the
paths the tool runs; this keeps it off and checks the result.
FANTOMAS-PRINTF-001 reports, at error severity, every function that
takes a printf format and every interpolated string with a hole the
compiler does not lower to String.Concat, in src/Fantomas and
src/Fantomas.Core. It reads the untyped tree and states the lowering of
dotnet/fsharp#19971 itself, because the typed tree comes from the
analyzer SDK's own compiler, which predates it. A test in
Fantomas.Tests checks the same against the compiled assemblies, by
looking for PrintfFormat constructions in their IL. The uses that
remain are ones the tool never reaches, and each is suppressed or
allowed with the reason beside it. Two fallbacks and a DEBUG-only
failwithf are rewritten without printf instead.
The TestAot pipeline publishes the tool with Native AOT for the machine
it runs on and runs Fantomas.Tests against that build. A new CI job runs
it on Linux, Windows and macOS. When FantomasAot is set, the lock files
go under artifacts/obj, so a publish for a runtime identifier no longer
rewrites the checked in ones.
The vendored compiler now comes from the dotnet/fsharp#20658 branch on a
fork, which builds parser diagnostics without printf or runtime
reflection. FCSRepository in Directory.Build.props names the repository
to download from, read through MSBuild, and goes back to dotnet/fsharp
once that pull request is merged.
0 commit comments