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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃弫馃崕馃惂 Add Mono to prerequisites list #1606

Open
aaronfranke opened this issue Jan 10, 2018 · 16 comments
Open

馃弫馃崕馃惂 Add Mono to prerequisites list #1606

aaronfranke opened this issue Jan 10, 2018 · 16 comments
Labels
compatibility Can we make more games compatible with the app without them having to change anything? enhancement Feature creep but also quality of life stuff v25.x Issues that affect version 25

Comments

@aaronfranke
Copy link

aaronfranke commented Jan 10, 2018

OpenRA requires the Mono framework (>= 3.2) to be installed. Other games likely need it too.

https://github.com/OpenRA/OpenRA/wiki/Installation

https://itch.io/docs/itch/integrating/prereqs/

https://github.com/itchio/itch/issues?q=label%3Aprereqs

On Windows, Mono is available as an MSI package. However, on Windows, many Mono games, including OpenRA, can also be ran if the .NET framework is installed. We could either have Itch install Mono regardless of .NET, install Mono if .NET is missing, or install .NET when Mono is listed as a prerequisite. To be safe, it would make sense to install Mono regardless.

On MacOS, Mono is available as a PKG package. Once installed, the executable is located at
/Library/Frameworks/Mono.framework/Versions/Current/bin/mono

On Ubuntu & Debian, Itch could just run sudo apt install mono-complete -y to install Mono via apt. For other Linux distributions, Mono is probably also offered through the package manager.
Once installed, the executable is located at /usr/bin/mono

As you've already ported the install logic to butler (#1530) this should be implementable now.

@aaronfranke
Copy link
Author

aaronfranke commented Jan 27, 2018

The Godot engine is currently built against Mono 5.12. Exporting games is currently not available, but when exporting is available, games using Mono in Godot will probably require Mono >= 5.12.

See: godotengine/godot#15923

@fasterthanlime
Copy link
Collaborator

Although I have many reservations, I have been thinking about interfacing with apt-get for some dependencies. I was hoping most Mono games/apps would eventually adopt something like MonoKickstart and not need a system-wide Mono installed.

My reservations are as follows:

  • I have serious doubts about backwards compatibility: in theory, a game that requires Mono N would run fine with Mono M (with M > N), but in practice, there's many issues where a newer version broke something that worked fine in older versions
  • Interfacing with apt-get, or .pkg packages is not trivial: it often involves parsing text output, showing dialog elements for prompts, etc. - but for apt-get I don't think we'll have a choice (to install the latest firejail for example), so I'm willing to invest some effort there.
  • For Linux mono apps, would we need to detect .exe that are .NET assemblies and run them through the mono command, or would there still (always) be some kind of native Linux executable or script that would call mono itself?

@aaronfranke
Copy link
Author

aaronfranke commented Jan 28, 2018

I believe Mono apps should not have a problem with forwards compatibility. OpenRA, a Mono 3.2 app, runs just fine with Ubuntu 16.04's Mono, 4.2.1.

EDIT: I also installed Mono 5.8.0.127 (as Godot requires >= 5.4.1) and I can confirm that OpenRA, using Mono 3.2, still works just fine on 5.8.

2nd EDIT: 5.10 also works.

In my experiments with OpenRA, trying to call the system's Mono directly (/usr/bin/mono) via Itch with an Itch app manifest will set the working directory to /usr/bin which is obviously not right. When I tried to call it indirectly, with Itch calling a script which calls Mono, it just opens the script in a text file.

The method I'm using right now is to have a file called mono which is a symlink to /usr/bin/mono and ship this with the game. Then the Itch manifest calls "mono game.exe" This is obviously not ideal.

@fasterthanlime
Copy link
Collaborator

I agree (also the /usr/bin CWD is a straight up bug, you're right).

I'll look into making prerequisites platform-agnostic in my re-implementation (see #1642), we need to figure out a transition plan because right now the redist specification format assumes windows: http://dl.itch.ovh/itch-redists/info.json - and I'd like to deploy the new system side-by-side with v23, so the format needs to retain old fields for a while.

Maybe I'll move to windows, linux and osx subfields, and copy the windows fields to the top-level as well so the old app keeps working.

@aaronfranke
Copy link
Author

aaronfranke commented Mar 3, 2018

Zero-K is another game on Itch that uses Mono. Like OpenRA, they're on GitHub and currently do not ship Linux builds via archives: ZeroK-RTS/Zero-K#2820

@fasterthanlime
Copy link
Collaborator

Maybe I'll move to windows, linux and osx subfields, and copy the windows fields to the top-level as well so the old app keeps working.

Quick status update: I've done that a while ago! Also:

I'm still hesitant to fully jump on the "let's install native OS packages" train for Linux, but I do think we need a clear plan for Zero-K & OpenRA, I'd like to have @GranPC's input on this!

@aaronfranke
Copy link
Author

aaronfranke commented Apr 26, 2018

Indeed, and now I'm also thinking it may not be the best idea. The Godot engine devs are thinking about ways to handle exporting Mono projects right now, you should probably read up on their ideas.

They want to "Bundle all the assemblies that can break compatibility between versions of mono" but it sounds like they still would require having Mono installed for Godot/C# games. I am curious which assemblies they are referring to, as while OpenRA and Zero-K seem to work fine with Mono 5.10 when they were designed for earlier versions, perhaps more complex projects would break between versions.

Using native OS packages is normal on Linux, but it's completely understandable if this doesn't work for all cases or if you want to use the same method on Windows/Mac/Linux.

@aaronfranke aaronfranke changed the title Add Mono to prerequisites list 馃弫馃崕馃惂 Add Mono to prerequisites list Apr 26, 2018
@fasterthanlime
Copy link
Collaborator

Well, I've pinged @GranPC because he's working on a linux prereq plan that involves having our own copies of various libraries (downloaded on demand) in some itch-owned directory (rather than system-wide).

The nice thing about this approach is that it doesn't interfere with the rest of the system at all. I'm not sure it's doable for mono because - even though I haven't looked closely - I suppose it's not just a neatly folded bunch of ELF files, but probably has config files in various places, etc. - so we might have to "fake" a lot more things for it to get to run from a local prefix.

@aaronfranke
Copy link
Author

aaronfranke commented Apr 27, 2018

Do let me know how that goes. There are advantages to each approach, I would love to know how well an "Itch runtime" project would turn out.

Steam does have Steam runtime, however, I should point out that some Linux users have issues with it and specifically choose to disable it or override it with system libraries. Either the self-contained runtime approach has serious issues, or Steam's implementation is flawed.

@fasterthanlime
Copy link
Collaborator

Either the self-contained runtime approach has serious issues, or Steam's implementation is flawed.

The truth is probably somewhere in the middle - it's a hard problem, and afaict Steam chose to ship a lot of libraries, including stuff like libstdc++.

Quick update btw, Zero-K made a version that doesn't require Mono to be installed: https://itch.io/post/408768 - if only OpenRA & Godot could follow suit, we could put this ugly business behind us :)

@aaronfranke
Copy link
Author

This may be useful: https://www.mono-project.com/docs/about-mono/versioning/

The major version number [X in X.Y.Z] is used to indicate which ABI/API version Mono uses. When it changes, there is no guarantee that existing code will continue to work (though the utmost effort will be made to maintain compatibility). The major version changes infrequently.

@fasterthanlime fasterthanlime moved this from P2 to P3 in itch v25 Jul 11, 2018
@fasterthanlime fasterthanlime removed this from P3 in itch v25 Aug 23, 2018
@fasterthanlime fasterthanlime added compatibility Can we make more games compatible with the app without them having to change anything? v25.x Issues that affect version 25 enhancement Feature creep but also quality of life stuff labels Sep 18, 2018
@Ellpeck
Copy link

Ellpeck commented Jul 4, 2019

Are there any news about this? I'd also appreciate having a prereq for Mono.

@fasterthanlime
Copy link
Collaborator

Are there any news about this?

Not at the moment, sorry.

@aaronfranke
Copy link
Author

@fasterthanlime Any update on this? OpenRA now has automated uploading of builds to Itch.io as of OpenRA/OpenRA#18227, but they still depend on the system having the correct libraries. A Mono prereq would remove the need for a portable installation (and a portable installation would increase the app download size and each update would be slower vs if it was a prereq).

Coincidentally, it has been 1 year since you were last pinged about this :)

@fasterthanlime
Copy link
Collaborator

Hey @aaronfranke!

Unfortunately, still not a high priority, and I'm still not keen on shipping prereqs for non-Windows platforms. I'll let you know if anything changes. Right now I'm focused on some security stuff, and then shipping v26.

@Mailaender
Copy link

but they still depend on the system having the correct libraries

That is actually not true. Mono is bundled for both Linux and macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Can we make more games compatible with the app without them having to change anything? enhancement Feature creep but also quality of life stuff v25.x Issues that affect version 25
Projects
None yet
Development

No branches or pull requests

4 participants