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

Add an option to resolve SDK runtime version from a cache file #2630

Conversation

yazeedobaid
Copy link
Collaborator

Description

This PR continues the work done on #2625 which adds functionality to resolve the SDK runtime version for referenced assemblies using the official Dotnet releases package (Microsoft.Deployment.DotNet.Releases). Using this package provides an exact matching runtime version for the specified SDK version from a global.json file. However, as raised in the #2618 issue, this solution has the downside of network restrictions or failure.

This PR attempt to address the downside by caching the releases file and fallback to it when accessing the network is not an option. The solution is as follows:

  1. A new build step CacheDotNetReleases has been added to FAKE's build script to get the releases file and cache it in the file src/app/Fake.Runtime/cachedDotnetSdkReleases.json
  2. The SdkAssemblyResolver.fs will now fallback to that file if the runtime version cannot be resolved from the network for any reason.

For the cached file and the updates on it. Dotnet releases are not very frequent. So updates to this release description are not done frequently. If this file got outdated and accessing the network is not an option, the SdkAssemblyResolver.fs will fail the script with a descriptive message. For this rare case, the solution would be to publish a new release of FAKE that will update the cached file.

Feedback is highly appreciated,

Thanks

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)

    Note: Consider using the CreateProcess API which can be tested more easily, see https://github.com/fsharp/FAKE/pull/2131/files#diff-4fb4a77e110fbbe8210205dfe022389b for an example (the changes in the DotNet.Testing.NUnit module)

  • 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

@yazeedobaid yazeedobaid merged commit 83810f3 into fsprojects:release/next Jan 19, 2022
@xperiandri
Copy link
Collaborator

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.

SdkAssemblyResolver fails to pick up .NET 6.0
2 participants