Description
The --noRestore CLI flag is parsed and stored in CrackerOptions.NoRestore, but MSBuildCrackerResolver.mkOptionsFromDesignTimeBuildAux hardcodes /restore in the dotnet msbuild arguments, so the flag has no effect on the MSBuildCracker code path.
This causes sequential per-project restores during the project cracking phase, adding ~20s to compilations for projects with many transitive references (~25 in our case), even when the user passes --noRestore.
Repro code
No F# repro needed — this is a CLI/infrastructure issue. Steps:
- Have a project with many transitive
ProjectReferences
dotnet restore the root project
dotnet fable --noRestore
- Observe that Fable still runs
dotnet msbuild ... /restore for each referenced project during the "Parsing" phase
The /restore is hardcoded at MSBuildCrackerResolver.fs line 146:
let arguments =
$"/restore /t:%s{targets} %s{properties} --getItem:FscCommandLineArgs ..."
options.NoRestore is available on CrackerOptions but never checked.
Expected and actual results
Expected: With --noRestore, the MSBuild design-time build should omit /restore, skipping per-project restores.
Actual: /restore is always included regardless of the flag.
Related information
Description
The
--noRestoreCLI flag is parsed and stored inCrackerOptions.NoRestore, butMSBuildCrackerResolver.mkOptionsFromDesignTimeBuildAuxhardcodes/restorein thedotnet msbuildarguments, so the flag has no effect on the MSBuildCracker code path.This causes sequential per-project restores during the project cracking phase, adding ~20s to compilations for projects with many transitive references (~25 in our case), even when the user passes
--noRestore.Repro code
No F# repro needed — this is a CLI/infrastructure issue. Steps:
ProjectReferencesdotnet restorethe root projectdotnet fable --noRestoredotnet msbuild ... /restorefor each referenced project during the "Parsing" phaseThe
/restoreis hardcoded atMSBuildCrackerResolver.fsline 146:options.NoRestoreis available onCrackerOptionsbut never checked.Expected and actual results
Expected: With
--noRestore, the MSBuild design-time build should omit/restore, skipping per-project restores.Actual:
/restoreis always included regardless of the flag.Related information
4.28.0dotnet restore#2134 (original--noRestorerequest), Rewrite Fable.CLI #3725 (CLI rewrite discussion)