-
Notifications
You must be signed in to change notification settings - Fork 72
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
Retarget everything to .NET 6 #606
Conversation
Extra note: this is a superset of the previous PRs |
Works on my machine, but |
@Numpsy hey, thanks for rebasing this PR. Sorry for being a bit unresponsive the past days, I was on holidays. Seems CI is broken now, can you fix? |
It looks like the nuget package restore is failing on the macOS build (which then causes the Linux build that has got further to be aborted), not sure why that is. |
Saying that, just forced a retry on the build at https://github.com/Numpsy/FSharpLint/actions/runs/6942714944 and it worked, so :-( |
The error looks like the one described at fsprojects/Paket#3767 |
Upgrading paket to v8 doesn't increase reliability? |
I'll give it a go |
It still seems to have a problem with Paket 8, but I did try a run without the storage:symlink setting for the docs at https://github.com/Numpsy/FSharpLint/actions/runs/6948076650 and that one worked |
So let's propose this as a separate PR to increase paket reliability on MacOS CI? |
Ok. |
I've been trying to get everything [building with .NET 6](#606) and the related tooling, and have been getting CI build failures in the macOS builds, with errors that look like those described at fsprojects/Paket#3767 It looks like changing Paket to use 'packages' storage instead of 'symlink' avoids that issue, by putting the restored nuget packages directly into the local packages folder instead of symlinking them. (I don't know much about this Paket feature - the docs suggest its for reducing disk usage by avoid duplicates, which might not really be an issue for the builds?) On a related note, we also have this issue - #578 - where you have to either run the build as admin on windows or set some extra OS options otherwise the package restore will fail. I think this change would avoid that as well. Note: Changing the paket storage to 'none' helped with package restore issue, but caused the 'docs' build to break for me because the Fornax tool couldn't find the libraries, whereas it works when set to 'packages'
Let's rebase this now? |
Let's now remove the Paket update? Since it's not really needed for this PR anymore. |
src/FSharpLint.Core/Rules/Conventions/RaiseWithTooManyArguments/FailwithBadUsage.fs
Outdated
Show resolved
Hide resolved
@Numpsy ? |
I removed the test change to use Paket 8, but the update to 7 was there because the version it currently uses doesn't understand .NET 6/7 and it caused build warnings when updating nuget packages that target those versions |
rebased to resolve conflicts with other CI build definition changes |
Thanks very much! BTW, do you mind if we make the commits a bit clear? For example:
Can you squash 1 with 3 since they both change CI? |
If you don't know how can you merge 2 commits into 1 let me know and I'll be able to help. BTW, now that you'd be doing an interactive rebase, can you also explain (in the commit msg) the paket commands you ran that made changes into the paket.deps and paket.lock files? I'm not a paket expert so every little bit of extra info you could add would be appreciated. |
@knocte, on the paket side, I'd guess the changes were "adjust Sometimes, when I want to be conservative, I use Other times, when I want to see what a "updating everything" does, I just erase a group in the Other time, when I want to update just one dependency, I remove the line form the There are more fine grained commands for handling a specific dependency. |
Ok, I'll do that later (and look at rebasing on top of the 0.21.5 changes at the same time) |
I think that's just what I did for updating the TFMs in paket.dependencies, followed by updates to the FAKE libs and the Test SDK (I don't think there were any updates to the versions of things beyond that). My knowledge of Paket is very slim itself - as I mentioned on the initial post the attempt at updating without any extra settings tried to update things like Microsoft.Build that I didn't want it to (or which don't work), so it needs --keep-patch or similar to restrict what gets updated |
Can you be more specific please, and actually put the info in the commit msg. I want to be able to replicate what you did and see the same diff that your commit has. BTW I'm afraid this needs yet another rebase (as I'm doing many releases in the past days which include merging stuff here and there that touches these files as well, sorry). |
Rebased and updated commit comments. For the record here, the |
Thanks Richard! getting there. Now only 2 things left I think:
|
The approach of merging this work as separate PRs is different than merging a PR with separate commits. I don't prefer the former because each PR needs to have its own goal. However, a PR can have a goal but still be split in different commits with specific sub-goals which, all combined achieve the bigger goal of the PR. And in the latter approach, I prefer that each commit has a green CI status. I've been trying to replicate what you did, with the instructions you provided, in my own branch here (not succeeding yet, so far): https://github.com/knocte/FSharpLint/commits/make_it_all_6/ I will now take your advice about how to update paket (because that's the only difference, I guess, between my branch and yours), and report further. |
I had to rebase everything on top of the changes in #629, and that has also meant that all the changes to the build yaml file are now in one commit. Also added an extra 'Update paket with dotnet tool update paket' to the commit message. |
Ah, that makes more sense! However, to double-check that everything is good now with the commits of your PR, I pushed them one by one, cherry-picking them into a branch of mine, and I'm afraid their intermediate CI statuses are not green. See: https://github.com/knocte/FSharpLint/commits/rw/make_it_all_6/ This means that there are some bits of the commits that depend on each other. To try to make myself understood I'm going to bring a naive example: you're correcting the README.md file in your last commit but that means the README.md file was broken in the commit that changed the name of the workflow; therefore, the changes for that commit should be squashed with the commit that changes the name of the workflow (the one titled "update the CI builds"). The above is just an example because when I say that the "README.md file is broken", what I mean is that it links to a broken link for a CI badge. It's not easy to see/know that it's broken. But CI sometimes can gives us better hints of how something is broken. |
@Numpsy thanks for rebasing again! We're getting closer because now there's only 1 red CI status, see my branch (which is exactly the same as yours, but pushed 1 by 1): https://github.com/knocte/FSharpLint/commits/rw/make_it_all_6/ Shouldn't you just squash the last commit with the previous one, to solve the problem? Another thing to be improved that I find in your commit msg is:
However, if I do the same on my machine, it updates to version 8.0.0, not 7.2.1 like it happened in your PR. Did you forget to append --version flag? |
On another note, I keep trying to replicate what you did, without success: https://github.com/knocte/FSharpLint/commits/updToNet6/ I'm not sure how you fixed the CI issues. And if I can't figure out from the info in your commit msgs, then we need better commit messages. @MrLuje ping? maybe you can help here move this forward? |
No, it's just that the initial PR was done before .NET 8 went RTM, so doing it without specifying an explicit version got 7.x at the time, and might get 8 now. As the only code (rather than build/project) changes were already merged in #636 we could probably just squash the CI and project changes, yes. |
Update fake-cli with dotnet tool update fake-cli to update to the .NET 6 version Update paket with dotnet tool update paket, to get a version with .net 6 support Update Paket restrictions by editing paket.dependencies and changing frameworks to net6.0 Run dotnet paket install --keep-patch to update paket.lock Run dotnet paket update --group build to update FAKE to v6 Update the CI build
Agreed.
Got it. However, I tried to replicate again what you did, this time adding the --version flag when updating paket (to upgrade to the same version you upgraded to) and I still got CI broken. What magic trick did you do in your diff (that you're forgetting to add to the commit message) to make CI pass? This is the branch where I followed your instructions from your commit msg bit by bit: https://github.com/knocte/FSharpLint/commits/replicateNumpsyWork/ And this is the error that CI gets:
Is it maybe that you're forgetting to comment about 2 modifications you did in paket.dependencies? In particular, assigning "strategy" to "min" and/or changing framework: netstandard2.0 to net6.0? You're not commenting anything about that in your commit msg and I doubt that any tool you invoked made those changes. |
There seems to be no way to fix this problem with the tests throwing the below exception about not finding ConfigurationManager assembly (unless we modify the paket.lock file **manually** like we do in this commit): ``` Starting test execution, please wait... A total of 1 test files matched the specified pattern. Failed FunctionalTestConsoleApplication [651 ms] Error Message: Did not find the following expected errors: [`List.fold ( + ) 0 x` might be able to be refactored into `List.sum x`.,`List.head (List.sort x)` might be able to be refactored into `List.min x`.,`a <> true` might be able to be refactored into `not a`.,`fun x -> x` might be able to be refactored into `id`.,`not (a <> b)` might be able to be refactored into `a = b`.,`not (a = b)` might be able to be refactored into `a <> b`.,`not false` might be able to be refactored into `true`.,`not true` might be able to be refactored into `false`.,`x = null` might be able to be refactored into `isNull x`.] Found the following unexpected warnings: [] Complete output: MSBuild could not load the project file /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.NetCore/FSharpLint.FunctionalTest.TestedProject.NetCore.fsproj because: InvalidProjectFileMessage "GenericError ("/home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.NetCore/FSharpLint.FunctionalTest.TestedProject.NetCore.fsproj", "Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)")" Expected and actual are both <Microsoft.FSharp.Collections.FSharpSet`1[System.String]> Values differ at index [0] Missing: < "`List.fold ( + ) 0 x` might be able to be refactored into `List.sum x`.", ... > Stack Trace: at FSharpLint.FunctionalTest.Tests.TestConsoleApplication.FunctionalTestConsoleApplication() in /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest/TestConsoleApplication.fs:line 108 Failed FunctionalTestConsoleApplicationSolution [649 ms] Error Message: Did not find the following expected errors: [`List.fold ( + ) 0 x` might be able to be refactored into `List.sum x`.,`List.head (List.sort x)` might be able to be refactored into `List.min x`.,`a <> true` might be able to be refactored into `not a`.,`fun x -> x` might be able to be refactored into `id`.,`not (a <> b)` might be able to be refactored into `a = b`.,`not (a = b)` might be able to be refactored into `a <> b`.,`not false` might be able to be refactored into `true`.,`not true` might be able to be refactored into `false`.,`x = null` might be able to be refactored into `isNull x`.] Found the following unexpected warnings: [] Complete output: MSBuild could not load the project file /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.MultiTarget/FSharpLint.FunctionalTest.TestedProject.MultiTarget.fsproj because: InvalidProjectFileMessage "GenericError ("/home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.MultiTarget/FSharpLint.FunctionalTest.TestedProject.MultiTarget.fsproj", "Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)")" Expected and actual are both <Microsoft.FSharp.Collections.FSharpSet`1[System.String]> Values differ at index [0] Missing: < "`List.fold ( + ) 0 x` might be able to be refactored into `List.sum x`.", ... > Stack Trace: at FSharpLint.FunctionalTest.Tests.TestConsoleApplication.FunctionalTestConsoleApplicationSolution() in /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest/TestConsoleApplication.fs:line 124 Failed! - Failed: 2, Passed: 8, Skipped: 0, Total: 10, Duration: 7 s - /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest/bin/Release/net6.0/FSharpLint.FunctionalTest.dll (net6.0) ``` And the idea was actually extracted from PR#606 [1] diff. [1] fsprojects#606 Co-authored-by: webwarrior <reg@webwarrior.ws>
The changes to the .net version in paket.dependencies were what the 'editing paket.dependencies and changing frameworks to net6.0' comment in the commit is about (In the case of the Build group, I think because the fake 5 libraries were built as .net standard 2, and the fake 6 libraries are built as .net 6.0). Did you use the --keep-patch flag when doing the paket install? That's supposed to stop it trying to update the libraries to newer versions. |
There seems to be no way to fix this problem with the tests throwing the below exception about not finding ConfigurationManager assembly (unless we modify the paket.lock file **manually** like we do in this commit): ``` Starting test execution, please wait... A total of 1 test files matched the specified pattern. Failed FunctionalTestConsoleApplication [651 ms] Error Message: Did not find the following expected errors: [`List.fold ( + ) 0 x` might be able to be refactored into `List.sum x`.,`List.head (List.sort x)` might be able to be refactored into `List.min x`.,`a <> true` might be able to be refactored into `not a`.,`fun x -> x` might be able to be refactored into `id`.,`not (a <> b)` might be able to be refactored into `a = b`.,`not (a = b)` might be able to be refactored into `a <> b`.,`not false` might be able to be refactored into `true`.,`not true` might be able to be refactored into `false`.,`x = null` might be able to be refactored into `isNull x`.] Found the following unexpected warnings: [] Complete output: MSBuild could not load the project file /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.NetCore/FSharpLint.FunctionalTest.TestedProject.NetCore.fsproj because: InvalidProjectFileMessage "GenericError ("/home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.NetCore/FSharpLint.FunctionalTest.TestedProject.NetCore.fsproj", "Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)")" Expected and actual are both <Microsoft.FSharp.Collections.FSharpSet`1[System.String]> Values differ at index [0] Missing: < "`List.fold ( + ) 0 x` might be able to be refactored into `List.sum x`.", ... > Stack Trace: at FSharpLint.FunctionalTest.Tests.TestConsoleApplication.FunctionalTestConsoleApplication() in /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest/TestConsoleApplication.fs:line 108 Failed FunctionalTestConsoleApplicationSolution [649 ms] Error Message: Did not find the following expected errors: [`List.fold ( + ) 0 x` might be able to be refactored into `List.sum x`.,`List.head (List.sort x)` might be able to be refactored into `List.min x`.,`a <> true` might be able to be refactored into `not a`.,`fun x -> x` might be able to be refactored into `id`.,`not (a <> b)` might be able to be refactored into `a = b`.,`not (a = b)` might be able to be refactored into `a <> b`.,`not false` might be able to be refactored into `true`.,`not true` might be able to be refactored into `false`.,`x = null` might be able to be refactored into `isNull x`.] Found the following unexpected warnings: [] Complete output: MSBuild could not load the project file /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.MultiTarget/FSharpLint.FunctionalTest.TestedProject.MultiTarget.fsproj because: InvalidProjectFileMessage "GenericError ("/home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.MultiTarget/FSharpLint.FunctionalTest.TestedProject.MultiTarget.fsproj", "Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)")" Expected and actual are both <Microsoft.FSharp.Collections.FSharpSet`1[System.String]> Values differ at index [0] Missing: < "`List.fold ( + ) 0 x` might be able to be refactored into `List.sum x`.", ... > Stack Trace: at FSharpLint.FunctionalTest.Tests.TestConsoleApplication.FunctionalTestConsoleApplicationSolution() in /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest/TestConsoleApplication.fs:line 124 Failed! - Failed: 2, Passed: 8, Skipped: 0, Total: 10, Duration: 7 s - /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest/bin/Release/net6.0/FSharpLint.FunctionalTest.dll (net6.0) ``` And the idea was actually extracted from PR#606 [1] diff. [1] fsprojects#606 Co-authored-by: webwarrior <reg@webwarrior.ws>
There seems to be no way to fix this problem with the tests throwing the below exception about not finding ConfigurationManager assembly (unless we modify the paket.lock file **manually** like we do in this commit): ``` Starting test execution, please wait... A total of 1 test files matched the specified pattern. Failed FunctionalTestConsoleApplication [651 ms] Error Message: Did not find the following expected errors: [`List.fold ( + ) 0 x` might be able to be refactored into `List.sum x`.,`List.head (List.sort x)` might be able to be refactored into `List.min x`.,`a <> true` might be able to be refactored into `not a`.,`fun x -> x` might be able to be refactored into `id`.,`not (a <> b)` might be able to be refactored into `a = b`.,`not (a = b)` might be able to be refactored into `a <> b`.,`not false` might be able to be refactored into `true`.,`not true` might be able to be refactored into `false`.,`x = null` might be able to be refactored into `isNull x`.] Found the following unexpected warnings: [] Complete output: MSBuild could not load the project file /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.NetCore/FSharpLint.FunctionalTest.TestedProject.NetCore.fsproj because: InvalidProjectFileMessage "GenericError ("/home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.NetCore/FSharpLint.FunctionalTest.TestedProject.NetCore.fsproj", "Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)")" Expected and actual are both <Microsoft.FSharp.Collections.FSharpSet`1[System.String]> Values differ at index [0] Missing: < "`List.fold ( + ) 0 x` might be able to be refactored into `List.sum x`.", ... > Stack Trace: at FSharpLint.FunctionalTest.Tests.TestConsoleApplication.FunctionalTestConsoleApplication() in /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest/TestConsoleApplication.fs:line 108 Failed FunctionalTestConsoleApplicationSolution [649 ms] Error Message: Did not find the following expected errors: [`List.fold ( + ) 0 x` might be able to be refactored into `List.sum x`.,`List.head (List.sort x)` might be able to be refactored into `List.min x`.,`a <> true` might be able to be refactored into `not a`.,`fun x -> x` might be able to be refactored into `id`.,`not (a <> b)` might be able to be refactored into `a = b`.,`not (a = b)` might be able to be refactored into `a <> b`.,`not false` might be able to be refactored into `true`.,`not true` might be able to be refactored into `false`.,`x = null` might be able to be refactored into `isNull x`.] Found the following unexpected warnings: [] Complete output: MSBuild could not load the project file /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.MultiTarget/FSharpLint.FunctionalTest.TestedProject.MultiTarget.fsproj because: InvalidProjectFileMessage "GenericError ("/home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.MultiTarget/FSharpLint.FunctionalTest.TestedProject.MultiTarget.fsproj", "Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)")" Expected and actual are both <Microsoft.FSharp.Collections.FSharpSet`1[System.String]> Values differ at index [0] Missing: < "`List.fold ( + ) 0 x` might be able to be refactored into `List.sum x`.", ... > Stack Trace: at FSharpLint.FunctionalTest.Tests.TestConsoleApplication.FunctionalTestConsoleApplicationSolution() in /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest/TestConsoleApplication.fs:line 124 Failed! - Failed: 2, Passed: 8, Skipped: 0, Total: 10, Duration: 7 s - /home/runner/work/FSharpLint/FSharpLint/tests/FSharpLint.FunctionalTest/bin/Release/net6.0/FSharpLint.FunctionalTest.dll (net6.0) ``` And the idea was actually extracted from PR#606 [1] diff, so we add him as co-author. [1] fsprojects#606 Co-authored-by: Richard Webb <webby@beardmouse.co.uk>
You're still not explaining what the
Yes I did, since @smoothdeveloper explained it above (very useful thanks Gauthier).
That might be the right way to do it indeed (and maybe this is what you did, since CI in your branch is green), but if you haven't documented it I cannot really accept a PR that changes paket.lock so much without me being able to replicate it (that paket.lock file is a blackbox...). So in the end I've succeeded in, more or less, adopting the work you did here, in this other PR: #655 , which I'm going to merge shortly. Thanks for your work! I added a co-authored git tag to it. |
.NET5 is out of support, and .NET6 is an LTS version. Closes #606 Co-authored-by: Richard Webb <webby@beardmouse.co.uk>
An attempt at updating everything to .NET 6 all at once:
Note: I had to fight with Paket a bit doing the updates as it kept trying to update Microsoft.Build.* to v17.7 (which needs .NET 7, and thus doesn't work) - so I hope the updated paket files are sensible