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

Mono #225

Open
wants to merge 23 commits into
base: development
Choose a base branch
from
Open

Mono #225

wants to merge 23 commits into from

Conversation

ila-embsys
Copy link

@ila-embsys ila-embsys commented Mar 2, 2024

It's an prototype of Mono build.

I had started this experiment out of curiosity a little bit earlier than this repo got EOL notice and found that it actually possible to run the app under Mono. Then the branch was abandoned for some time until I noticed here a new maintainer. So I think better to keep the prototype here. Now I rebased the old branch to the head and added CI.

Partially, I have gone the path described in Cross-Platform-Vision.

Most changes are fixing file name cases. The functionality that crash the app and prevent it to run, currently is just commented out. Need to fix them to not break windows builds, so the request is in a draft state.

The build from CI artifact could be run by mono XCP-ng\ Center.exe.
It is how it currently looks:

xenadmin-mono

So if someone interested in Mono build too, he could start from here.

ila-embsys added 23 commits May 1, 2024 17:01
Downgrading TargetFramework version allows building the project using Mono on Linux hosts. Expected that the change will not significantly impact Windows builds. Probably, the downgraded version currently is the latest supported by Mono.

Signed-off-by: Ilya Stolyarov <[email protected]>
…urces or vice-versa

The builds on Linux are usually stored on case-sensitive file systems. While on Windows is no matter how to write letter cases, the Linux build fails because of it. These changes should allow building the same code on both host platforms.

Signed-off-by: Ilya Stolyarov <[email protected]>
… password is wrong

The focus setting doesn't work on Mono, so just skip that behaviour if the runtime is Mono. In the result, the focus remains on the username field. The change doesn't impact user experience a lot.

Signed-off-by: Ilya Stolyarov <[email protected]>
These changes are hotfixes to successfully pass building on Mono. Expected negative impacts:
- Losing the cursor change behaviour by moving across snapshot items
- Losing some elements positioning

The TODOs left in the code should notice about the issue. Probably better to revert this commit in the future and reimplement lost behaviour in cross-platform way.

Signed-off-by: Ilya Stolyarov <[email protected]>
…l fields group

The cutting effect noticed by running on Mono. To fix that, the AutoSize feature on the group box is disabled.

Signed-off-by: Ilya Stolyarov <[email protected]>
…tyles

The change fixes a group of exceptions that were throwing by catching null values on the font argument on some internal functions. This behaviour noticed by running on Mono.

Signed-off-by: Ilya Stolyarov <[email protected]>
Doesn't work on Mono. The expected negative effect is losing indication to a user that the input is sending to a VM.

Signed-off-by: Ilya Stolyarov <[email protected]>
The code in `XenAdmin/VNC/KeyMap.cs` is not crossplatform. It must be reimplemented. After that, this commit can be reverted.

Signed-off-by: Ilya Stolyarov <[email protected]>
It is the hotfix to avoid a program stuck on Mono because of a call loop. Expected negative impact is impossibility to send keyboard and mouse input to a VM. The issue need more investigation and after resolving it this hotfix commit can be reverted.

Signed-off-by: Ilya Stolyarov <[email protected]>
This is the hotfix to avoid the exception throwing by disabling some functionality if the runtime platform is Mono. The impact is unknown. Need more investigation to revert this hotfix.

Signed-off-by: Ilya Stolyarov <[email protected]>
…e frames

Reimplemented update timer of frames for Mono runtime.

Signed-off-by: Ilya Stolyarov <[email protected]>
The splash image that is showing on the first moments on a screen is changed to a PNG formatted variant. The previous BMP formatted variant doesn't work on Mono. Expected that the change doesn't affect Windows users.

Signed-off-by: Ilya Stolyarov <[email protected]>
For some reason, enabling that HomePage tab is the cause of connection lost right after the attempt to do connect to a server.
The HomePage tab shows nearly nothing useful than the add new server link. Actually the tab content is a web page that require a webbrowser library that doesn't look available at current days, and doesn't work on Mono, so just disable it. Significant negative impact to users on Mono platform doesn't expect.

Signed-off-by: Ilya Stolyarov <[email protected]>
Doesn't work on Mono, so just disable it. The impact in unknown. The ClipboardViewer must be a crossplatform to revert this hotfix commit and restore lost functionality.

Signed-off-by: Ilya Stolyarov <[email protected]>
Doesn't work on Mono, so just disable it. The impact in unknown. The RestartManager must be a crossplatform to revert this hotfix commit and restore lost functionality.

Signed-off-by: Ilya Stolyarov <[email protected]>
…ll loop

This fix disables the functionality that is a cause of the program stuck due to is a call loop. The negative impact isn't expected, since the disabled code looks like just selects some default value. This doesn't look important.

Signed-off-by: Ilya Stolyarov <[email protected]>
This fix disables the functionality that is a cause of exceptions throwing. The negative impact isn't expected, since the disabled code just prints some debugging messages. This doesn't look important.

Signed-off-by: Ilya Stolyarov <[email protected]>
This fix disables the functionality that is a cause of exceptions throwing and impossibility to run the program. The negative impact isn't expected, since the disabled code probably needed to run tests. Maybe that functionality need to be restored in the future to provide automated tests.

Signed-off-by: Ilya Stolyarov <[email protected]>
…Pipe

The function ExistsPipe could throw an exception on catching the NotFound related error. Add safe try-catch block that skip the error since if the pipe doesn't exist the code does nothing too.

Signed-off-by: Ilya Stolyarov <[email protected]>
This hotfix disables the functionality that is a cause of exceptions throwing on Mono runtime. The expected negative impact is the probability to lose the horizontal scroll function somewhere.

Signed-off-by: Ilya Stolyarov <[email protected]>
@ila-embsys
Copy link
Author

Since an attention to this groundwork is existing, I decided to prepare this MR for review and discussion:

  • Whole code changes are separated to a set of commits, where each is affecting a piece of app function.

  • Each commit is commented to explain why the change was introduced and which effects to the app is expected.

  • Each commit title is marked by the labels 'ci', 'project', 'resource', 'mono':

    • The label 'mono' is set on commits that are expected to be avoiding any effect to a non-mono runtime, while have a direct effect to Mono.
    • The other labels are set on commits that are expected to be having effects in any runtime, and those commits need a detailed attention.
  • Each commit that disable a piece of the app function, have a note about the reasons in the code comments too, to easy find a related commit in the future.

Summary to current Mono build state

  • Mostly works fine and stable for basic workflow like observing lists and states for VMs, disks, networks etc. However, nothing have detailed testing.
  • The interface rendering have glitches like missing rendering some lists until them gets clicking.
  • The VM console viewing is works, but have troubles in rendering a background and the mouse/keyboard input is disabled due to some functions are non-implemented in a cross-platform way. While technically, the feature is nearly working, actually it is unusable.

Artifacts and packages
The build artefacts for testing the result are available on the Actions page of my project fork that builds on the same branch as this MR. The CI here on the MR page is not approved and disabled.

Also, there are prepared packages for some distros built on OpenBuildService that could be downloaded by clicking the "Download package" button. The branch for package builds is the same as on this MR.

@ila-embsys ila-embsys marked this pull request as ready for review May 4, 2024 17:02
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.

1 participant