Skip to content

Rebuild resource task and FSComp.fs when FCSCommitHash changes - #3553

Merged
nojaf merged 1 commit into
fsprojects:mainfrom
nojaf:fix-3552
Oct 17, 2026
Merged

nojaf merged 1 commit into
fsprojects:mainfrom
nojaf:fix-3552

Conversation

@nojaf

@nojaf nojaf commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

In an existing checkout, a new FCSCommitHash did not reach the generated FSComp.fs. The vendored FSharpEmbedResourceText task was only built when its assembly was missing, and its own up-to-date check compares FSComp.txt with its outputs and nothing else. A generator change upstream, such as dotnet/fsharp#20658 replacing FSharpValue.MakeFunction with String.Format, never reached the checkout. Under Native AOT the old boilerplate fails for every message with an int argument. Fresh clones and CI were not affected.

The task now builds into a folder named after the hash, and the generated FSComp.fs, .fsi and .resx go to one too, so a hash change gives a fresh task and fresh output. The task build gets the hash passed on, so a hash set on the command line builds where Fantomas.FCS looks for it. The UsingTask uses TaskHostFactory, as dotnet/fsharp does, so a reused MSBuild node does not keep the old task loaded or locked.

Closes #3552

In an existing checkout, a new FCSCommitHash did not reach the
generated FSComp.fs. The vendored FSharpEmbedResourceText task was only
built when its assembly was missing, and its own up-to-date check
compares FSComp.txt with its outputs and nothing else. A generator
change upstream, such as dotnet/fsharp#20658 replacing
`FSharpValue.MakeFunction` with `String.Format`, never reached the
checkout. Under Native AOT the old boilerplate fails for every message
with an int argument. Fresh clones and CI were not affected.

The task now builds into a folder named after the hash, and the
generated FSComp.fs, .fsi and .resx go to one too, so a hash change
gives a fresh task and fresh output. The task build gets the hash
passed on, so a hash set on the command line builds where Fantomas.FCS
looks for it. The UsingTask uses TaskHostFactory, as dotnet/fsharp
does, so a reused MSBuild node does not keep the old task loaded or
locked.

Closes fsprojects#3552
@nojaf
nojaf merged commit f734124 into fsprojects:main Oct 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A change to FCSCommitHash does not regenerate FSComp.fs in an existing checkout

1 participant