Skip to content
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

Update to dotnet 7. #779

Merged
merged 4 commits into from
Nov 17, 2022
Merged

Update to dotnet 7. #779

merged 4 commits into from
Nov 17, 2022

Conversation

nojaf
Copy link
Collaborator

@nojaf nojaf commented Nov 14, 2022

I was able to generate the Fantomas API docs locally with this change.
//cc @dsyme

@nojaf
Copy link
Collaborator Author

nojaf commented Nov 14, 2022

At one point I did see this error on my local machine:

/home/runner/work/FSharp.Formatting/FSharp.Formatting/src/FSharp.Formatting.Common/YaafFSharpScripting.fs:line 144
   at FSharp.Formatting.CodeFormat.CodeFormatter.processSourceCode@345-1.Invoke(StringReader reader) in /home/runner/work/FSharp.Formatting/FSharp.Formatting/src/FSharp.Formatting.CodeFormat/CodeFormatAgent.fs:line 363
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 510
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 112
--- End of stack trace from previous location ---
   at Microsoft.FSharp.Control.AsyncResult`1.Commit() in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 454
   at Microsoft.FSharp.Control.AsyncPrimitives.QueueAsyncAndWaitForResultSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1140
   at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1167
   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1511
   at FSharp.CodeFormat.Tests.getContentAndToolTip(String source) in /home/runner/work/FSharp.Formatting/FSharp.Formatting/tests/FSharp.CodeFormat.Tests/CodeFormatTests.fs:line 124
   at [email protected](String x)
   at FSharp.CodeFormat.Tests.Functions and methods are in spans of 'f' class() in /home/runner/work/FSharp.Formatting/FSharp.Formatting/tests/FSharp.CodeFormat.Tests/CodeFormatTests.fs:line 207
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
  Failed Functions and methods are in spans of 'f' class - custom CSS [3 ms]
  Error Message:
   System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

it is trying to use the legacy resolver for some reason.
Then it went away, but I assume the problem is still there.
Do we need a change for fsChecker.GetProjectOptionsFromScript?

Update net6.0 projects to net7.0
@nojaf
Copy link
Collaborator Author

nojaf commented Nov 15, 2022

I'm not going to claim I fully understand how this works but if you target net6.0 the MSBuild DLLs are not published to the output folder. Using net7.0 they are and the test pass.

The next bottleneck would be getting FAKE to work on net7. (See fsprojects/FAKE#2719)

@nojaf
Copy link
Collaborator Author

nojaf commented Nov 16, 2022

Hello @dsyme, would it be ok if we changed the FAKE script to a project instead?
See docs.
It would resolve the current net7 problem.

@dsyme
Copy link
Contributor

dsyme commented Nov 17, 2022

@nojaf Thanks! this is great

Even better would be to remove the use of FAKE from this core project.

@dsyme dsyme merged commit 62a3057 into fsprojects:main Nov 17, 2022
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.

2 participants