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

Upgrade to .NET 8 #94

Merged
merged 3 commits into from
Dec 31, 2024
Merged

Conversation

peeley
Copy link
Contributor

@peeley peeley commented Dec 30, 2024

Fixes #93.

This PR upstreams the downstream changes from this patch (credit to @GGG-KILLER). I tested the upgrade on both x86 Linux and ARM64 MacOS, and (miraculously) it seems as though the application still works as expected without any other changes required. Unfortunately, I don't have a Windows PC to test these changes on; testing from other contributors would be greatly appreciated.

I also threw in a commit to try and fix the CI pipeline. It looks like the issue is with the version of MacOS that the GitHub workflow uses, hopefully updating to macos-latest fixes it.

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to stay as standard 2.0 (can probably be bumped to 2.1 tho) because windows launcher is framework and thus relies on it.
It's the reason why CI fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted back to netstandard2.1.

Copy link
Collaborator

Choose a reason for hiding this comment

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

this needs to be standard 2.0
2.1 strips framework support :(

@@ -16,13 +16,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
Copy link
Collaborator

Choose a reason for hiding this comment

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

For background, the reason why i pinned it to -13 at one point was because eto/dotnet was behaving really strangely with back then it being latest. Not sure if it's fixed now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

macos still fails, but I don't consider it blocking.

LLINK : warning MM0079: The recommended Xcode version for Microsoft.macOS 15.0.8319 is Xcode 16.0 or later. The current Xcode version (found in /Applications/Xcode_15.4.app/Contents/Developer) is 15.4. [/Users/runner/work/AM2RLauncher/AM2RLauncher/AM2RLauncher/AM2RLauncher.Mac/AM2RLauncher.Mac.csproj]

ILLink : unknown error IL7000: An error occurred while executing the custom linker steps. Please review the build log for more information. [/Users/runner/work/AM2RLauncher/AM2RLauncher/AM2RLauncher/AM2RLauncher.Mac/AM2RLauncher.Mac.csproj]

Copy link
Collaborator

Choose a reason for hiding this comment

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

@peeley you wanna try changing ~line 44 for this or keep it as is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh man, I didn't even notice that line. I was wondering why the Xcode version was behaving weirdly. I'm gonna just try and delete that, since the same command works locally on MacOS (and I don't see why that specific version of XCode is needed, instead of the latest version).

Copy link
Collaborator

Choose a reason for hiding this comment

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

macos-latest doesnt have the latest xcode enabled by default for whatever reason.
At least last that was the case when I added it. Deleting it doesnt actually do anyting because it currently doesnt already get triggered on your branch because its wrapped in an if macos-13, while we're on macos-latest

The switch there needs to be changed to 16.0 or 16.1

See here: https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#xcode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out I was misunderstanding what macos-latest points to - I thought it was macos-15, but it points to macos-14 (src). macos-15 has the correct XCode version, so I think I need to point to macos-15 explicitly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

macos-15 is still in beta (your source) so I'd like to not point to it explicitly.
I'd just point to macos-latest and have the xcode switch removed - by the time someone makes another pull request macos15 is hopefully Generally Available and then those tests.

@Miepee
Copy link
Collaborator

Miepee commented Dec 30, 2024

nixos is able to point to a commit in the main development branch, right?
Just noting cause there's still blocking things to a release I have to get to at one point....

Also im surprised the application works on arm64 macos

@GGG-KILLER
Copy link

nixos is able to point to a commit in the main development branch, right?
Just noting cause there's still blocking things to a release I have to get to at one point....

We're able to import PR as patches that we apply on the latest stable release. If that doesn't work out of the box I can fiddle around with the patch a little more until it works.

The reason I didn't upstream these changes is because they're really a hack meant to make it build with the .NET 8.0 SDK but there are quite a few other things that also need to be checked when upgrading such as breaking changes, older package versions that are still net6.0 and so on, so I opted to leave this kind of work to upstream as I never used this tool before and am just helping with the effort of removing all usages of .NET 6.0 in nix.

@peeley
Copy link
Contributor Author

peeley commented Dec 30, 2024

nixos is able to point to a commit in the main development branch, right? Just noting cause there's still blocking things to a release I have to get to at one point....

Also im surprised the application works on arm64 macos

Yeah, we can just point to an arbitrary commit to update the package. There's no need for a full semver release.

@@ -16,13 +16,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
configuration: [Release]
include:
- os: ubuntu-latest
COMMAND: AM2RLauncher.Gtk -p:PublishSingleFile=true -p:DebugType=embedded -r ubuntu.18.04-x64 --no-self-contained
Copy link
Collaborator

Choose a reason for hiding this comment

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

linux fails here:

The specified RuntimeIdentifier 'ubuntu.18.04-x64' is not recognized.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like the existing runtime is not one of the listed runtime identifiers - I'll add a commit to fix it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh wow, i didnt notice that they cut off like half their RIDs

Copy link
Collaborator

@Miepee Miepee left a comment

Choose a reason for hiding this comment

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

all relevant tests pass, so im fine with merging

ty both for the effort for the changes

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.

.NET 6 has hit EOL
3 participants