-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
Make Mono 6 builds work on Windows #3218
Conversation
Got a graphical docker:5.20 container running with this: xhost +si:localuser:root
docker run -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v `pwd`:/build -it mono:5.20 /usr/bin/mono /build/ckan.exe Trying with a master ckan.exe it throws the Mono5 error from #2976 as expected, a build from your branch does indeed start successfully! 🎉 |
Wonder whether Visual Studio will automatically add them back in when somebody edits the localizations with it. I guess we'll find out when somebody does that, just have to pay attention that it doesn't sneak in. |
Mono 5 throws a bunch of other errors in the background, but they're all non-fatal and might be due to running in a Docker container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also confirmed to work on Windows. Thanks a lot for digging into this. We can finally leave Mono 5 behind ⏲️
It would be great to make a Test for this somehow. Any ideas? |
Background
Before #2964, we built releases on Mono 5.16, then that PR changed it to Mono 6.6. This broke things (see below), so as
a workaround, #2976 changed it back to Mono 5.20 in a panic. Here we attempt to address the root cause.
Problem
When we build on Mono 6, running the GUI on Windows throws an exception at startup:
Mono 5 also freaks out, in a similar but slightly different way. It seems the same problem causes a null reference exception instead of the above.
Cause
Clearly there's something involving
CalendarId
that Windows doesn't like. The.resx
files are compiled to.resources
files in_build/out/CKAN-GUI/Debug
, and if we inspect one of these files in a Mono 6 build, we indeed see instances ofCalendarId
:Looking above, these seem to be within an instance of a
System.Globalization.CultureInfo
object, and our.resx
file contains exactly one of those, in the$this.Language
property. The same file built on Windows shows no references toCalendarId
at all; so Mono and .NET disagree on precisely howCultureInfo
should be (de)serialized, which causes problems trying to use data from one platform on the other.$this.Language
sets theControl.Language
orForm.Language
property, which is used by Visual Studio to control what locale is being edited in its form designer. This property has no role at run-time 🤦.Changes
Now our
.resx
files no longer contain$this.Language
, which makes our Mono 6 builds run on Windows and Mono 5.To celebrate, we now build releases on
mono:latest
.