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.0 and eradicate ☠ Mono ☠ #21577

Closed
wants to merge 12 commits into from

Conversation

michaeldgg2
Copy link
Contributor

@michaeldgg2 michaeldgg2 commented Sep 13, 2024

Changes

Apart from targeting .NET 8.0 this PR does other things too:

  • removes all Mono-related stuff
  • updates README.md
  • updates .editorconfig after migrating to .NET 8.0 and removing Mono
  • fixes some warnings related to upgrade to .NET 8.0
  • removes workarounds for Mono in code

TODO

  • fix new warnings after changes to .editorconfig
  • someone with macOS should finish and test macOS stuff (I made separate commit for that to separate it from other changes)
  • script for dedicated server (?) for FreeBSD still uses Mono (someone with FreeBSD should migrate it to the new .NET)

.NET 8.0 on older Windows versions

Surprisingly, not only .NET 8.0 runtime works on Windows 8.1, but also the SDK. More importantly OpenRA compiled targeting .NET 8.0 works on Windows 8.1 as well (this runs in a VM so ignore the FPS):

openra_net80_win81

@michaeldgg2 michaeldgg2 force-pushed the net80 branch 2 times, most recently from 1852e97 to 35b23bc Compare September 13, 2024 21:46
@RoosterDragon
Copy link
Member

The current dev appetite is for the next release to still use net6+mono, so this will need to wait until after that has occured at a minimum.

I would recommend grepping the repo for net6, net 6 and mono for additional areas the will need an update. Between documentation, packaging and other various scripts and code config I would expect a complete switchover to net 8 and dropping of mono to affect dozens of files.

@michaeldgg2 michaeldgg2 changed the title Upgrade to .NET 8.0 and remove/migrate obsolete stuff Upgrade to .NET 8.0 and eradicate Mono Sep 14, 2024
@michaeldgg2 michaeldgg2 changed the title Upgrade to .NET 8.0 and eradicate Mono Upgrade to .NET 8.0 and eradicate ☠ Mono Sep 14, 2024
@michaeldgg2 michaeldgg2 changed the title Upgrade to .NET 8.0 and eradicate ☠ Mono Upgrade to .NET 8.0 and eradicate ☠ Mono ☠ Sep 14, 2024
Copy link
Member

@Mailaender Mailaender left a comment

Choose a reason for hiding this comment

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

It saves into ~/Documents/.config/openra/ instead of ~/.config/openra/ on Linux. https://learn.microsoft.com/dotnet/core/compatibility/core-libraries/8.0/getfolderpath-unix

Copy link
Member

@RoosterDragon RoosterDragon left a comment

Choose a reason for hiding this comment

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

Still a few hits for net 6 in these files:

  • .github\workflows\documentation.yml
  • .github\workflows\packaging.yml
  • packaging\functions.sh
  • packaging\macos\apphost.c
  • packaging\windows\buildpackage.sh

And mono in these files:

  • OpenRA.Game\Exts.cs
  • packaging\freebsd\openra

Extra System or Microsoft nuget packages that align with the runtime version should be bumped from 6 to 8.

.editorconfig Outdated
@@ -820,7 +820,7 @@ dotnet_diagnostic.CA1843.severity = warning
# Provide memory-based overrides of async methods when subclassing 'Stream'.
dotnet_diagnostic.CA1844.severity = warning

# Use span-based 'string.Concat'. (Not available on mono)
# Use span-based 'string.Concat'.
dotnet_diagnostic.CA1845.severity = none
Copy link
Member

Choose a reason for hiding this comment

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

Let's set this to a warning.

if [ -L "bin/${REPLACE}" ]; then
return 0
fi
# .NET 6 does not support .config files, so we must use symlinks instead
Copy link
Member

Choose a reason for hiding this comment

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

.NET 8 - assuming the comment still holds in 8.

Copy link
Member

Choose a reason for hiding this comment

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

With mono gone we don't have .config files at all, so this whole file needs to be updated (comments at top, function names, etc) to reflect .NET.

@PunkPun
Copy link
Member

PunkPun commented Sep 16, 2024

needs a rebase for support folder to be correct on Mac and Linux

@pchote
Copy link
Member

pchote commented Sep 16, 2024

This would also be a good time to get rid of configure-system-libraries.sh and follow the normal .NET behaviours for native libraries.

dllPath = [exePath stringByAppendingPathComponent: @"x86_64/OpenRA.dll"];
}
}
cpu_type_t type;
Copy link
Member

Choose a reason for hiding this comment

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

Spaces -> Tabs in this file please.

@dnqbob
Copy link
Contributor

dnqbob commented Oct 14, 2024

umm, is Mono dead or something bad happened?

@JovialFeline
Copy link
Contributor

umm, is Mono dead or something bad happened?

Something like that. https://www.mono-project.com/

@dnqbob
Copy link
Contributor

dnqbob commented Oct 14, 2024

thanks! @JovialFeline

@michaeldgg2
Copy link
Contributor Author

Somebody should take a look at FreeBSD start script too.

@omnivagant
Copy link

.NET 6 is out of support since yesterday https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core

Copy link
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

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

Looks like Exts has a function that references mono ResizeArray. It's unused so the whole function could be just removed.

Could you also rebase for the new SDL?

@@ -212,7 +208,7 @@ for MOD in "Red Alert" "Tiberian Dawn"; do
done

for MOD in "Red Alert" "Tiberian Dawn" "Dune 2000"; do
for p in "arm64" "mono"; do
for p in "arm64"; do
Copy link
Member

Choose a reason for hiding this comment

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

cool loop

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.

9 participants