Skip to content

Fix #8509: warn and ignore --simpleresolution on .NET Core#19914

Open
T-Gro wants to merge 5 commits into
mainfrom
fix/issue-8509
Open

Fix #8509: warn and ignore --simpleresolution on .NET Core#19914
T-Gro wants to merge 5 commits into
mainfrom
fix/issue-8509

Conversation

@T-Gro

@T-Gro T-Gro commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

On .NET Core, --simpleresolution caused the resolver to search for .NET Framework assemblies (mscorlib, System.dll, etc.) in non-existent directory layouts, producing a flood of misleading FS0078 errors.

Changes

  • Gate on runtime: When running on .NET Core, emit a single FS3888 warning and skip the useSimpleResolution assignment. Desktop fsc is unchanged.
  • New diagnostic: Added optsSimpleresolutionIgnoredOnNetCore (FS3888) to FSComp.txt and all xlf files.
  • Tests: Added component tests verifying that on .NET Core, --simpleresolution produces a single FS3888 warning and does not produce FS0078 errors.

Fixes

Fixes #8509

Copilot and others added 3 commits June 9, 2026 08:21
These tests assert the post-fix behaviour: on .NET Core, --simpleresolution must be ignored with a single FS3888 warning instead of producing FS0078 file-not-found errors for .NET Framework assemblies. They are expected to fail on main until the fix in CompilerOptions.fs lands.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
On .NET Core, --simpleresolution caused the resolver to search for .NET Framework assemblies (mscorlib, System.dll, System.Windows.Forms, ...) in non-existent directory layouts, producing a flood of misleading FS0078 errors. Gate the handler on FSharpEnvironment.isRunningOnCoreClr: when running on .NET Core, emit a single FS3888 warning and skip the useSimpleResolution assignment. Desktop fsc is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add release-notes entry pointing to #8509 under 11.0.100.md.

- Correct the Include path casing for the new simpleresolution test file

  in FSharp.Compiler.ComponentTests.fsproj (Fsc, not fsc) so the build

  resolves on case-sensitive filesystems (Linux CI).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

✅ No release notes required

The fix on this branch (commits a101d85, 8594cb9, 80adf32, 61636cf)
warned and ignored --simpleresolution on .NET Core. Two problems make
the change unshippable:

1. Microsoft.FSharp.NetSdk.targets sets <SimpleResolution>true</> by
   default, so every `dotnet build` of an F# project passes
   --simpleresolution. The new warning is escalated to `FSC : error
   FS3888` by MSBuild's FscTask, which broke 22/22 CI jobs in
   Azure DevOps build 1455738, including the build of FSharp.Core
   itself.

2. The new `3888,optsSimpleresolutionNotSupportedOnCoreClr` entry was
   inserted in the unsorted `optsXxx` section of FSComp.txt; the next
   numbered entry (1046,...) is smaller than 3888, so
   `src/Compiler/FSCompCheck.fsx` fails with "Error codes not sorted
   in FSComp.txt, break(s) happened after [3888]".

Reverts the production code, FSComp.txt + xlf additions, the new
component tests, the test-project listing change and the release-
notes entry. Issue #8509 remains open - any future fix must avoid
warning on the SDK-driven coreclr code path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

--simpleresolution does something strange on coreclr version of F# compiler.

1 participant