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 assembly-resolver to not hardcode .NET 6.0 #2777

Merged
merged 6 commits into from
Jul 15, 2024

Conversation

Thorium
Copy link
Member

@Thorium Thorium commented May 26, 2024

Description

Some workarounds to issue [mentioned in https://github.com//issues/2713]:(#2713 (comment))
The .NET version was for no reason hard-coded to 6.0 and not coming from an environment variable that can be overwritten by the user. There is no reason why Fake needs to be updated every time .NET version updates.

  1. This commit adds new FAKE_SDK_RESOLVER_CUSTOM_DOTNET_VERSION which can be used to change the default "6.0" to whatever other version. So you set it to .NET "18.5" if you want.

  2. Also, this changes assembly-resolver to use lists instead of single strings: SdkVersionRaws SdkVersions and PaketFrameworkIdentifiers. The default is still list of single item ["6.0"] to not break any backward-compatibility. However, in many cases the user has multiple NET versions installed in the computer and is just interested of whatever defined in wherever "globals.json" and not what Fake is compiled with. Currently the system just throws build errors, meanwhile user would just want to old VB style on-error-resume-next: "come on, build it now!", e.g. user tries to builds .NET 8 software. So you can define "6.0" and "8.0" and then the assembly-resolver will check what it can find. There are still backward compatible versions kept, SdkVersionRaw SdkVersion and PaketFrameworkIdentifier which just take the first from the list.

@xperiandri xperiandri force-pushed the sdk-assembly-resolver-update branch from 17acb92 to efe34c8 Compare July 11, 2024 13:46
@xperiandri
Copy link
Collaborator

@Thorium formatting required

@Thorium
Copy link
Member Author

Thorium commented Jul 11, 2024

Thanks, done...

Copy link
Collaborator

@xperiandri xperiandri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add FAKE_SDK_RESOLVER_CUSTOM_DOTNET_VERSION to the documentation somewhere?

src/app/Fake.Runtime/SdkAssemblyResolver.fs Outdated Show resolved Hide resolved
@Thorium
Copy link
Member Author

Thorium commented Jul 11, 2024

Do we need to add FAKE_SDK_RESOLVER_CUSTOM_DOTNET_VERSION to the documentation somewhere?

yes, and probably to the error message!

Edit: Added to error message. But there is no documentation for the other environment variables either.

@xperiandri
Copy link
Collaborator

And update release notes, please
https://github.com/fsprojects/FAKE/pull/2778/files

@xperiandri xperiandri force-pushed the sdk-assembly-resolver-update branch from ef83e75 to 3ea4ae2 Compare July 14, 2024 08:26
RELEASE_NOTES.md Outdated Show resolved Hide resolved
@Thorium
Copy link
Member Author

Thorium commented Jul 15, 2024

This should be good now.

@xperiandri xperiandri merged commit 7191806 into fsprojects:master Jul 15, 2024
3 checks passed
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.

3 participants