[Feature]: Remove The Mono Dependency On MacOS

by ADMIN 47 views

[Feature]: Remove the Mono dependency on macOS

Problem

Complicated Installation Process and Limited Support for Newer Devices

Right now, users on macOS need to install Mono independently of CKAN to use it. This is undesirable because it complicates the install process and doesn't support newer ARM devices without a translation layer (i.e. Rosetta 2). The current setup requires users to have a separate installation of Mono, which can be time-consuming and may lead to compatibility issues. Furthermore, the lack of support for newer ARM devices limits the usability of CKAN on these devices.

Suggestion

Switch to a Self-Contained .NET 8 Build for Mac

CKAN could switch to a self-contained .NET 8 build for Mac because it doesn't need the WinForms feature of Mono. This seems to be as simple as using dotnet build with the right flags. By using .NET 8, CKAN can take advantage of the latest features and improvements in the .NET ecosystem, while also providing a more streamlined and user-friendly installation process.

Example Usage

dotnet publish -r osx-arm64 -f net8.0 --self-contained Cmdline/CKAN-Cmdline.csproj
dotnet publish -r osx-x64 -f net8.0 --self-contained Cmdline/CKAN-Cmdline.csproj

file ./_build/out/CKAN-CmdLine/Release/bin/net8.0/osx-arm64/publish/CKAN-CmdLine consoleui
# --> "Mach-O 64-bit executable arm64"

./_build/out/CKAN-CmdLine/Release/bin/net8.0/osx-arm64/publish/CKAN-CmdLine consoleui

Additional Configuration

To prevent the duplicate log4net.xml files from being an issue, you may need to add the following configuration to each csproj:

<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>

Shipping the Entire Publish Directory

The entire publish directory would have to be shipped because the output isn't single file, but that's probably okay because Mac apps are folders anyways. This means that users will need to download the entire publish directory, which may take up more space on their device.

Potential Differences Between Mono and .NET 8

There might be some differences between Mono and .NET 8 that could cause bugs, so it'd likely be worth making sure everything is working first. By testing the .NET 8 build thoroughly, you can ensure that CKAN continues to function as expected on macOS devices.

Alternatives

No response

Additional context

No response

Benefits of Removing the Mono Dependency

Removing the Mono dependency on macOS can provide several benefits, including:

  • Simplified Installation Process: By using a self-contained .NET 8 build, users can install CKAN without needing to install Mono separately.
  • Improved Support for Newer Devices: The .NET 8 build can take advantage of the latest features and improvements in the .NET ecosystem, providing better support for newer ARM devices.
  • Enhanced User Experience: A streamlined installation process and improved support for newer devices can enhance the overall user experience for CKAN users on macOS.

Conclusion

Removing the Mono dependency on macOS can provide several benefits, including a simplified installation process, improved support for newer devices, and an enhanced user experience. By switching to a self-contained .NET 8 build, CKAN can take advantage of the latest features and improvements in the .NET ecosystem, while also providing a more streamlined and user-friendly installation process.
[Feature]: Remove the Mono dependency on macOS - Q&A

Frequently Asked Questions

Q: What is the current issue with Mono on macOS?

A: The current issue with Mono on macOS is that users need to install Mono independently of CKAN to use it. This complicates the install process and doesn't support newer ARM devices without a translation layer (i.e. Rosetta 2).

Q: What is the proposed solution to remove the Mono dependency?

A: The proposed solution is to switch to a self-contained .NET 8 build for Mac. This can be achieved by using dotnet build with the right flags, which will produce a standalone executable that doesn't require Mono.

Q: What are the benefits of removing the Mono dependency?

A: The benefits of removing the Mono dependency include:

  • Simplified Installation Process: By using a self-contained .NET 8 build, users can install CKAN without needing to install Mono separately.
  • Improved Support for Newer Devices: The .NET 8 build can take advantage of the latest features and improvements in the .NET ecosystem, providing better support for newer ARM devices.
  • Enhanced User Experience: A streamlined installation process and improved support for newer devices can enhance the overall user experience for CKAN users on macOS.

Q: What are the potential differences between Mono and .NET 8 that could cause bugs?

A: There might be some differences between Mono and .NET 8 that could cause bugs, so it'd likely be worth making sure everything is working first. By testing the .NET 8 build thoroughly, you can ensure that CKAN continues to function as expected on macOS devices.

Q: How do I configure the csproj files to prevent duplicate log4net.xml files?

A: To prevent the duplicate log4net.xml files from being an issue, you may need to add the following configuration to each csproj:

<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>

Q: Do I need to ship the entire publish directory?

A: Yes, the entire publish directory would have to be shipped because the output isn't single file, but that's probably okay because Mac apps are folders anyways.

Q: What are the potential drawbacks of removing the Mono dependency?

A: The potential drawbacks of removing the Mono dependency include:

  • Additional Testing Required: Thorough testing of the .NET 8 build is required to ensure that CKAN continues to function as expected on macOS devices.
  • Potential Bugs: There might be some differences between Mono and .NET 8 that could cause bugs, which would need to be addressed.

Q: How can I get started with removing the Mono dependency?

A: To get started with removing the Mono dependency, you can follow these steps:

  1. Update the csproj files: Update the csproj files to use the .NET 8 build and add the necessary configuration to prevent duplicate log4net.xml files.
  2. Test the .NET 8 build: Thoroughly test the .NET 8 build to ensure that CKAN continues to function as expected on macOS devices.
  3. Ship the entire publish directory: Ship the entire publish directory to ensure that users can install CKAN needing to install Mono separately.

Conclusion

Removing the Mono dependency on macOS can provide several benefits, including a simplified installation process, improved support for newer devices, and an enhanced user experience. By switching to a self-contained .NET 8 build, CKAN can take advantage of the latest features and improvements in the .NET ecosystem, while also providing a more streamlined and user-friendly installation process.