Skip to content

--noRestore flag does not skip MSBuildCracker restores #4527

Closed

Description

@randrag

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:

  1. Have a project with many transitive ProjectReferences
  2. dotnet restore the root project
  3. dotnet fable --noRestore
  4. 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

Activity

  1. github-actions commented on Apr 23, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    This issue has been fixed. PR #4548 (contributed by @randrag and merged by @MangelMaxime on 2026-04-20) adds the --no-restore flag to the MSBuild invocation when --noRestore is passed to Fable, preventing the unwanted restores.

    This issue should be safe to close now. 🎉

    Generated by 🌈 Repo Assist, see workflow run. Learn more.

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@51c8f6ad4357d2ecc06e47120031b3d75e80227d
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions