Cache the AOT compiler path, to avoid an expensive recomputation on every
build. This is even more expensive when building remotely from Windows, so
store the cached value on Windows.
Fixes https://github.com/xamarin/xamarin-macios/issues/16774.
This is the first in a series or changes for making pinvokes that take
strings contain all blitable types.
NativeString.cs is being used to do the conversion. Be aware that we're
abusing `IDisposable` to act like C++'s RAII, but it makes the usage
cleaner.
* Improve these methods to find members inside nested types as well.
* Simplify their implementation somewhat.
* Make the filter method optional to allow enumerating everything.
* Rename these methods to Enumerate* to better express what they do.
* Make them extension methods on AssemblyDefinition to make them more
discoverable and easier to use.
Improve perf in cecil-tests by caching loaded assemblies, and thus only
loading them once. The gain isn't all that much - it saves about 3s of ~2m on
my machine, so ~1.5% faster - but it'll be more and more important as we write
more tests. Also the code becomes slightly simpler too.
Closes#16979
The only `MidiPacket` constructor ever used internally is the one accepting an `IntPtr` argument. Therefore `bytes` will always have the default empty array value. Because of this, in the `Bytes` get accessor `bytes` is not null, but empty and indexing into `bytes` on line 848 throws the exception. The other option would have been to remove the empty array default value that was added in #15098, but the length check seemed like the safer, although maybe slightly less performant, option.
NSObject_Disposer.Drain isn't reentry-safe, and there's a rather impressive
(and not in a good way) case where this can happen: if a native dealloc method
ends up processing the main thread's runloop somehow.
The fix makes the Drain function detect reentrancy, and just re-schedule a
call to itself on the run loop. I believe should be safe - either the dealloc
method will process the runloop again a few times, in which case we'll just
re-schedule the drain call every time, until the dealloc method finishes
processing the runloop, and then the next drain call will actually drain.
Fixes https://github.com/xamarin/xamarin-macios/issues/16587.
The automatic translation apparently runs on windows, creates files with crlf,
and will check in the corresponding files as such. During the local build
these files will be read and written out again, but now with lf endings,
leaving all these files modified.
So set the 'text' git attribute for these files, so that they're stored as
'lf' and converted to 'crlf' on Windows.
Don't put availability attributes inside a platform condition, because we need
all availability attributes to be visible when building all platforms,
otherwise we won't generate the correct attributes for other platforms.
Improve performance in Cecil.Tests.GenericPInvokesTest by creating fewer
strings.
This saves about 1m07s seconds on my machine, from 2m10s to 1m03s, so ~52%
faster.
* There's no such thing as Mac Catalyst 8.0. This is probably copied from iOS 8.0,
which is supported in all versions of Mac Catalyst, so just remove the version
for the corresponding SupportedOSPlatform attributes.
* Remove the version in SupportedOSPlatform attributes when the version is equal
to or lower than the min OS version we support for the given platform.
* Remove UnsupportedOSPlatform attributes when there's an identical ObsoletedOSPlatform
attribute.
* Remove UnsupportedOSPlatform attributes when it's a blatent lie, because the
API is available (in Security/Certificate.cs).
* There's no such thing as Mac Catalyst 10.13. It looks like this was a typo, meant
to be Mac Catalyst 13.0.
The BackingFieldDelayHandler will temporarily remove the body of Dispose
methods, and then for every field accessed in the Dispose method that was
preserved by the linker, we'll keep the corresponding code in the Dispose
method (otherwise we'd remove the code).
This is a way to remove fields that are _only_ accessed (and nulled out) in
the Dispose method.
However, we were running into a problem with determining if a field was marked
by the linker: if the field is in a generic type, and that field was not
marked by the linker, the linker might have actually removed the field from
the containing type before we're processing the Dispose methods, and we'd find
a null field definition where no null field definition was expected
(eventually resulting in an ArgumentNullException).
Fix this by treating a null field definition as an unmarked field.
Also add a test.
Fixes https://github.com/xamarin/xamarin-macios/issues/16957.
This allows us to unify the code between all platforms.
Also add all the NSAttributedStringDocumentAttributeKey values we haven't bound yet.
There are no changes in the public API, because I'm only changing internal types.
Ref: #14489.
Implement a launch timeout for macOS and Mac Catalyst apps where if a certain
environment variable (LAUNCH_SENTINEL_FILE) is set, the app will create that
file at launch. The code launching the test app will wait 10 seconds and check
if the file is there: if it's not, something went wrong, in which case the app
should be terminated and launched again.
This necessitated re-implementing the launch script in C#, since it got quite
complicated to implement in bash.
This fixes an issue with Mac Catalyst apps where something would go wrong
during the app launch and nothing would happen (but the app wouldn't be
deadlocked, it would just sit there, doing nothing).
The TestRuntime.cs and ApplePlatform.cs had to be added to a few test projects
to make this compile, which required a few fixes in these files for building
with legacy Xamarin.Mac.
Fixes https://github.com/xamarin/maccore/issues/2414.
Fixes this:
SyntaxError: Unexpected identifier
at new AsyncFunction (<anonymous>)
Error: Unhandled error: SyntaxError: Unexpected identifier
at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6.3.3/dist/index.js:13356:16)
at main (/home/runner/work/_actions/actions/github-script/v6.3.3/dist/index.js:13452:26)
at Module.858 (/home/runner/work/_actions/actions/github-script/v6.3.3/dist/index.js:13429:1)
at __webpack_require__ (/home/runner/work/_actions/actions/github-script/v6.3.3/dist/index.js:24:31)
at startup (/home/runner/work/_actions/actions/github-script/v6.3.3/dist/index.js:43:19)
at /home/runner/work/_actions/actions/github-script/v6.3.3/dist/index.js:49:18
at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v6.3.3/dist/index.js:52:10)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
by not storing the changelog entry in an environment variable between tasks,
but instead store it on disk.
It looks like some timezone data has changed, so this test is now failing.
Mono will probably not be updated, so just ignore the test.
Fixes https://github.com/xamarin/maccore/issues/2629.
This also allows us to unify the code between all platforms.
There are no changes in the public API, because I'm only changing internal types.
Ref: #14489.
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/ceLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
Hopefully fixes this problem:
Unhandled managed exception: Failed to print exception: System.NullReferenceException: Object reference not set to an instance of an object
at Foundation.MonoTouchException.AppendNativeStackTrace (System.Text.StringBuilder sb) [0x0002f] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.0.0.72/src/Xamarin.iOS/Foundation/MonoTouchException.cs:51
at Foundation.MonoTouchException.get_Message () [0x00039] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.0.0.72/src/Xamarin.iOS/Foundation/MonoTouchException.cs:43
at ObjCRuntime.Runtime.PrintException (System.Exception exc, System.Boolean isInnerException, System.Text.StringBuilder sb) [0x0000f] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.0.0.72/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:528
at ObjCRuntime.Runtime.PrintAllExceptions (System.IntPtr exception_gchandle) [0x0003b] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.0.0.72/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:545