-
Notifications
You must be signed in to change notification settings - Fork 520
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
[XM] Fix 44707 by fixing launcher and mmp #971
Conversation
…M apps - https://bugzilla.xamarin.com/show_bug.cgi?id=44707 - Also teach mmp about MonoBundle/mono/4.5/machine.config file - Mono should be fixed to not need machine.config, but may come up in future - Also allow customers to copy in custom machine.config easily - Also clean up some test output formatting issues found while writing new tests
@kumpera - This is the XM side of 44707. We're not generating an "empty" machine.config since you fixed mono, but the option is there --custom-machine-config="" in case the bug resurfaces. @timrisi Please look over the test changes. @rolfbjarne The launcher changes are trivial, but can you verify they are in the right place? |
The XM_TEST_NAME hack is something i've wanted to do for awhile, so I can stop locally hacking that file every time one test fails. |
@@ -357,6 +358,8 @@ | |||
// So route through MONO_DEBUG | |||
setenv ("MONO_DEBUG", "no-gdb-backtrace", 0); | |||
} | |||
|
|||
setenv ("MONO_CFG_DIR", [monobundle_dir UTF8String], 1); |
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.
We already call mono_set_dirs
[1], whose second parameter sets the config directory. Maybe we should check why that doesn't work instead?
[1] https://github.com/xamarin/xamarin-macios/blob/master/runtime/launcher.m#L495-L499
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.
Let me look into this. That is a good point.
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.
We first run mono_set_dirs here:
frame #0: RemotingTest`mono_set_dirs()
frame #1: RemotingTest`app_initialize()
frame #2: RemotingTest`::xamarin_main()
frame #3: RemotingTest`main()
and appear to correctly set things. But then in mono_main we get stomped
frame #0: RemotingTest`fallback [inlined] mono_set_dirs(assembly_dir="/Users/donblas/Programming/macios/master/xamarin-macios/builds/install/mac64/lib", config_dir="/Users/donblas/Programming/macios/master/xamarin-macios/builds/install/mac64/etc") at assembly.c:588 [opt]
frame #1: RemotingTest`fallback + 23
frame #2: RemotingTest`mono_set_rootdir
frame #3: RemotingTest`mono_main()
frame #4: RemotingTest`::xamarin_main()
frame #5: RemotingTest`main()
And then we're hosed.
MONO_CFG_DIR is letting us bypass this.
Is this a bug/limitation in the embedding API? It seems wrong.
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.
@chamons OK, I guess we can fix this ourselves until mono fixes its embedding API then.
But maybe pass 0
for the overwrite
parameter to setenv
then, so that the value won't overwrite any existing values set if executed from the command line?
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.
Filed a bug w\ mono here - https://bugzilla.xamarin.com/show_bug.cgi?id=45279
I'll change that setenv param now.
@@ -287,7 +288,8 @@ static void Main2 (string [] args) | |||
{ "http-message-handler=", "Specify the default HTTP Message Handler", v => { http_message_provider = v; }}, | |||
{ "extension", "Specifies an app extension", v => is_extension = true }, | |||
{ "allow-unsafe-gac-resolution", "Allow MSBuild to resolve from the System GAC", v => {} , true }, // Used in Xamarin.Mac.XM45.targets and must be ignored here. Hidden since it is a total hack. If you can use it, you don't need support | |||
{ "disable-lldb-attach=", "Disable automatic lldb attach on crash", v => disable_lldb_attach = ParseBool (v, "disable_lldb_attach")}, | |||
{ "disable-lldb-attach=", "Disable automatic lldb attach on crash", v => disable_lldb_attach = ParseBool (v, "disable-lldb-attach")}, | |||
{ "custom-machine-config=", "Custom machine.config file to copy into MonoBundle/mono/4.5/machine.config. Pass \"\" to copy in a valid \"empty\" config file.", v => custom_machine_config_path = v }, |
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.
Isn't custom-
a bit redundant? If you're passing a path here, it's kind of obvious it's a custom file... so maybe name it just machine-config=
instead?
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.
Good point.
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.
Fixed in latest to just --machine-config
Build failure |
1 similar comment
Build failure |
Test changes lgtm |
Build failure |
1 similar comment
Build failure |
Build failure |
Hmm. Somehow i broke msbuild-tests. Will look into it. |
- FSharp tests will fail to build inside msbuild-test with: /Library/Frameworks/Mono.framework/Versions/4.4.0/lib/mono/4.5/Microsoft.FSharp.Targets: error : Error executing task Fsc: ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - So we unset MONO_CFG_DIR when we setup the other environomental variables, which was setup by the test launcher in launcher.m
Build success |
- Remove hack in tests since we've moved into all apps - Was breaking xbuild building fsharp inside any XM app
Build success |
Also includes some test infrastructure improvements that can split out if necessary.