-
Notifications
You must be signed in to change notification settings - Fork 793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"#if" directive around nullness removed fromsrc/Compiler/DependencyManager/DependencyProvider.fs and refactored. #18207
base: main
Are you sure you want to change the base?
"#if" directive around nullness removed fromsrc/Compiler/DependencyManager/DependencyProvider.fs and refactored. #18207
Conversation
"#if" directive around nullness removed from src Related: dotnet#18061 (partially addresses) - [x] Release notes entry updated: in `docs/release-notes/.FSharp.Compiler.Service/9.0.200.md`,
❗ Release notes required
|
@@ -122,10 +122,8 @@ type IResolveDependenciesResult = | |||
/// This path is also equivalent to | |||
/// #I @"c:\somepath\to\packages\1.1.1\ResolvedPackage" | |||
abstract Roots: seq<string> | |||
|
|||
#if NO_CHECKNULLS | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The directive is logically negated, i.e. NO_CHECKNULLS.
With SDK 9, we do have null checking support, so the attribute is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some reason project build fails when i remove this,
#if NO_CHECKNULLS [<AllowNullLiteral>] #endif
also btw my machine is too weak to build it so i am using your ci/cd. hope its okay....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@T-Gro it fails with
Restore was successful. Restored /Users/runner/work/1/s/.packages/microsoft.dotnet.arcade.sdk/9.0.0-beta.24623.3/tools/Tools.proj (in 2.25 sec). /Users/runner/work/1/s/src/FSharp.Build/FSharp.Build.fsproj : error NU1503: Skipping restore for project '/Users/runner/work/1/s/src/FSharp.Build/FSharp.Build.fsproj'. The project file may be invalid or missing targets required for restore. [/Users/runner/work/1/s/FSharp.sln] ##[error]src/FSharp.Build/FSharp.Build.fsproj(0,0): error NU1503: (NETCORE_ENGINEERING_TELEMETRY=Restore) Skipping restore for project '/Users/runner/work/1/s/src/FSharp.Build/FSharp.Build.fsproj'. The project file may be invalid or missing targets required for restore. /Users/runner/work/1/s/tests/service/data/TestTP/TestTP.fsproj : error NU1503: Skipping restore for project '/Users/runner/work/1/s/tests/service/data/TestTP/TestTP.fsproj'. The project file may be invalid or missing targets required for restore. [/Users/runner/work/1/s/FSharp.sln] ##[error]tests/service/data/TestTP/TestTP.fsproj(0,0): error NU1503: (NETCORE_ENGINEERING_TELEMETRY=Restore) Skipping restore for project '/Users/runner/work/1/s/tests/service/data/TestTP/TestTP.fsproj'. The project file may be invalid or missing targets required for restore. /Users/runner/work/1/s/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj : error NU1503: Skipping restore for project '/Users/runner/work/1/s/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj'. The project file may be invalid or missing targets required for restore. [/Users/runner/work/1/s/FSharp.sln] ##[error]tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj(0,0): error NU1503: (NETCORE_ENGINEERING_TELEMETRY=Restore) Skipping restore for project '/Users/runner/work/1/s/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj'. The project file may be invalid or missing targets required for restore. /Users/runner/work/1/s/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj : error NU1503: Skipping restore for project '/Users/runner/work/1/s/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj'. The project file may be invalid or missing targets required for restore. [/Users/runner/work/1/s/FSharp.sln] ##[error]tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj(0,0): error NU1503: (NETCORE_ENGINEERING_TELEMETRY=Restore) Skipping restore for project '/Users/runner/work/1/s/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj'. The project file may be invalid or missing targets required for restore. /Users/runner/work/1/s/tests/benchmarks/FSharp.Benchmarks.Common/FSharp.Benchmarks.Common.fsproj : error NU1503: Skipping restore for project '/Users/runner/work/1/s/tests/benchmarks/FSharp.Benchmarks.Common/FSharp.Benchmarks.Common.fsproj'. The project file may be invalid or missing targets required for restore. [/Users/runner/work/1/s/FSharp.sln] ##[error]tests/benchmarks/FSharp.Benchmarks.Common/FSharp.Benchmarks.Common.fsproj(0,0): error NU1503: (NETCORE_ENGINEERING_TELEMETRY=Restore) Skipping restore for project '/Users/runner/work/1/s/tests/benchmarks/FSharp.Benchmarks.Common/FSharp.Benchmarks.Common.fsproj'. The project file may be invalid or missing targets required for restore. Determining projects to restore... /Users/runner/work/1/s/src/FSharp.Core/FSharp.Core.fsproj : error MSB4057: The target "_GetRestoreSettingsPerFramework" does not exist in the project. [TargetFramework=netstandard2.0] ##[error]src/FSharp.Core/FSharp.Core.fsproj(0,0): error MSB4057: (NETCORE_ENGINEERING_TELEMETRY=Restore) The target "_GetRestoreSettingsPerFramework" does not exist in the project. /Users/runner/work/1/s/src/fsc/fscProject/fsc.fsproj : error MSB4057: The target "_GetRestoreSettingsPerFramework" does not exist in the project. [TargetFramework=net9.0] ##[error]src/fsc/fscProject/fsc.fsproj(0,0): error MSB4057: (NETCORE_ENGINEERING_TELEMETRY=Restore) The target "_GetRestoreSettingsPerFramework" does not exist in the project. /Users/runner/work/1/s/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj : error MSB4057: The target "_GetRestoreSettingsPerFramework" does not exist in the project. [TargetFramework=netstandard2.0] ##[error]src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj(0,0): error MSB4057: (NETCORE_ENGINEERING_TELEMETRY=Restore) The target "_GetRestoreSettingsPerFramework" does not exist in the project. /Users/runner/work/1/s/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj : error MSB4057: The target "_GetRestoreSettingsPerFramework" does not exist in the project. [TargetFramework=net9.0] ##[error]tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj(0,0): error MSB4057: (NETCORE_ENGINEERING_TELEMETRY=Restore) The target "_GetRestoreSettingsPerFramework" does not exist in the project. /Users/runner/work/1/s/tests/fsharp/FSharpSuite.Tests.fsproj : error MSB4057: The target "_GetRestoreSettingsPerFramework" does not exist in the project. [TargetFramework=net9.0] ##[error]tests/fsharp/FSharpSuite.Tests.fsproj(0,0): error MSB4057: (NETCORE_ENGINEERING_TELEMETRY=Restore) The target "_GetRestoreSettingsPerFramework" does not exist in the project. /Users/runner/work/1/s/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj : error MSB4057: The target "_GetRestoreSettingsPerFramework" does not exist in the project. [TargetFramework=net9.0] ##[error]tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj(0,0): error MSB4057: (NETCORE_ENGINEERING_TELEMETRY=Restore) The target "_GetRestoreSettingsPerFramework" does not exist in the project. /Users/runner/work/1/s/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj : error MSB4057: The target "_GetRestoreSettingsPerFramework" does not exist in the project. [TargetFramework=net9.0] ##[error]tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj(0,0): error MSB4057: (NETCORE_ENGINEERING_TELEMETRY=Restore) The target "_GetRestoreSettingsPerFramework" does not exist in the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my guess is it has something to makefiles or buildscripts or whatever f# equivalent there is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git checkout cf575d3
bfbca20
to
cf575d3
Compare
/run fantomas |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Failed to run fantomas: https://github.com/dotnet/fsharp/actions/runs/12667153205 |
@@ -160,15 +160,15 @@ type ReflectionDependencyManagerProvider | |||
|
|||
let instance = | |||
if not (isNull (theType.GetConstructor([| typeof<string option>; typeof<bool> |]))) then | |||
Activator.CreateInstance(theType, [| outputDir :> objnull; useResultsCache :> objnull |]) | |||
Activator.CreateInstance(theType, [| outputDir :> obj | null; useResultsCache :> obj | null |]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
objnull
is an alias which became part of the public API of FSharp.Core -> that one can remain.
It is just an alias to obj|null, both are fine.
Does "dotnet fantomas ." fail for you locally as well? |
I guess the changed files must temporarily be put into the nullness section of .fantomasignore until fantomas 7 is out. |
So I took a look:
(fyi @nojaf) So I think @progressive-galib the best we can do here is to revert formatting changes (and also the ones which are deemed not necessary by @T-Gro) and put the DependencyProvider to the .fantomasignore. Sorry for the inconvenience here, nulls shook the F# ecosystem a bit. Other files might cause less problems :) |
Hi, Could you try the latest beta maybe? That has initial support for all the nullness stuff: https://www.nuget.org/packages/fantomas/7.0.0-beta-001 You PR here will need to be ignored (via .fantomasignore) as it seems to have nullness syntax. |
I think it behaves differently and does some changes, but eventually the beta also throws SO :/ |
@psfinaki could you share some more details? Latest beta worked for me on this branch. |
could you push cause it fails on my machine. |
You need to ignore the file for now. |
Description
"#if" directive around nullness removed fromsrc/Compiler/DependencyManager/DependencyProvider.fs and refactored.
Related: #18061 (partially addresses)
Checklist
docs/release-notes/.FSharp.Compiler.Service/9.0.200.md
,