-
Notifications
You must be signed in to change notification settings - Fork 588
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
SdkAssemblyResolver: Use dotnet --version to resolve the correct SDK #2665
SdkAssemblyResolver: Use dotnet --version to resolve the correct SDK #2665
Conversation
Looks like this may fix #2648 as well. |
@yazeedobaid Any idea when someone might be able to take a look at this PR? I logged this issue over a month ago and a proposed fix over a week ago. We have several projects using FAKE in my organization and #2641 is causing a fair amount of headaches with our build agents. |
@mclark1129 Thanks for the PR and sorry for the later response. Can you please confirm/add tests for cases in which if DotNet host is using for example v5 then what output will be? Also, why not provide the two options? From a |
@yazeedobaid No problem, just want to help out getting this issue resolved! As far as I understand it, the current code would not allow an SDK other than 6 to resolve its runtime, due to
Since this filters out only releases with a product version of
The issue is that trying to manually read from the global.json doesn't contain enough logic to properly resolve an appropriate local SDK. By using I'll confirm the output in the event only .NET 5 or lower is installed, and add test cases. I'm also happy to clean up a bit more in that area (boyscout rule) to help ensure the appropriate error messages are returned with resolution fails. I didn't want to come in with my first PR changing everything around without asking first :). |
@mclark1129 Thanks a lot |
48031e6
to
dfcce1e
Compare
@yazeedobaid I've cleaned this up, and I'm overall happy with the solution. However when writing an integration test for rollForward and found another issue here https://github.com/fsprojects/FAKE/blob/release/next/src/app/Fake.DotNet.Cli/DotNet.fs#L666 This code blows up if the global.json SDK doesn't match exactly, which prevents us from using rollForward at all. This doesn't make sense to me, it seems as if we are fighting against the framework itself. If a user wanted to force an exact match of an SDK in their build, they could do so by specifying On a related note, the whole exercise makes me question why we are doing any of this custom resolution at all. Seems like we could just use Currently my integration does not pass due to the issue outlined above, there is also an unrelated Nuget Unit Test failing because it looks like the underlying nuget repo is returning different results from before. I believe this was failing on the previous PR as well. Let me know what you'd like me to do, but I think we need to remove the error in the DotNet module in order for this solution to move forward. |
dfcce1e
to
aef36f0
Compare
@yazeedobaid I went ahead and removed the global.json check. As far as I can tell, all tests are passing with the exception of the |
@mclark1129 if you could help in fixing that failing test that would be great. Thanks! |
aef36f0
to
d4535d7
Compare
@yazeedobaid I fixed the failing NuGet test and then ran into another issue with Anyways, |
@yazeedobaid TIL I learned how to run the checks from my forked repo! 🚀 There is at least one test still failing due to the fact that |
@yazeedobaid Ok I have a green run on my fork https://github.com/mclark1129/FAKE/pull/1/checks, would you mind re-running the workflow when you're available? |
Thanks a lot for the PR. |
@yazeedobaid If you can cut a pre-release first I can pull it in and test it out on our builds. |
@mclark1129 It seems the build is failing on macOS. Could you please check? |
Description
This PR updates the
SdkAssemblyResolver
to usedotnet --info
in order to resolve the most appropriate runtime for a project.If available, link to an existing issue this PR fixes. For example:
TODO
Feel free to open the PR and ask for help
New (API-)documentation for new features exist (Note: API-docs are enough, additional docs are in
help/markdown
)unit or integration test exists (or short reasoning why it doesn't make sense)
boy scout rule: "leave the code behind in a better state than you found it" (fix warnings, obsolete members or code-style in the places you worked in)
(if new module) the module has been linked from the "Modules" menu, edit
help/templates/template.cshtml
, linking to the API-reference is fine.(if new module) the module is in the correct namespace
[] (if new module) the module is added to Fake.sln (
dotnet sln Fake.sln add src/app/Fake.*/Fake.*.fsproj
)Fake 5 API guideline is honored