Compare commits

..
961 Commits
Author SHA1 Message Date
Alexander Köplinger d9001b5ae7 Bump bockbuild to get GTK NSPasteboardType change (#18815)
Backport of https://github.com/mono/mono/pull/18080.

Approved for 2019-08 by @marek-safar in https://github.com/mono/mono/pull/18080#issuecomment-585451815
2020-02-12 23:46:45 +01:00
Alexander Köplinger e69d4b57d7 Bump bockbuild for Pango patch
Fixes bug #1048838, correct SF font not loading in VSMac

Backport of https://github.com/mono/mono/pull/18566
2020-01-28 13:13:48 +01:00
Alexander Köplinger fd9f379d29 [sdks] Use Xcode 11.3 stable version for iOS/Mac SDKs
As requested by the xamarin-macios team.

(cherry picked from commit 7e65a73d4d)
2019-12-18 22:08:19 +01:00
monojenkins e3084ecece [debugger] skip suspend for unattached threads (#18138)
[2019-08] [debugger] skip suspend for unattached threads

When the debugger tries to suspend all the VM threads, it can happen with cooperative-suspend that it tries to suspend a thread that has previously been attached, but then did a "light" detach (that only unsets the domain). With the domain set to `NULL`, looking up a JitInfo for a given `ip` will result into a crash, but it isn't even necessarily needed for the purpose of suspending a thread.

More details: Consider the following:
```
(lldb) c
error: Process is running.  Use 'process interrupt' to pause execution.
Process 12832 stopped
* thread #9, name = 'tid_a31f', queue = 'NSOperationQueue 0x8069b670 (QOS: UTILITY)', stop reason = breakpoint 1.1
    frame #0: 0x00222870 WatchWCSessionAppWatchOSExtension`debugger_interrupt_critical(info=0x81365400, user_data=0xb04dc718) at debugger-agent.c:2716:6
   2713         MonoDomain *domain = (MonoDomain *) mono_thread_info_get_suspend_state (info)->unwind_data [MONO_UNWIND_DATA_DOMAIN];
   2714         if (!domain) {
   2715                 /* not attached */
-> 2716                 ji = NULL;
   2717         } else {
   2718                 ji = mono_jit_info_table_find_internal ( domain, MONO_CONTEXT_GET_IP (&mono_thread_info_get_suspend_state (info)->ctx), TRUE, TRUE);
   2719         }
Target 0: (WatchWCSessionAppWatchOSExtension) stopped.
(lldb) bt
* thread #9, name = 'tid_a31f', queue = 'NSOperationQueue 0x8069b670 (QOS: UTILITY)', stop reason = breakpoint 1.1
  * frame #0: 0x00222870 WatchWCSessionAppWatchOSExtension`debugger_interrupt_critical(info=0x81365400, user_data=0xb04dc718) at debugger-agent.c:2716:6
    frame #1: 0x004e177b WatchWCSessionAppWatchOSExtension`mono_thread_info_safe_suspend_and_run(id=0xb0767000, interrupt_kernel=0, callback=(WatchWCSessionAppWatchOSExtension`debugger_interrupt_critical at debugger-agent.c:2708), user_data=0xb04dc718) at mono-threads.c:1358:19
    frame #2: 0x00222799 WatchWCSessionAppWatchOSExtension`notify_thread(key=0x03994508, value=0x81378c00, user_data=0x00000000) at debugger-agent.c:2747:2
    frame #3: 0x00355bd8 WatchWCSessionAppWatchOSExtension`mono_g_hash_table_foreach(hash=0x8007b4e0, func=(WatchWCSessionAppWatchOSExtension`notify_thread at debugger-agent.c:2733), user_data=0x00000000) at mono-hash.c:310:4
    frame #4: 0x0021e955 WatchWCSessionAppWatchOSExtension`suspend_vm at debugger-agent.c:2844:3
    frame #5: 0x00225ff0 WatchWCSessionAppWatchOSExtension`process_event(event=EVENT_KIND_THREAD_START, arg=0x039945d0, il_offset=0, ctx=0x00000000, events=0x805b28e0, suspend_policy=2) at debugger-agent.c:4012:3
    frame #6: 0x00227c7c WatchWCSessionAppWatchOSExtension`process_profiler_event(event=EVENT_KIND_THREAD_START, arg=0x039945d0) at debugger-agent.c:4072:2
    frame #7: 0x0021b174 WatchWCSessionAppWatchOSExtension`thread_startup(prof=0x00000000, tid=2957889536) at debugger-agent.c:4149:2
    frame #8: 0x0037912d WatchWCSessionAppWatchOSExtension`mono_profiler_raise_thread_started(tid=2957889536) at profiler-events.h:103:1
    frame #9: 0x003d53da WatchWCSessionAppWatchOSExtension`fire_attach_profiler_events(tid=0xb04dd000) at threads.c:1120:2
    frame #10: 0x003d4d83 WatchWCSessionAppWatchOSExtension`mono_thread_attach(domain=0x801750a0) at threads.c:1547:2
    frame #11: 0x003df1a1 WatchWCSessionAppWatchOSExtension`mono_threads_attach_coop_internal(domain=0x801750a0, cookie=0xb04dcc0c, stackdata=0xb04dcba8) at threads.c:6008:3
    frame #12: 0x003df287 WatchWCSessionAppWatchOSExtension`mono_threads_attach_coop(domain=0x00000000, dummy=0xb04dcc0c) at threads.c:6045:9
    frame #13: 0x005034b8 WatchWCSessionAppWatchOSExtension`::xamarin_switch_gchandle(self=0x80762c20, to_weak=false) at runtime.m:1805:2
    frame #14: 0x005065c1 WatchWCSessionAppWatchOSExtension`::xamarin_retain_trampoline(self=0x80762c20, sel="retain") at trampolines.m:693:2
    frame #15: 0x657ea520 libobjc.A.dylib`objc_retain + 64
    frame #16: 0x4b4d9caa WatchConnectivity`__66-[WCSession onqueue_handleDictionaryMessageRequest:withPairingID:]_block_invoke + 279
    frame #17: 0x453c7df7 Foundation`__NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    frame #18: 0x453c7cf4 Foundation`-[NSBlockOperation main] + 88
    frame #19: 0x453cacee Foundation`__NSOPERATION_IS_INVOKING_MAIN__ + 27
    frame #20: 0x453c6ebd Foundation`-[NSOperation start] + 835
    frame #21: 0x453cb606 Foundation`__NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 27
    frame #22: 0x453cb12e Foundation`__NSOQSchedule_f + 194
    frame #23: 0x453cb26e Foundation`____addOperations_block_invoke_4 + 20
    frame #24: 0x65de007b libdispatch.dylib`_dispatch_call_block_and_release + 15
    frame #25: 0x65de126f libdispatch.dylib`_dispatch_client_callout + 14
    frame #26: 0x65de3788 libdispatch.dylib`_dispatch_continuation_pop + 421
    frame #27: 0x65de2ee3 libdispatch.dylib`_dispatch_async_redirect_invoke + 818
    frame #28: 0x65df087d libdispatch.dylib`_dispatch_root_queue_drain + 354
    frame #29: 0x65df0ff3 libdispatch.dylib`_dispatch_worker_thread2 + 109
    frame #30: 0x66024fa0 libsystem_pthread.dylib`_pthread_wqthread + 208
    frame #31: 0x66024e44 libsystem_pthread.dylib`start_wqthread + 36
```

Going further, `info` is about this thread:
```
(lldb) p/x *(int *)(((char *) info->node.key) + 0xa0)
(int) $2 = 0x01243f93
(lldb) thread list
Process 12832 stopped
  thread #1: tid = 0x1243ee1, 0x65f7e396 libsystem_kernel.dylib`mach_msg_trap + 10, name = 'tid_303', queue = 'com.apple.main-thread'
  thread #2: tid = 0x1243ee6, 0x65f816e2 libsystem_kernel.dylib`__recvfrom + 10
  thread #3: tid = 0x1243ee7, 0x65f81aea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
  thread #4: tid = 0x1243ee9, 0x65f7e3d2 libsystem_kernel.dylib`semaphore_wait_trap + 10, name = 'Finalizer'
  thread #5: tid = 0x1243eea, 0x65f816e2 libsystem_kernel.dylib`__recvfrom + 10, name = 'Debugger agent'
  thread #6: tid = 0x1243f1d, 0x65f7e396 libsystem_kernel.dylib`mach_msg_trap + 10, name = 'com.apple.uikit.eventfetch-thread'
  thread #8: tid = 0x1243f93, 0x65f7e396 libsystem_kernel.dylib`mach_msg_trap + 10, name = 'tid_6d0f', queue = 'NSOperationQueue 0x8069b300 (QOS: UTILITY)'
* thread #9: tid = 0x12443a9, 0x00222870 WatchWCSessionAppWatchOSExtension`debugger_interrupt_critical(info=0x81365400, user_data=0xb04dc718) at debugger-agent.c:2716:6, name = 'tid_a31f', queue = 'NSOperationQueue 0x8069b670 (QOS: UTILITY)', stop reason = breakpoint 1.1
  thread #10: tid = 0x1244581, 0x65f7fd32 libsystem_kernel.dylib`__workq_kernreturn + 10
(lldb) thread select 8
* thread #8, name = 'tid_6d0f', queue = 'NSOperationQueue 0x8069b300 (QOS: UTILITY)'
    frame #0: 0x65f7e396 libsystem_kernel.dylib`mach_msg_trap + 10
libsystem_kernel.dylib`mach_msg_trap:
->  0x65f7e396 <+10>: retl
    0x65f7e397 <+11>: nop

libsystem_kernel.dylib`mach_msg_overwrite_trap:
    0x65f7e398 <+0>:  movl   $0xffffffe0, %eax         ; imm = 0xFFFFFFE0
    0x65f7e39d <+5>:  calll  0x65f85f44                ; _sysenter_trap
(lldb) bt
* thread #8, name = 'tid_6d0f', queue = 'NSOperationQueue 0x8069b300 (QOS: UTILITY)'
  * frame #0: 0x65f7e396 libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x65f7e8ff libsystem_kernel.dylib`mach_msg + 47
    frame #2: 0x66079679 libxpc.dylib`_xpc_send_serializer + 104
    frame #3: 0x660794da libxpc.dylib`_xpc_pipe_simpleroutine + 80
    frame #4: 0x66079852 libxpc.dylib`xpc_pipe_simpleroutine + 43
    frame #5: 0x66043a8f libsystem_trace.dylib`___os_activity_stream_reflect_block_invoke_2 + 30
    frame #6: 0x65de126f libdispatch.dylib`_dispatch_client_callout + 14
    frame #7: 0x65de3d71 libdispatch.dylib`_dispatch_block_invoke_direct + 257
    frame #8: 0x65de3c62 libdispatch.dylib`dispatch_block_perform + 112
    frame #9: 0x6604349a libsystem_trace.dylib`_os_activity_stream_reflect + 725
    frame #10: 0x6604ef19 libsystem_trace.dylib`_os_log_impl_stream + 468
    frame #11: 0x6604e44d libsystem_trace.dylib`_os_log_impl_flatten_and_send + 6410
    frame #12: 0x6604cb3b libsystem_trace.dylib`_os_log + 137
    frame #13: 0x6604f4aa libsystem_trace.dylib`_os_log_impl + 31
    frame #14: 0x4b4eb4e9 WatchConnectivity`WCSerializePayloadDictionary + 393
    frame #15: 0x4b4d7c4d WatchConnectivity`-[WCSession onqueue_sendResponseDictionary:identifier:] + 195
    frame #16: 0x4b4da435 WatchConnectivity`__66-[WCSession onqueue_handleDictionaryMessageRequest:withPairingID:]_block_invoke.411 + 35
    frame #17: 0x453c7df7 Foundation`__NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    frame #18: 0x453c7cf4 Foundation`-[NSBlockOperation main] + 88
    frame #19: 0x453cacee Foundation`__NSOPERATION_IS_INVOKING_MAIN__ + 27
    frame #20: 0x453c6ebd Foundation`-[NSOperation start] + 835
    frame #21: 0x453cb606 Foundation`__NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 27
    frame #22: 0x453cb12e Foundation`__NSOQSchedule_f + 194
    frame #23: 0x453cb067 Foundation`____addOperations_block_invoke_2 + 20
    frame #24: 0x65dedf49 libdispatch.dylib`_dispatch_block_async_invoke2 + 77
    frame #25: 0x65de4461 libdispatch.dylib`_dispatch_block_async_invoke_and_release + 17
    frame #26: 0x65de126f libdispatch.dylib`_dispatch_client_callout + 14
    frame #27: 0x65de3788 libdispatch.dylib`_dispatch_continuation_pop + 421
    frame #28: 0x65de2ee3 libdispatch.dylib`_dispatch_async_redirect_invoke + 818
    frame #29: 0x65df087d libdispatch.dylib`_dispatch_root_queue_drain + 354
    frame #30: 0x65df0ff3 libdispatch.dylib`_dispatch_worker_thread2 + 109
    frame #31: 0x66024fa0 libsystem_pthread.dylib`_pthread_wqthread + 208
    frame #32: 0x66024e44 libsystem_pthread.dylib`start_wqthread + 36
```
which is a thread in a "light" detach state (aka. coop detach), where we only unset the domain:
https://github.com/mono/mono/blob/4cefdcb7ce2d939ee78fb45d1b4913eb3bc064fd/mono/metadata/threads.c#L6084-L6111

Fixes https://github.com/mono/mono/issues/17926



<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->


Backport of #18105.

/cc @lewurm
2019-12-12 19:06:03 +01:00
monojenkins da5b1c675d [2019-08] Enable GSS on android (#18116)
Backport of #17838.
2019-12-11 14:04:12 +01:00
monojenkins bef1e63358 [interp] track valuetype stack for CEE_RET too (#17998)
Backport of #17968

Fixes https://github.com/mono/mono/issues/17924
2019-12-03 10:47:01 -05:00
Bernhard Urban-Forster 56325f4097 [arm] if mtriple is provided, do not set -march
E.g. when passing `-march=arm -mtriple=armv7s-ios`, `-march` will win and thus ignore `armv7s`.

Fixes https://github.com/mono/mono/issues/17931

* Caused by 5e318afd2e
* Related with 4cd5068230
* Almost fixed by e431093f73

Hopefully we are done with it.
2019-12-02 17:24:04 +01:00
monojenkins c4a1b40fbd [2019-08] [runtime] Treat calling a non-virtual method through… (#17961)
* [runtime] Treat calling a non-virtual method through an open delegate the same as the normal case instead of the OPEN_VIRTUAL case.

* [amd64] Fix the return value mapping in gsharedvt calls, the return address might be in different registers in the caller and callee.

* [runtime] Always initialize del->method_ptr even if interp_method is set, JITted code makes calls through it in mixed mode.

* Add a test for open delegates and gsharedvt.

* Increase nrgctx trampoline count, its needed by dynamic-method-churn.exe in full-aot-interp mode.
2019-12-02 17:20:35 +01:00
Ankit Jain 0c9250280d [2019-08] bump msbuild+roslyn to track mono-2019-08 (#17954)
* Bump msbuild to track mono-2019-08

* Bump roslyn to 3.4.0-beta4-19569-03

.. to match version from `dotnet/toolset` `releaes/3.1.1xx`: https://github.com/dotnet/toolset/blob/597688dfa01a77b8f502bfea9d79feecfc63e33d/eng/Versions.props#L36

* Bump nuget.exe to 5.4.0
2019-11-29 11:20:11 +01:00
Ankit Jain 14aac0c541 Bump msbuild to track mono-2019-08 (#17854) 2019-11-25 10:29:09 -06:00
monojenkins a77128ca79 [merp] Remove extraneous waitpid invocation (#17762)
The extraneous call basically guarantees that the following waitpid invocation will fail. Fixes merp stating that its process has failed when it hasn't.
2019-11-14 12:17:44 +01:00
monojenkins 296a9afdb2 [MacSDK] Bump xamarin-gtk-theme.py to latest revision from private bockbuild (#17786)
This adds some accessibility fixes from https://github.com/mono/xamarin-gtk-theme/pull/35

Backport of #17785.
2019-11-14 09:26:22 +01:00
Larry Ewing e59c3fbb68 Bump msbuild packages to 1e1d0f2caad3731357cca18b298536e514f5519b (#17724)
Pull in dotnet/toolset versions

```
Microsoft.NET.Sdk: 3.1.100-preview3.19553.1 (from 3.1.100-preview2.19528.2)
Microsoft.NET.Sdk.Razor: 3.1.0-preview3.19553.1 (from 3.1.0-preview2.19528.1)
Microsoft.NET.Sdk.Web: 3.1.100-preview3.19554.3 (from 3.1.100-preview2.19529.1)
Microsoft.DotNet.Cli.Runtime: 3.1.100-preview3.19554.3 (from 3.1.100-preview2.19529.1)
```
2019-11-06 11:06:29 +01:00
Alexander Köplinger 062f0ab8ca [sdks] Use Xcode 11.2 stable version for iOS/Mac SDKs
As requested by the xamarin-macios team.
2019-11-04 15:25:39 +01:00
monojenkins e1ef774391 [2019-08] Bump CoreFX to pickup corefx PR #367 to fix #17133. (#17622)
Bump CoreFX to pickup mono/corefx#367 to fix #17133.

Backport of #17590.
2019-11-01 14:20:37 -04:00
Ankit Jain 6d1f88e0ad Bump msbuild to get SDK updates from https://github.com/mono/msbuild/pull/150 2019-11-01 11:22:36 -05:00
Larry Ewing a3f3bfc4c3 Bump nuget to the latest suggested version 2019-11-01 11:22:36 -05:00
Larry Ewing 9bd3079f1c [2019-08] bump msbuild with more p2 packages 2019-11-01 11:22:36 -05:00
Thays Grazia 6ac1ff75a2 [dim][regression] Explicit interface override (#17583) (#17627)
* Precedence order:
-> Override interface method in class
-> Method in class
-> DIM
2019-10-30 21:41:45 -03:00
Alexander Köplinger a119807a01 [acceptance-tests] Bump mono/roslyn to get build fix
See https://github.com/mono/roslyn/commit/6bfcd4e770609a38b8523e83ce1ec943162f30bb

(cherry picked from commit 1340095581)
2019-10-29 21:44:45 +01:00
Aleksey Kliger d234d34b70 [2019-08][merp] Install sigterm handler in EnableMicrosoftTelemetry
Partly revert https://github.com/mono/mono/pull/17296 backports.

Follow-up work for backports of https://github.com/mono/mono/pull/17537 backports.

Addresses https://github.com/mono/mono/issues/17419
2019-10-28 14:31:34 -04:00
monojenkins 444a9a3fc4 [2019-08] [merp] Introduce a new 'dump mode' that allows different signal behavior when dumping (#17568)
* [merp] Introduce a new 'dump mode' that allows different signal behavior when dumping

The primary reason for this is gaining the ability to interpret SIGTERM properly as a crashing signal when outside of 'dump mode', and as a utility signal during the 'thread summarizer' dumping process.
2019-10-26 18:49:25 -04:00
Steve Pfister 8946e49a97 Added SR.missing from original backport 2019-10-24 21:31:39 -05:00
Steve Pfister 5c784c9747 Bump to mono/corefx@fb41040
Includes upstream corefx changes that makes NTLM auth work for more scenarios.

Backport of https://github.com/mono/mono/pull/17530
2019-10-24 21:31:39 -05:00
Larry Ewing fdb704901e Revert "[2019-08] rollback msbuild/roslyn updates for a preview" (#17543)
This reverts commit 1b2e536b22.
now that packages have been built.
2019-10-24 17:40:31 -04:00
monojenkins 92a177923c [2019-08] [debugger] Changing how debugger handles exception w… (#17524)
* Removing all fixes to fix #15203 and #17083, and trying a new approach to fix this #17084, together.

The thing is when we are executing on hybrid suspend the caller is executed inside try catch in the runtime_invoke_ method that is generated. And this try catch should be ignored for the debugger exception, otherwise it's the last try catch in main thread, but should always be considered to generate the stack trace.

Fixes #17084

* This test check the case that we were missing. On preemptive this test always runs perfectly, on Hybrid, never run well until this PR.

* Changing how call unit test. Changing variable name.
2019-10-24 11:54:14 -04:00
Larry Ewing 1b2e536b22 [2019-08] rollback msbuild/roslyn updates for a preview 2019-10-23 16:22:43 -04:00
Ankit Jain ec4ef9bc34 Bump roslyn-binaries to get roslyn 3.4.0-beta3-19521-01
.. from https://github.com/mono/roslyn-binaries/pull/20 .
2019-10-23 11:46:23 -05:00
Ankit Jain cc8deca901 Bump msbuild to pick up sdks+roslyn updates
.. from https://github.com/mono/msbuild/pull/147 .
2019-10-23 11:46:23 -05:00
Ankit Jain 335f0109c5 Bump msbuild to track mono-2019-08 2019-10-23 11:46:23 -05:00
Zoltan Varga 90d6e496e4 Fix checks so stack overflows work again. 2019-10-23 11:38:40 -05:00
Zoltan Varga 4b60e7f930 [jit] Avoid running mono_handle_native_crash () on the altstack, it can't produce a backtrace. AMD64 only for now. 2019-10-23 11:38:40 -05:00
Marius Ungureanu 989333d6ae Bump Bockbuild to pick-up gtk# binding change (#17486)
Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1005448
Which causes quite a few broken clipboard bugs and possible memory corruption
2019-10-23 14:32:30 +02:00
monojenkins baa12e5d24 [profiler] Fix coverage profiler on macos (#17422)
If we have coverage profiling enabled for a method (mono_profiler_coverage_instrumentation_enabled, with coverage_filter callback), then we should be able to allocate a coverage info structure (mono_profiler_coverage_alloc). After https://github.com/mono/mono/commit/52429673dc617fd437518757c04c7448211075e9, coverage_filter was reporting wrapper methods as ok to profile, while mono_profiler_coverage_alloc was refusing to allocate the necessary structure, leading to crashes.
2019-10-22 13:24:39 +03:00
monojenkins ef75d4bef7 [2019-08] BeginConnect complete to early when not using callback. (#17416)
* BeginConnect complete to early when not using callback.

The following commit, https://github.com/mono/mono/commit/068e8fe0424806753d7ab72a7b9bf0e54b58408b#diff-33b28a9dc0b8032650ed77213481a99f
changed the way we do DNS resolve in BeginConnect using host name. Instead
of doing a blocking DNS resolve, it switched to an async DNS resolve, followed
by an async connect. The returned IAsyncResult was just representing the
completion of the DNS resolve task and not the underlying connect. It
also turns out that part of doing EndConnect, we did some validation
of the used IAsyncResult making sure it was an instance of SocketAsyncResult,
meaning that if EndConnect was called on the returned IAsyncResult from
BeginConnect, EndConnect would throw and exception.

NOTE, this only happens if you use pattern like this:

var result = sock.BeginConnect (hostName, port, null, null);
result.AsyncWaitHandle.WaitOne (2000);
sock.EndConnect (result);

It did not happened if you used callbacks, since then EndConnect would
be called as part of callback and that IAsyncResult was of correct type,
or if you did a BeginConnect with an EndPoint or IPAddress[] since that
won't trigger the DNS resolve.

Fix is to make sure we hand out the SocketAsyncResult instance that will
be used in our internal connect calls from BeginConnect. We also make
sure, we chain the DNS resolve task together with a task doing the async
connect (using the same SocketAsyncResult instance). This will make sure
the IAsyncResult returned from BeginConnect is the same one as used in
internal connect call, so it will only complete when the connect call
completes.

* Adding test for BeginConnect using host name.

* Bump API snapshot submodule

Backport of #17035.
2019-10-21 17:48:30 +02:00
monojenkins 01dbbb746f [2019-08] Enable GSS on Linux (#17410)
* Fix GSS on Linux

* fix build

* use gssapi_krb5

* enable on linux

* [csproj] Update project files

* enabled GSS for monodroid

* [csproj] Update project files
2019-10-18 11:34:18 +02:00
Filip Navara 51a3dc37da Fix SafeHandle marshalling in ref/in/out parameters (#17330)
* Fix SafeHandle marshalling in ref/in/out parameters

* Reorder code to make it exception safe, update comments

* Revert the code reordering because it breaks the invariant that new handle returned from native code should always create new SafeHandle on the managed side

* Fix test_0_safehandle_ref test. The test was expecting incorrect behavior, verified on .NET Core 3 and .NET Framework 4.8.

* Address PR feedback

* Fix cut & paste error

* Fix build

* Really fix the test_0_safehandle_ref tests

* Add more tests for SafeHandle marshalling

* Add exclusion for broken CoreFX test
2019-10-17 14:12:31 +02:00
Cody Russell 3eb5f34f54 [GTK] Bump bockbuild for GtkViewport autoscrolling patch. (#17321)
(cherry picked from commit 37dc33a257)
2019-10-16 17:03:54 +02:00
Kyle White b601371d5f Update MERP event type to MonoAppCrash
* Update parameters in MERP WerReportMetadata xml

To enable backend analysis, we need to update our parameters to match our back end event type, which is MonoAppCrash.

It doesn't make sense to me that the previous implementation constructed the XML here in Mono, but depended on the user (VSMac in this case) to add the "correct" event type.  The parameters in the XML, must match exactly what is expected for the given EventType, and so we should ensure they are always in-sync by defining them here.  Thus, I removed the usage of `eventType` in `mono_merp_enable` and hard coded the expected eventType.

* [merp] Don't pass eventType from managed

The eventType must me MONO_MERP_EVENT_TYPE_STR ("MonoAppCrash") - the backend
determines the format of the other fields based on the event type, so it
doesn't make sense to pass other values from managed since the runtime controls
the other fields.

For compatability Mono.Runtime.EnableMicrosoftTelemetry will still take a
string parameter (now called "unused" instead of "eventType_str") but it will
not pass it down to the internal call.

* Bump corlib version

* [merp] Revert paramerters in WerReportMetadata.xml

Still need event type to be `MonoAppCrash` but the parameters will be the same as before.
2019-10-15 19:10:14 +02:00
Alexander Köplinger 6184ff007b [2019-08][ci] Use Xcode11.1 and 11.2beta2 for XI/XM Mono SDK builds (#17324)
As requested by the xamarin-macios team.
2019-10-15 11:44:41 +02:00
monojenkins 8969f2cc99 [2019-08] [merp] Include any managed methods in the 'unmanaged_frames' portion … (#17316)
* [merp] Include any managed methods in the 'unmanaged_frames' portion of the output also

This can help correlate the two lists when we have mixed managed & unmanaged stacks in our crash output.

* Wehn symbol/function address is not found, still output the IaP

* Don't set native_offset to ip, that's not what it means

* [merp] Bump protocol version

* Minor formatting fix


* Remove unused var

* Refactor filling in managed info for stack frame
2019-10-14 17:12:39 -04:00
monojenkins 3009440108 [2019-08][merp] Don't install SIGTERM handler in EnableMicrosoftTelemetry (#17308)
* [merp] Don't call install_state_summarizer in EnableMicrosoftTelemetry

install_state_summarizer installs a SIGTERM handler. Unfortunately
sigterm_signal_handler assumes that it will only be called when a crash is
already in progress (it assumes it won't be the supervisor, and so it doesn't
setup the memory for capturing a crash report among other things).

* [merp] Register SIGTERM handler in dump_native_stacktrace

Previously it was installed by EnableMicrosoftTelemetry, which is too early.
Now we get here without a handler installed even when mono_merp_enabled returns true.
2019-10-14 20:54:05 +02:00
Alexander Köplinger df5e13f95d [tests] Bump corefx to get Azure testhost change (#17275)
* Bump corefx to get Azure testhost change

See https://github.com/mono/corefx/pull/360

* Update ClientWebSocketTest as well

(cherry picked from commit d457346e06)
2019-10-11 09:39:00 +02:00
monojenkins 11e1499c22 [2019-08] [merp] Print missing status marker file for stage 1 (setup) (#17220)
* [merp] Print missing status marker file for stage 1 (setup)

* Zeroing is not necessary, snprintf() always null-terminates in this case

* Remove unused variable
2019-10-10 23:34:08 -04:00
Vlad Brezae 7dbad3c361 [arm] Fix fetching of method addresses (#17253)
[2019-08][arm] Fix fetching of method addresses

After https://github.com/mono/mono/commit/9ff3b0d65ee4, in an aot image we can emit addresses either as bl offset (which uses 4 bytes) or as ldr pc, =<label>; <addr> (which uses 8 bytes). Before this commit we were dereferencing an instruction pointer, in get_call_table_entry, assuming 8 bytes per entry. This could overflow and crash if we used in fact only 4 bytes per entry. Fix this by including the entry size in the aot image.

Fixes random crashes on arm CI on full-aotmixed suite.

Backport of https://github.com/mono/mono/pull/17099
2019-10-09 21:45:56 +02:00
monojenkins 9a88a36789 [sgen] Fix invalid value passed to write barrier (#17247)
[2019-08] [sgen] Fix invalid value passed to write barrier

When doing memory copy dest is the destination address and src is the source address. If we are copying a single reference, we need to emit a write barrier and pass to the write barrier the value, not the pointer where the value is stored. Otherwise nursery checks will fail and we won't mark the card table.

Backport of #17236.

/cc @marek-safar @BrzVlad
2019-10-09 15:46:05 +02:00
Alexander Köplinger 0f241c975c [2019-08] Add drawing type converters to mobile profiles (#17240)
* [2019-08] Add drawing type converters to mobile profiles

Needed for https://github.com/xamarin/xamarin-android/issues/3726

* Bump API snapshot submodule

* [csproj] Update project files
2019-10-09 12:16:40 +02:00
Ankit Jain 7ebe1a1763 Update Roslyn to 3.4.0-beta2-19477-01
.. to match roslyn-binaries PR: https://github.com/mono/roslyn-binaries/pull/19
2019-10-08 12:06:41 -05:00
Ankit Jain b759449ba8 Bump msbuild to track mono-2019-08
.. which updates SDKs and roslyn (match what mono has) in
https://github.com/mono/msbuild/pull/144 :

```
Microsoft.NET.Sdk:                      3.1.100-preview1.19506.1
Microsoft.NET.Sdk.Web:                  3.1.100-preview1.19506.3
Microsoft.NET.Sdk.Razor:                3.1.0-preview1.19506.2

Microsoft.NETCore.App:                  3.1.0-preview1.19506.1
Microsoft.DotNet.Cli.Runtime:           3.1.100-preview1.19506.9

NuGet.Build.Tasks:                      5.3.0-rtm.6251

Roslyn:                                 3.4.0-beta2-19477-01
Based on dotnet/toolset release/3.1.1xx branch HEAD
(e9c6794f1f124e273571237eb72a949ee5c950c6):

https://github.com/dotnet/toolset/blob/e9c6794f1f124e273571237eb72a949ee5c950c6/eng/Versions.props#L36
```
2019-10-08 12:06:41 -05:00
monojenkins 617f399efc [IO] Remove read-only logic in mono_w32_get_disk_free_space (#17211)
[2019-08] [IO] Remove read-only logic in mono_w32_get_disk_free_space

Fixes #17151

This brings us in line with GetDiskFreeSpaceExW on Windows as well as .NET Core.

I checked with the Android folks and it seems like this won't fail their test - all they check is that the returned value isn't `long.MaxValue`.

Backport of #17177.

/cc @akoeplinger @CoffeeFlux
2019-10-08 02:15:58 +02:00
monojenkins 77258ea112 [2019-08] [debugger][exception] Debugger breaks on handled exceptions (#17202)
* If there is a perform_wait_callback in the stack there will be another catch generated by the owner thread, so we don't need to throw, we can continue and find the next catch. Fixes #17083

* Reverting unit test changed on commit 405d521.

* Fixing assert when calling mono_jit_info_get_method if it was a trampoline.
2019-10-07 17:10:58 -04:00
Ankit Jain f83c321f88 Bump msbuild to track mono-2019-08 (#17193)
.. to track https://github.com/mono/msbuild/pull/143 .
	`Update SDKs to track vs16.4 and `.NET Core 3.1 Dev``
2019-10-07 16:10:44 +02:00
monojenkins 1ecd094b44 [2019-08] [Mono.Debugger.Soft] Fix VirtualMachine detaching (#17077)
* Revert "[Mono.Debugger.Soft] Properly close connections"

This reverts commit 2da7707373.

This was previously reverted because it was causing issues and it still does. It is a hack fix. We signal the connection for closing and next we send the dispose command over the network. This is obviously racy.

* [Mono.Debugger.Soft] Make sure receiving thread always closes

When we want to close the connection, setting the close flag is not enough, because a thread can be already stuck in a blocking receive, without getting to check the flag. We fix this by additionaly breaking the connection, by using socket.Shutdown.

Fixes https://github.com/mono/mono/issues/7377

* Bump API snapshot submodule
2019-10-06 09:57:37 +03:00
monojenkins 54a33be9de [merp] Put thread into async context before running summarizer (#17197)
[2019-08] [merp] Put thread into async context before running summarizer

Followup work for https://github.com/mono/mono/pull/17090

In order to get managed method info for unmanaged stacktraces, we call
`mini_jit_info_table_find_ext` which calls `decode_exception_debug_info` which may
allocate if it's not in async context.

Do the switch in `mono_threads_summarize_execute` so that non-supervising threads
all switch when they run the `sigterm_signal_handler`.  `mono_threads_summarize`
already does it for the supervisor thread.

Fixes https://github.com/mono/mono/issues/17180



Backport of #17194.

/cc @lambdageek
2019-10-05 21:05:59 +02:00
Alexander Köplinger 72128bb00d Bump libgdiplus to 6.0.4
(cherry picked from commit 0600ea1256)
2019-10-05 17:46:04 +02:00
Johan Lorensson 65a972c033 Always do copy_stack_data on entering GC safe/unsafe mode. (#17184) 2019-10-05 10:01:40 -04:00
monojenkins 9e6def1553 [merp] exit_status is 0 if we ran the uploader successfully (#17187)
Not 1 (TRUE)
2019-10-04 17:22:59 -04:00
monojenkins 8a707cc012 [2019-08] [reflection] Only duplicate MonoMarshalSpec strings for custom types (#17189)
[2019-08] [reflection] Only duplicate MonoMarshalSpec strings for custom types

Fixes #16570

We were treating the union as though it was a different type than it really is, and so we got junk data for the pointers and attempting to access them caused a crash.

Also fixed a typo seen along the way.

Backport of #17175.

/cc @lambdageek @CoffeeFlux
2019-10-04 22:46:03 +02:00
monojenkins bd72952cf8 [2019-08] [merp] Don't overrun buffer in copy_summary_string_safe … (#17178)
* [merp] Don't overrun buffer in copy_summary_string_safe

MonoFrameSummary:str_destr is an array of MONO_MAX_SUMMARY_NAME_LEN bytes, not
MONO_MAX_SUMMARY_NAME_LEN + 1 bytes.

Fixes Coverity CID 1454563

* [merp] Use g_strlcpy for copy_summary_string_safe

Fixes Coverity CID 1454563

We would sometimes write to MonoSummaryFrame:str_descr which is
MONO_MAX_SUMMARY_NAME_LEN bytes long at index MONO_MAX_SUMMARY_NAME_LEN which
is one past the end of the array.

* nit: rename confusing parameter names

old names were confusing - we were copying from 'out' to 'in'.  Now we copy to
'dest' from 'src'
2019-10-04 01:20:33 -04:00
Ankit Jain b6efc0cc90 Bump msbuild to track xplat-master (#17132)
.. which is tracking dotnet branch `release/3.1.1xx`.
2019-10-03 23:47:01 +02:00
monojenkins 2869cd5f67 Bump ikvm to get https://github.com/mono/ikvm-fork/pull/13 (#17170) 2019-10-03 20:46:55 +02:00
monojenkins a64a25695d [2019-08] [merp] Use macOS version not Darwin version in MERP reports (#17147)
* Use macOS version not Darwin version in MERP

Fixes #17004

* Update mono-merp.c

Ensure this is only for Mac

* Don't allocate in macos_version_string

Use a static buffer.

Also some formatting fixes.

* Simplify error path code when getting the product version


* Add G_STRING_CONSTANT_AND_LENGTH macro

Cherrypicked from
https://github.com/mono/mono/commit/8c288f06664c65050b153da0a8952209adc958a0
2019-10-03 10:44:50 -04:00
Alexis Christoforides 57f068438d [2019-08] [merp] Add API method that whitelists all native libraries (#17128)
Backport of #16899 and #15622

* [merp] Add API method that whitelists all native libraries

This is so that complex consumers such as Visual Studio for Mac can forego attempting to enumerate all loaded libraries, register them one at a time and potentially keep the list updated

* Set out_module, to avoid getting no useful information in the printout

It seems that without this, most/all entries in the unmanaged frames list are have no useful information.

* Add stub of new function when crash reporting is disabled

* Remove problematic assert from SIGILL handler

mono_handle_native_crash() function can actually return if the native crash has triggered or has been trigerred by  more than one signal. So it is possible to reach the point of the assert

* Guard writing to out_module

* Fix pointing to stack on string && some add tracing

* [merp] Fix logic of 'is_managed' attribute

* [merp] Output native library module name when 'whitelist all' mode is enabled (#16899)

Contributes to  https://github.com/mono/mono/issues/16689

* Bump MONO_CORLIB_VERSION
2019-10-01 22:08:28 -04:00
Alexander Köplinger 528103728f [2019-08] Update NETStandard2.1 APIs (#17123)
* Update NETStandard2.1 APIs (#17080)

Contributes to #17064

* Add System.Data.DataSetExtensions to mobile profiles

* Bump API snapshot submodule
2019-09-30 22:59:41 +02:00
monojenkins d8441deead [crashing] Remove Mono signal handlers when starting to handle a crash (#17078)
[2019-08] [crashing] Remove Mono signal handlers when starting to handle a crash

Fixes https://github.com/mono/mono/issues/16803

Backport of #17002.

/cc @marek-safar @alexischr
2019-09-27 01:36:00 +02:00
monojenkins 7ae0f38fd7 [runtime] Respect runtime_version in mono_init_internal (#17086)
[2019-08] [runtime] Respect runtime_version in mono_init_internal

In 6d2c77fb33 we changed the representation of
the runtimes that we will probe from a NULL-terminated array to a linked list.
Unfortunately we made a typo, and in the case where the caller of
`mono_init_internal` provided a runtime_version, we still picked
`DEFAULT_RUNTIME_VERSION` instead of the given `runtime_version`.

This is an issue for embedders like XA that use the "mobile" runtime - all
their BCL assemblies are compiled with the "mobile" version number (2.0.5.0) but
Mono running with the default runtime configuration will remap to 4.0.0.0.  As
a result, when there are references to 2.0.5.0 assemblies, the load requests
will be remapped to 4.0.0.0 which will never see the already loaded 2.0.5.0
assemblies, and we will fall back on the embedder's preload hook or filesystem
probing every single time.  This is a performance fail.




Backport of #17085.

/cc @lambdageek
2019-09-26 21:36:12 +02:00
Rolf Bjarne Kvinge 61ca7fe3a4 [sdks] Bump min iOS version to 7.0. (#17070)
Because that's the min iOS version in all current versions of Xamarin.iOS.
2019-09-26 14:14:22 +02:00
Steve Pfister c99adb97ed [2019-08] Fix time zone issue when jumping into DST (#17027)
There is an issue with jumping into DST for some time zones when the incorrect date-time offset is returned for date-time in UTC (which comes from DateTime.Now). The fix is to just check if the incoming date-time is in UTC
Also I added set of tests for some time zones but they verify jumping into DST in general.

Fixes #16395

Backport of https://github.com/mono/mono/pull/16430
2019-09-25 17:03:13 +02:00
Alexander Köplinger 6a8aced231 [2019-08] Bump bockbuild to get recent fixes (#17058)
- https://github.com/mono/bockbuild/pull/121
- https://github.com/mono/bockbuild/pull/122

Backport of https://github.com/mono/mono/pull/17054
2019-09-25 16:56:28 +02:00
monojenkins af008b207d [2019-08] [threads] clear small_id_key TLS when unregistering a thread (#17015)
[2019-08] [threads] clear small_id_key TLS when unregistering a thread

Fixes
```
* thread #12, name = 'tid_a507', stop reason = EXC_BREAKPOINT (code=1, subcode=0x1be66144)
  * frame #0: 0x1be66144 libsystem_c.dylib`__abort + 184
    frame #1: 0x1be6608c libsystem_c.dylib`abort + 152
    frame #2: 0x003e1fa0 monotouchtest`log_callback(log_domain=0x00000000, log_level="error", message="* Assertion at ../../../../../mono/utils/hazard-pointer.c:158, condition `mono_bitset_test_fast (small_id_table, id)' not met\n", fatal=4, user_data=0x00000000) at runtime.m:1251:3
    frame #3: 0x003abf44 monotouchtest`monoeg_g_logv_nofree(log_domain=0x00000000, log_level=G_LOG_LEVEL_ERROR, format=<unavailable>, args=<unavailable>) at goutput.c:149:2 [opt]
    frame #4: 0x003abfb4 monotouchtest`monoeg_assertion_message(format=<unavailable>) at goutput.c:184:22 [opt]
    frame #5: 0x003904dc monotouchtest`mono_thread_small_id_free(id=<unavailable>) at hazard-pointer.c:0:2 [opt]
    frame #6: 0x003a0a74 monotouchtest`unregister_thread(arg=0x15c88400) at mono-threads.c:588:2 [opt]
    frame #7: 0x00336110 monotouchtest`mono_thread_detach_if_exiting at threads.c:1571:4 [opt]
    frame #8: 0x003e7a14 monotouchtest`::xamarin_release_trampoline(self=0x166452f0, sel="release") at trampolines.m:644:3
    frame #9: 0x001cdc40 monotouchtest`::-[__Xamarin_NSTimerActionDispatcher release](self=0x166452f0, _cmd="release") at registrar.m:83445:3
    frame #10: 0x1ce2ae68 Foundation`_timerRelease + 80
    frame #11: 0x1c31b56c CoreFoundation`CFRunLoopTimerInvalidate + 612
    frame #12: 0x1c31a554 CoreFoundation`__CFRunLoopTimerDeallocate + 32
    frame #13: 0x1c31dde4 CoreFoundation`_CFRelease + 220
    frame #14: 0x1c2be6e8 CoreFoundation`__CFArrayReleaseValues + 500
    frame #15: 0x1c2be4c4 CoreFoundation`CFArrayRemoveAllValues + 104
    frame #16: 0x1c31ff64 CoreFoundation`__CFSetApplyFunction_block_invoke + 24
    frame #17: 0x1c3b2e18 CoreFoundation`CFBasicHashApply + 116
    frame #18: 0x1c31ff10 CoreFoundation`CFSetApplyFunction + 160
    frame #19: 0x1c3152cc CoreFoundation`__CFRunLoopDeallocate + 204
    frame #20: 0x1c31dde4 CoreFoundation`_CFRelease + 220
    frame #21: 0x1c304a80 CoreFoundation`__CFTSDFinalize + 144
    frame #22: 0x1bfa324c libsystem_pthread.dylib`_pthread_tsd_cleanup + 644
    frame #23: 0x1bf9cc08 libsystem_pthread.dylib`_pthread_exit + 80
    frame #24: 0x1bf9af24 libsystem_pthread.dylib`pthread_exit + 36
    frame #25: 0x0039df84 monotouchtest`mono_threads_platform_exit(exit_code=<unavailable>) at mono-threads-posix.c:145:2 [opt]
    frame #26: 0x0033bb84 monotouchtest`start_wrapper(data=0x1609e1c0) at threads.c:1296:2 [opt]
    frame #27: 0x1bf9b914 libsystem_pthread.dylib`_pthread_body + 128
    frame #28: 0x1bf9b874 libsystem_pthread.dylib`_pthread_start + 44
    frame #29: 0x1bfa3b94 libsystem_pthread.dylib`thread_start + 4
```


Debugged by @lambdageek. Contributes to https://github.com/mono/mono/issues/10641

Edit: C/p into PR description so it's in the commit message:

We think what happens is:

1. `start_wrapper` runs `unregister_thread` when the thread is exiting.  At that point the `small_id` for the thread is cleared from the hazard pointer bitset by `mono_thread_small_id_free (small_id)`

2. Some other TLS destructor runs and attaches the thread again (which runs `mono_thread_info_register_small_id` which first calls `mono_thread_info_get_small_id` which tries to get the small id from the `small_id_key` TLS key and so the new `MonoThreadInfo` has the same `small_id` as the previously destroyed `MonoThreadInfo` - but the hazard pointer bitset is **not** updated).

3. This other TLS destructor runs and calls `mono_thread_detach_if_exiting` which calls `unregister_thread` again.

4. `unregister_thread` calls `	mono_thread_small_id_free (small_id)` a second time which asserts because we already cleared that id from the hazard pointer bitset.



Backport of #16973.

/cc @lewurm
2019-09-24 23:15:54 +02:00
monojenkins 6d40f13121 [2019-08] [debugger] Crash when debugging iOS application that throws (#16989)
* Doing the same fix from Android to IOS, I removed the ifdef, I don't think that this will happen when not using IOS nor Android, but I prefer to let the if there to avoid the exception. On mini-exceptions.c check if there is no ji we can continue and generate the exception without checking wrapper_type.

Fixes #16824

* Removing unnecessary check.
2019-09-24 20:50:09 +02:00
Jo Shields 4546440471 Add mono-hang-watchdog.in to tarball (#17018)
Remove custom distdir target and use standard EXTRA_DIST to do so.

(cherry picked from commit 75c21692a0)
2019-09-24 16:09:53 +02:00
monojenkins 4c31bdabf3 [2019-08] [debugger] New way to filter exceptions to support VSWin features (#17000)
* Creating a new version of MOD_KIND_EXCEPTION_ONLY to support VsWin features, discussed with Joaquin Jares. Because we don't have this functionality of get every other exception that is not specified, VsWin was getting every exception and filtering later. But this causes a slowness during the debugger because we stop all thread on each exception that we get, even if they are caught and we don't want to stop.

* Fixing other unit test because now we have 2 nested classes. Fixing indentation.

* Creating a flag in the MOD_KIND_EXCEPTION_ONLY protocol event and not creating a new protocol event.

* Changing what was suggested by Zoltan.

* Coding style

* Bump API snapshot submodule
2019-09-24 11:08:20 -03:00
Alexander Köplinger d73a286a2c [ci] Make ios/mac sdks archive URL more predictable
Requested by xamarin-macios team.

(cherry picked from commit 0a3c9c451b)
2019-09-24 15:27:12 +02:00
monojenkins dacef517fa [merp] Use function names even in 'private crashes' mode (#17003)
Partially fixes https://github.com/mono/mono/issues/16689

Backport of #16897.
2019-09-24 11:41:06 +02:00
monojenkins d1ca1a5d2e [2019-08] [System.Xml] Fix deserialization issue (#17014)
[This ](https://github.com/mono/mono/pull/11194/files#diff-ae54d9565e735005686191de0f19ed50R431-R435)change in `XmlTypeMapElementInfo.GetElement`  introduced the logic for handling the case of derived types deserialization. 
For some cases (like https://github.com/mono/mono/issues/16918) it breaks existing functionality because it returns wrong element for given element name after searching withing derived types collection.

![image](https://user-images.githubusercontent.com/3258267/65416085-bedc0500-ddff-11e9-941c-f24045c64121.png)

Unfortunately, what I can do here is just reverting the related changes.

Fixes https://github.com/mono/mono/issues/16918

Backport of #16965.

/cc @marek-safar @MaximLipnin
2019-09-24 11:35:39 +02:00
monojenkins 1d55b355f3 Correctly check for HAVE_STAT_BIRTHTIME in configure.ac checks for System.Native (#17001)
The check was done incorrectly, the include files need to be separated by newlines otherwise we would get a false negative result.

config.log contained this:

```
conftest.c:279:23: warning: extra tokens at end of #include directive [-Wextra-tokens]
#include <sys/types.h>, #include <sys/stat.h>
                      ^
                      //
```

This means that when doing File.GetCreationTime() we'd fall back to returning the last modified time.

It regressed when we switched to System.IO.File to the CoreFX implementation i.e. System.Native in https://github.com/mono/mono/commit/8f5cef936491e8b20888bbf18d426482c890637c.

Fixes https://github.com/mono/mono/issues/16974
2019-09-24 10:12:30 +02:00
monojenkins bb522edb0d [2019-08] Restore Previous ExecutionContext Capture Behavior (#16997)
Restores previous ExecutionContext Capture behavior where we were copying a new SynchronizationContext as opposed to a reference to the existing one.

The old behavior caused SynchronizationContextAwaitTaskContinuations to not post to a SynchronizationContext.

Fixes https://github.com/mono/mono/issues/16759

Reverts a fix for https://github.com/mono/mono/issues/12421

Backport of https://github.com/mono/mono/pull/16945
2019-09-23 19:06:16 -04:00
Bernhard Urban 7f7b5c9f3e [interp] avoid exception checkpoint when in thread is in GC Safe state (#16967)
[2019-08] [interp] avoid exception checkpoint when in thread is in GC Safe state

Backport of https://github.com/mono/mono/pull/16955
2019-09-23 21:46:06 +02:00
Alexander Köplinger c87f99dd81 [ci] Fix typo in sdks-archive.groovy 2019-09-23 15:53:44 +02:00
Alexander Köplinger 065499c2ef [ci] Fix typo in sdks-archive.groovy 2019-09-23 15:48:59 +02:00
Alexander Köplinger 9f7b2c8d0a [ci] Fix typo in sdks-archive.groovy 2019-09-23 15:44:44 +02:00
Alexander Köplinger 2c003ec71d [ci] Build iOS/Mac Mono sdks archive using Xcode 11
This was requested by the xamarin-macios team.

(cherry picked from commit 6ad929c317)
2019-09-23 15:43:33 +02:00
Bernhard Urban e02e823ef7 [arm64_32] fix pointer size in CallInfo
Note that in the output below `a`, `b`, etc. are NSObjects, so they are really passed as pointer.

Before:
```
* thread #1, name = 'tid_303', queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x04f301d4 aWatchOSExtension`::xamarin_localized_string_format_9(format="hello%@%@%@%@%@%@%@%@%@", a=0, b=1, c=2, d=3, e=4, f=5, g=6, h=7, i=0x00000000) at nsstring-localization.m:81:9
   78   void *
   79   xamarin_localized_string_format_9 (NSString *format, id a, id b, id c, id d, id e, id f, id g, id h, id i)
   80   {
-> 81           return [NSString localizedStringWithFormat: format, a, b, c, d, e, f, g, h, i];
   82   }
   83
   84   }
(lldb) mbt 4
* thread #1
  * frame #0: 0x04f301d4 aWatchOSExtension`::xamarin_localized_string_format_9(format="hello%@%@%@%@%@%@%@%@%@", a=0, b=1, c=2, d=3, e=4, f=5, g=6, h=7, i=0x00000000) at nsstring-localization.m:81:9
    frame #1: 0x04d9984c aWatchOSExtension`interp_to_native_trampoline + 156
    frame #2: 0x04f41d5c aWatchOSExtension`ves_pinvoke_method(frame=0x05167af8, sig=0x1518afd0, addr=(aWatchOSExtension`::xamarin_localized_string_format_9(NSString *, id, id, id, id, id, id, id, id, id) at nsstring-localization.m:80), string_ctor=0, context=0x14550960, save_last_error=0) at interp.c:1411:2 [opt]
    NSString::xamarin_localized_string_format_9 @ 68 "calli.nat" || frame #3: 0x04f3bfa4 aWatchOSExtension`interp_exec_method_full(frame=0x05167d38, context=<unavailable>, clause_args=0x00000000, error=0x05168540) at interp.c:3290:5 [opt]
```

After:
```
* thread #1, name = 'tid_303', queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x04c2c1e0 aWatchOSExtension`::xamarin_localized_string_format_9(format="hello%@%@%@%@%@%@%@%@%@", a=0, b=1, c=2, d=3, e=4, f=5, g=6, h=7, i=8) at nsstring-localization.m:81:9
   78   void *
   79   xamarin_localized_string_format_9 (NSString *format, id a, id b, id c, id d, id e, id f, id g, id h, id i)
   80   {
-> 81           return [NSString localizedStringWithFormat: format, a, b, c, d, e, f, g, h, i];
   82   }
   83
   84   }
```
2019-09-23 11:53:10 +02:00
monojenkins 70d6903053 [2019-08] [merp] Use a separate program as the hang supervisor. (#16900)
* [merp] Use a separate program as the hang supervisor.

Fixes https://github.com/mono/mono/issues/15646

macOS does not like signals being sent from the forked supervisor process, possibly towards anywhere but definitely when sent to the parent process. The following message is currently spewed after the supervisor process attempting to send a SIGSEGV to a hanged Mono process:
"The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec()."

We follow that direction and introduce a new binary that, when available in the mono executable's binary directory, is used to abort the parent process for us.

* Experiment: remove line possibly causing bad compilation under C++
2019-09-20 16:21:34 +02:00
Rolf Bjarne Kvinge 4bff2b6370 [offsets-tool] Install clang into the user-specific python directory.
Because the system location isn't world writeable on Catalina.
2019-09-20 16:19:44 +02:00
EgorBo 81894ec8ca Implement WriteCore and ReadCore in DeflateStream 2019-09-20 16:18:28 +02:00
Alexander Köplinger bfbf823ca1 [ci] Remove more XCODE32_DIR usages (#16964)
Follow-up to https://github.com/mono/mono/pull/16936

(cherry picked from commit 74b9ca426a)
2019-09-20 14:01:06 +02:00
Alexander Köplinger ce01b20a4d Add net_4.8.xml to EXTRA_DIST and bump binary-reference-assemblies again
The file was missed in https://github.com/mono/mono/pull/16912.
Also pull in another reference assemblies update.

(cherry picked from commit 857284b412)
2019-09-20 12:00:41 +02:00
Alexander Köplinger 7a587d7fa6 Add .NET 4.8 reference assemblies (#16912)
Brings in https://github.com/mono/reference-assemblies/pull/20

(cherry picked from commit f6a080bb79)
2019-09-20 12:00:35 +02:00
Rolf Bjarne Kvinge 35e454a8f6 [sdks] Remove the mac32 build. (#16936)
Xamarin.Mac doesn't need nor use it anymore.

This also removes the last part of the mono archive that required Xcode 9.4.
2019-09-19 14:34:30 -05:00
monojenkins 75eb342f53 [2019-08] [System] Make FileSystemWatcher backend non-static (#16926)
[2019-08] [System] Make FileSystemWatcher backend non-static

The FileSystemWatcher `watcher` field is the backend IFileWatcher that's
supposed to be used for the actual operations.

Each backend has a `bool GetInstance (out watcher)` method that returns a
singleton object, so each new instance of FileSystemWatcher gets the same
IFileWatcher instance.  (They will get different `watcher_handle` instances
which are used by some backends to uniquely identify this FileSystemWatcher).

However when the first FileSystemWatcher instance is `Dispose`d, it will set
`watcher = null` which will prevent the remaining instances from calling

    watcher?.StopDispatching (watcher_handle);
    watcher?.Dispose (watcher_handle);

which means that the backend won't properly cleanup resources for any other FSW
instances that have other `watcher_handle` values.

Addresses https://github.com/mono/mono/issues/16709



<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->


Backport of #16922.

/cc @steveisok @lambdageek
2019-09-19 14:45:54 -04:00
monojenkins 5881981f79 [2019-08] [mini] Add missing membars when initializing rgctx entries (#16909)
[2019-08] [mini] Add missing membars when initializing rgctx entries

Whenever we are publishing changes to the rgctx arrays, we are racing with rgctx_lazy_fetch_trampoline, so we need to make sure any pointers we set there must have their contents initialized.


Backport of #16904.

/cc @marek-safar @BrzVlad
2019-09-18 11:36:20 -04:00
monojenkins 6290b6cd6e Temporarily disable embedded ppdb data decompression (#16911)
Backport of #16868.
2019-09-18 14:57:42 +02:00
monojenkins a0e7f9eaf2 [2019-08] [arm64_32] make "Debug Mode" work on Watch series 4 with --interpreter (#16886)
[2019-08] [arm64_32] make "Debug Mode" work on Watch series 4 with --interpreter

Main objective for reviewers: This PR shouldn't change anything for `arm64`.

Context: "Debug Mode" on the Apple Watch allows execution of regular machine code and thus is pretty similar to FullAOT on iPhone, i.e. it doesn't require bitcode, but _still_ doesn't allow `signal(3)` so cooperative suspend is required.

Apple Watch Series 4 and onward use an ARM64 chip, but with a different ABI, also known as `arm64_32`. This PR changes the AOT compiler and related trampolines so that the AOT compiler can generate all necessary code to run the interpreter on this target.


Changes:

--------------------------------------

[arm64_32] set register size to 8 in cross compiler too 

-----------------------------------------

 [machine] update `target_mgreg_t` definition

`SIZEOF_REGISTER` is usually the same as `TARGET_SIZEOF_VOID_P`, except when `MONO_ARCH_ILP32 is defined.

`target_mgreg_t` should represent the width of the hardware register, that is, `SIZEOF_REGISTER`.

---------------------------------------------

[arm64_32] fix AOT image layout 

---------------------------------------------

 [arm64_32] make trampolines bitwidth aware

* replace pointer loads/stores with bitwidth-dependent macro
* reflect `specific` trampolines so that only two instructions are used for ILP32, since the related pair in the data page only needs 2 * 32bits too
* replace some `sizeof (target_mgreg_t)` with `TARGET_SIZEOF_VOID_P` (former is hardware register size, latter is pointer size)

---------------------------------------------
These regression tests are _not_ passing: https://github.com/mono/mono/issues/16864 Also some of monotouch-tests are crashing, see https://github.com/mono/mono/issues/16819

Here is a screenshot of a debug session in VSMac:
<img width="1321" alt="Screenshot 2019-09-16 at 19 13 22" src="https://user-images.githubusercontent.com/75403/64981326-1dfbc000-d8bc-11e9-9d16-48036f36b638.png">


Contributes to https://github.com/mono/mono/issues/10641


Backport of #16865.

/cc @lewurm
2019-09-17 17:06:03 -04:00
monojenkins 6275840a7f Rename bundle identifier for the various Mono.frameworks we create for Xamarin.iOS. Fixes xamarin/xamarin-macios#7005. (#16901)
This is the equivalent of
https://github.com/xamarin/xamarin-macios/commit/a9abc07cb357f9f012e3da66c70fa09d96bf02f7,
just for the Mono.frameworks in the mono archive.

Fixes https://github.com/xamarin/xamarin-macios/issues/7005.
2019-09-17 21:18:06 +02:00
monojenkins 25f6093283 [corlib] Fix building nunit-lite twice (#16895)
We sometimes saw the following build error in Mono SDKs builds on Jenkins:

```
[2019-09-16T01:03:30.709Z] CSC     [xammac] nunit-lite-console.exe
[2019-09-16T01:03:30.709Z] error CS0009: Metadata file '/Users/builder/jenkins/workspace/archive-mono/2019-08/mac/release/mcs/class/lib/xammac/nunitlite.dll' could not be opened -- PE image doesn't contain managed metadata.
```

Taking a closer look we found out that nunit-lite was trying to be built twice for the same profile which caused a race where the file was corrupted.

The reason for this is that the corlib Makefile defines two test assemblies: the normal PROFILE_corlib_test.dll and BinarySerializationOverVersionsTest.dll and
integrating the BinarySerializationOverVersionsTest.dll via the `test-vts` target incorrectly overwrote the `test` target instead of using `test-local`.

Backport of #16894.
2019-09-17 20:26:09 +02:00
monojenkins 7ec17ba1be [2019-08] [android sdk] Add aprofutil tool (#16884)
Backport of #16866.
2019-09-17 15:58:17 +02:00
monojenkins f755f3b539 [metadata] Fix leaks when handling a few attributes (#16850)
[2019-08] [metadata] Fix leaks when handling a few attributes

Callers of mono_reflection_create_custom_attr_data_args_noalloc were leaking some of the returned information. Accessed attributes are FixedBufferAttribute and UnmanagedFunctionPointerAttribute.

Backport of #16675.

/cc @BrzVlad
2019-09-16 20:16:02 -04:00
monojenkins 5f9a2db39b [2019-08] Fix infrequent hangs in test-runner. (#16854)
* Fix infrequent hangs in test-runner.

test-runner has been plagued with very infrequent hangs causing long
timeouts on CI. Turns out that there is a race in AsyncStreamReader
used by Process class for handling stdout/stderr when closing down
process. Since AsyncStreamReader::Dispose didn't make sure no pending
async read requests were still in flight before closing the stream
and underlying handle, it led to a race condition deadlocking the
complete process, hanging test-runner. A similar race has also been
observed but instead of causing a deadlock, it could also manifest as an
System.ObjectDisposedException when doing EndRead while another thread
is disposing the underlying stream. Hitting that race didn't deadlock
the process but failed to complete invoke of test-runner.

Fix is to better protect the async callback and the thread doing the
dispose call. In order to make sure we don't close underlying handle
while still having async reads in flight, fix also checks async result
for completion and if not completed when trying to dispose AsyncStreamReader
it will try to cancel outstanding pending IO and wait for completion
before closing the stream.

Since the issue has only been seen on Windows, the fix will try
to cancel pending IO and wait for completion before closing stream
on Windows. On other platforms, old behavior will be preserved, meaning
that the implementation will still be vunarable to race between pending
reads and close of stream, but since problem has not been observed on
other platforms and since there is no good way of cancel outstanding
blocking reads, old behavior is kept.

At some point in future we should look into replacing the implementation
of AsyncStreamReader and use cancelation tokens, but since we don't have
all corefx support around cancelation in Mono BCL, that currently won't
solve the issue, meaning that we need to bring in more classes. Since the
problem also occur in test-runner using the build BCL profile, even more
needs to be added to that profile in order to get similar support. But due
to the infrequency of the problem and that it has only been observed on
Windows, the isolated fix seems more reasonable.

Backport of #16793.
2019-09-16 16:32:33 +02:00
Bernhard Urban f31f5ea1f1 [2019-08] [threads] do not convert NULL thread name (#16828)
Avoids this warning printed in the VSMac application output when debugging:
```
2019-09-13 17:47:27.315540+0200 aWatchOSExtension[31768:24665480] ../../../../../mono/eglib/giconv.c:1029: assertion 'str != NULL' failed
```

With this trace:
```
(lldb) mbt
* thread #2
  * frame #0: 0x00583453 aWatchOSExtension`break_on_me at giconv.c:1023:2
    frame #1: 0x005834a6 aWatchOSExtension`monoeg_g_utf16_to_utf8(str=0x00000000, len=0, items_read=0x00000000, items_written=0x00000000, err=0x00000000) at giconv.c:1036:3
    frame #2: 0x0046d871 aWatchOSExtension`mono_thread_get_name_utf8(thread=0x24d08120) at threads.c:1812:16
    frame #3: 0x002cb7ef aWatchOSExtension`thread_commands(command=2, p="�>\x02\x18\x10", end="�>\x02\x18\x10", buf=0xb0ae0d20) at debugger-agent.c:8818:13
    frame #4: 0x002c7170 aWatchOSExtension`debugger_thread(arg=0x00000000) at debugger-agent.c:9932:10
    frame #5: 0x0047652b aWatchOSExtension`start_wrapper_internal(start_info=0x00000000, stack_ptr=0xb0ae1000) at threads.c:1221:3
    frame #6: 0x0047616c aWatchOSExtension`start_wrapper(data=0x7b63a050) at threads.c:1294:8
    frame #7: 0x077365f8 libsystem_pthread.dylib`_pthread_body + 137
    frame #8: 0x077397f7 libsystem_pthread.dylib`_pthread_start + 78
    frame #9: 0x077357ce libsystem_pthread.dylib`thread_start + 34
```

Introduced by b5c0c831da and seemingly fixed by accident in https://github.com/mono/mono/commit/7b64f1cd005ef4f8e7f0aa5655debca2754b1755#diff-f1a9287559d3aa620b058619f47f00c9R1832

Instead of backporting 7b64f1cd00 to 2019-08, I'm proposing this PR for the release branch.
2019-09-15 19:52:52 -05:00
monojenkins 20308e6f87 [aot] Do not wrap tool_prefix path when calling strip (#16820)
[2019-08] [aot] Do not put quotes around wrapped path

Should fix: https://github.com/xamarin/xamarin-android/issues/3619

As it results in double quoting, which vanishes the effect and breaks
AOT for XA on Windows.

The actual error:

    [aot-compiler stdout] Stripping the binary: ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Stable\MSBuild\Xamarin\Android\ndk\arm-linux-androideabi-"strip" --strip-symbol=\$a --strip-symbol=\$d obj\Release\90\aot\armeabi-v7a\libaot-Xamarin.Android.Arch.Core.Common.dll.so.tmp
    [aot-compiler stderr] '""C:\Program' is not recognized as an internal or external command,
    [aot-compiler stderr] operable program or batch file.
    [aot-compiler stderr] AOT of image C:\Users\peter\source\repos\App9\App9\App9.Android\obj\Release\90\android\assets\Xamarin.Android.Support.CoordinaterLayout.dll failed.


Backport of #16792.

/cc @lewurm @radekdoulik
2019-09-13 13:56:04 -04:00
Radek Doulik cecda47c48 [aprofutil] Add -p and -f options
-p PORT allows easier retrieval of AOT profile from the application
 running with aot profiler, using the socket connection on local PORT

-f instructs the tool to try setup adb port forwarding to/from Android
 device or emulator

Example usage, retrieve the AOT profile from Android:

    > mono aprofutil.exe -s -v -f -p 9998 -o my.aprof
    Calling 'adb forward tcp:9998 tcp:9998'...
    Reading from '127.0.0.1:9998'...
    Read total 94903 bytes...
    Summary:
    	Modules:          6
    	Types:          262
    	Methods:      1,162
    Going to write the profile to 'my.aprof'
2019-09-12 13:05:43 +02:00
Steve Pfister 824cc12ac3 Bump to mono/corefx@e79cf5b
Backport of https://github.com/mono/mono/pull/16774
2019-09-12 08:57:24 +02:00
Alexander Köplinger b77dc06a7e [aprofutil] Install the tool correctly (#16112)
It needed a few tweaks to be usable when Mono is installed to the prefix.
2019-09-11 12:08:38 -05:00
Radek Doulik 1848d78d60 [aotprof-tool] Initial import of AOT profiler tool (#15384)
* [aotprof-tool] Initial import

Imported https://github.com/radekdoulik/aotprofile-tool and updated it
to use Mono.Profiler.Log

* [aotprof-tool] Added man page

* [aotprof-tool] Use the shortened name in README.md
2019-09-11 12:08:38 -05:00
monojenkins da0086e304 [2019-08] Add RenamedEvent* to FSW sources from CoreFX (#16756)
Add RenamedEvent* to FSW sources from CoreFX

Fixes #16486 - This was only partially fixed until now

* [csproj] Update project files

* Add test files which test these code paths on corefx
2019-09-11 12:11:57 -04:00
monojenkins 0297b21b03 [msbuild][roslyn] Bump msbuild and roslyn to pull in new versions (#16768) 2019-09-11 07:42:21 -05:00
monojenkins 40631e3b9e [2019-08] [aot] move method_addresses to data.rel.so section to avoid text relocations (#16751)
[2019-08] [aot] move method_addresses to data.rel.so section to avoid text relocations

Another revert of a revert! 🎉 

After some discussions with @grendello and @radekdoulik, we came up with this solution. It's a better attempt to fix https://github.com/mono/mono/issues/16369 as it (1) works within the restrictions of Android 10 and (2) still works for armv7 AOT. 


`.text` relocations aren't allowed in Android 10 (and this change shouldn't hurt on Linux).

AOT compilation:
```console
$ MONO_PATH=/Users/lewurm/Downloads/xamarin.android-oss-v10.0.99.136_Darwin-x86_64_pr_766265b9-Debug/bin/Debug/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/ \
MONO_ENV_OPTIONS="" \
./sdks/out/android-cross-arm-release/bin/armv7-linux-android-mono-sgen \
--aot=keep-temps,outfile=here.dll.so,asmwriter,mtriple=armv7-linux-gnueabi,tool-prefix=/Users/lewurm/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-,ld-flags= \
~/Downloads/xamarin.android-oss-v10.0.99.136_Darwin-x86_64_pr_766265b9-Debug/bin/Debug/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v10.0/Mono.Android.dll

Mono Ahead of Time compiler - compiling assembly /Users/lewurm/Downloads/xamarin.android-oss-v10.0.99.136_Darwin-x86_64_pr_766265b9-Debug/bin/Debug/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v10.0/Mono.Android.dll
AOTID 7DDD05DA-37E0-813A-8C27-3E1634391BB3
Compiled: 144382/144382
Executing the native assembler: "/Users/lewurm/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_550yHJ.o /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_550yHJ
Executing the native linker: "/Users/lewurm/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld"  -shared -o here.dll.so.tmp  /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_550yHJ.o
Stripping the binary: "/Users/lewurm/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d here.dll.so.tmp
Retained input file.
JIT time: 15031 ms, Generation time: 7374 ms, Assembly+Link time: 75130 ms.
```

Before:
```console
$ grep -C 6 'method_addresses:' /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_550yHJ
        .align 3
jit_code_end:

        .byte 0,0,0,0
.text 1
        .align 3
method_addresses:
        .local method_addresses
        .type method_addresses,#function
ldr pc,=.Lm_0
.ltorg
ldr pc,=.Lm_1
.ltorg
$ arm-linux-androideabi-readelf -a here.dll.so | grep -i textrel
 0x00000016 (TEXTREL)                    0x0
 0x0000001e (FLAGS)                      TEXTREL
```

After switching to `.data.rel.so`:
```console
$ grep -C 6 'method_addresses:' /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_1YhAgn  # assembly file produced by AOT compiler
jit_code_end:

        .byte 0,0,0,0
.section ".data.rel.ro"
.subsection 0
        .align 3
method_addresses:
        .local method_addresses
        .type method_addresses,#object
ldr pc,=.Lm_0
.ltorg
ldr pc,=.Lm_1
.ltorg
$ arm-linux-androideabi-readelf -a here.dll.so | grep -i textrel
$ echo $?
1
```

Backport of #16729.

/cc @lewurm
2019-09-10 12:35:47 -04:00
Thays Grazia 68b77674e2 Vtable [i] can be null so this should be check before use it. Fixes #16712 2019-09-09 19:17:14 +02:00
Bernhard Urban 4a0b4f41ed [mini] publish global patches after JitInfo has been added
Fixes https://github.com/mono/mono/issues/14080

Consider the following example:

```csharp
static void CommonCallTarget () { }

static void TailA () {
    tailcall CommonCallTarget ();
}

static void TailB () {
    tailcall CommonCallTarget ();
}
```

Since `TailA` and `TailB` are tailcalling into `CommonCallTarget`, the resolution at patch-time is a bit tricky, that is, since it's a jump-like instruction the patching machinery won't know where it was called from. That's why we maintain a global hashtable `jump_target_hash` where each jump-site is signed up to be patched. At patch-time we know the target method (in the example `CommonCallTarget`), but since we don't know where we are coming from, we will just apply all patches for that target.

This works since ages, so why did it crash on arm64 sometimes?
When the patching happens, we check if the displacement between jump-site and target fits into it (24bit). If not, which happens not very often, we have to allocate a _thunk_:
https://github.com/mono/mono/blob/36296ce291f8a7b19de3eccb7a32c7e4ed9df8f2/mono/mini/mini-arm64.c#L928-L942

So instead of jumping to the target directly, we'll branch to the thunk. This is a little trampoline that loads the full address of the target and then finally branches to it. This one will live close-by the jump-site, because during compilation we will reserve specifically for that scenario some space after the generated code. For this, however, we need the JitInfo of the jump-site. And that's where the origin of the race is. Let's say:

* Thread A compiles `TailA`, and then jumps into it. Thus one patch point is in the `jump_target_hash`.
* Now Thread B compiles `TailB`, registers the patch point but has _not_ yet registered its JitInfo.
* Then Thread A continues, does the tailcall into `CommonCallTarget`, enters the patching machinery, which sees two patches. Now assume when applying the patch for `TailB` the displacement is too large, thus it tries to allocate a thunk but can't find the relevant JitInfo for it that it needs to emit the thunk. So it crashes as reported in https://github.com/mono/mono/issues/14080

As far as I can tell this only affects ARM64, ARM and PPC.
2019-09-09 18:33:23 +02:00
Thays Grazia 7a1f63fde6 [debugger][android] It was not initialising seq_points on MonoCompile on Android, so when was compiling dynamic methods, seq_points wasn't created and we got the assert when try to single step. 2019-09-06 23:28:08 +02:00
Martin Baulig 29b1ac19c9 Fix the tests. 2019-09-03 19:24:31 -05:00
Martin Baulig 71e34edce2 X509CertificateImplBtls.PrivateKey should allow to actually set the key. 2019-09-03 19:24:31 -05:00
monojenkins 1ecb6e59de [2019-08] [corlib] Add hack for Hebrew calendar data (#16641)
* [corlib] Add hack for Hebrew calendar data

* Fix month names for the Hebrew calendar

* [csproj] Update project files
2019-09-03 14:14:33 -04:00
monojenkins 17ba402d80 [2019-08] Remove MAX_PATH usage in w32process (#16595)
* Remove MAX_PATH usage in w32process

* Fixes

* Shrink buffer temporarily

* More fixes

* Reset buffer size to 260

* Fix length check and add notes

* Actually free things

* Add tracing and zero len at start

* Typo

* Fix another leak

* Simplify logic
2019-09-02 14:10:13 -05:00
monojenkins ded02bc115 [2019-08] [debugger][android] Fixing single step inside Exception on Android (#16597)
* Fixing single step inside Exception on Android... The method is null because on ss_create_init_args the IL is -1 when calling method Mono_UnhandledException_internal what I think it's expected, because of that I ignore the single step on android if there is no method. (debugger-engine.c) After that the sequence point cannot be found because it's calling a method of class DynamicMethodNameCounter what I think it's expected, because of that I remove the assert on android. (debugger-agent.c) Fixes #14772

* Changing comment to make it clear...
2019-08-31 08:23:52 -04:00
monojenkins 585f244aed [2019-08] Bump ikvm to pick up caa8e7f54279a47422626005d228447f5d3670d5. (#16574)
* Bump ikvm to pick up caa8e7f54279a47422626005d228447f5d3670d5.

* [monodis] Add a missing cattr parent case.
2019-08-30 12:28:45 +02:00
Alexander Köplinger 23cc371009 Build pkg-config as 64bit only, libtiff as universal and remove gtk-quartz-engine.py (#16548)
See https://github.com/mono/bockbuild/pull/116

(cherry picked from commit 309cf1bcee)

# Conflicts:
#	external/bockbuild
2019-08-29 20:31:53 +02:00
monojenkins ce6fa810dd [2019-08] Use the right FileSystemWatcher sources (#16554)
* Use the right FileSystemWatcher sources

The corefx code for FileSystemEventArgs has some changes to support
constructing one with a null filename.

Fixes #16486

* Remove the mono sources for the newly replaced files

* [csproj] Update project files
2019-08-29 14:35:26 +02:00
monojenkins bff42f3540 [2019-08] Implement Read and WriteAsyncMemory in Mono DeflateStream (#16549)
Resolves #16122

Since we put in the corefx version of GZipStream, it is expected that
our version of DeflateStream actually implements Write+ReadAsyncMemory.

This change does that by just calling the plain WriteAsync & ReadAsync
methods until we decide (or not) to pull in the corefx DeflateStream.

Backport of #16523.
2019-08-29 14:34:58 +02:00
monojenkins 076bab44f6 [2019-08] [arm/arm64] fix fconv/rconv issues with LLVM (#16532)
* [ci] add make -C mono/mini llvmaotcheck to FullAOT LLVM lanes

* [arm64] use opcode emulation for fconv/rconv

LLVM eagerly optimizes constants such as NaN in a way that does not align with .NET behaviour. In the future we can change it so that we only do opcode emulation when LLVM is used.

Fixes https://github.com/mono/mono/issues/16411

* [arm] account only 4 bytes on stack for single precision arguments

Fixes `test_0_arm64_small_stack_args` in gshared.cs when
* `test_0_arm64_small_stack_args` is compiled with LLVM
* `Foo3.Floats` is compiled with Mini

* [arm] use opcode emulation for fconv/rconv

* [llvmaotcheck] require sse3 being available for regression tests

* [amd64] use opcode emulation for fconv/rconv

* fix cast and signature for mono_rconv_u4
2019-08-28 13:28:52 +02:00
monojenkins 75f2ac15bd [threadpool-io] Throw if backend won't be able to register a FD (#16500)
The poll+select i/o selector backend can't handle file descriptor ids greater
than FD_SETSIZE.  This can happen if too many files are open and we want to
wait on it.

Previously, mono would fail in the i/o selector thread by which point it was
too late to do anything.

With this change we will fail eagerly on the thread that calls IOSelector.Add
by throwing a NotSupportedException.

Addresses https://github.com/mono/mono/issues/15931
2019-08-27 15:17:41 -04:00
Steve Pfister 44e1854943 Allow file:// based Uri's to be used in HttpClient when the BaseAddress is set
Fixes https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/967582

Bumps the HttpClient part in mono/corefx at: https://github.com/mono/corefx/commit/ee3acec16b37bec5016da129e1e3840097ca629b

The test that would have caught this failure was disabled previously via:
https://github.com/mono/mono/commit/2f411750acfd2132f9b4970ef8cf11d9a0f62df9

(cherry picked from commit 580defd967)
2019-08-27 20:02:46 +02:00
Alexander Köplinger 53cc8a61dc [acceptance-tests] Bump roslyn test repo to remove a problematic nuget feed
(cherry picked from commit 8d422436f5)
2019-08-27 19:48:29 +02:00
monojenkins 6717bcb8b6 [2019-08] [w32socket] Translate some errno codes to WSA_ errors imprecisely. (#16488)
* [w32socket] Translate some errno codes to WSA_ errors imprecisely.

These aren't a perfect match, but better than falling into the `default` case
where Mono asserts and crashes.

Addresses part of https://github.com/mono/mono/issues/16024

* [w32error] Add WSA_INVALID_PARAMETER and WSA_INVALID_HANDLE
2019-08-27 01:28:14 +02:00
monojenkins d82d780e42 [2019-08] [android] remove text relocations in AOT/arm32 (#16472)
* Revert "[aot] partial revert of #14043 (#14135)"

This reverts commit 223e0bd78d.

* Revert "[aot] change method table generation so that it works for larger assemblies on ARM (#14043)"

This reverts commit 9ff3b0d65e.
2019-08-27 01:25:25 +02:00
Alexander Köplinger 13bc35face [utils] Don't use MAP_32BIT on Apple platforms, fixes crash with XCode 11 beta6 (#16480)
As of XCode 11 beta6 the MacOSX SDK defines the MAP_32BIT symbol.

This causes the `mono_valloc()` function to try to use the `MAP_32BIT` flag for `mmap()`.

However as mentioned in the comment for the symbol in mman.h it seems to require a special entitlement which isn't available/documented anywhere yet.
This in turn causes the mmap call to fail presumably because we're missing that entitlement.

Instead we now skip setting this flag on Apple platforms to make `mmap()` behave like it did before.

Backport of https://github.com/mono/mono/pull/16441
2019-08-26 19:39:50 +02:00
monojenkins 8df98444c1 Pass --clr-memory-model in csc/vbc wrapper script (#16444)
[2019-08] Pass --clr-memory-model in csc/vbc wrapper script

Should help with random CSC crashes on ARM (we've been using it in the Mono build for a while).


Backport of #16439.

/cc @akoeplinger
2019-08-26 08:15:49 -04:00
monojenkins d63841057e [coop] Add a handle frame in construct_culture (#16442)
[2019-08] [coop] Add a handle frame in construct_culture

Otherwise we see warnings like these:

```
ves_icall_System_Globalization_CultureInfo_internal_get_cultures_raw USED 680 handles
```


Backport of #16299.

/cc @akoeplinger @lambdageek
2019-08-26 07:30:48 -04:00
monojenkins dc98767858 Fix issue in SafeHandle.DangerousReleaseInternal() that caused #16034. (#16423)
Using the CoreCLR version of this line fixed the problem and my investigations
also revealed why.

The `SafePipeHandle` contains a reference to both the Socket as well as the
`SafeSocketHandle`, taking ownership of them.  If there are no additional
references to either of them, so that both are collected in the same GC pass,
their finalizer may be invoked in any order.

If the Socket gets finalized first, it's `SafeSocketHandle` will have a `_mstate`
of 8 (two references) at the beginning of `DangerousReleaseInternal()` - which
will set it to 6 (one reference plus disposed flag).

Then when the `SafePipeHandle` gets collected, it will call `DangerousRelease ()`
on it's `SafeSocketHandle`.  As mentioned above, it's `_mstate` will be 6.
Now we own the handle, so we'll decrease it's reference count by one and set the
`Closed` flag - the new `_mstate` should thus be 3.

However, using

    new_state = (old_state & RefCount_Mask) - RefCount_One;

would set it to 1 - thus effectively clearing the `Disposed' flag.  And since it's
reference count is now also zero, the next finalize pass will then throw.

The CoreCLR version of this class uses

    new_state = old_state - RefCount_One;

which fixes this.

Backport of #16244.
2019-08-23 15:33:56 +02:00
Steve Pfister 472f0820d3 [2019-08] Add Compiler Server Workaround for 32-bit Linux (#16421)
Currently, if the process is 32-bit, roslyn tries to determine how much
memory is available. To do that, it tries to pinvoke into GlobalMemoryStatusEx,
which is not supported on mono.

Without it, the compiler server bombs on https://github.com/dotnet/roslyn/blob/0e63260c5afb3fb5b74c357dd250e500172bcd63/src/Compilers/Server/VBCSCompiler/NamedPipeClientConnection.cs#L55-L59

Backport of https://github.com/mono/mono/pull/16405
2019-08-23 14:48:26 +02:00
Alexander Köplinger 2ad05ee764 Bump corefx to get https://github.com/mono/corefx/pull/336 2019-08-23 14:44:13 +02:00
monojenkins 32ded2e340 [android] mono_dl_open_file: use g_file_test only on absolute paths (#16393)
The intention of calling `g_file_test (file, G_FILE_TEST_EXISTS)` where file is
the name of a shared library we want to open is to speed up probing for
non-existent libraries.

See https://github.com/mono/mono/pull/12074

The problem is that if file is just a simple "libdl.so" then `dlopen (file)`
doesn't just look for it in the current working directory, it will probe some
other paths too.  (For example on desktop linux you'd also look in all the
directories in LD_LIBRARY_PATH).  So the g_file_test() call is not a robust way
to avoid calling dlopen if the filename is relative.

But it actually broke more things: https://github.com/xamarin/xamarin-android/issues/3388

When probing for "libdl.so" on Android mono_lookup_pinvoke_call will first try
prepending some paths that it knows about and we end up calling
`dlopen ("/system/lib/libdl.so")` which will fail because Bionic has security
restrictions on what code can dlopen something from /system/lib with an
absolute path.  Eventually mono_lookup_pinvoke_call will go back to trying the
bare "libdl.so" which hits `g_file_test` and returns NULL.

The new code only does the file test if we pass it an absolute path, which
gives Bionic's dlopen a chance to deal with relative paths however it needs to.
2019-08-22 13:43:27 -04:00
monojenkins d80d33b053 [2019-08] [profiler] Rename helper functions to have common prefix (#16372)
* [profiler] Rename helper functions to have common prefix

Unfortunately https://github.com/mono/mono/pull/16335 didn't fix the new symbols showing up in the log profiler module.
The reason is that we actually pass `--disable-visibility-hidden` for iOS builds in https://github.com/mono/mono/blob/0b6d95e8ce7c882e2db9e89fa0dec850c687f65e/sdks/builds/ios.mk#L98.

Rename the helper functions instead to have a common prefix so they can be ignored in xamarin-macios tests.

* Fix Windows build
2019-08-20 22:57:39 +02:00
Alexander Köplinger 04c9f2f442 Bump corefx to get https://github.com/mono/corefx/pull/332 2019-08-20 20:53:25 +02:00
Jo Shields c0f0ff02fc Pass -fvisibility=hidden to profiler modules. (#16335)
* Pass -fvisibility=hidden to profiler modules.

This appears to not break the profilers:

```
directhex@breakfast:/tmp$ nm -g /tmp/ponyponyponypony/lib/libmono-profiler-log.so | grep close_socket_fd
directhex@breakfast:/tmp$
directhex@breakfast:/tmp$ /tmp/ponyponyponypony/bin/mono --profile=log:report bottle.exe
99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 99 bottles of beer on the wall.

[..]

No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.

Mono log profiler data
	Profiler version: 3.0
	Data version: 17
	Arguments: log:report
	Architecture: x86-64
	Operating system: linux
	Mean timer overhead: 86 nanoseconds
	Program startup: Mon Aug 19 14:18:30 2019
	Program ID: 17715
	Server listening on: 41539

JIT summary
	Compiled methods: 753
	Generated code size: 228046
	JIT helpers: 0
	JIT helpers code size: 0

GC summary
	GC resizes: 0
	Max heap size: 0
	Object moves: 0

Metadata summary
	Loaded images: 3
	Loaded assemblies: 3

Exception summary
	Throws: 0
	Executed finally clauses: 3

Thread summary
	Thread: 0x7fcd968c9700, name: "Finalizer"
	Thread: 0x7fcd966c8700, name: "Profiler Sampler"
	Thread: 0x7fcd9b036780, name: "Main"
	Thread: 0x7fcd964c7700, name: "Profiler Helper"
	Thread: 0x7fcd954c5700, name: "Profiler Dumper"
	Thread: 0x7fcd95cc6700, name: "Profiler Writer"

Domain summary
	Domain: (nil), friendly name: "bottle.exe"

Context summary
	Context: (nil), domain: (nil)

Counters:
	Mono System:
		User Time                      : 70.000ms
		System Time                    : 0.000ms
		Total Time                     : 140.000ms
		Working Set                    : 22032384
		Private Bytes                  : 63455232
		Virtual Bytes                  : 449630208
		Page Faults                    : 3004
		CPU Load Average - 1min        : 1.870000
		CPU Load Average - 5min        : 2.670000
		CPU Load Average - 15min       : 2.900000
	Mono JIT:
		Methods from AOT               : 536
		Methods JITted using mono JIT  : 154
		Methods JITted using LLVM      : 0

```

* Add missing annotations and includes

(cherry picked from commit 3070ab6a96)
2019-08-20 16:18:12 +02:00
monojenkins a8c9ef3b66 [2019-08] Add missing Dispose() call on error in MonoTlsStream.CreateStream(). (#16328)
* Add missing `Dispose()` call on error in `MonoTlsStream.CreateStream()`.

* Remove the `finally` block to make it more easy to read.
2019-08-20 08:34:15 -04:00
Alexander Köplinger 31f480c436 Bump bockbuild to get gtksharp 2019-08-20 11:52:04 +02:00
monojenkins 6df5f69b26 [2019-08] [corlib] Fix sharing mode validation rules (#16281)
Fixes https://github.com/mono/mono/issues/16032

When we switched to corefx File.Copy on unix, the behavior changed where it opened a source and destination stream in order to pass the safe handles to Interop.Sys.CopyFile. This exposed a flaw in our sharing validation rules in MonoIO.Open, which threw an exception in this scenario:

new FileStream("source.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite, 2048, FileOptions.DeleteOnClose);
new FileStream("source.txt", FileMode.Open, FileAccess.Read, FileShare.Read, 2048, FileOptions.None);

Simplified the FileShare check down to:

1. If the caller specifies FileShare.None, then it's an exclusive lock and no
   sharing is allowed.

2. If the caller specifies some other FileShare option, then FileShare.None
    cannot be specified.
2019-08-16 07:55:46 -04:00
monojenkins 94ec04bfdb Exclude Authenticode tests on Watch (#16283)
1002a4de2b added Authenticode cert support on non-WatchOS. The tests,
however, were not non-WatchOS-only. Fix this, so Watch doesn't try to
run Authenticode tests.
2019-08-16 00:31:59 -04:00
monojenkins a5184ed8ed Add missing FCONV_TO_U8 on ILP32 (WatchOS 5) (#16277) 2019-08-15 13:57:36 -04:00
monojenkins 4087eba140 Fix failing OSX Android lane (#16275)
Linker order matters when using .a files, so zlib.a MUST come after
sgen.a if sgen.a was compiled with support for compressed ppdb
2019-08-15 10:40:36 -04:00
monojenkins 2ef68dc530 [cominterop] Fix copy-paste error in ComVisibleAttribute testing helper. (#16269)
This type was introduced with 29a95bafd8.

Backport of #16254.
2019-08-15 14:36:55 +02:00
monojenkins 64f9c2de6f [2019-08] Fix linking of OS-provided zlib (#16245)
* Fix linking of OS-provided zlib

This is a reduced version of https://github.com/mono/mono/pull/16091
without the Z_PREFIX stuff

* Get rid of HAVE_ZLIB, be explicit about HAVE_SYS_ZLIB vs HAVE_STATIC_ZLIB

Backport of #16177.
2019-08-14 21:20:12 +02:00
monojenkins 2f373a9ad4 (mono.1) Update the MONO_THREADS_SUSPEND description (#16237) 2019-08-14 19:23:47 +02:00
monojenkins c51c60988b [sre] Outline typebuilder_setup_fields loop body (#16204)
The loop body uses coop handles, so wrap it in HANDLE_FUNCTION_ENTER/HANDLE_FUNCTION_RETURN

Addresses part of #16179

Backport of #16184.
2019-08-14 12:29:43 +02:00
Marek Safar f333a19c3a Bump linker 2019-08-14 10:18:03 +02:00
Alexander Köplinger abf46116ef [pkg] Bump libgdiplus to 6.0.2
(cherry picked from commit b60aaea791)
2019-08-13 12:13:33 +02:00
Sebastien Pouliot ec590ad3eb [2019-08][sdk] Enable the SRE runtime code inside iOS builds
This will allow the interpreter to use System.Reflection.Emit.

Note: There is a small size increase (about 50kb) for an application
built in release mode with the LLVM backend (even if the interpreter
is now used).

Backport of https://github.com/mono/mono/pull/16151
2019-08-12 21:43:36 +02:00
UnknownShadow200 dc534a8d3f [WinForms] Fix NotifyIcon not showing in systray on 64bit linux
https://bugzilla.xamarin.com/show_bug.cgi?id=14976

Credit goes to datnhanlz for noting that removing XChangeProperty(DisplayHandle, hwnd.whole_window, _XEMBED_INFO, _XEMBED_INFO, 32, PropertyMode.Replace, atoms, 2); would also fix the bug.

Note that the type of Atom is actually unsigned long (see usr/include/X11/X.h), however the code used a C# int for the atoms. As such the code worked without a problem on 32 bit linux, but broke on 64 bit linux.

I switched to using IntPtr instead to make the code also work on 64-bit.
2019-08-12 21:22:30 +02:00
Ankit Jain 835c26154c [msbuild] Bump to track xplat-master and update roslyn (#16154)
Upstream msbuild doesn't have a branch for vs16.4, so tracking master
for now.

Prompted by mono/msbuild#126:

This includes:

- merge mono-2019-06
- SDK update to track dotnet release/3.0.100-preview8
- Roslyn updated to 3.3.0-beta2-19381-14
2019-08-12 17:03:28 +02:00
Nikita Voronchev 03be2643f5 [System.Drawing.Design] Allow context be a null in the ColorEditor.EditValue (#16174)
Backport of #16141
2019-08-12 12:26:54 +02:00
Alexander Köplinger f69128c70a Bump corefx to fix build break 2019-08-10 23:47:59 +02:00
Alexander Köplinger ac12ebc375 Bump corefx to get https://github.com/mono/corefx/pull/327 2019-08-10 16:22:01 +02:00
Alexander Köplinger 595b7821e3 Bump corefx to get https://github.com/mono/corefx/pull/323 2019-08-09 16:20:31 +02:00
Alexander Köplinger 409c0a7c2d [ci] Trigger PR builds for netcore only on master branch
The work is happening in master only for now.

(cherry picked from commit fde0a5b628)
2019-08-09 01:00:47 +02:00
Alexis Christoforides a9658665bf [2019-08] [System] Guard against attempting to creating out-of-range spans in m… (#16124)
* [System] Guard against attempting to creating out-of-range spans in macOS FileSystemWatcher

Backport of #16049
2019-08-09 00:16:37 +02:00
Alexander Köplinger 4fd89f9b11 [tests] Fix accessing field of MarshalByRefObject in remoting1.cs (#16119)
We need to copy it to a local variable first.
This was exposed by a new Roslyn optimization for String.Concat (see https://github.com/dotnet/roslyn/issues/37830).

(cherry picked from commit ec35e14636)
2019-08-09 00:13:22 +02:00
monojenkins 0707345b89 [2019-08] Fixed RuntimeType.GetConstructorCandidates("") to return 0 elements. (#16109)
* Fixed RuntimeType.GetConstructorCandidates("") to return 0 elements.

https://github.com/mono/mono/issues/16010

The current behavior for GetConstructorCandidates when the name is null, "",
or "*" is to return the set of constructors for the type. For "", .NET Core and
.NET Framework return 0 elements.  This PR adds a check for "" to match that
behavior.

* Removed unncessary changes

* Unnecessary spaces

* Made the if check a bit more readable

Backport of #16054.
2019-08-08 16:49:04 +02:00
monojenkins 0bb83d064d [2019-08] Bump linker (#16088)
* Bump linker

* Bump api-doc-tools and add NEW_CECIL define to mdoc

* Bump linker

* Bump API snapshot submodule

* [csproj] Update project files
2019-08-08 12:12:33 +02:00
monojenkins 3115d3a0c0 [2019-08] [arm] respect I1 and I2 on gsharedvt out transition (#16081)
* [arm] respect I1 and I2 on gsharedvt out transition

In order to trigger the problem, we must call into gsharedvt code ("in" transition) and then escape the gsharedvt world ("out" transition). The bug happens in the latter. Also some other stars need to align (I haven't fully understood it), thus the repro is quite long.

The provided repro only triggers with LLVM, which we don't have enabled on CI yet: https://github.com/mono/mono/issues/15999

Fixes https://github.com/mono/mono/issues/15261
Fixes https://github.com/mono/mono/issues/15262
Fixes https://github.com/mono/mono/issues/15263
Fixes https://github.com/mono/mono/issues/15307

* fix it on amd64 too

* more amd64
2019-08-07 12:43:11 +02:00
Thays Grazia 8c27e2adf9 allow emitting DIM 2019-08-07 09:26:13 +02:00
Aleksey Kliger f8e9a15ed7 [w32socket] Translate ELOOP and ENAMETOOLONG
Translate to WSAELOOP and WSAENAMETOOLONG, respectively.

See https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2
2019-08-07 09:23:30 +02:00
monojenkins d1bd30f22d [2019-08] Bump api-doc-tools to latest master (#16050)
* Bump api-doc-tools to latest master

Disable building mdoc.exe in mcs mode since it no longer builds because of new C# features.

* Fix mcs build by disabling more mdoc invocations

* Bump monodroid_tools to compile against v4.7 reference assemblies

mdoc needs ValueTuple which is not in v4.6.

Backport of #16035.
2019-08-06 20:19:27 +02:00
monojenkins 1c57af4dc0 [2019-08] DeflateStream: check IsInvalid before disposing (#16053)
Backport of #16048.
2019-08-06 14:54:56 +02:00
Jo Shields 85cecac278 Bump version to 6.6 (#16029)
* Bump version to 6.6
2019-08-05 15:31:59 -04:00
Egor Bogatov d1700fc93f Add finalizer to DeflateStream (#15879)
Fixes #15825
2019-08-05 13:20:29 +02:00
Zoltan Varga 17b35dc4fc Merge pull request #15640 from vargaz/wasm-xunit
Add beginnings of support for running xunit tests.
2019-08-04 17:05:59 -04:00
Zoltan Varga f239e4e68b [wasm] Add basic support for running xunit tests. 2019-08-04 15:59:36 -04:00
Stephen Toub f532f93ea6 Enable stylecop warnings 1205, 1212, and 1617 (dotnet/corefx#39941)
* Enable stylecop warning 1617 (void return value should not be documented)

* Enable stylecop warning 1212 (get/set accessor ordering)

* Enable stylecop warning 1205 (modifier ordering)

Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
Stephen Toub 3385433b60 Enable several StyleCopAnalyzers (dotnet/corefx#39921)
* Fix ordering of keywords in member signatures

* Add StyeCop.Analyzers

Most rules are disabled.  Many of them we'll want to leave disabled, however there are a handful it'll be good to enable over time.

* Use built-in type alias

* Fix straggling stylecop warnings in all configurations

* Replace tabs with spaces

Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
Stephen Toub 3fde98da3e Re-enable CA1823 (unused private fields) (dotnet/corefx#39899)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
Sung Yoon Whang 66a7646232 Make counters use dedicated thread instead of timer (dotnet/coreclr#25864)
* Make a dedicated polling thread for EventCounters

* Cleanup

* remove debug prints

* nit

* Fix comment

* addressing issues from code review

* Fix an assertion from getting fired when we have multiple listeners

* Fix a test issue

* code review feedback

* Fix a potential deadlock

* Fix another deadlock

* Allow s_sleepDurationInMilliseconds to be reset to a larger value

* More issues fix

* Let thread wake up from sleep if needed

* Some suggestions for the counters fix.

The resulting behavior should be the same as what is there now (assuming I didn't mess anything up), these are all just code simplifications that hopefully make it easier to review and maintain going forward. In total I think this reduces the change size in CounterGroup.cs by ~30%.
- With the addition of the AutoResetEvent the ManualResetEvent is no longer needed, removed it.
- Removed the various if foo != null checks for the shared state, it is all initialized once when then thread is created and then assumed to be non-null elsewhere.
- Removed a 2nd lock acquisition inside OnTimer
- Replaced an if with Math.Min in PollForValues

* fix test

Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
ts2do 5104fd4b2f Eliminate extra time zone conversions in DateTimeOffset (#25658)
* Eliminate extra time zone conversions in DateTimeOffset

Revised members dealing specifically with local time by removing delegation to DateTime methods to avoid an extra call to TimeZoneInfo to determine offset:
Now
FromFileTime(long)
ToLocalTime()

* Fix DateTimeOffset.ToLocalTime(bool)

* Consolidate conversion from UTC DateTime to Local DateTimeOffset

Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
Stephen Toub 6345e18108 Fix use of AddTo/RemoveFromActiveTasks in async methods (#25911)
When we rewrote the async methods implementation with AsyncStateMachineBox, we neglected to call AddToActiveTasks if the debugger is paying attention to tasks.  This hasn't mattered as the debugger's support for Tasks hasn't worked for other reasons in .NET Core, but there is now a renewed focus on it, and this is preventing some of that support from working.

This change is a minimal fix to ensure that we're adding the state machine box task when it's created and removing it when it completes.  Post-3.0, we should look at overhauling this, e.g. to clean up a lot of this logging and tracking that's done, to use a weak table in order to avoid keeping task objects alive artificially if they're dropped without completing by the developer code, etc.

This only affects when the debugger is attached, as the s_asyncDebuggingEnabled field is only ever set by the debugger.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
Stephen Toub fa0c0bb2e2 Fix nullability annotations for static (dotnet/coreclr#25913)
The compiler is now analyzing statics.  Get compliant.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-03 20:55:40 +02:00
Egor Bogatov e08bddaa63 [netcore] Minor fixes around System.Reflection (#15905)
* Minor fixes

* Update HelloWorld.csproj
2019-08-03 20:49:38 +02:00
Ryan Lucia 848811e4b2 [netcore] Enable ALC loaded_assemblies (#15850)
* Typo

* Enable loaded_assemblies and lock

* Make mono_domain_assembly_open_internal ALC-aware

* Populate loaded_assemblies


Switch from prepend to append

* Some notes

* Exclude add_assembly_to_alc on non-netcore

* Cleanup appdomain.c

* Remove mono_alc_cleanup for now

* Update comment

* Disable using loaded_assemblies in the search hook

* Adjust alc cleanup
2019-08-03 20:47:38 +02:00
Peter Collins 920e03f732 [corlib] Ignore TimeZoneTest.TestCtors on Android GMT
TimeZone.CurrentTimeZone.DaylightName returns an empty value on Android
when the system timezone is set to GMT.
2019-08-03 20:35:27 +02:00
Zoltan Varga 9da563509e Remove error_init from native icall wrappers since managed does it. (#15943)
Preferable would be native only, i.e. for interpreter and for when
it is actually unused, but ok for now.

Between removing the managed and the native, managed is preserved
in case there uses of MonoError in C# other than icall wrappers.
Keep them safe.

But again ideally move it to native and remove the managed type,
pending debugging WebAssembly failure doing so.
2019-08-03 12:00:46 -04:00
Kenneth Pouncey a61d8ea767 [wasm][framework] Rework framework linker descriptions (#15952)
- Remove the fully preserved assembly references from `WebAssembly.Bindings` and `WebAssembly.Net.Http`

Close https://github.com/mono/mono/issues/15365
2019-08-03 12:00:19 -04:00
Jb Evain 283c0557d3 Fix usage of mono_debug_get_seq_points to avoid leaks (#15977) 2019-08-03 11:59:25 -04:00
imhameed 3ab93f97e6 [llvm] Add support for JIT + LLVM 9.0. (#15997)
* [llvm] Add support for llvm 9.0.

Works with this branch:
https://github.com/mono/llvm/tree/release_90

* Add support for JIT + LLVM 9.

* Don't assume that all memset targets will be aligned; fixes LLVM 6 on amd64.
2019-08-03 11:58:40 -04:00
Calvin Buckley e70ac8c6ae Enable MONO_ARCH_EMULATE_FCONV_TO_U4 on PPC (#15991)
Fixes regression related to floating point introduced in #15930.

This does mean we have to take a slower path instead of using the
PPC instruction, but it provides consistent results. Other CPUs
have to do this too, so it's not like PPC is impacted unfairly.
(i.e, NaN gives an inconsistent result, at least with POWER7 and
some amd64 CPUs tested)

Fixes #15990.
2019-08-02 19:00:02 -04:00
Jo Shields 9a7b6fd5ee Bump libgdiplus to new release (#15996) 2019-08-03 00:48:26 +02:00
Calvin Buckley 9ea07610ee Don't use clock_nanosleep on PASE (#15988)
* Don't use clock_nanosleep on PASE

PASE exports this AIX syscall so autoconf detects it, but using it
will trigger SIGILL (for unimplemented syscall), which emits a LIC
log entry type of 4700-000F.

* Change ifdef guard for clock_nanosleep in threads

It only used clock_nanosleep on Linux, but enable it for all except
PASE. Android used to be guarded against, but the reasoning was
unknown, so @akoeplinger requested to have that guard removed.
2019-08-02 23:04:50 +02:00
Aleksey Kliger (λgeek) 713df6a9c4 [netcore] Fix comments in ALC to use Mono terminology (#15998) 2019-08-02 16:31:06 -04:00
Martin Baulig 6818163383 Use MultipleConnectAsync from CoreFX. (#15972)
* Use `MultipleConnectAsync` from CoreFX.

* [csproj] Update project files
2019-08-02 15:10:03 -04:00
Alexander Köplinger 2f21664fc2 [ci] Remove the downloaded pr-files.txt 2019-08-02 21:07:06 +02:00
Zoltan Varga 0104cc6a8f [ci] Skip lanes on ppc/wasm changes. (#15995) 2019-08-02 20:56:11 +02:00
Aleksey Kliger (λgeek) 2f2f6c104b [netcore] Implement referenced assembly resolving and ALC.GetLoadContext (#15946)
* [netcore] Implement GetLoadContext

* [netcore] Implement ALC-aware referenced assembly resolution.

The process is described in
https://docs.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext?view=netcore-3.0#usage-in-the-runtime

We try four things until one of them returns a non-null assembly.

1. Check if the assembly is already loaded in the ALC of the requesting
assembly.
2. If the ALC is not the default ALC, invoke the Load override.
3. Try the default ALC (TPA - trusted platform assemblies) loading.
4. Invoke the Resolving event of the original ALC.

The implementation borrows some managed code from
https://github.com/dotnet/coreclr/blob/8ba2e15201361402acd0ae9710bd37d50785cdfa/src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs#L84-L187

It would be nice if that code was shared between the runtimes.

* [runtime] Implement mono_assembly_name_culture_is_neutral

* [netcore] Add mono_alc_invoke_resolve_using_resolve_satellite

* [netcore] Use ResolveSatelliteAssembly for satellite assembly refs

* [netcore] Some AssemblyLoadContextTest tests now pass

System.Runtime.Loader.Tests.AssemblyLoadContextTest.PublicConstructor_Default
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetAssemblyNameTest_NullParameter
System.Runtime.Loader.Tests.AssemblyLoadContextTest.LoadFromAssemblyName_AssemblyNotFound
System.Runtime.Loader.Tests.AssemblyLoadContextTest.PublicConstructor_Theory (with isCollectible: False)
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetAssemblyNameTest_ValidAssembly
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetLoadContextTest_SystemPrivateCorelibAssembly
System.Runtime.Loader.Tests.AssemblyLoadContextTest.DefaultAssemblyLoadContext_Properties
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetAssemblyNameTest_AssemblyNotFound
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetLoadContextTest_ValidTrustedPlatformAssembly
2019-08-02 14:06:44 -04:00
Thays Grazia 0b8a0e09d3 [Debugger] Fixing test with mcs (#15985) 2019-08-02 18:48:42 +02:00
Alexander Köplinger 67aed94e2b [ci] Set apidiff/csprojdiff statuses even when we're skipping the build
They are required GitHub statuses so we need to set them.
2019-08-02 17:19:14 +02:00
Zoltan Varga 5bb4f1eea8 [ci] Skip jenkins lanes for PRs which only contain changes to the netcore/ subdir. (#15978) 2019-08-02 17:12:46 +02:00
Egor Bogatov d0aa0310ee [netcore] Use mono-netcore to run real world apps using dotnet run (#15942)
So currently we have two .NET Core:

1) `mono-repo/.dotnet` - we use it to bootstrap and build stuff (the SDK version is specified in `global.json`) - if you open `netcore/Makefile` it's referred there as `$(DOTNET)` variable.
2) `mono-repo/netcore/.dotnet` - it's just a runtime + CoreFX libs (it doesn't contain SDK stuff, templates, msbuild, etc) - we use it only to run tests because this runtime is synchronized with corefx tests in `eng/Versions.prop` file which is updated by a bot and `netcore/shared` sources for our System.Private.CoreLib also depend on that exact runtime version (the sources also updated by the bot).

This PR introduces a rule to copy mono bits to the `mono-repo/.dotnet` folder to be able to run real world apps (at your own risk) using mono-netcore (so when you run `mono-root/.dotnet/.dotnet run -c Release` for an app - even MSBuild will use mono runtime to build that app). However in theory we need exact SDK for the runtime version we have but I have no idea where and how to get one.

BTW, currently MSBuild crashes when it's powered by mono on `$(DOTNET) build` command for a hello world.
```
monoeg_assertion_message
mono_domain_assembly_preload
invoke_assembly_preload_hook
...
at <unknown> <0xffffffff>
at System.Reflection.RuntimeAssembly:GetExportedTypes <0x000a2>
at AssemblyInfoToLoadedTypes:ScanAssemblyForPublicTypes <0x0008e>
```
2019-08-02 17:06:37 +02:00
Egor Bogatov 40f28b2e63 Make System.Private.CoreLib.csproj VS friendly (#15965)
Now it's possible to open System.Private.CoreLib.csproj in an IDE and build (use Roslyn version from eng/Versions.props).
2019-08-02 10:05:22 -04:00
Thays Grazia 3a9df67a64 [debugger] Invoke method with fixed size array as an attribute of this (#15766)
Implement debugger invoke when the this has an attribute that is a fixed size array.

Fixes #15556
2019-08-02 15:47:25 +02:00
Vlad Brezae 4883b56c10 [interp] Remove unconditional branches to next instruction (#15939)
[interp] Remove unconditional branches to next instruction

These are very common, at least in debug builds. Optimize them away so it doesn't distort performance numbers.
2019-08-02 05:16:07 -04:00
Kenneth Pouncey 4ed2aadbdf [wasm][sdk] Support for Custom Linker Configuration (#15953)
- Provide extra definitions to the linker to ensure the type, methods and/or fields are not eliminated from your application.

* Use a <LinkDescription> item as follows:

```
  <ItemGroup>
    <LinkDescription Include="customlinker.xml" />
  </ItemGroup>
```

This will then be added to the `WasmLinkAssemblies` step.
2019-08-02 08:58:50 +02:00
Martin Baulig 455b051ce5 Fix compiler warnings in System.dll. (#15971)
* Merge the `System.Diagnostics/ProcessStartInfo.cs` part into the referencesource file to avoid CS0282.

* Remove duplicate `using`.

* Fix unreachable code warning that got introduced in my last PR.
2019-08-01 18:46:15 -04:00
Phil Jaenke fcfd3e54a5 Fix patch step in mdoc tests for non-Linux (#15974)
Non-Linux systems largely do not support `--binary`. Since the patch appears to be text anyway, it's probably safe to remove for all platforms.

With `patch -p0` , mdoc test now provides accurate pass/fail on FreeBSD.
2019-08-01 23:42:05 +02:00
Egor Bogatov 26f3df9881 [netcore] Minor fixes, fix GetTypeTests.GetType_EmptyString (#15933)
* Fixes https://github.com/mono/mono/issues/15023
 
* Fixes https://github.com/mono/mono/issues/15189 (were marked as "require large array
support" in dotnet/corefx by @filipnavara)

* Move InternalGetHashCode to RuntimeHelpers
2019-08-01 16:56:56 -04:00
Zoltan Varga 6f05192669 [netcore] Add a README. (#15934)
* [netcore] Add a README.
2019-08-01 16:27:40 -04:00
Jay Krell 75a99b7e84 Bump monolite version. (#15969)
It got out of sync for some reason.
2019-08-01 21:38:52 +02:00
Vlad Brezae 87ba12e13f [sgen] Fix check-nursery-pinned debug option (#15865)
* [sgen] Remove dead unpin_queue argument

* [sgen] Fix check-nursery-pinned debug option

And rename it to better reflect what is is doing now (which is to check that we don't leave any vtables tagged at the end of a collection). It used to also check that nursery objects are pinned, back when we were doing a nursery collection as part of the finishing pause of a concurrent collection.
2019-08-01 21:48:23 +03:00
Filip Navara 3c92cd8c94 [jit] Align float/double Nan/Inf to uint conversion behavior with CoreCLR/LLVM/Roslyn (#15930)
* [jit] Align float/double Nan/Inf to uint conversion behavior with CoreCLR/LLVM

* Fix float/double -> ulong conversion for edge cases

* Fix mono_fconv_u8 / mono_rconv_u8 to also return 0 for PositiveInfinity

* Enable support for platform specific implementations of OP_RCONV_U8/OP_FCONV_U8/OP_FCONV_U4

* Restore OP emulation on WASM target

* Update tests

* Disable failing tests for now

* Adjust tests

* Adjust tests

* Fix float -> uint conversion on WASM

* Make interpreter consistent with compiled code

* Blind attempt to fix WASM test leg

* Implement remaining conversions in LLVM

* Fix ARM32

* Workaround for Windows x64 FullAOT+LLVM

* Bump AOT version
2019-08-01 13:37:41 -04:00
Maxim Lipnin d72ca69693 Bump corefx (#15932)
This PR brings changes from mono/corefx#313.
Fixes #15887.
2019-08-01 18:36:29 +02:00
Filip Navara 98cb4aed20 [System.Drawing] Fix comparison in MeasureString_Wrapping_Dots test (#15958) 2019-08-01 17:09:38 +02:00
Jay Krell a7b74fc69c Support proper Windows kernel Unicode thread names. (#15919)
These do not require a debugger, can be retrieved, appear in ETW, etc.

Extracted from https://github.com/mono/mono/pull/15859.
2019-08-01 15:53:41 +02:00
Zoltan Varga 6a66472815 [wasm] Add normal GC support. (#15577)
* [llvm] Spill all ref variables to the stack on wasm, so GC stack scanning can scan all references.

* [runtime] Add an option to enable on-demand GC.
2019-08-01 15:50:28 +02:00
Vlad Brezae e3ca891235 [marshal] Free delegates with target that are passed to native code. (#15935)
* [marshal] Always use gchandles in delegate_hash_table

Makes the code easier to follow and it also fixes race from https://github.com/mono/mono/commit/caa4a753ca8e15d43baaa01adb0f56f374b74a2b with boehm.

* [marshal] Free delegates with target that are passed to native code.

For static method delegates, we have a unique delegate_trampoline that is shared among all delegates. We always keep alive the first static method delegate passed to native, by creating a normal gchandle to it and storing it in delegate_hash_table. For instance methods, each delegate will create a separate wrapper and these wrappers are never shared (which was wrongly assumed in https://github.com/mono/mono/commit/caa4a753ca8e15d43baaa01adb0f56f374b74a2b). We shuldn't keep the delegate alive and this commit reverts the behavior for delegate with instance methods introduced in the mentioned commit.

Fixes https://github.com/mono/mono/issues/15751
2019-08-01 16:06:05 +03:00
Vlad Brezae ce398411a0 [mini] Ignore conv.r.un if top of stack is already float (#15818)
Fixes https://github.com/mono/mono/issues/15794
2019-08-01 15:21:50 +03:00
Martin Baulig e92ecdc9ce Fix Socket.ConnectAsync(SocketAsyncEventArgs) behavior. (#15947)
We need to clearly distinguish between synchronous and asynchronous completions
and avoid any ambiguities and race conditions when it comes to error handling.

On synchronous completion, we must not invoke the async completion delegate.

In `System.Net.Sockets/Socket.cs`, the internal `BeginSConnect()` and `BeginMConnect()`
now return a `bool` indicating whether or not an async operation is pending.

If any error happens prior to starting the async operation, then we shall call
`SocketAsyncResult.Complete(..., true)` and return `false`.  And since this is
a synchronous completion, it's `AsyncCallback` will not be invoked.

In `referencesource/System/net/System/Net/Sockets/_MultipleConnectAsync.cs`,
I compared the entire file against the CoreFX version and then copied the
`AttemptConnection()` method from their implementation to adapt their behavior.

The difference is that on synchronous completion, the `InternalConnectCallback(null, args)`
should be invoked.
2019-08-01 12:31:25 +02:00
monojenkins 0e6965f6ba [csproj] Update project files 2019-08-01 07:45:48 +03:00
Alexis Christoforides 4abc400244 [corlib] Allow copying/moving/replacing broken symlinks
Fixes https://github.com/mono/mono/issues/14971
2019-08-01 07:45:48 +03:00
Andy Gocke 863ab55d48 Add Roslyn maestro dependency (#15944)
* Add Roslyn maestro dependency

This should bring down the Microsoft.Net.Compilers package,
which contains the Roslyn binaries needed for mono packaging.

* Add Version to Versions.props as well
2019-08-01 02:04:04 +02:00
Jay Krell 180fcfe1fd Factor copy/pasted code into mono_gstring_append_thread_name. (#15920)
Extracted from https://github.com/mono/mono/pull/15859.
2019-08-01 01:25:31 +02:00
Jay Krell 3db9635bf5 Remove error_init from native icall wrappers since managed does it.
Preferable would be native only, i.e. for interpreter and for when
it is actually unused, but ok for now.

Between removing the managed and the native, managed is preserved
in case there uses of MonoError in C# other than icall wrappers.
Keep them safe.

But again ideally move it to native and remove the managed type,
pending debugging WebAssembly failure doing so.
2019-07-31 15:49:54 -07:00
Vlad Brezae 985a1c33f2 [tests] Bump sleep for pinvoke3 test (#15937)
On some operating systems, this test can take forever because the worker starves the other threads by holding the gc_lock. Bump sleeping so it doesn't rely on OS scheduling that much and guarantees other threads can progress in reasonable amount of time.
2019-08-01 00:24:06 +03:00
Alexander Köplinger cf0e2dd972 [zlib] Fix typo in readme and remove deleted file from msvc projects 2019-07-31 22:58:21 +02:00
Jay Krell 431bb95c71 Update zlib from 1.2.5 to 1.2.11. (#15480)
Circa 2010 to circa 2017.

Retrieved with apt-get source zlib on WSL Ubuntu 18.04.2 LTS.

This matches Debian or Ubuntu (they differ by one commit, and one of them restores a dummy function for compat).

---

* [minizip] Ensure we don't ever accidentally change calling convention

Make sure we always #define ZCALLBACK to empty so we don't change
the calling convention on windows by including a header which defines
'CALLBACK'. This will keep things as cdecl as required by the c#
pinvokes.

* Update zlib readme.

* Update zlib from 1.2.5 to 1.2.11.

* [zlib] Small fix for Visual C++.
see https://github.com/madler/zlib/pull/435/files#diff-0558e84b0c24a83ca790dcb05cd26212R1087
and https://github.com/madler/zlib/pull/435/files#diff-0558e84b0c24a83ca790dcb05cd26212R1104

* Add gzguts.h to Makefiles.

* Add .h files to Visual Studio project files just for GUI purposes.
2019-07-31 22:56:34 +02:00
Zoltan Varga 1d9a87e449 Fix the netcore build. (#15941) 2019-07-31 22:04:37 +02:00
turbo 8b9033e4d2 Add O_NOATIME to OpenFlags (#8993)
O_NOATIME (Linux > 2.6.8): Do not update the file last access time (st_atime in the inode) when the file is read(2). Programs that merely index the existence of a file (backup programs e.g.) can reduce disk load using this flag.
2019-07-31 21:24:53 +02:00
Zoltan Varga 60c277cb4e [runtime] Convert more icalls to use handles. (#15862)
* [runtime] Convert Volatile to use the same approach as the netcore version, get rid of most Volatile icalls.

* [runtime] Reduce the number of handles used by construct_culture ().

* [runtime] Convert some icalls to handles.

* Fix signature of FAMNextEvent.

* [aot] Avoid aoting the gsharedvt versions of Volatile:Read<T>/Write<T>.

* Bump API snapshot submodule

* Convert Marshal:UnsafeAddrOfPinnedArrayElement to use coop handles.
2019-07-31 14:08:50 -04:00
Aleksey Kliger (λgeek) 349a3d5eef [threads] Enter GC Unsafe before pumping HP queue in unregister_thread (#15890)
If the thread info TLS key dtor runs unregister_thread from a foreign thread
and we have work in the hazard pointer queue, we need to first switch to GC
Unsafe mode because some of the free methods passed to
mono_thread_hazardous_try_free need to be coop-aware.

Also, added checked mode assertions that conc_table_free and
jit_info_table_free are called from GC Unsafe mode.

Fixes https://github.com/mono/mono/issues/15878
2019-07-31 13:30:30 -04:00
Jay Krell 499a02d6a1 Cleanup and resynchronize Thread/InternalThread fields. (#15910)
- Remove unused.
- Add missing that just happened to work.
- Synchronize size between netcore and regular. `#if` considered bad.

Extracted from https://github.com/mono/mono/pull/15859.
2019-07-31 18:30:50 +02:00
Jay Krell 9acd4c8004 mono_thread_set_name_internal change unreadable boolean parameters to enum flags. (#15921)
Extracted from https://github.com/mono/mono/pull/15859.
2019-07-31 18:30:28 +02:00
Zoltan Varga 6223e74688 [jit] Optimize the initialize of MonoError locals. (#15869)
Previously, we would emit a call to memset since the struct is large (> 100 bytes). Only the error code field needs to be initialized.
2019-07-31 14:26:24 +02:00
Calvin Buckley 1059b3e6f5 Update Haiku support (#15674)
* Build System.Native.

* Disable `pthread_mutexattr_setprotocol` use, since it returns EINVAL on Haiku.

* Disable the `strerror` cache on Haiku. On Haiku, errors begin at `0x8000_0000` like a Win32 HRESULT. This means the indexing would be on negative numbers, which is a no-no. There are a few alternative ways to keep it though: hashtable, tuple array, offset...

Unfortunately, doesn't build all the way through. Has a tendency to bomb out during building `build-unix`. Will investigate why.
2019-07-31 14:23:48 +02:00
coypoop f86d46d136 configure.ac: Use = as a test(1) operator. (#15876)
== is a bash extension
= is POSIX and equivalent
2019-07-31 14:22:26 +02:00
Zoltan Varga 4170bef2c3 [wasm] Small changes. (#15918)
* [wasm] Touch the dummy .exe files created during linking if they already exist.

* [wasm] Display longer stack traces on v8.

* [wasm] Add a --native-strip option to the packager, defaults to true.

* Add targets for separate interpreter test projects. Normalize main.exe command line arguments.
2019-07-31 14:20:40 +02:00
Jay Krell e0335d3570 Save 64 bytes from most Linux/amd64 interpreter frames. (#15926)
Probably same on all 64bit architectures. half on 32bit.

before:
```
0000000000003ce0 <interp_exec_method_full>:
    3ce0:	55                   	push   %rbp
    3ce1:	48 89 e5             	mov    %rsp,%rbp
    3ce4:	41 57                	push   %r15
    3ce6:	41 56                	push   %r14
    3ce8:	41 55                	push   %r13
    3cea:	41 54                	push   %r12
    3cec:	49 89 f4             	mov    %rsi,%r12
    3cef:	53                   	push   %rbx
    3cf0:	48 89 fb             	mov    %rdi,%rbx
    3cf3:	48 81 ec 78 01 00 00 	sub    $0x178,%rsp
```

after:
```
0000000000003ce0 <interp_exec_method_full>:
    3ce0:	55                   	push   %rbp
    3ce1:	48 89 e5             	mov    %rsp,%rbp
    3ce4:	41 57                	push   %r15
    3ce6:	41 56                	push   %r14
    3ce8:	41 55                	push   %r13
    3cea:	41 54                	push   %r12
    3cec:	49 89 f4             	mov    %rsi,%r12
    3cef:	53                   	push   %rbx
    3cf0:	48 89 fb             	mov    %rdi,%rbx
    3cf3:	48 81 ec 38 01 00 00 	sub    $0x138,%rsp
```

It was 0x158 recently.

Some frames will be larger, i.e. dynamic + pinvoke.

Classic technique:
 pointer instead of struct
 initialized to null
 alloca it when needed and not null

A more detailed analysis might enable better, such as making
the parameter optional, and/or having the callee default it to its
local storage.
2019-07-31 14:20:03 +02:00
Nikolay Sivov c8fd75734b Fix some compiler warnings for Win32/mingw64 build (#15903)
* [mono] Fix unused variable warning in mono_config_parse().

* [ligc] Fix strict prototype warning for Win32 build.

* Add some casts.
2019-07-31 14:18:53 +02:00
coypoop bed4c00e02 Remove unused libdl setting (#15884)
We test dlopen with no library and in libdl later, without the
use of this setting.

Got the hint since I'm building for a configuration which had it set wrong.
2019-07-31 14:17:34 +02:00
coypoop a65eec76be Remove unused declarations (#15907) 2019-07-31 14:16:37 +02:00
Zebediah Figura dc48d9e241 Always marshal a class as a COM interface if it has the InterfaceType attribute set. (#15671)
This fixes Game Maker Studio 2 Desktop under Wine.
2019-07-31 14:15:38 +02:00
Zebediah Figura b51c696081 [cominterop] Handle NULL pointers when marshalling native-to-managed return values. (#15906)
Fixes a bug running Rak24u with wine-mono: bugs.winehq.org/show_bug.cgi?id=47561
2019-07-31 14:14:39 +02:00
Jay Krell c37fc12ca5 Fix race condition and use less memory in mono_lookup_icall_symbol. (#14532)
It is racy because it is doing on-demand initialization, which is often racy.

The rewrite changes the result to be one pointer, atomically swapped, which implies a full barrier and data dependency, so no race.

It could also be fixed by copying and sorting an array of pairs, and one pointer to that.

However in order to save memory I instead use indirect data that is an array of uint16 pointing into the original data. That is a slight memory vs. time tradeoff.

Yes there is debugging code left, under #if, that I prefer to leave, both as evidence that I tested it, and to make it somewhat but ideally testable in future.

The code also was using an unnecessary somewhat risky but probably ok here way to compare pointers, that I fixed.

As well the result is marginally smaller and faster because it was inlining something like bubblesort, now reuses qsort.
2019-07-31 14:13:21 +02:00
Alexander Köplinger 471421023c [ci] Handle master build purging in a separate cleanup job 2019-07-31 13:32:06 +02:00
Jay Krell bd0c46a842 [Coop] Add TYPED_HANDLE_DECL. (#15909)
Extracted from #15900.
2019-07-31 12:35:59 +02:00
Bernhard Urban a6e6c72c8f [sdks] remove 32bit llvm (#15896)
[sdks] remove 32bit llvm

Also switches the MXE cross compilers for Android and WebAssembly to 64bit host.
2019-07-30 19:05:41 -04:00
Alexander Köplinger 2cfbadb0a6 [pkg] Don't keep per-commit master builds in CI
We only want the daily builds.
2019-07-31 00:34:38 +02:00
Filip Navara 60bb726eac Update CoreFX.issues.rsp (#15870)
Removed tests fixed by #13907.
Fixes #14945
Fixes #14946
Fixes #14948
2019-07-30 23:39:34 +02:00
Jay Krell ca8f155983 [Coop] Convert ves_icall_string_new_wrapper_impl. (#15901)
Static analysis prefers not even these short lived raw pointers.
Extracted from #15900.
2019-07-30 23:37:58 +02:00
Jay Krell 56082ab528 [Coop] Convert mono_string_from_byvalwstr_impl. (#15902)
Remove the raw pointer that static analysis will flag.
Extracted from #15900.
2019-07-30 23:37:09 +02:00
Zoltan Varga f8fd60b5c0 [interp] Simplify the main interpreter loop code to speed up compilation. (#15889)
* [interp] Simplify the control flow in the main loop to speed up compilation of interp.c.

Get rid of the handle_finally and main_loop labels.

* [interp] Move some rarely used locals to InterpFrame to speed up compilation and to increase the chance that the other locals end up in registers.

* Add macros for throwing exceptions to shorten the code a bit.

* Fix a previous change.
2019-07-30 16:02:27 -04:00
Larry Ewing eb68675461 Bump msbuild to xplat-master 2019-07-30 14:20:22 -05:00
Larry Ewing 11b6828420 Update nuget binary 2019-07-30 14:20:22 -05:00
Alexander Köplinger ce1653b08a [sdks] Don't keep per-commit master builds in CI
We only want the daily builds.
2019-07-30 21:14:02 +02:00
Alexander Köplinger ee636ee8d9 [sdks] Make sure python3-pip is installed for Linux Android builds 2019-07-30 20:46:11 +02:00
Alexander Köplinger 9f0d493eea [netcore] Replace dl-test-assets.py with msbuild download (#15883)
The python file was unreliable on macOS, let's see whether a simple msbuild replacement is better.

Also fixed dependencies on some of the Makefile targets so that they correctly detect when they need to run.
2019-07-30 19:27:42 +02:00
Jay Krell a8d8fb6cea Fix warnings. (#15768)
* boehm-gc.c:1923:14: warning: variable old_obj set but not used [-Wunused-but-set-variable]

* class-init.c:1720:1: warning: compare_by_interface_id defined but not used [-Wunused-function]

* class.c:1724:1: warning: compare_interface_ids defined but not used [-Wunused-function]

* icall.c:8190:13: warning: variable klass set but not used [-Wunused-but-set-variable]

* image.c:1063:20: warning: variable header set but not used [-Wunused-but-set-variable]

* metadata.c:2573:25: warning: right shift count >= width of type [-Wshift-count-overflow]

* sgen-dynarray.h:194:1: warning: dyn_array_int_is_copy defined but not used [-Wunused-function]

* sgen-mono.c:255:1: warning: emit_managed_allocater_noilgen defined but not used [-Wunused-function]
sgen-mono.c:238:1: warning: emit_nursery_check_noilgen defined but not used [-Wunused-function]

* sgen-tarjan-bridge.c:449:25: warning: right shift count >= width of type [-Wshift-count-overflow]

* threads.c:1451:11: warning: variable res set but not used [-Wunused-but-set-variable]

* w32process-unix-default.c:239:19: warning: variable min_dev set but not used [-Wunused-but-set-variable]
w32process-unix-default.c:239:10: warning: variable maj_dev set but not used [-Wunused-but-set-variable]

* w32process-unix.c:2107:25: warning: variable waitret set but not used [-Wunused-but-set-variable]

* aot-compiler.c:4180:1: warning: add_lazy_init_wrappers defined but not used [-Wunused-function]

* aot-compiler.c:7200:86: warning: format %lu expects argument of type long unsigned int, but argument 3 has type gsize {aka unsigned int} [-Wformat=]

* aot-compiler.c:10013:7: warning: unused variable index [-Wunused-variable]

* aot-compiler.c:10012:15: warning: variable method set but not used [-Wunused-but-set-variable]

* method-to-ir.c:4031:22: warning: variable tmpreg set but not used [-Wunused-but-set-variable]

* mini-runtime.c:2977:14: warning: variable invoke set but not used [-Wunused-but-set-variable]

* mono-rand.c:94:1: warning: mono_getentropy defined but not used [-Wunused-function]
2019-07-30 12:10:30 +02:00
Jay Krell f1958bacaa Remove mono_thread_get_name. (#15875)
Unused since https://github.com/mono/mono/commit/b5c0c831da328b8ab7b7283a38fa56baaa7ae380.
And not likely to come back.
2019-07-30 03:08:55 +02:00
Jay Krell 929e3135bb HANDLE_FUNCTION_RETURN_VAL must not use handles in current frame (#15873) 2019-07-30 01:39:44 +02:00
Calvin Buckley 95f8a68c56 ArgumentNullException when pointer is null for Marshal.AddRef/Release/QueryInterface (#15867)
Fixes #15853
2019-07-29 20:27:18 +02:00
dotnet-maestro[bot] a0aae297d9 Update dependencies from https://github.com/dotnet/arcade build 20190729.1 (#15881)
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19379.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19379.1
2019-07-29 20:24:40 +02:00
Jay Krell b5c0c831da Fix thread name leak in debugger. (#15858) 2019-07-29 11:31:14 +02:00
Jay Krell babcdbdcbd [Coop] Convert System.Buffer. (#15861)
And inline `mono_array_handle_length`.
And remove `inline` in .c files a little -- it only belongs in .h.
2019-07-29 11:30:16 +02:00
Zoltan Varga 967a79e5a1 [wasm] Fix the generation of emsdk_env.sh. (#15872) 2019-07-29 11:28:29 +02:00
Vlad Brezae 91b9ff3e53 [interp] Optimize ldelema (#15846)
Makes the opcode 2-3x time faster
2019-07-27 17:37:00 +03:00
Zoltan Varga 9f25324936 [WIP] [runtime] Convert WindowsIdentity.GetRoles () icall to coop. (#15849)
* [runtime] Convert WindowsIdentity.GetRoles () icall to coop.

* [runtime] Replace some Buffer icalls with Unsafe methods.

* Fix the windows build.
2019-07-27 02:27:24 -04:00
Alexander Köplinger 6a6a0f6213 [netcore] Disable new post-build.yml stage in AzDO pipeline 2019-07-27 02:54:50 +02:00
Alexander Köplinger 64be3113a3 [netcore] Add back _DotNetPublishToBlobFeed variable in AzDO pipeline 2019-07-27 02:41:41 +02:00
Alexander Köplinger e38468d0e4 [netcore] Fix condition in AzDO pipeline 2019-07-27 02:15:49 +02:00
Alexander Köplinger 4398a12286 [netcore] Fix name of empty.proj in AzDO pipeline 2019-07-27 02:07:31 +02:00
Alexander Köplinger a3fda4a3cb [netcore] Add back pushing to blob feed in AzDO pipeline 2019-07-27 02:01:20 +02:00
Alexander Köplinger 4ef62c8c46 [netcore] Set variables a bit differently 2019-07-27 00:56:25 +02:00
Alexander Köplinger 882208bbc6 [netcore] Explicitly set _PublishUsingPipelines variable to true
It shouldn't be needed when using the eng/common/templates/jobs/jobs.yml template but it is.
2019-07-27 00:34:38 +02:00
Alexander Köplinger e12a6bf5d8 [netcore] Only install Linux packages on hosted pool 2019-07-27 00:23:00 +02:00
Alexander Köplinger ae488c93e9 [netcore] Fix building of nupkg (#15855)
When https://github.com/mono/mono/commit/9010d2f290d28dc97ac276e0c0d32a2932b7550f was merged we stopped including mcs/build/config.make.
However, that file set the VERSION variable which wasn't migrated to the new netcore/config.make so the nuget package missed the version.

Additionally, System.Private.CoreLib sources were moved into the netcore folder and we now seemingly need to pass `-p:IsPackable=true` for dotnet pack to build the nuget package.
2019-07-27 00:17:31 +02:00
Alexander Köplinger dc16db91a1 [netcore] Enable nuget validation in post-build AzDO pipeline stage 2019-07-26 23:23:12 +02:00
Alexander Köplinger ccb53b88f4 [netcore] Switch back to old way of specifying poolname
Otherwise the AzDO test view contains `$(poolname)`
2019-07-26 23:18:59 +02:00
Alexander Köplinger 296d395535 [netcore] Use yaml stages in azure pipelines definition (#15838)
Arcade would like us to start using yaml stages.
2019-07-26 23:13:12 +02:00
Stephen Toub 216fad5177 Re-enable CA1802 (use consts instead of readonly statics) (#39782)
* Re-enable CA1802 (use consts instead of readonly statics)

I enabled it only for privates and internals, as we've previously violated this in public surface area, and as everything goes through API review moving forward, didn't seem worthwhile fighting it and adding suppressions in various places.

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-07-26 20:08:24 +02:00
Nicholas Schell 51aa4b019a [Mono.Posix] Parameters for chown should be signed integers not unsigned (#15828)
Fixes https://github.com/mono/mono/issues/10748

The calls for chown, lchown, fchown, and fchownat (from `Mono.Unix.Native.Syscall`) are all declared with unsigned integers for the `owner` and `group` parameters. This is incorrect.

Directly from the manpage
`man 2 chown`
<pre><code>
...
       int chown(const char *pathname, uid_t owner, gid_t group);
       int fchown(int fd, uid_t owner, gid_t group);
       int lchown(const char *pathname, uid_t owner, gid_t group);

...

       int fchownat(int dirfd, const char *pathname,
                    uid_t owner, gid_t group, int flags);

...
...
       <b>If the owner or group is specified as -1</b>, then that ID is not changed.
...
</pre></code>

Emphasis added on the documentation explaining how the parameters can take the value -1, clearly not an unsigned integer. The `uid_t` struct is not an unsigned integer. I am assuming this was just an oversite on whoever re-wrote `Mono.Unix.Native.Syscall`.

The original calls from `Mono.Posix.Syscall` (now marked as Obsolete) all correctly use signed integers.
```
                [DllImport ("libc", SetLastError=true)]
                public static extern int chown (string path, int owner, int group);
                [DllImport ("libc", SetLastError=true)]
                public static extern int lchown (string path, int owner, int group);
```

Even the documentation directly from `mcs/class/Mono.Posix/Documentation/en/Mono.Unix.Native/Syscall.xml`
```
          <para>
            One of the owner or group id's
            may be left unchanged by specifying it as -1.
          </para>
```
2019-07-26 20:07:38 +02:00
Ryan Lucia 29428550c2 [netcore] Implement AssemblyLoadContext.GetLoadedAssemblies() (#15832)
* [netcore] Implement AssemblyLoadContext.GetLoadedAssemblies()

* No refonly on netcore

* Ifdef out AppDomain.GetAssemblies() on netcore

* Don't init the error

* Unnecessary ifdef
2019-07-26 18:23:43 +02:00
monojenkins 86fbf751fe [csproj] Update project files 2019-07-26 16:52:58 +02:00
Marek Safar 044982b390 [wasm] Remove assemblies we don't want to distribute 2019-07-26 16:52:58 +02:00
Bernhard Urban b4c5d68c28 [android] switch to python offset tool (#15834)
[android] switch to python offset tool

And drop C# tool.

Fixes https://github.com/mono/mono/issues/9621
2019-07-26 08:15:50 -04:00
Kenneth Pouncey ddb1f31c9e Fix http framework module that errors using SDK 2.1.801 (#15844)
- 2.1.801 seems to have a problem with:

```
						using (var uint8Buffer = Uint8Array.From(await request.Content.ReadAsByteArrayAsync ()))
```
2019-07-26 12:13:27 +02:00
Zoltan Varga 390353d48b [netcore] Add a missing make dependency. 2019-07-26 10:03:14 +02:00
unknown a809e479f3 Update dependencies from https://github.com/dotnet/core-setup build 20190725.9
- Microsoft.NETCore.App - 5.0.0-alpha1.19375.9
2019-07-26 09:10:04 +02:00
unknown 0bb362511c Update dependencies from https://github.com/dotnet/corefx build 20190725.11
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19375.11
2019-07-26 09:10:04 +02:00
dotnet-maestro[bot] 08bd3e5dc1 Update dependencies from https://github.com/dotnet/arcade build 20190725.3 (#15836)
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19375.3
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19375.3
2019-07-26 02:11:51 +02:00
Alexander Köplinger ad2405761b [sdks] Report xcode11 builds as a separate GitHub status 2019-07-25 23:47:24 +02:00
Alexander Köplinger 77ac509c0b [sdks] Add special build job for building with Xcode 11 2019-07-25 23:47:24 +02:00
Aleksey Kliger (λgeek) 04517d3a39 [metadata] Fields whose types are gparams with a reference type constraint aren't blittlable. (#15761)
* [metadata] Fields whose types are gparams with a reference type constraint
aren't blittlable.
Don't try to layout the field to find out if it's blittable.
For gshared gparams, follow the blittability of the constraint.

Fixes certain recursive examples.

```
using System;

namespace TestRecursiveType
{
    class Program
    {
        static void Main(string[] args)
        {
            SubClass subC = new SubClass();
            Console.WriteLine(subC.GetTest());
        }
    }

    public struct ValueTest<U>
    {
        // When U is instantiated with T, from BaseClass, we know it'll be a
	// reference field, so we know the instantiation ValueTest<T> won't
	// be blittable.
        public readonly U value;
    }

    public abstract class BaseClass<T> where T : BaseClass<T>
    {
        public ValueTest<T> valueTest = default(ValueTest<T>);
    }

    public class SubClass : BaseClass<SubClass>
    {
        private String test = "test";

        public string GetTest()
        {
            return test;
        }
    }
}
```

Fixes https://github.com/mono/mono/issues/15760

---

The failure is happening when we are doing mono_class_setup_fields ("BaseClass<T>") which needs to decide for each field whether it is blittable or not. So therefore we are trying to decide if ValueTest<T> (that is: the ValueTest<U> field inside BaseClass<T>) is blittable or not.

So we instantiate U with T.
Now to decide whether VaueTest<T> is blittable or not, we look at every field.
So then we look at T value.
To decide if T is blittable we first check if it's a reference type.

That check is currently inadequate for generic parameters - what the PR adds is the ability to see if theres a T : class constraint or a T : C constraint - where C is some class. As soon as we know that T's constraint will force it to be a reference type we can definitely say that T won't be blittable without having to initialize C, at all.

Previously, Mono would see that T is some kind of type for which it couldn't definitively decide that it's a reference type and it would call: mono_class_setup_fields (field_class) which would then try to setup the fields of the parent class BaseClass<T>. And that would hit the recursion check.
2019-07-25 17:31:48 -04:00
Aleksey Kliger (λgeek) 090dffb9a0 [tests] Return non-zero exit code from MERP crash test on failure (#15804)
If any of the stress tests fail, return a non-zero exit code from the
supervising process.

Fixes #15781
2019-07-25 17:20:12 +02:00
Jay Krell ee34e2b122 [jit] [x86] Cleanup "_body" and finish conversion to x86_byte. (#15628) 2019-07-25 09:18:20 -04:00
Alexander Köplinger 6a196d6de8 [ci] Disable boehm on FreeBSD
It seems to cause issues and we don't want to spend time on boehm-related problems.
2019-07-25 01:38:00 +02:00
Cassio de Vargas Oliveira 8f0e9887b0 [System.ServiceModel] Add PUT, DELETE and OPTIONS handling to HttpReplyChannel (#15746)
Fixes #15740.
2019-07-25 01:09:41 +02:00
Calvin Buckley 68849282b3 Add community-supported FreeBSD CI to README (#15821) 2019-07-25 01:04:06 +02:00
Jay Krell 8cc7226834 ld configure: Add another dash to export-dynamic. (#15717)
GNU ld accept single or double dash, means the same thing.
AIX ld warns on single dash, errors on double dash, in autoconf, and then errors on single dash later.
We want the double dash so autoconf rejects it on AIX.
2019-07-25 01:02:46 +02:00
Filip Navara 30ce79f3f9 [netcore] Update CoreFX.issues.rsp (#15816)
Remove exclusions fixed by #14967
2019-07-24 22:04:56 +02:00
Aleksey Kliger (λgeek) 784b350c40 [cxx][llvm] Fix C++ build (#15807)
* [cxx] Fix LLVMModuleFlags var initialization

* [cxx] Fix C++ errors in mini-llvm.c
2019-07-24 12:37:57 -04:00
Jay Krell 9e78ce94d5 Remove unneeded auto cast with codeman. (#15792)
The uses are all void* or casted.
2019-07-24 17:31:26 +02:00
Stephen Toub 23cbdeba1b Re-enable CA1825 (zero-length array allocations) (dotnet/corefx#39708)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 17:27:08 +02:00
Vlad Brezae 4f84f21cbc [sre] Don't throw random exception when runtime shuts down (#15798)
Added here https://github.com/mono/mono/commit/89d1455a80ef`
2019-07-24 18:17:09 +03:00
Alexander Köplinger 6dff5fc813 Remove traces of w32process-win32-internals.h which was deleted by previous commit 2019-07-24 16:52:37 +02:00
Jay Krell f68c52c089 [Coop] Convert System.Diagnostics.{FileVersionInfo,Process}. (#15789) 2019-07-24 16:50:39 +02:00
Alexander Köplinger 57a6ebbf1a [netcore] Run tests only on public builds (#15812) 2019-07-24 15:26:48 +02:00
Vlad Brezae 71630cce75 [sre] Make creation of dynamic method synchronized
Before, reflection_create_dynamic_method could end up being called by two threads simultaneously. At the end of the method the ilgen field of the MonoReflectionDynamicMethod object is cleared, to enable its collection since it is no longer needed. The problem with this is that it can confuse the other thread compiling the dynamic method, making it see that there is no body.

We could either bother making this clearing work with multiple threads (and I'm not 100% convinced that the rest of the code is thread safe), disable the clearing of ilgen (which would make us use more memory) or go with the simple approach of locking on this DynamicMethod so only one thread is compiling it at one time.
2019-07-24 14:31:51 +02:00
Steve Pfister 2238c9dc5f Bump mono/corefx@eb5ba09 (#15799) 2019-07-24 07:50:52 -04:00
Alexander Köplinger 5f1da4d454 [ci] Add extra CI_TAGS for freebsd 2019-07-24 12:33:08 +02:00
Filip Navara 24bffd544a Update CoreFX.issues.rsp 2019-07-24 11:02:42 +02:00
Egor Bogatov 122494330d [netcore] Allow different enums as return type in CreateDelega… (#15787)
* Relaxed check for return type in CreateDelegate

* fix build errors
2019-07-24 09:50:29 +02:00
Marek Safar 2a01e1b125 [netcore] Update roslyn dependency 2019-07-24 09:45:03 +02:00
Jan Kotas 047a961ecd Fix build break in TimerQueue.Portable.cs
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Sung Yoon Whang 3468ef668f Fix first value of counter payload being skewed (dotnet/coreclr#25739)
* Fix issue 25709

* rename

* Fix regression test

* cleanup

* Code review feedback

* set maxincrement to 3

Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub f8d61819b8 Make all event types nullable (dotnet/coreclr#25752)
Late-breaking design change: all events should be declared with nullable delegate types.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub 4ec5b8de98 Remove now unnecessary !s / TODO-NULLABLE comments (dotnet/coreclr#25749)
* Remove !s and TODO-NULLABLE comments for [DoesNotReturn]

* Remove !s and TODO-NULLABLE comments for [NotNullIfNotNull]

* Remove !s and TODO-NULLABLE comments for writes via Interlocked.CompareExchange

* Remove !s and TODO-NULLABLE comments for Debug.Assert on fields

* Update/add several TODO-NULLABLE comments

Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Santiago Fernandez Madero 0a683afa9a Fix nullability warnings from compiler update
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Jan Kotas 176d523060 Delete unnecessary method (dotnet/coreclr#25661)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub ef3cbe9c56 Disable debugger evaluation of ValueTask<T>.Result (dotnet/coreclr#25727)
If the debugger evaluates a `ValueTask<T>`'s `Result`, that counts as the "you should only consume a `ValueTask<T>`" once, and ends up breaking / hanging / throwing exceptions and other bad stuff while stepping through code in the debugger.

This commit addresses that in two ways:
1. Adds `[DebuggerBrowsable(Never)]` to `Result` to prevent it from showing up in debugger views.
2. Adds a NotifyOfCrossThreadDependency call to its ToString.  This prevents the debugger from using ToString to show an implicit representation of the instance, and it forces the developer explicitly trying to access ToString (e.g. in the watch window) to click a button acknowleding the impact.

(Post 3.0, we should consider removing the `ValueTask<T>.ToString()` override altogether.)

Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Jan Kotas 927d8c322d Fix use of uninitialized variables in managed decimal implementation (#25674)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub c465ad1e80 Remove stale nullable !s and pragmas (dotnet/coreclr#25640)
Also update TODO-NULLABLE comments to be more specific where appropriate.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub 089743f733 Add AggressiveInlining to Single.GetHashCode (dotnet/coreclr#25633)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub 137c333cda Fix Timer argument exception parameter names (dotnet/coreclr#25617)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Stephen Toub 9d64e1ef74 Fix regression in Timers with long timeouts (dotnet/coreclr#25604)
* Fix regression in Timers with long timeouts

Early in .NET Core 3.0, we added an important optimization to significantly reduce lock contention and CPU overheads in situations where lots of timers were firing.  The optimization worked by splitting the set of timers into those expected to fire in the very near future and then everything else.  However, for really long timers (e.g. > 24 days), due to integer overflows we can accidentally put a long timer onto the short list and cause a timer that shouldn’t fire for days to instead fire in milliseconds.  This is not the first such bug we’ve had in Timer, and there is a fair amount of complicated casting (that we sometimes get wrong, obviously) in order to keep the tick count usage within the Int32 domain.  This PR addresses the problem (and hopefully others in the future) by switching over to using Int64.  We’re already paying to get 64-bit tick counts on both Windows and Unix, so this just removes truncation that was being performed, does a little more addition/comparison with 64-bit values instead of with 32-bit, and stores an Int64 instead of Int32 in each TimerQueueTimer.  On 64-bit, this has a 0 increase in memory consumption, as it simply ends up utilizing padding space that was previously in TimerQueueTimer.  On 32-bit, it increases memory allocation when creating a Timer by 4 bytes from 80 to 84 (still 3 allocations), but I believe it’s the right trade-off for reduced complexity and bug likelihood.

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-07-24 09:45:03 +02:00
Alexander Köplinger 70c72891f2 [netcore] Update Version.Details.xml
The earlier PR didn't update this file which is used by arcade for tracking.
2019-07-24 08:39:35 +02:00
Aleksey Kliger (λgeek) 7467ce4369 [netcore] Implement AssemblyLoadContext.InternalLoad (#15753)
Fixes https://github.com/mono/mono/issues/14830
2019-07-23 19:09:27 -04:00
Filip Navara 1551fa7951 [netcore] Bump CoreFX version to 5.0.0 (#15795)
* Bump CoreLib version

* Workaround to get dotnet to find dependencies

* Compile CoreLib with nullablePublicOnly
2019-07-24 00:53:30 +02:00
Zoltan Varga 69d179cba2 Avoid creating handles in a loop. 2019-07-23 12:55:55 -05:00
Zoltan Varga 4d1a6358d0 [runtime] Convert AssemblyBuilder.basic_init to handles using a gc handle to pin the object. 2019-07-23 12:55:55 -05:00
Zoltan Varga 063c3ed7f9 [runtime] Mark a few icalls as NOHANDLES. 2019-07-23 12:55:55 -05:00
Zoltan Varga 7b384f710c [runtime] Convert Environment icalls to handles. 2019-07-23 12:55:55 -05:00
Zoltan Varga fe015de078 Fix the netcore build. 2019-07-23 12:55:55 -05:00
Zoltan Varga 5ca052fca2 [runtime] Convert ValueType icalls to handles. 2019-07-23 12:55:55 -05:00
Larry Ewing 84af927e7d [wasm] clean up the clean targets 2019-07-23 12:16:22 -04:00
Zoltan Varga a9404577e6 [runtime] Convert locale code to use handles. (#15774)
* [runtime] Convert locale code to use handles.

* Sort a list of defines.

* Remove a do-while.

* Fix c++-ism.

* Use mono_string_handle_to_utf8 (). Update comments.
2019-07-23 11:33:20 -04:00
Jo Shields ce6c02e903 Forcibly clean working directory on every AzDO build (#15801) 2019-07-23 11:05:18 -04:00
Aleksey Kliger (λgeek) 148891b515 [cxx][netcore] Fix C++ build (#15786)
assembly.c `exact_sn_match` uses bitwise-or on MonoAssemblyNameEqFlags
2019-07-23 11:42:51 +02:00
Zebediah Figura 1854e439e5 [corlib] Foward System.Type.GetTypeFromProgID() to the correct function (#15693)
Fixes a stack overflow when running Staxel under wine-mono.
2019-07-23 11:17:28 +02:00
Alexander Köplinger 3e7f130739 [ci] Make sure global variables are really global
Using "def" in groovy makes it local to the run() method.
2019-07-23 10:27:53 +02:00
Kenneth Pouncey d46fa9b1e3 Add target for the browser threads tests run 2019-07-22 20:07:34 -04:00
Kenneth Pouncey 7cd7f5f9e1 Add running the browser tests for threads. 2019-07-22 20:07:34 -04:00
Ryan Lucia beb5553398 [netcore] Make assembly name parsing and comparison case-insensitive (#15522)
* Re-enable test

* Parse assembly info case-insensitively

* Lowercase the parsed public key token

* Case-insensitive comparison of public key tokens

* Fix string copy
2019-07-22 17:23:26 +02:00
Jo Shields 548fe0e0c1 Fix build on Autoconf 2.63 (#15636)
* Fix build on Autoconf 2.63

This was broken in e7f9dbe73c, because
AS_VAR_APPEND does not exist until v2.63b (?!)

* Work around autoconf for Mac not being fit for purpose

The correct way to do this is with AC_DEFUN in a special m4 file

But this dies on Mac, because reasons.

See also https://github.com/jedisct1/libsodium/issues/217
2019-07-22 17:20:47 +02:00
Maxim Lipnin ffe5446a40 Fix ambiguous time at the end of DST period on Windows 2019-07-22 17:12:46 +02:00
Ryan Lucia 54f608d08d Miscellaneous loader-related fixes (#15765)
* Clarify contents of list

* Fix mono_assembly_get_alc

* Remove pointless ifdef

* Prepend to domain_assemblies

* Revert "Prepend to domain_assemblies"

This reverts commit dbe6e47b80470fa13d22d97d32721d18c4764597.

* Ditch another ifdef
2019-07-22 10:58:12 -04:00
Vlad Brezae 009b0dd4c3 [interp] Enable inlining of object constructors (#15665)
* [interp] Split code for obj / vt newobj instruction

* [interp] Enable inlining of object constructors

If the ctor was inlined, the newobj instruction receives a max ushort as the data item for the index, so it doesn't execute the ctor in this case. Also, when inlining, we need to push on the stack the allocated object, once as argument for the ctor and the second needs to remain on the stack as the result of the IL newobj instruction.
2019-07-22 17:03:26 +03:00
Ryan Lucia 3c2813deb7 Special-case arrays of interfaces/generic parameters in IsAssignableFrom (#15749)
* Formatting fix

* Special-case arrays of interfaces/generic parameters

* Make more generic, fix typo

* Consider class constraint and add more elucidating comment

* Fix for potential crash

* Add test

* Fix test
2019-07-22 09:56:48 -04:00
Alexander Köplinger f497893a84 Add more tests to tarball with EXTRA_DIST 2019-07-22 15:23:09 +02:00
Aleksey Kliger (λgeek) 4138f096f8 [netcore] Re-enable AssemblyGetForwardedTypesLoadFailure (#15763)
Was fixed by https://github.com/mono/mono/pull/15752
2019-07-22 12:52:17 +02:00
Kenneth Pouncey e42d338e8f Add threads support to the SDK runtime generation.
- To enable the build with threads set `<EnableMonoWasmThreads>true</EnableMonoWasmThreads>`
   - default is false.
2019-07-19 17:33:08 -04:00
Kenneth Pouncey 98d8612b6b Fix packaging of the SDK when the runtime for threads does not exist
Closes https://github.com/mono/mono/issues/15734
2019-07-19 17:33:08 -04:00
Kenneth Pouncey eddd299c72 Add Signing.props file to common directory to be referenced from a common place
- Add the `Signing.props` to the `Directory.Build.props`
2019-07-19 17:33:08 -04:00
Maxim Lipnin e8d7f7c004 [netcore] Make System.Linq.Expressions.Tests.BindTests.GlobalField Pass (#15658)
`Expression.Bind` should throw `ArgumentException` if called with `FieldInfo` for a global field. The exception is thrown from validation of the (null) `DeclaringType` (see https://github.com/dotnet/corefx/pull/15318).
Mono returns `"<Module>"` in this case and doesn't throw so the test fails. 

Fixes #14917 .
2019-07-19 23:21:22 +02:00
Alexander Köplinger d159a38c47 [ci] Clean working directory after build in package and sdks build 2019-07-19 22:59:06 +02:00
Alexander Köplinger 1ab23207b5 [ci] Don't use method which is not allowed in Groovy sandbox 2019-07-19 22:52:01 +02:00
Alexander Köplinger 0c39f1f537 [ci] Fix OSX package builds to only be timer-triggered on master 2019-07-19 22:47:05 +02:00
Alexander Köplinger 6407d27000 [packaging] Don't use dl.xamarin.com for gtksharp package anymore 2019-07-19 22:16:34 +02:00
Alexander Köplinger 7bcba4e9bc [ci] Remove -f option from genhtml during code coverage
It needs some cpan modules to be installed which is a pain on OSX.
2019-07-19 22:10:38 +02:00
Alexander Köplinger 4909cf320f [ci] Run OSX package builds on master only once per day 2019-07-19 21:10:20 +02:00
Jay Krell 3e432663cd Remove mono_arch_free_jit_tls_data. (#15662) 2019-07-19 14:40:54 -04:00
Alexander Köplinger 49ed255707 [sdks] Calculate sha1 of sdks archive and upload it
This was requested by the XA team.
2019-07-19 20:05:48 +02:00
Ryan Lucia d685b72cb2 [netcore] Implement Thread.CurrentOSThreadId (#15748)
* [netcore] Implement Thread.CurrentOSThreadId

* Add comment explaining differences with mono_native_thread_id_get

* Add haiku implementation

* Attempt to fix linux builds

* Add MonoError parameter to icall
2019-07-19 13:22:50 -04:00
Sebastien Lebreton ec3cb3eb4e Fix TypeMirror.CSharpName computation 2019-07-19 10:42:00 -04:00
Kenneth Pouncey b85c584c0f WebAssembly.Core.Array.Pop should return null if the WebAssembly.Core.Array is empty instead of error. 2019-07-19 10:32:07 -04:00
Alexander Köplinger 3ff64f1efb [metadata] Fix name of header file
The file added as part of d5b374bb51 was actually called loaded-images-internals.h
2019-07-19 15:56:12 +02:00
Alexander Köplinger 7784f20a26 [ci] Don't require master node for reportGitHubStatus method
In some jobs we use throttle() logic which would mean only one job can execute on master, blocking other jobs in the meantime.

We don't really care which node executes this so let Jenkins pick one.
2019-07-19 14:50:10 +02:00
Egor Bogatov 8b2141a741 [netcore] Fix CI failures (#15745) 2019-07-19 14:06:04 +02:00
Alexander Köplinger a543958765 [ci] Add python3-pip package to wasm sdks build 2019-07-19 13:49:07 +02:00
Bernhard Urban 3f7d33ce85 [ios] Switch to python offset tool (#15744)
The C# version doesn't work on 64bit. It would require to update its dependencies, but Zoltan already added a Python version for WebAssembly which works fine.

Some notes:
* changed the semantics of `--xcode-path` in order to match the output of `xcode-select -p`
* switched to python3/pip3
* removed hack for arm64_32, it works properly now because the Python version uses stock `clang`
* removed some leftover usages of `XCODE32_DIR`.

Manually verified by comparing output with the C# version.

This will unblock the iOS team when building on Catalina/Xcode11, as they can't consume SDK archives there. See https://github.com/xamarin/xamarin-macios/pull/6603#issuecomment-512803082

Contributes to https://github.com/mono/mono/issues/9621
2019-07-19 13:48:02 +02:00
Aleksey Kliger (λgeek) 944cc96cac [netcore] Pass ALC in second loader request in load_reference_by_aname_default_asmctx (#15752)
Fixes crash in System.Reflection.Tests netcore testsuite in
System.Reflection.Tests.AssemblyNetCoreAppTests.AssemblyGetForwardedTypesLoadFailure
2019-07-19 07:44:07 -04:00
Alexander Köplinger 6ab8aff5dd [sdks] Add z option to tar
It's required on linux.
2019-07-19 12:49:38 +02:00
Alexander Köplinger a02f3aaf4b [sdks] Add linker sources to Android linux archive 2019-07-19 11:32:38 +02:00
Alexander Köplinger 349da3387c [sdks] Add third party notices and licenses to sdks archives (#15741)
It takes all THIRD-PARTY-NOTICES.TXT and LICENSE files from the repo.
2019-07-19 11:07:39 +02:00
Vlad Brezae c449308f8b [glib] Use clock_nanosleep if available (#15443)
According to the manual, it is recommended to use clock_nanosleep instead of nanosleep when the sleep can be repeatedly interrupted by signals and resumed. The remaining sleep interval was greater than the original timespec.

Fixes random timeouts of finalizer-abort.exe
2019-07-19 10:21:21 +03:00
Aleksey Kliger (λgeek) a37ad98b47 [loader] Pass ALC to mono_domain_loaded_internal, and then to domain search hook (#15743)
* Add a temporary mono_domain_ambient_alc function

Just use this to mark places where we need to pass through an ALC

* [runtime] Mark mono_assembly_loaded_full external only.

Runtime should use mono_assembly_loaded_internal.

* [loader] Add mono_install_assembly_search_hook_v2

Use it to install mono_domain_assembly_search and
mono_domain_assembly_postload_search.

The principal difference is that we can pass an assembly load context to the
hook.  But also we cleanup the "requesting assembly" hack for
mono_domain_assembly_postload_search.

* [domain] Comments and mono_assembly_get_alc ()

* [debugger] Comment on suspicious loader lock
2019-07-19 00:01:56 -04:00
Larry Ewing 34be988e33 Merge pull request #15704 from lewing/bump-msbuild-nuget-5.2
Bump msbuild to track xplat-master
2019-07-18 20:45:02 -04:00
Andy Hanson 25e79664b9 Return HardLimitBytes from GCMemoryInfo.TotalAvailableMemoryBytes (#25437)
* Add property HardLimitBytes to GCMemoryInfo

This adds a new property HardLimitBytes.

Unlike TotalAvailableMemoryBytes,
this will reflect an explicitly set COMPLUS_GCHeapHardLimit.

It will also reflect the fraction of a container's size that we use,
where TotalAvailableMemoryBytes is the total container size.

Normally, though, it is equal to TotalAvailableMemoryBytes.

Fix #38821

* Remove HardLimitBytes; have TotalAvailableMemoryBytes take on its behavior

* Fix typos

* Separate total_physical_mem and heap_hard_limit
so we can compute highMemoryLoadThresholdBytes and memoryLoadBytes

* Do more work in gc.cpp instead of Gc.cs

* Consistently end names in "Bytes"

Signed-off-by: dotnet-bot <[email protected]>
2019-07-18 19:10:21 -04:00
Aleksey Kliger (λgeek) 3f55bfb5cc [mini] Runtime check if boxing is needed for DIM constrained calls (#15729)
This is to handle the following example.  The issue is that in Check() we have
a constrained call where the called method is IAdder`1<!!U>::PlusPlus() which
is a default interface method, and we need to determine at runtime whether to
box the this argument.

```
using System;

public interface IAdder<T> {
	int Add (int x);

	int PlusPlus () {
		return Add (1);
	}
}

interface IGen3<T> { }

struct Adder<T> : IAdder<IGen3<T>> {
	int _field;
	public int Add (int x) {
		_field = x + _field;
		return _field;
	}
}

public class P {
	public static int Check<T, U>(T t) where T : IAdder<U> {
		return t.PlusPlus () + t.PlusPlus ();
	}

	public static void Main () {
		var x = new Adder<object> ();
		int y = Check<Adder<object>, IGen3<object>> (x);
		Console.WriteLine ("expect 2, got {0}", y);
	}
}
```
2019-07-18 16:46:55 -04:00
imhameed 561b400baa [interp] Use correctly-sized writes and reads in Unsafe.AddByteOffset and Unsafe.ByteOffset (#15677)
[interp] Use correctly-sized writes and reads in Unsafe.AddByteOffset and Unsafe.ByteOffset

The truncated store to the top of the stack in`MINT_INTRINS_UNSAFE_BYTE_OFFSET` could cause the upper bytes of the address used as the first argument to `ByteOffset` to linger, yielding inaccurate (and usually excessively large) offsets on systems where `sizeof(void *) > sizeof(guint32)`; this made
`System.Text.Unicode.Utf8Utility.GetPointerToFirstInvalidByte` return nonsense results.

The truncation in `MINT_INTRINS_UNSAFE_ADD_BYTE_OFFSET` hasn't, as far as I know, caused any test failures. But `AddByteOffset` takes an `IntPtr` as its second argument, not an `int`.

Fixes #14847.
2019-07-18 14:16:46 -04:00
Maxim Lipnin ab4eca1785 [netcore] Clean up rsp-file (#15700) 2019-07-18 18:34:10 +02:00
Egor Bogatov e6d2091a24 [netcore] Revise items in CoreFX.issues.rsp (#15664) 2019-07-18 18:33:38 +02:00
Aleksey Kliger (λgeek) d5b374bb51 [loader] Add MonoAssemblyLoadContext; stop sharing MonoImages on netcore (#15527)
Implement a couple of things:

1. Add a `MonoAssemblyLoadContext` opaque struct
2. On netcore Mono, use it to keep track of  which `MonoImage`s are loaded.  (Addresses part of #13891) 

In a bit more detail:

- Add a `MonoLoadedImages` struct to hold the hash tables that we use for checking if a `MonoImage` is already loaded
- Add an opaque `MonoAssemblyLoadContext` typedef
- (Framework Mono) Add a `get_global_loaded_images()` function to get the shared `MonoLoadedImages`
- (netcore Mono) Add a `MonoAssemblyLoadContext` struct that owns a `MonoLoadedImages` and add a `default_alc` member to `MonoDomain
- Pass a `MonoAssemblyLoadContext*` to most `MonoImage`-loading functions - on Framework Mono its usually NULL and we fall back to the global loaded images, on netcore Mono it's usually `domain->default_alc->loaded_images`
- (netcore Mono) Create a default Assembly Load Context when a `MonoDomain` is created
- Add a `MonoAssemblyLoadContext*` field to `MonoAssemblyLoadRequest` and pass an ALC in a few places.

---

Remaining work:

(netcore Mono) There are still places where a `MonoAssemblyLoadRequest` or a `MonoAssemblyOpenRequest` has a `NULL` ALC - those will need to be tracked down and fixed.

(netcore Mono) Eventually `MonoAssemblyLoadContext` should keep track of the loaded `MonoAssembly`s, not just images.  One goal on netcore Mono is to ifdef out `MonoDomain:domain_assemblies`.


---



* [loader] Add a MonoLoadedImages struct to own the MonoImage sharing

   Initially, there's just a single global set of loaded images.

   Once we have AssemblyLoadContext support, each ALC will have a separate set.

   NOTE:
     - Some of the existing Mono API is difficult to support with this design
       since it assumes each MonoImage is loaded at most once.

* [loader] Add a MonoAssemblyLoadContext member to MonoImage for netcore

* [loader] Unregister image from its owner when closing

* [loader] Pass MonoLoadedImages to register_image

* [domain] Add mono_domain_default_alc and mono_alc_get_loaded_images

* [loader] Add an AssemblyLoadContext argument to mono_image_loaded_internal

* [metadata] Add mono_image_get_alc ()

* [loader] Pass MonoAssemblyLoadContext to mono_image_open_from_data_internal

* [loader] Pass MonoAssemblyLoadContext to mono_image_open_from_module_handle

* [loaded] Pass MonoLoadedImages to mono_image_open_a_lot_parameterized

* [loader] Pass MonoAssemblyLoadContext to mono_image_open_a_lot

* [runtime] Mark mono_image_open_full external only

   Runtime should use mono_image_open_a_lot.

* [runtime] Mark mono_image_loaded_by_guid external only

   Also mark mono_image_loaded_by_guid_full external only

   Runtime will need some (as yet unwritten) mechanism that takes a MonoAssemblyLoadContext as an argument.

* [domain] Create a default ALC for each MonoDomain

* [netcore] Pass default ALC in mono_core_preload_hook

   If the assembly name matches a trusted platform assembly, open it in the default ALC of the root domain

* [mini] Open main assembly in default ALC in the root domain

* [netcore] Don't define get_global_loaded_images()

   Every assembly load request should come from an assembly load context.  Each ALC has a set of loaded images.  So we should never need a global list.

   With this PR, we no longer share MonoImages across distinct ALCs.  So in principle, each ALC can open the same assembly but resolve its references in different ways.

   Fixes part of https://github.com/mono/mono/issues/13891

* [runtime] Mark mono_pe_file_open external only

* [loader] Pass MonoAssemblyLoadContext to mono_image_open_raw  and mono_image_open_metadata_only

* [loader] Pass MonoAssemblyLoadContext to do_mono_image_open and set MonoImage:alc

* [loader] Add version 2 of assembly preload hook

   Pass MonoAssemblyLoadContext through the preload hook.  This is used in mono_assembly_request_byname_nosearch which, in turn, is called by load_reference_by_aname_default_asmctx which is used to resolve references from one assembly to another.

* [netcore] Pass native ALC ptr to AssemblyLoadContext.InternalLoadFile

* [netcore] Implement AssemblyLoadContext.InternalInitializeNativeALC

   also implement mono_domain_create_individual_alc ()

* [netcore] Pass ALC to System.Reflection.Assembly.InternalLoad

   Pass the domain default ALC to mono_assembly_load ()

   Also pass MonoAssemblyLoadContext to mono_assembly_load_full_gac_base_default ()

* [loader] Implement MONO_LOADED_IMAGES_ASSEMBLY properly

   Store the MonoLoadedImages for netmodules in the MonoImage for the main image of an assembly.  This is also used by SRE - the dummy module of the AssemblyBuilder has the loaded_images that contains the ModuleBuilders.

* [loader] Use global_loaded_images for netmodules with framework Mono

   The new stuff is only for ALC support in netcore

* [loader] Drop netmodule support in MonoAssemblyLoadContext

   netmodules are not supported in netcore

* [loader] Spin out image hashing out of image.c

   Move MonoLoadedImages support code to loaded-images.c loaded-images-global.c and loaded-images-netcore.c

Also spin out assembly-load-context.c for MonoAssemblyLoadContext functions

* Move ALC icall to assembly-load-context.c

* formatting fix

* [msvc] Add new files to .filters

* update comments

* [image] Change mono_loaded_images_remove_image to decrement the refcount

Decrement the refcount and remove the image from the loaded images hashes in
one place.  Change mono_loaded_images_remove_image to return TRUE if the rest
of image unloading should proceed or not.

* [loader] Drop unused argument to mono_alc_init
2019-07-17 17:35:15 -04:00
Jay Krell e2ce0a16a6 Fix leaks in mono_lookup_internal_call_full_with_flags, for lack of destructors. (#15659)
* Fix leaks in mono_lookup_internal_call_full_with_flags, for lack of C++ destructors.

* Initialize `sigstart` also.
2019-07-17 12:09:18 -07:00
Jay Krell b08aa71948 configure/makefile To support updating zlib to 1.2.11. (#15697) 2019-07-17 12:07:56 -07:00
Ryan Lucia 86e22c4a7f Print two bytes at a time in mono_pe_file_map conversion error (#15523)
* Print two bytes at a time

* Iterate over gunichar2
2019-07-17 11:49:30 -07:00
Alexander Köplinger c62473114a Add com.apple.security.cs.allow-unsigned-executable-memory exception to hardened runtime entitlements (#15721)
This avoids the issue from https://github.com/mono/mono/issues/13445 when hardened runtime is enabled.
2019-07-17 20:48:06 +02:00
Larry Ewing 36b9e006f3 Merge pull request #15713 from lewing/sdk-disable-gac
[ios][android] disable gac in ios and android sdk builds
2019-07-17 09:09:36 -04:00
Filip Navara 9af45e09db [netcore] Clear system last error before P/Invoke calls with SetLastError=true (#15703)
Fixes #15691
2019-07-17 14:44:50 +02:00
Alexander Köplinger 0509ceccb6 Revert "[ci] Remove separate utils.groovy file" and run step on master instead
This reverts commit d732cef5fc.

The github commit status setter step requires a node context so we now just use on on master instead.
2019-07-17 14:26:24 +02:00
Egor Bogatov 4febac951e [bcl] Sync recent NS2.1 changes (#15696)
1) Copied changes from corefx for System.Data (also https://github.com/mono/corefx/pull/310)
2) New Tracing api is left empty (because the current API is empty too)
3) New AES types throw PNSE

Bump netstandard.dll AssemblyVersion to 2.1 (fixes https://github.com/mono/mono/issues/13412)
2019-07-17 13:08:29 +02:00
monojenkins b61a4368c0 [bcl] Update BCL Linked Size 2019-07-17 06:42:24 -04:00
Alexander Köplinger ba1c7da0b9 [bcl] Add Mono.Cecil.Mdb assembly to monodroid_tools profile (#15710)
* [bcl] Add Mono.Cecil.Mdb assembly to monodroid_tools profile

Requested by the XA team.

* [csproj] Update project files
2019-07-17 11:19:04 +02:00
Alexander Köplinger d732cef5fc [ci] Remove separate utils.groovy file
For some reason when using a separate file and loading the function
from there Jenkins still requires us to have a node() context when
calling the function which is not what we want.

(cherry picked from commit d410e07d8b)
2019-07-17 10:57:38 +02:00
Larry Ewing 3a075b0b1e [wasm] disable gac in wasm runtime (#15686)
* [wasm] disable gac in wasm runtime

* [wasm] disable gac wasm.mk not configure.ac
2019-07-17 04:56:42 +02:00
Zoltan Varga 553fee6f03 [runtime] Fix the error message for exceptions created from MonoError. (#15705)
Fixes https://github.com/mono/mono/issues/15692.
2019-07-16 21:09:39 -04:00
Alexander Köplinger 39472e06a3 [ci] Wait for signing outside of a node() block
We don't need to block the machine just for waiting on signing to finish.
2019-07-17 01:01:42 +02:00
Larry Ewing 6727d1a39b [ios][android] disable gac in ios and android sdk builds 2019-07-16 18:22:26 -04:00
Zoltan Varga 978653633b [interp] Make the code GC safe on wasm. (#15695)
* [interp] Pass the vtable to get_virtual_method () to reduce the number of objrefs being passed around.

* No longer a prototype.

* [interp] Make the code GC safe on wasm.

* Use frame->o only on WASM.
2019-07-16 17:49:33 -04:00
Jay Krell 43f1a26804 Fix use of freed memory. (#15660)
Fix use of freed memory.
Move the free later, on the assumption that the free itself doesn't use memory now freed before it.
Found with Valgrind.
2019-07-16 13:16:52 -07:00
Alexander Köplinger 7480830b36 [ci] Bump timeout for .pkg signing job
In preparation for notarizing our .pkg with Apple we need to bump the timeout
since it can take up to an hour for Apple's server to return a result.
2019-07-16 21:32:13 +02:00
Aleksey Kliger (λgeek) d8a679375d [netcore] Use the strict loader (#15668)
Mono historically was quite lax in how it resolved assembly references - it
would pick the first assembly with a matching simple name.  The "strict"
mode (available in framework Mono with `--assembly-loader=strict`) follows the
spec behavior: the version and public key token of the candidate assembly must
match what is requested.
2019-07-16 20:30:16 +02:00
Filip Navara d2f7851c92 [netcore] Ignore public key when matching assemblies (#15678)
Related to #15669
2019-07-16 11:05:26 -07:00
Larry Ewing ee2b1089ff Bump msbuild to track xplat-master 2019-07-16 10:43:54 -04:00
Alexander Köplinger 709ba3faa5 Revert "Update dependencies from dotnet/corefx"
This reverts commit 4e513f802a.

It broke a few netcore tests.
2019-07-16 16:31:50 +02:00
Alexander Köplinger cef723ca9c [sdks] Use Azul Zulu OpenJDK for Android Linux build, since Debian 10 has no Java 8 2019-07-15 23:25:26 +02:00
Alexis Christoforides 532605f533 [System] Keep events from firing from a disposed 'DefaultWatcher' FileSystemWatcher
Fixes https://github.com/mono/mono/issues/8747

Also try to stop other implementations from dispatching events past Dispose(), without guaranteeing it
2019-07-15 23:25:32 +03:00
Alexander Köplinger 4b6f49bb06 [sdks] Update android linux builds to Debian 10
This was suggested by XA folks to fix the weird mingw llvm issues we've been seeing.
2019-07-15 21:36:04 +02:00
Larry Ewing 11ca09b3bb [wasm][size-diff] fix typo in wasm targets (#15676) 2019-07-15 20:25:33 +02:00
Alexander Köplinger 4e513f802a Update dependencies from dotnet/corefx 2019-07-15 17:52:29 +02:00
dotnet-maestro[bot] 157728ce0d [master] Update dependencies from dotnet/corefx (#15689)
* Update dependencies from https://github.com/dotnet/corefx build 20190714.1

- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview8.19364.1

* Update dependencies from https://github.com/dotnet/arcade build 20190703.1

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19353.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19353.1

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/corefx build 20190703.3

- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview8.19353.3

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08
2019-07-15 17:14:49 +02:00
Thays Grazia 73128453da [debugger] Don't list finalizer gc thread if it's not executing managed code (#15618)
* The example that reproduces the bug does this:
var thread = vm.GetThreads()[0];
greetingValue = program.InvokeMethod(thread, greeting, new Value[0]) as StringMirror;

But sometimes the Thread[0] was the MainThread of the program and it works, and other times was the GC Finalizer, but when it tries to run something on GC Finalizer thread, the thread is not suspended and throws an exception.
In the fix I removed the Finalizer thread if it's not executing a managed code of the list that is returned when CMD_VM_ALL_THREADS is called.

Fix #13311
2019-07-15 11:58:04 -03:00
Alexander Köplinger d85fe2c391 [System] Remove FileSystemWatcher tests from monotouch/xammac
They were already excluded from watch and tv but they don't work on any mobile Apple profile.
2019-07-15 15:17:27 +02:00
Jay Krell ceb09980f5 Fix leak in create_runtime_invoke_info when mono_class_vtable_… (#15661) 2019-07-15 11:34:54 +02:00
Jay Krell 6cd6f65f69 Trim mono_mini_arch_lock, mono_mini_arch_unlock, mini_arch_mutex. (#15663) 2019-07-15 11:34:34 +02:00
Bernhard Urban 9a19bdb6e6 [llvm] avoid FP elimination on iOS/armv7 (#15617)
[llvm] avoid FP elimination on iOS/armv7

Instead of
```
push    {r4, r5, r6, r7, r10, r11, lr}
```

LLVM will generate
```
push    {r4, r5, r6, r7, lr}
add     r7, sp, #12
push    {r9, r10}
```

Seems like this https://github.com/mono/llvm/commit/a04e9e4a0af16f15ace258e81448b7eeca5ff599 assumes that `-disable-fp-elim` is passed for iOS targets. I wondered why this wouldn't break things for them, but when you run `clang` from Xcode with `-v`, you will discover that its driver passes `-mdisable-fp-elim`.

Together with https://github.com/mono/llvm/pull/48 this fixes crashes with FullAOT+LLVM on iOS 32bit.

Fixes https://github.com/mono/mono/issues/15058

Contributes to https://github.com/mono/mono/issues/9621
2019-07-14 16:15:55 -04:00
Aleksey Kliger (λgeek) 70e9f8c501 Add configure flag to disable GAC support; disable GAC in netcore (#15681)
* [runtime] Add configure flag to disable GAC support

* [netcore] Disable GAC support
2019-07-13 11:36:37 -04:00
Larry Ewing 016a5253bb Merge pull request #10202 from Unity-Technologies/fix-dynamic-method-marshal-info
Don't try to access metadata for dynamic method added to non-dynamic …
2019-07-12 18:22:01 -05:00
Steve Pfister 611b94cb41 [ios] Nil Check to Ensure Local TimeZone Id is Set For TimeZon… (#15682)
In runtime.m added nil check in xamarin_timezone_get_local_name. Returns Local as the Id in the case of nil.
2019-07-12 20:56:45 +02:00
Alexander Köplinger e3d5b23ff9 [ci] Upload mac-entitlements.plist to azure when uploading .pkg
So it can be used by the codesigning job.
2019-07-12 19:46:50 +02:00
monojenkins 45c82cc647 [bcl] Update BCL Linked Size 2019-07-12 20:15:06 +03:00
Jo Shields 202dca075b Add hardened runtime testing to Catalina lane (#15589)
* Permit DYLD mangling, so p/invokes work from non-system paths

* Add com.apple.security.cs.disable-library-validation

This is required for the .dylibs used in p/invokes to work.

* Use adhoc signing
2019-07-12 15:29:00 +02:00
Alexander Köplinger 02829bb914 [ci] Add back accidentally removed check 2019-07-12 15:27:39 +02:00
Kenneth Pouncey f3aaade4c7 [wasm][sdk][tests] Use the SDK to build the browser tests (#15605)
# Fix the runtime paths evaluation.
- If running from a master build the runtime builds path is different from the nuget paths.
  - From a master build the runtime builds are found in `wasm\builds` now.

# Browser Tests modifications:
- Moved all sources to a sources directory `tests\browser\src\`.
- Create a solutions project that can be built by VSfMac or VS using the SDK
- Create separate projects for each TestSuite.
- Change makefile target for the browser tests to use `dotnet` to build instead of the `packager.exe`

# SDK modifications and fixes:

Fix sdk build to run `monolinker.exe` using `dotnet`
- Run `mono` as task tool if running from `dotnet` and not running under Windows instead of executing the `monolinker.exe` directly
- Clean up WasmLinkAssemblies code.
   - Add routine to determine if build was initiated from `dotnet` instead of msbuild.
   - Add common routine to find the correct monolinker.exe to execute depending on running local or nuget.

Without the previous fixes, `monolinker` step can fail with the following message when using `dotnet build`

```
.nuget/packages/mono.webassembly.build/0.1.0-preview1/build/netstandard2.0/Mono.WebAssembly.Build.targets(76,3): error MSB6006: "monolinker.exe" exited with code 8.
```

The faling msbuild target is:

```
      _MonoWasmLink:
         /Users/Jimmy/.nuget/packages/mono.webassembly.build/0.1.0-preview1/build/tools/monolinker.exe --verbose --exclude-feature
         ... the rest of the command is cut off from here to save space

```

With the fixes command above becomes the following which execute the `monolinker` with `mono`. :

```
      _MonoWasmLink:
         /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono /Users/Jimmy/.nuget/packages/mono.webassembly.build/0.1.0-preview1/build/tools/monolinker.exe --verbose --exclude-feature remoting --exclude-feature com

         ... the rest of the command is cut off from here to save space
```
2019-07-12 14:44:40 +02:00
Jay Krell 81ed8dfaff extern "C" reduction. (#15634) 2019-07-12 12:01:35 +02:00
Marek Habersack 461ceae59b Fix offsets tool for Android NDK r20
Android NDK r20 contains a header file (`ioctl.h`) with this code:

    int ioctl(int __fd, int __request, ...);

    #if !defined(BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD)
    /* enable_if(1) just exists to break overloading ties. */
    int ioctl(int __fd, unsigned __request, ...) __overloadable __enable_if(1, "") __RENAME(ioctl);
    #endif

The `_RENAME` macro is defined as `__asm__(x)` and serves the purpose of
replacing an existing symbol with the new one, decorated with the keyword.
Unfortunately, Mono's `offsets-tool` doesn't parse the header properly as
`CppSharp` doesn't understand `__asm__`:

    Processing triple: armv7-none-linux-androideabi
    Error parsing '/Users/rodo/git/xa2/external/mono/mono/metadata/metadata-cross-helpers.c'
    /Users/rodo/android-toolchain/ndk/sysroot/usr/include/bits/ioctl.h(60,5): error: conflicting types for 'ioctl'
    Error parsing '/Users/rodo/git/xa2/external/mono/mono/mini/mini-cross-helpers.c'
    /Users/rodo/android-toolchain/ndk/sysroot/usr/include/bits/ioctl.h(60,5): error: conflicting types for 'ioctl'
    make: *** [/Users/rodo/git/xa2/external/mono/sdks/builds/android-cross-arm-release/armv7-linux-android.h] Error 1

The workaround, implemented in this commit, is to define the
`BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD` macro thus removing the "conflicting"
declaration from the picture, which changes nothing from the offset tool's point
of view and lets us process the headers in NDK r20 properly.
2019-07-12 12:41:54 +03:00
Zoltan Varga 04034032f4 [jit] Fix the devirt of EqualityComparer<byte>. (#15644)
* [jit] Fix the devirt of EqualityComparer<byte>.

* Add a test.

* Fix the tests.
2019-07-12 01:24:52 -04:00
Steve Pfister 537fc4b60d [ios] Ensure Local TimeZone Id is Set For TimeZoneInfo.Local (#15667)
* Fixes https://github.com/mono/mono/issues/14839

The local timezone name was not known and defaulted to "Local".
This change adds an sdk function that returns the local name.
2019-07-11 23:45:03 +02:00
Egor Bogatov 792bfbff91 [netcore] Do not inline ThrowHelpers, fix SkipFrames handling. (#15607)
1) Do not inline ThrowHelpers (e.g. `static void ThrowException() => throw new Exception();`)
2) `get_trace` incorrectly handles `skip` argument
3) fix broken ci (`dl-test-assets.py` is not python2 compatible any more)

Fixes https://github.com/mono/mono/issues/15182
Fixes https://github.com/mono/mono/issues/15188
2019-07-11 21:42:14 +02:00
Egor Bogatov 972cd65365 [netcore] Fix IsAssignableFrom (#15641)
Mono used to return `true` for these three cases (see System.Reflection.Tests.TypeTests.IsAssignableFrom tests):
```csharp
using System.Reflection;
using Xunit;

namespace ConsoleApp
{
    public static class Program
    {
        static void Main(string[] args)
        {
            Assert.False(typeof(TI_Interface1[]).GetTypeInfo().IsAssignableFrom(
                         typeof(TI_StructWithInterface[]).GetTypeInfo()));

            Assert.False(typeof(int?[]).GetTypeInfo().IsAssignableFrom(
                         typeof(int[]).GetTypeInfo()));

            Assert.False(typeof(int[]).GetTypeInfo().IsAssignableFrom(
                         typeof(int?[]).GetTypeInfo()));
            
        }
    }
    
    public interface TI_Interface1 { }
    public struct TI_StructWithInterface : TI_Interface1 { }
}
```
Fixes https://github.com/mono/mono/issues/10848
Fixes https://github.com/mono/mono/issues/15080

Unrelated  System.Reflection.MetadataLoadContext.Tests tests that don't fail anymore:
Close https://github.com/mono/mono/issues/15351
Close https://github.com/mono/mono/issues/15348
Close https://github.com/mono/mono/issues/15347
Close https://github.com/mono/mono/issues/15346
Close https://github.com/mono/mono/issues/15345
Close https://github.com/mono/mono/issues/15343
Close https://github.com/mono/mono/issues/15342
Close https://github.com/mono/mono/issues/15341
Close https://github.com/mono/mono/issues/15338
Close https://github.com/mono/mono/issues/15337
Close https://github.com/mono/mono/issues/15336
2019-07-11 21:41:11 +02:00
Zebediah Figura 2f1b50bfbf [metadata] Respect unmanaged calling conventions in function signatures. (#15363)
According to ECMA-335 § II.15.3, calling conventions other than "default" and
"vararg" describe unmanaged methods. Accordingly they should be treated as
pinvokes so that that their calling conventions are respected.
2019-07-11 14:38:03 -04:00
Micah N Gorrell 1002a4de2b [Mono.Security] Allow importing certificates from authenticode assemblies (#14210)
This change allows a number of games, such as DARK, to start successfully. The games use X509Certificate.CreateFromSignedFile() to load the certificate from their assemblies in order to verify them.

* Added support for creating an AuthenticodeDeformatter for an assembly
that has been loaded into memory

* Allow importing a certificate from an assembly signed with authenticode
when using BTLS

* Allow importing a certificate from an assembly signed with authenticode
when not using BTLS

* Added a test for loading certificates from assemblies signed with
authenticode
2019-07-11 19:09:33 +02:00
Calvin Buckley 41469ee55a Misc AIX/PASE tweaks (#15651)
* Partial enablement of alternate stack for AIX/i

It turns out much like macOS, AIX doesn't like to do mprotect/valloc
for the first thread's guard pages, so skip those. It seems mostly
fine except for one or two crashes causes it to grab the wrong IAR
and deadlock dumping memory. As such, leave the code and configure
script override to disable in place, just change the comment and
add support code.

* Use Qp2getifaddrs on PASE

Not sure if proper way to implement. Reuses getifaddrs code as much
as possible, since it's merely a name change based on the docs, due
to it being namespaced in case AIX gets it or something.

I'm not sure how many of these codepaths still work properly;
one had a questionable order of ifdef.

This will eventually prepare for CoreFX NetworkInterface, so test
it here.
2019-07-11 12:42:47 -04:00
Alexander Köplinger 37f5ef91bb Bump bockbuild to fix gtk build break 2019-07-11 17:29:33 +02:00
Alexander Köplinger 439ab4fb4c Bump bockbuild to get https://github.com/mono/bockbuild/pull/105 2019-07-11 16:08:01 +02:00
Jay Krell 2950bd39e1 Remove configure cruft -- Interlocked and GetProcessId. (#15633)
They are never checked and all relevant systems have all of them.
2019-07-11 13:39:11 +02:00
Jay Krell 7bdff9065b Cleanup mono_threads_platform_get_stack_bounds. (#15632)
Fix mingw warning unused function __readfsdword.
2019-07-11 13:35:57 +02:00
Steve Pfister 625be3d1fd Bump mono/corefx@17dd540 (#15654) 2019-07-11 13:30:01 +02:00
Steve Pfister 53a0a9eaf4 Add TypeForwards for FileSystemName & CryptographicOperations (#15652)
* Add TypeForwards for:

* System.IO.Enumeration.FileSystemName
* System.Security.Cryptography.CryptographicOperations

Since these were removed in NS 2.1

* Bump API snapshot submodule
2019-07-10 23:58:59 +02:00
Thays Grazia 4917c086b6 [debugger] Add intrinsic for creating a byte array (#15591)
Fixes #15268
2019-07-10 23:29:13 +02:00
Vlad Brezae 2f2a9bcc37 [interp] Add JitHelper intrins for enum comparison (#15635)
Fixes https://github.com/mono/mono/issues/15596
2019-07-10 20:42:50 +03:00
Ryan Lucia 370e76dfc8 [netcore] Don't default to mscorlib in Assembly.GetType (#15488)
* [netcore] Don't default to mscorlib in Assembly.GetType

* Add argument for whether or not to search mscorlib

* Reorder and rename search_mscorlib argument

* Use gboolean exclusively
2019-07-10 09:21:56 -07:00
Jay Krell 7a486d8f43 Remove quadratic behavior from g_strconcat. (#15630)
Prefer strlen + memcpy over strcat.
2019-07-10 12:06:51 -04:00
Jay Krell 58fc782d86 Fix warning: unused function get_address_from_sockaddr (#15631) 2019-07-10 10:36:46 +02:00
Jay Krell 77c269721e Provide g_strnlen to replace strnlen for portability to older systems. (#15626)
See https://github.com/mistydemeo/tigerbrew/issues/605.
See https://www.gnu.org/software/gnulib/manual/html_node/strnlen.html.
2019-07-09 23:43:12 -04:00
Kenneth Pouncey 8b8fd0a820 Create package of the templates
- Create a `Mono.WebAssembly.Templates.cproj`
- Moved the existing DotNet template to a new subfolder Templates\templates
- Add `dotnet pack` of the project to the Makefile.
2019-07-09 20:36:48 -05:00
Zoltan Varga 5fb57b4fbd [wasm] Bump emscripten to 1.38.38. (#15639) 2019-07-09 20:51:54 -04:00
Zoltan Varga cba874139d [interp] Avoid declaring MonoError's in interp_exec_method_full (), it increases the native stack frame size because the optimizer can't seem to figure out live ranges. (#15613)
* [interp] Avoid declaring MonoError's in interp_exec_method_full (), it increases the native stack frame size because the optimizer can't seem to figure out live ranges.

* Remove some unused fields from InterpFrame.
2019-07-09 15:16:46 -04:00
Thays Grazia d33747a6e3 [debugger] Update client thread frames after SetIP. (#15449)
* Fixes #13408

PR of draft https://github.com/mono/mono/pull/14667

* Disabling test on Interpreter.
2019-07-09 16:07:46 -03:00
Kenneth Pouncey a6983e4a37 Add threads option
```

  --threads (enable threads)
        type: bool  default: false

```
2019-07-09 13:26:24 -05:00
Kenneth Pouncey 742c98c5b4 Update 2019-07-09 13:26:24 -05:00
Kenneth Pouncey 46025dab20 Change formatting 2019-07-09 13:26:24 -05:00
Kenneth Pouncey 607027b544 Update docs
- Include threading
2019-07-09 13:26:24 -05:00
Martin Baulig cf609799f0 [System]: Allow reading fully buffered HttpWebResponse body… (#15220)
[System]: Allow reading fully buffered `HttpWebResponse` body after close.

If we have already read the entire response body, then we should allow the
user to read it even after the request has been aborted.

* `WebConnectionStream.Read ()`: Move `Operation.ThrowIfClosedOrDisposed ()`
   call down after argument checks and call a new protected abstract method
   called `TryReadFromBufferedContent ()` prior to it.

* `WebResponseStream.TryReadFromBufferedContent ()`: Implement it here.
  If the entire response body has been buffered, then `bufferedEntireContent`
  is true and `innerStream is BufferedReadStream` and we can call the new
  `BufferedReadStream.TryReadFromBuffer ()`.

* `WebResponseStream.ReadAllAsync ()`: Set `bufferedEntireContent = true`
   after reading the entire response body.

* `BufferedReadStream.TryReadFromBuffer ()`: New internal method.

Fixes #10645.
2019-07-09 19:26:42 +02:00
Zoltan Varga 2cefbc18df [jit] Add support for valuetype arguments to gsharedvt constrained calls. (#15610) 2019-07-09 11:40:06 -04:00
dotnet-maestro[bot] 6f24998e8b [master] Update dependencies from dotnet/corefx (#15608)
* Update dependencies from https://github.com/dotnet/corefx build 20190707.5

- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview8.19357.5

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/corefx build 20190703.6

- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview8.19353.6

* Update dependencies from https://github.com/dotnet/arcade build 20190703.19

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19353.19
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19353.19

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08
2019-07-09 14:12:26 +02:00
Egor Bogatov 9dc20c9b5f [netcore] Fix netcore CI lane (#15627) 2019-07-09 13:29:19 +02:00
Alexander Köplinger b2ba8e62ca Make RemoteExecutor a no-op on all mobile profiles (#15611)
Starting another Mono process for the remote executor doesn't work on any of them.

Helps with https://github.com/mono/mono/issues/15328
2019-07-09 11:45:00 +02:00
Zoltan Varga aeacedfd38 Remove support for llvm36, its not used anymore. (#15619)
* Remove support for llvm36, its not used anymore.

* [jit] Remove support for older llvm versions.
2019-07-09 11:44:17 +02:00
Jay Krell 5a0bc3cf81 [profiler] Fix printf bug -- char* vs. MonoString* (#15602)
Gcc warned.
2019-07-09 11:24:39 +02:00
Jay Krell 369f796d8d [jit] [x86] [amd64] Cleanup with x86_byte() (#15600) 2019-07-09 11:12:52 +02:00
Jay Krell 39b52e2da8 Access mini_debug_options directly within the runtime. (#15594)
We had some inconsistency around accessing mini_debug_options in the runtime (both directly as well as through the function, mini_get_debug_options). This PR makes the access consistent through the runtime.
2019-07-09 11:12:15 +02:00
Alexander Köplinger 9cec2b0da3 [ci] Remove check-seq-points step from CI runs
The test was disabled with https://github.com/mono/mono/pull/15623
2019-07-09 11:11:04 +02:00
Jay Krell 135eaa1758 Disable check-seq-points test. (#15623)
See https://github.com/mono/mono/pull/15599#issuecomment-509444313.
See https://github.com/mono/mono/pull/15567.

Alternative to https://github.com/mono/mono/pull/15599 and part https://github.com/mono/mono/pull/15567.
2019-07-09 11:09:29 +02:00
Jan Kotas 9335f2637e Cleanup IL linker heuristic usage (dotnet/coreclr#25547)
Prep-work for using mainstream IL linker

Signed-off-by: dotnet-bot <[email protected]>
2019-07-09 08:39:16 +03:00
Alexis Christoforides c6bf6370dd The regression is the accidental removal of RegisterReportingForNativeLib from the managed side, introduced by b919ac4#diff-939ea9baecd2e8b24260bcb33f531274 2019-07-09 01:34:44 +03:00
Jay Krell e4bc8790d3 runtime.h remove extern "C" and distribute normally instead of extra. (#15558) 2019-07-08 13:59:05 -04:00
Johan Lorensson 12c962835f Align native_handle open/close for MonoThreadInfo/MonoInternalThread on Windows. (#15482)
* Align native_handle open/close for MonoThreadInfo/MonoInternalThread on Windows.

* Drop assert on DuplicateHandle failure.

* Fix native thread handle gpointer conversion.
2019-07-08 13:50:17 -04:00
Alexander Köplinger 784449a077 [sdks] Fix android sdks job, take 2
It needs to work for both debug and release configs.
2019-07-08 19:34:32 +02:00
Jay Krell 63126b72f7 Remove some unused third party code. (#15475)
i.e. C++ helpers for Boehm GC.
2019-07-08 19:30:14 +02:00
Alexander Köplinger 305b2e76e6 [sdks] Fix android sdks job
It would try to execute the .stamp-android-loader-path target in unrelated configurations.
2019-07-08 18:04:23 +02:00
Thays Grazia ebebfe263b Crashes on running the boring.il test from coreclr, the problem was that using [System.Runtime]System.String the type was not understood as the primitive type string. (#15552)
Using ilasm from coreclr and running on mono it works, because of that I decided to fix on ilasm and not on runtime.

Fixes #13923
2019-07-08 10:22:19 -03:00
Zoltan Varga cb330378cf [runtime] Implement mono_verifier_class_is_valid_generic_instantiation () etc. even if the verifier is disabled. (#15564)
Fixes https://github.com/mono/mono/issues/15551.
2019-07-08 10:36:49 +02:00
Jay Krell f19bc96343 mono_native_tls_get_value that does not change LastError. (#15568) 2019-07-08 09:44:23 +02:00
Jay Krell 963ba77863 Inline GetLastError and SetLastError. (#15560) 2019-07-08 09:42:54 +02:00
Egor Bogatov 55cc1d6d8f [netcore] Throw ICE for Array.Copy(object[], enum[]) (#15585)
* test

* undo rsp changes

* Fix ICollection_NonGeneric_CopyTo_ArrayOfEnumType

* group all "requires precise gc" issues

* Add more gc precise tests (and a flaky one)
2019-07-07 09:11:03 -04:00
Ryan Lucia 851dfdb98a Convert dl-test-assets.py to Python 3 (#15524) 2019-07-06 17:34:30 -04:00
Jay Krell d540aee31f Cleanup zlib-helper.c allocations -- move integer overflow checks into calloc. (#15505) 2019-07-06 14:59:27 -04:00
Zoltan Varga de5dca2264 [jit] Add missing float conv.u8.ovf.un conversion. (#13907)
* [jit] Add missing float conv.u8.ovf.un conversion.

* Add support for the float64 bit version as well.

* Fix interpreter support.
2019-07-06 05:47:47 -04:00
Jay Krell 1cb8e04331 Distribute sgen-dynarray.h via source, not EXTRA_DIST. (#15559) 2019-07-05 18:05:13 +02:00
Jay Krell 2b7e2d2f34 Remove extra explicit dist. (#15557)
Automake sees through the conditionals.
2019-07-05 18:04:22 +02:00
Radek Doulik 0991905c8b [sdks] Use @loader_path for mono and libmonosgen (#15580)
* [sdks] Use @loader_path for mono and libmonosgen

This way we are able to dynamically load libmonosgen and also use host
mono binary.

The library dependencies look like this after the change:
```
otool -L /Users/rodo/git/mono/sdks/out/android-host-Darwin-release/bin/mono
/Users/rodo/git/mono/sdks/out/android-host-Darwin-release/bin/mono:
	@loader_path/libmonosgen-2.0.dylib (compatibility version 2.0.0, current version 2.0.0)
	...

otool -L /Users/rodo/git/mono/sdks/out/android-host-Darwin-release/lib/libmonosgen-2.0.dylib
/Users/rodo/git/mono/sdks/out/android-host-Darwin-release/lib/libmonosgen-2.0.dylib:
	@loader_path/libmonosgen-2.0.dylib (compatibility version 2.0.0, current version 2.0.0)
	...
```
2019-07-05 17:38:19 +02:00
Bernhard Urban 5a5cbcc0a7 [sdks] sanity check for maximum number of open file descriptors (#15582)
Default for `ulimit -n ` seems to be 256, that isn't enough for the Android SDK build.
2019-07-05 17:19:08 +02:00
Alexander Köplinger 3ffe317138 [netcore] Only do CI builds on master
We don't care about the 2019-xx branches yet.
2019-07-05 17:15:12 +02:00
Alexander Köplinger bc269dc39e [netcore] Read NETCORETESTS_VERSION and NETCOREAPP_VERSION fro… (#15584)
* [netcore] Simplify CI build invocation

We now have build.sh as a one-stop entry to the build system.

* [netcore] Read NETCORETESTS_VERSION and NETCOREAPP_VERSION from eng/Versions.props

The Versions.props is auto-updated by Arcade so we automatically get new versions.
2019-07-05 17:03:49 +02:00
dotnet-maestro[bot] 3b3829e33c [master] Update dependencies from dotnet/arcade (#15550)
* Update dependencies from https://github.com/dotnet/arcade build 20190703.1

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19353.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19353.1

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/corefx build 20190703.3

- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview8.19353.3

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.05

- Microsoft.NETCore.App - 3.0.0-preview8-27903-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190703.08

- Microsoft.NETCore.App - 3.0.0-preview8-27903-08
2019-07-05 17:03:09 +02:00
Egor Bogatov 3a7afab91c [netcore] CI work, add rsp for Windows (#15549) 2019-07-05 17:02:44 +02:00
Jay Krell e7f9dbe73c Link with -z now or -bind_at_load. (#14562)
Advantages:
 Dynamic linker gets out of the way of random function calls,
 in terms of timing, in terms of locking, and in term of success,
 and possibly in terms of security (readonly function pointers).
 If you successfully load, then you can make function calls with impunity,
 without regard as to if they are in the same .so as the caller, well,
 assuming they are to a leaf like libc, or to something itself built with -z now.

 The "success" is significant, as otherwise loaded LLVM has unresolved symbols lurking, depending on which code paths you send it down.

Disadvantage: Slower startup.

Mixed:
 Platform consistency, since this is how Windows behaves usually (unless you say link /delayload)

This will combine well with an upcoming revision of https://github.com/mono/mono/pull/14524.

Difficult alternative: Force the binding along sensitive paths by calling their callees earlier.
Typical alternative: Ignore the matter.

Android: It is believed this switch produces a warning, which is ignored, there is no affect, and it is unclear if the behavior is actually "now" or "lazy". Logs could be checked and a test run, but neither.
2019-07-05 15:54:16 +02:00
Jay Krell 4cf527f6d9 Readonly codemanager callbacks. (#15538) 2019-07-05 15:46:10 +02:00
Jay Krell 28ec3644ef Make thread locals just always extern. (#15563)
Making them static for C is not worth the ifdef.
2019-07-05 15:38:15 +02:00
Jay Krell b84b85688b Win32 zlib support. (#15509)
Fixes https://github.com/mono/mono/issues/15503

Always statically link on Windows (msvc and mingw).
This is a somewhat old zlib, and will be updated shortly (https://github.com/mono/mono/pull/15480)

Note that zlib is not valid C++, so always compile as C.
2019-07-05 14:38:56 +02:00
Steve Pfister 063985e04d Bump mono/corefx@9354dfd (#15545) 2019-07-05 14:35:14 +02:00
Bernhard Urban 808592925b [android] switch cross compilers host from 32bit to 64bit (#15553)
Untested, but we need to do it anyway soon. This will help us to understand the situation on Xamarin.Android while finishing the work for Xamarin.iOS.

Contributes to https://github.com/mono/mono/issues/9621
2019-07-05 13:58:38 +02:00
Johan Lorensson b1b61d7cb7 Interpreter reads last error to late after pinvoke. (#15571)
* Interpreter reads last error to late after pinvoke.

This could lead to clobbered last error since interpreter loop needs to
run two additional IL instructions in order to read out the value. This works
on JIT since the lowering saving the last error will happen right after
pinvoke.

This fix makes sure interpreter will get needed information to read out
last error right after pinvoke (if requested).

It adds a new IL prefix issued in managed->native wrapper that will tell
codegen (and interpreter) that upcoming calli instruction needs to save
last error, meaning that it could be done right after issuing the call,
no need to run any additional IL instructions to do that work, closing
the gap between the return of pinvoke call and save of last error.

Should fix, https://github.com/mono/mono/issues/15541.

* Optimize emit_get_last_error.
2019-07-05 10:30:17 +02:00
Kenneth Pouncey a90b735cf8 Update ,gitignore (#15561)
- emsdk_env.sh
- builds/threads
2019-07-05 07:29:52 +02:00
Kenneth Pouncey d8f2ebe384 Add a package.json to the tests/runtime directory. (#15573)
- Installs the required packages to run
- Modify make target `run-threads-sample` to use npm to install and run the test.
- There are two targets in the package.json file one for `test` and another 'start`
2019-07-05 05:43:50 +02:00
Larry Ewing 6530ba9861 [wasm] Add BlazingPizza.Client to size tesets 2019-07-04 19:48:34 -05:00
Jan Kotas a288cb1aae Delete some dead code (dotnet/coreclr#25546)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-04 19:18:35 +03:00
Jay Krell 5637cbd42d Do not compile metadata support/compress.c. (#15535) 2019-07-04 16:05:17 +02:00
Maxim Lipnin e0da61d691 [netcore] Make System.Reflection.Tests.TypeTests.GetEnumUnderlyingType Pass (#15510)
* [netcore] Make System.Reflection.Tests.TypeTests.GetEnumUnderlyingType Pass

* Remove recursive name parsing in case of "+" character; remove if condition for nested names
2019-07-04 09:10:18 -04:00
Alexander Köplinger 16750e4fd9 [netcore] Trigger Azure Pipelines builds only for master and release branches
Also batch changes so the system waits until a build is completed,
then queues another build of all changes that have not yet been built.
2019-07-04 09:16:56 +02:00
Larry Ewing 03d5525757 [wasm] allow overriding the build command invocation 2019-07-03 23:37:58 -05:00
Kenneth Pouncey 1a08a840c2 Fix the directory paths after threads commit
- Add threads build directories to the Runtime package.
2019-07-03 17:24:52 -05:00
Jay Krell 167709be8c Make sure TLS (thread local storage) is always TLS and not FLS (fiber local storage).
The Windows SDKs are inconsistent (and clearly documented as so), and the JIT assumes TLS.
2019-07-03 15:45:47 -05:00
Thays Grazia fb49d2d631 [debugger][wasm] Display content of "this" (#15528)
* Implementing watch of variable "this"
Fixes #15446

* Fixing indentation.
2019-07-03 12:15:18 -03:00
Vlad Brezae 6136d51ae9 [interp] Simplify MINT_NEWOBJ_ARRAY 2019-07-03 09:08:20 -05:00
Vlad Brezae aa7b713715 [interp] Make newarr lockfree
Before this commit, we were creating the array class from the element class during run time, also taking a lock in the meantime. This makes array allocation 2x faster. (on multithread much faster)
2019-07-03 09:08:20 -05:00
Johan Lorensson e30184752b Abort async suspend request on failure doing preemptive suspend. (#15486)
When a preemptive suspend fails, state machine will get into an invalid
state and the thread is in an unknown state (running/self-suspended). In case of
failure in mono_threads_suspend_begin_async_suspend, a new method should be
called, mono_threads_transition_abort_async_suspend making sure state machine
reflects correct thread state as well as reporting correct result to initial
caller of mono_threads_suspend_begin_async_suspend.
2019-07-03 13:08:05 +02:00
Jay Krell 08feb423c1 HAVE_DL_LOADER is never used so remove it. (#15500) 2019-07-03 11:01:59 +02:00
Jay Krell 33b4d2695e AC_DEFINE instead of AC_SUBST MONO_DL_NEED_USCORE. (#15499)
i.e. so it can be used in C instead of make.
i.e. so it can actually work.

The lone use is here:
```
C:\s\mono2\mono\utils\mono-dl.c(271):#if MONO_DL_NEED_USCORE
```
2019-07-03 11:01:19 +02:00
Jay Krell 177ae36c7a Do not compile unused support/uncompr.c. (#15516) 2019-07-03 10:59:38 +02:00
Egor Bogatov 57f362207c [netcore] Clean up CoreFX.issues.rsp (#15526) 2019-07-03 10:58:50 +02:00
Zoltan Varga c533ad99ce [wasm] Ongoing work. (#15504)
* [wasm] Avoid AOTing mscorlib if the input file haven't changed.

* [wasm] Store the wasm builds in a builds/ subdir.

* [wasm] Add a run-chrome- target to run test suites under chrome using a puppeteer script.

* [wasm] Link with -O0 in debug mode.

* [wasm] Add a runtime-threads make target.

* [wasm] Compile driver.o etc. with -Oz. Make the build-native -> packager.exe dependency order only.

* [wasm] Run the threads sample using chrome.

* Bump emscripten to 1.38.37.

* Fix the build.

* Fix the tests.

* Fix the tests.
2019-07-03 08:48:51 +02:00
Rich Lander 8fe4109ead Add entry for GCC (#15473) 2019-07-02 17:57:38 +02:00
Michal Strehovský 29e1d630b4 Use Array.MaxArrayLength in ArrayList (dotnet/coreclr#25530)
Now that `ArrayList` is in CoreLib, we don't need the copy.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-02 17:26:31 +02:00
Jay Krell 4b074e842b Correct MONO_DL_NEED_USCORE for C++, and memcpy is faster than strcpy. (#15498) 2019-07-02 11:09:32 -04:00
Alexander Köplinger e843b52098 [netcore] Add DARC subscriptions for Microsoft.NETCore.App 2019-07-02 15:11:32 +02:00
Johan Lorensson 5fee1d3eea Add support for TLS callbacks on Windows. (#15423)
* Add support for TLS callbacks on Windows.

Mono runtime depends on DllMain to be called by OS in order to correctly
detach threads from the runtime. If this doesn't happen,
threads from native thread pools (not owned by runtime) and attached
using native->managed callback, won't detach resulting in attached
threads no longer running. Since threads are still attached
to runtime, next GC will try to suspend the thread and that will fail
and that in turn will put the state machine in an incorrect state,
bringing down the runtime at next GC (when the thread state is revisited).

This problem is currently handled by DllMain, but since DllMain only exist
in DLL's, statically link Mono runtime will get us into the above scenario.

This commit add support to hook up a TLS callback using the same mechanism
used by MSVC linker and c-runtime (also available under MINGW). The
callback will be included in a section/segment of an object file and included
in final image (DLL or EXE) by linker and called by OS loader, solving the
problem with static linked Mono runtime not being able to detach terminating
threads.

The commit keeps current DllMain method when building a DLL but
includes a mechanism making sure we only use one of the callback techniques
at runtime, if both have been included in final image. This will simplify the build
of libmini since we can always build the object including the callback, regardless
how the library will be consumed.
2019-07-02 14:06:57 +02:00
Alexander Köplinger b62878973d [netcore] Add DARC subscriptions for Microsoft.Private.CoreFx.NETCoreApp
It contains the corefx test assets.
2019-07-02 13:56:09 +02:00
Bernhard Urban 6f7da4ce49 [stats] distinguish between mini and LLVM AOT method (#15483)
[stats] distinguish between mini and LLVM AOT method

Also print the stats on shutdown when configured with `--with-core=only`
2019-07-02 04:55:50 -04:00
Zoltan Varga adbb7df7ce [netcore] Remove some unused SRE icalls. (#15484) 2019-07-02 04:27:48 -04:00
Jay Krell d956cf687c Fix const warning. (#15478) 2019-07-02 09:08:05 +02:00
Jay Krell caecad895a Make codeman not public (#15415)
Seems a bit obscure to be public, the header is not public.
2019-07-02 09:07:18 +02:00
Zoltan Varga 4473e761c5 Fix make package. 2019-07-01 22:15:21 -05:00
Zoltan Varga 5767de0213 Fix some targets. 2019-07-01 22:15:21 -05:00
Zoltan Varga 708d1948e4 Make a local copy of emsdk_env.sh for the interpreter builds. 2019-07-01 22:15:21 -05:00
Zoltan Varga 6304c094db Make a local copy of emsdk_env.sh during the ninja build. 2019-07-01 22:15:21 -05:00
Zoltan Varga e84e9e786d Avoid calling emsdk_env.sh, it calls emsdk update_env which is racy. 2019-07-01 22:15:21 -05:00
Zoltan VargaandLarry Ewing aacd83ad39 Fix formatting.
Co-Authored-By: Larry Ewing <[email protected]>
2019-07-01 22:15:21 -05:00
Zoltan VargaandLarry Ewing f01cb9c9d2 Fix formatting
Co-Authored-By: Larry Ewing <[email protected]>
2019-07-01 22:15:21 -05:00
Zoltan Varga beea086ec9 Enable threads builds on CI. 2019-07-01 22:15:21 -05:00
Zoltan Varga 3970c6112a Add back some stubs for the non-threads build. 2019-07-01 22:15:21 -05:00
Zoltan Varga 648bef053e Set Module.mainScriptUrlOrBlob so workers can load it. 2019-07-01 22:15:21 -05:00
Zoltan Varga 16ed192da3 Add missing file. 2019-07-01 22:15:21 -05:00
Zoltan Varga b40a624898 [wasm] Add threads support to the packager. 2019-07-01 22:15:21 -05:00
Zoltan Varga 7c3adaf873 [wasm] Implement pthreads support in the runtime. 2019-07-01 22:15:21 -05:00
Zoltan Varga e21bed53a0 [wasm] Allow overwriting EMSCRIPTEN_SDK_DIR. Add a runtime build with threads support if ENABLE_WASM_THREADS is defined in Make.config. 2019-07-01 22:15:21 -05:00
Zoltan Varga 7fa884b721 [wasm] Add a threads sample. 2019-07-01 22:15:21 -05:00
Zoltan Varga bc787a8a01 [runtime] Disable a a AC_TRY_RUN when cross-compiling. 2019-07-01 22:15:21 -05:00
Zoltan Varga 20a8edacb8 [wasm] Add a make define for wasm runtime builds. 2019-07-01 22:15:21 -05:00
Steve Pfister d39c84d45f [netcore] Remove IsByRef check on Reflection.Emit.DynamicMethod
Fixes https://github.com/mono/mono/issues/15324

Removed check on the return type being by ref.
2019-07-01 21:12:06 -04:00
Martin Baulig 3508cd8026 [System.Net.Http]: Delete broken Send_Transfer_Encoding_Custom() test. (#15470)
This test was checking a broken Mono-specific behavior, which has been
removed after we switched to the new corefx-based handler. It also does
not make much sense to use a `Transfer-Encoding` header with a GET request.
2019-07-02 01:27:42 +02:00
Johan Lorensson 51a11b68c5 Disable zlib on mingw Windows build to avoid dependency on zlib (#15493)
#4484 broke Windows mingw build due to new dependency, zlib1.dll not available in PATH on build bots. Disabling for now until we know how this should be handled (and also fixed for MSVC build runtime).
2019-07-02 01:15:37 +02:00
Alexander Köplinger 1a1e921efe Bump bockbuild to bring in fix for mono/mono#14957 2019-07-02 00:30:58 +02:00
Marek Safar 71d1b10c3e [netcore] Bump Roslyn 2019-07-01 23:01:13 +02:00
Michal Strehovský 68872c4a60 Use AssemblyLoadContext from shared partition (dotnet/corert#7570)
We were missing methods that got added for 3.0. The only LoadContext that works is the default one though.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Stephen Toub d0d2096fc7 Fix ActivityTracker ES_BUILD_STANDALONE build
Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Koundinya Veluri 306e8c3cd6 Fix an assertion failure in the thread pool's QueueUserWorkItemCallbackBase (#25482)
Fixes https://github.com/dotnet/coreclr/issues/25242
- The issue could be that there is no memory barrier (or in the wrong place) on the thread reading the value, and an old value could be cached and read

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Santiago Fernandez Madero 4dfd7437a7 React to new compiler nullability warnings
Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Jan Kotas c88c0dd873 Fix typo & make the code leaner (dotnet/coreclr#25442)
Enum.HasFlag generates bigger IL and depends on complex JIT optimization for a good code.
The classic bit check is strongly preferred accross CoreCLR and CoreFX.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Stephen Toub 45e5bb8ec0 Tweak nullable attribute per API review (dotnet/coreclr#25443)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Levi Broderick 83a9ee16fb Fix EncoderNLS / DecoderNLS regression in reporting error index (#25397)
Also fixes incorrect asserts in the Encoding type

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Ben Adams aeb8b0fa8f Don't show AggressiveInlining items in exception stacks (#25408)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Tanner Gooding c754857c0e Reverting the ShouldRoundUp logic to not change for custom numeric format strings. (#25400)
Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Jan Kotas 674f8876cc Delete DeserializationBlockedException (dotnet/coreclr#25393)
Contributes to dotnet/corefx#36723

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Stephen Toub 1543276813 React to compiler respecting nullable attributes on properties
Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Tarek Mahmoud Sayed 0890f588e9 Map C Locale to Invariant (dotnet/coreclr#25373)
ICU map the C locale to en-US_POSIX which has a non desired collation behavior as it doesn't support case insensitive comparison.
This change is to force mapping C locale to Invariant instead.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Jan Kotas cc779bd7e3 Fix StackChange value for OpCodes.Stelem (dotnet/coreclr#25382)
Fixes dotnet/corefx#37955

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Santiago Fernandez Madero 4da8b52e28 Address last round of nullable feedback - S.Resources.ResourceManager, System.Reflection.Emit and ILGeneration (#25318)
* Address nullable feedback for System.Resources.ResourceManager

* Address nullable feedback for System.Reflection.Emit.ILGeneration

* Address nullable feedback for System.Reflection.Emit

* PR Feedback and clean-up redundant casts

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Tanner Gooding c471996c8b Updating Dragon4 to ensure the number buffer always provides a significant digit if one exists. (#25096)
* Updating Dragon4 to ensure the number buffer always provides a significant digit if one exists.

* Changing System.Number.RoundNumber to not round up floating-point numbers.

* Re-enabling the RealFormatterTestsBase CoreFX tests

* Updating Number.RoundNumber to take a isCorrectlyRounded parameter and to use IEEE compliant rounding for floating-point numbers.

* Change SinglePrecisionCustomFormat to 7, ensuring it matches the value used in netcoreapp2.1

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Ganbarukamo41 52814eb6bb Make Vector*.ToString() Culture invariant (dotnet/coreclr#25343)
* Remove IFormattable
* Hardcode characters
* Add tests

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 23:01:13 +02:00
Egor Bogatov d20fe8ec37 [netcore] Fix Array.Copy* tests. Bump NETCORETESTS_VERSION ver… (#15428)
* Fix Array.Copy* tests

* simplify code

* Add comments

* Address feedback

* Update CoreFX.issues.rsp

* Fix SRE tests

* Add comment

* bump versions again
2019-07-01 20:20:25 +02:00
Maxim Lipnin 15668a6292 Bump corefx (#15463)
This PR will bring mono/corefx#303
2019-07-01 19:01:23 +02:00
Miguel de Icaza de18c594f0 [metadata] Rename, null-initialize, and properly free *args variables (#13855) 2019-07-01 12:11:02 -04:00
Rich Lander 241d2d1809 Create THIRD-PARTY-NOTICES.TXT
Use: https://github.com/mono/mono/blob/6a9950c5d22a1d748a2163ce6bdbc7fa6ffd8e77/mcs/tools/sqlmetal/src/DbLinq/Test/Providers/ReadTest_Complex.cs#L571
2019-07-01 17:16:51 +02:00
dotnet-maestro[bot] 36b0c02463 [master] Update dependencies from dotnet/arcade (#15477)
* Update dependencies from https://github.com/dotnet/arcade build 20190630.1

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19330.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19330.1
2019-07-01 17:10:47 +02:00
Michal Strehovský 75dfa5c298 Remove AggressiveOptimization flag from System.Text (dotnet/coreclr#25356)
Based on conversation with Levi, I don't think this flag is needed.

The flag currently controls two things:
* Disqualifies the method from precompilation
* Disables Tier-0 JIT for the method

Removing the attribute allows us to precompile some of the methods (not all, because of `Vector<T>`). It measurably helps improve startup time because many of the attributed methods are complex and take a while to compile.

Once tier-1 JIT kicks in, the generated code should be identical to what we were getting before.

Signed-off-by: dotnet-bot <[email protected]>
2019-07-01 17:07:00 +02:00
Jay Krell 8c20d5c67a Remove unused AMD64 JIT CALLCONV_IS_STDCALL. (#15416) 2019-07-01 09:53:01 +02:00
Larry Ewing df74f5227f [wasm][debugger] remove args parsing hack 2019-06-30 12:25:40 -05:00
Larry Ewing 3b337e31c3 [wasm] use the router for all requests 2019-06-30 12:25:40 -05:00
Larry Ewing 18b031870e [wasm] remove TabMapper and just filter values key by key
proxy the version response through our logic so that we match
the actual protocol versions. Refactor the mapping logic so we
just rewrite specific keys that we understand and pass the rest
along.
2019-06-30 12:25:40 -05:00
Larry Ewing f293fd7174 [wasm] make the host url a uri 2019-06-30 12:25:40 -05:00
Larry Ewing 9455030364 [wasm] use options directly in other places 2019-06-30 12:25:40 -05:00
Larry Ewing 0065b50c93 [wasm] Start reworking the server logic for the Proxy and Debugger
Split some of the configuration logic out into options so that
we can start moving away from a fixed configuration.
2019-06-30 12:25:40 -05:00
Larry Ewing d7cfc6994a [wasm] make extract_conn_url return null on unexpected data
We want to avoid throwing inside ErrorDataReceived on unexpected
input because tends to hang the process in a bad state.  Instead
we return null from extract_conn_url and let the normal cleanup
process happen.
2019-06-30 12:25:10 -05:00
Rich Lander 40ebd4e815 Add entry for Silicon Graphics and HP
For https://github.com/mono/mono/blob/d58dfa185af1d48fb93efdef1d046762f214f0a7/libgc/include/gc_allocator.h
2019-06-29 20:54:42 +02:00
lateralusX be77d03c22 Fix 32-bit build error when using C++ compiler. 2019-06-29 13:48:34 -05:00
Katelyn Gadd c239906a01 Disable compiler server on darwin. Add force-enable option for compiler server. (#15450) 2019-06-28 18:24:09 -04:00
Filip Navara c788634b54 Add tests 2019-06-28 14:56:47 -05:00
Filip Navara cbe365b659 Fix marshalling bugs for StringBuilder parameters 2019-06-28 14:56:47 -05:00
Jo Shields 4421ebc1f2 Correct env vars used for Android directory override (#15469)
This fixes https://github.com/mono/mono/pull/15453

The issue is the env var names differ vs. Xamarin.Android
2019-06-28 15:29:37 -04:00
Jo Shields 714da9f5be Use /mnt/scratch for Android SDK, to match https://github.com/… (#15453) 2019-06-28 19:20:41 +02:00
Maxim Lipnin efa0a0bb3a Fix time zone transition out of DST (#15401)
When a datetime appears in range of [end_of_DST_period - Daylight_delta; end_of_DST_period] it's not DST and should return base offset.

Fixes #9664.
2019-06-28 19:04:21 +02:00
Kenneth Pouncey dfb9cdd072 Fix generation of wrong version. 2019-06-28 10:55:35 -05:00
Ryan Lucia c879bc4691 [netcore] Fix Assembly.GetForwardedTypes() (#15452)
* [netcore] Make GetForwardedTypes return nested types

* [netcore] Throw proper error in GetTopLevelForwardedTypes

* Remove unnecessary function

* Formatting

* Re-enable relevant tests

* Switch to REFERENCE_MISSING

* Use local error
2019-06-28 11:54:27 -04:00
dotnet-maestro 9bf0809439 Update dependencies from https://github.com/dotnet/arcade build 20190627.39
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19327.39
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19327.39
2019-06-28 17:27:39 +02:00
dotnet-maestro 5da074c43d Update dependencies from https://github.com/dotnet/arcade build 20190626.44
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19326.44
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19326.44
2019-06-28 17:27:39 +02:00
Zoltan Varga 112297ef5c [runtime] Implement support for embedded ppdb, when the ppdb blob is compressed and embedded into the pe image. 2019-06-28 15:19:43 +02:00
Jay Krell 19681ad2d4 Fix year+ old MIPS compile break. (#15459)
Fixes https://github.com/mono/mono/issues/15441
2019-06-28 11:28:05 +02:00
Alexander Köplinger 4e022f7f07 Replace two more MONO_DEBUG=clr-memory-model env vars with commandline switches
Follow up to https://github.com/mono/mono/pull/15447
2019-06-28 10:19:16 +02:00
Kenneth Pouncey 6b5113220c Simplify the file generation and remove the Encoding="Unicode" option 2019-06-28 01:01:58 -05:00
Kenneth Pouncey c692828f49 Add a target to set the version of the Templates's sdk version in the global.json.
- The `_WriteDotNetTemplateVersion` is called from the sdk build.

```
"Mono.WebAssembly.Sdk": "0.1.0-preview1"
```
2019-06-28 01:01:58 -05:00
Kenneth Pouncey 4c1cf2c148 Trying BeforeTargets="_GenerateRestoreProjectSpec" 2019-06-28 01:01:58 -05:00
Kenneth Pouncey 7e2433d9f4 Modify _CreatePackagesDir
- Another try
2019-06-28 01:01:58 -05:00
Kenneth Pouncey 1a2f43d4cb Address review comments separate versions for each sdk package
- Update to use only the SDK package version.
2019-06-28 01:01:58 -05:00
Kenneth Pouncey 6e6580beba Rename target to prefix it with an underscore to indicate that users should not call it directly. 2019-06-28 01:01:58 -05:00
Kenneth Pouncey 99e64a970f Add target to create packages directory if it does not exist. 2019-06-28 01:01:58 -05:00
Kenneth Pouncey 5ca42e24fb Remove the WebAssembly.Net.Http.xml file that was inadvertently commited 2019-06-28 01:01:58 -05:00
Kenneth Pouncey c9db6a08f1 Add versioning to the sdk and framework project files.
- Add a central versioning file `common\Versions`
- Modify projects to use the central version file
- Auto generate a versions file for the SDK versions so that they can be updated automatically.
2019-06-28 01:01:58 -05:00
Zoltan Varga a29cbc429d [netcore] Avoid calling mono_runtime_install_appctx_properties () in aot mode. (#15448) 2019-06-27 23:16:47 -04:00
Thays Grazia c011456f3f [dim] Emit error when calling abstract methods (#15433)
* Emitting bad image exception when a non virtual call is calling an abstract method.

* Fixing side-effect.
Implementing the same thing on interpreter.
Adding unit test.
2019-06-27 22:02:39 -03:00
Zoltan Varga 064d367ede Pass the --clr-memory-model flag on the command line instead of MONO_DEBUG so its not inherited by child processes. (#15447) 2019-06-27 20:44:39 -04:00
lateralusX c5ef80bf86 FIx id formatting to align with rest of code. 2019-06-27 14:59:59 -05:00
lateralusX 56d38ca430 Fix incorrect thread state on suspend thread failure.
According to documentation of mono_threads_suspend_begin_async_suspend:

"If begin suspend fails the thread must be left uninterrupted and resumed."

Current implementation on Windows didn't resume thread in case GetThreadContext
fails, leaving a thread in suspended state on failure.

Fix is to resume thread if GetThreadContext fails.
2019-06-27 14:59:59 -05:00
lateralusX 973f430d45 Fix use THREAD_SUSPEND_DEBUG macros on Windows.
Several errors in current implementation, both compile time errors as
well as warnings.
2019-06-27 14:59:59 -05:00
dotnet-maestro 6ae04f597d Update dependencies from https://github.com/dotnet/arcade build 20190626.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19326.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19326.2
2019-06-27 14:21:36 +02:00
Steve Pfister 814d20db91 [netcore] Review and document netcore test failures that are skipped (#15359)
* Went through the majority of corefx tests that were being skipped in CoreFX.issues.rsp.

For each failure, a github issue was logged and if possible, a more expanded
failure reason was specified.

Part of the https://github.com/mono/mono/issues/14787 epic work

* Cleaned up header that no longer had tests in it

* Pesky -method still around.  It'll ignore now
2019-06-27 14:14:02 +02:00
Ryan Lucia 8e4d1eb06f Disable flaky test HttpClientTest.CancelRequestViaProxy 2019-06-26 21:01:58 -05:00
Ryan Lucia 19bb89805a CreateNLSocket and CloseNLSocket should return gpointer (#15408)
In managed, these functions are used as `static external IntPtr`. This means that previously on arm64 the top bits of the return value were garbage. A comparison with 64-bit -1 like in LinuxNetworkChange.EnsureSocket would never be true, which was causing us to hit other assertions in the runtime.
Co-authored-by: Aleksey Kliger <[email protected]>
2019-06-26 15:41:11 -04:00
Steve Pfister 452fa3b50c Update CODEOWNERS (#15429) 2019-06-26 15:14:07 -04:00
Johan Lorensson b70694828d Fix unused-function warning in main.c. (#15424) 2019-06-26 19:16:11 +02:00
Aleksey Kliger (λgeek) 927c608184 [sdks] dynamically link libmonosgen to mono-sgen for monodroid host builds (#15410)
* [configure] Cosmetic AC_MSG_WARN fix

* [runtime] Mark mono_file_map_error as MONO_API, always

Fixed the `--with-static_mono=no` build on non-Win32

* [sdks] dynamically link libmonosgen to mono-sgen for monodroid host builds
2019-06-26 11:10:03 -04:00
Jay Krell cad60fce03 Remove mono_tls_get_tls_getter. 2019-06-26 07:14:30 -05:00
Jay Krell 8d6feabf0d Replace MONO_PATCH_INFO_GET_TLS_TRAMP with MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL. 2019-06-26 07:14:30 -05:00
Vlad Brezae 6359520633 [sgen] Fix crashes in sgen due to xdomain refs
CADMessages are passed directly between appdomains. When using contained data, we need to make sure we don't create any cross domain references.

When domains are unloaded, all threads executing code in that appdomain are aborted and the entire heap is traversed and objects in that appdomain are cleared. If any objects in other domains are directly referencing objects in the unloaded domain, they will reference junk. If any, cross domain refs should only be allowed when the referenced object is in the root domain which is never unloaded.
2019-06-26 07:13:07 -05:00
Martin Baulig c56b37e00d [test-helpers]: Don't use named Mutexes on mobile. 2019-06-26 07:11:08 -05:00
Vlad Brezae aa05d4f43c [interp] Reduce computation under calc_section mutex
Calc_section mutex is meant to be a lower level mutex used only for synchronization on InterpMethod contents. Before this commit we were taking the loader mutex which was leading to deadlocks.
2019-06-26 07:10:37 -05:00
Larry Ewing f185358d96 [wasm] update the debugger instructions 2019-06-26 07:10:00 -05:00
dotnet-maestro d99c1e631b Update dependencies from https://github.com/dotnet/arcade build 20190624.24
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19324.24
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19324.24
2019-06-26 11:57:51 +02:00
Egor Bogatov 78b9c66501 Add xunit-summary.py (#15373) 2019-06-26 11:49:24 +02:00
Alexander Köplinger 6307f0156c [profiler] Add helper.h to tarball 2019-06-26 10:41:38 +02:00
Ryan Lucia a2a28b94c1 [netcore] Fix build.sh (#15380)
* [netcore] Revert changes to build.sh

It appears to have accidentally been changed in #15215, and the script no longer works correctly as a result, so revert

* Strip call to make
2019-06-25 23:58:41 -04:00
Larry Ewing 73dd9ac01e [wasm] make packager.exe depend on release/ and debug/ because it may use either 2019-06-25 21:44:06 -05:00
Alexis Christoforides 43f504a43e Bump bockbuild for fix to https://github.com/mono/mono/issues/14957 2019-06-25 20:59:50 -05:00
Larry Ewing 191854ded8 Merge branch 'master' into fix-dynamic-method-marshal-info 2019-06-25 20:18:14 -05:00
Zoltan Varga dc321b06a2 [aot] Save the number of locals into the aot debug info so the method header doesn't have to be decoded when its loaded. 2019-06-25 20:03:35 -05:00
Kenneth Pouncey 4699ff275d Add signing of the framework assemblies to the projects using the Open key. (#15303) 2019-06-25 17:45:13 -05:00
Thays Grazia 2bdf49cae1 [debugger][wasm] Local vars (#15385)
* Fixing side effect of #15357.

* Fixing side effect of #15357.
2019-06-25 17:36:26 -05:00
Alexander Köplinger 41767754d5 [System] Fix monotouch_watch xunit tests build
Forgot to exclude one more file.
2019-06-25 22:21:26 +02:00
Jay Krell 1c09e4de62 Fix tarball build and refresh monolite due to memory model change (#15370)
* Revise monolite due to memory model change.

* Fix tarball builds wrt netcore/config.make.

* Remove System.Private.CoreLib from mcs/class/Makefile, it was moved to netcore/

* Bump min_mono_version in basic-profile-check

The new MONO_DEBUG=clr-memory-model runtime option isn't available in earlier Mono versions.
2019-06-25 22:14:41 +02:00
Jay Krell 3e270ffe20 [threads] Define interlocked_mutex as non-recursive and on 32bit platforms only (#15393) 2019-06-25 14:56:37 -04:00
Radek Doulik 3efc0959fe [profiler] Add helper.c to static sources where needed (#15400)
This should fix broken `OS X x64 iOS SDK` build.
2019-06-25 20:04:16 +02:00
Alexander Köplinger bc1d080ba9 Exclude a few tests on monotouch_watch/xammac (#15397)
* [System.Core] Exclude AnonymousPipe tests on monotouch/xammac profiles

They should only be run on xammac_net_4_5.

Fixes https://github.com/mono/mono/issues/15329

* [System] Exclude WebClient and WebSocket tests on monotouch_watch

Fixes https://github.com/mono/mono/issues/15265.
2019-06-25 20:01:17 +02:00
Zoltan Varga ba242226f4 [wasm] Bump emscripten to 1.38.36. 2019-06-25 11:43:12 -05:00
Johan Lorensson 5ca92bdbe8 Add cooperative suspend aware threads for hybrid suspend. (#15204)
* Add cooperative suspend aware threads for hybrid suspend.

When running in hybrid suspend and having threads in blocking mode, GC Safe
mode, threads will still be preemptive suspended. This is done to make sure
compatibility is kept with embedders since current embedding API is not coop
aware. If, however the external attached threads promise to follow the coop
rules for a thread in Safe mode, it could still be possible to have them
running, making sure they won't be preempted when running STW. Unlocking this
possibility could have large performance wins if embedding threads runs a lot
of native code on threads attached to runtime.

This commit adds support for a new pair of API's where an external thread can
mark itself as cooperative suspend aware. Doing that guarantees the runtime
that it will follow all rules as dictated by cooperative suspend when a thread
is in safe mode. The change only goes one way since this is a lifetime commitment
for a thread. Once’s set, thread will be kept running when in safe mode.
2019-06-25 17:40:39 +02:00
Kevin Pilch d36d2dd02d Remove a stale comment (#15378)
Pushing https://github.com/aspnet/AspNetCore/pull/10561 upstream, to fix
AzDO Bug #890301 (https://dev.azure.com/devdiv/DevDiv/_workitems/edit/890301/)
2019-06-25 17:25:34 +02:00
Zoltan Varga 9ace0a3b9c [runtime] Refactor mono-debug.c. (#15381)
* [debug] Refactor the code in mono-debug.c.

Store the domain->debug info table mapping in MonoDomain to avoid a hashtable lookup.
Rename MonoDebugDataTable to DebugDomainInfo to better reflect its meaning.

* Remove some mono_ prefixes from static functions, along with the full/internal prefixes.
2019-06-25 09:35:21 -04:00
Alexander Köplinger b2ac112d37 [bcl] Move MONO_DEBUG env variable after Q_MCS
Otherwise we'd get "/bin/sh: @echo: command not found" errors.
2019-06-25 14:38:37 +02:00
Radek Doulik 858b2b8405 [aot profiler] Listen for commands on given port (#14936)
* [aot profiler] Listen for commands on given port

Extended the aot profiler so, that it can receive commands over the network.

Added new option `port=PORT`, which enables command server and specifies
the port the server should listen at.

We have 2 commands so far.

    save ... save the profile data to socket and close it
    quit ... quit the profiler. it also saves the profile to the file
             in case the output option was specified.

It makes the aot profiling much easier to use on Android as we don't need to
save the profile to a file on the device. That means we don't need to set
`<application android:debuggable="true"/>` flag, which changes the Android
app behavior and thus influence the profile itself. It is also convenient way
for IDEs to retrieve the aot profiles.

Example use for Xamarin.Android. Save and receive the profile data:

	adb shell setprop debug.mono.profile aot:verbose,port=9999
	adb forward tcp:9999 tcp:9999
	nc -v 127.0.0.1 9999 > profile.aotprof
	found 0 associations
	found 1 connections:
	     1:	flags=82<CONNECTED,PREFERRED>
		outif lo0
		src 127.0.0.1 port 50398
		dst 127.0.0.1 port 9999
		rank info not available
		TCP aux info available

	Connection to 127.0.0.1 port 9999 [tcp/distinct] succeeded!
	save

Check what we received:

	aotprofile-tool -sd profile.aotprof
	Modules:
		132475FF-85AA-430D-913C-7642CBD8587E mscorlib
		F7BDCAB5-83D3-4A0A-A33D-BBE94284667D Mono.Android
		22897151-27C9-4064-B001-8A04F5847812 System
		AA3FC224-D486-4304-A8C9-EBF316556B26 Java.Interop
		00D98403-051B-4168-A391-F3F601637CBD System.Core
		FD06519A-C321-426C-BDD8-C97777452057 xat_latests_and_greatest_vsmac_8._1
		9ECB003E-D449-438B-BE35-58810DCBC917 Xamarin.Android.Support.v7.AppCompat
		11659962-EFAC-400D-9F8D-AF925B26AE41 Xamarin.Android.Support.Fragment
		48C436F7-611D-470D-9949-AC13FFDCF613 Xamarin.Essentials
		2792D10D-7E13-46E6-BB4A-933C25635F48 Xamarin.Android.Support.Design
	Summary:
		Modules:         10
		Types:          221
		Methods:        932

* Try to fix WIN32 compilation

* Add helper.c to mono-profiler-log.vcxproj

* Add helper.c to mono-profiler-log.vcxproj.filters as well
2019-06-25 12:17:45 +02:00
Johan Lorensson f8fbbcf280 Increase max size of localloc and localloc_imm on amd64. (#15374)
We hit the following assert when doing full AOT of some assemblies:

wrong maximal instruction length of instruction localloc (expected 96, got 99)
Assertion: should not be reached at mono\mono\mini\mini-amd64.c:6801

Turns out that that size could be hit when a couple of things happens as part
of lowering OP_LOCALLOC and OP_LOCALLOC_IMM:

sreg1 is not RAX, RCX or RDI
dreg is not RAX, RCX or RDI
cfg->param_area is bigger than 127

Fix is to increase max size of the instruction, from 96 -> 120 (same as x86).
2019-06-25 10:46:33 +02:00
Johan Lorensson b181dbc50d Add support for Windows x64 Full AOT + LLVM + Interpreter on CI. (#15276) 2019-06-25 08:20:25 +02:00
Nikita Voronchev c30a10bc3e [System.Windows.Forms] Fix crash of DataGridView in case of assigning a custom Column Header (#15135) 2019-06-24 21:51:47 -04:00
Johan Lorensson b2124dab01 Add missing CI test script when running full AOT interpreter on Windows. (#15281) 2019-06-24 17:00:01 -04:00
Marek Safar 7066c05c39 [System.Private.CoreLib] Add new shared string resource 2019-06-24 21:12:12 +02:00
Andrii Siriak 0abee2baf5 Switch from IndexOf(string) to Contains(string) for better readability and performance (#38757)
* Fix performance IndexOf(string) -> Contains(string)

* Make comparison ordinal

Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Stephen Toub eeb377842e Force secondary await continuations to run asynchronously (#25280)
* Force secondary await continuations to run asynchronously

For performance reasons, await continuations have been invoked synchronously, meaning they're invoked as part of the antecedent task's completion (as long as that task allows it, as long as there's sufficient stack space, etc.)  This generally works out well in the case where there's a single await continuation, which is far and away the common case.  However, it can cause problems in situations where there are multiple await continuations, as those continuations will end up being serialized, which can lead to slowdowns and deadlocks in niche situations.  To address that, this commit backs off a bit.  The first await continuation is still invoked synchronously, but subsequent await continuations are invoked asynchronously, such that they are not blocked by a previously registered await continuation.

* Fix nits

Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Marco Rossignoli 3af0d87397 MemoryExtensions ToUpper / ToLower throws for overlapping buffer (#25327)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Roman Marusyk 96481aedf0 Change exception throwing in Path.GetRelativePath (dotnet/coreclr#25047)
* Fix Path.GetRelativePath throws ArgumentNullException when relativeTo is empty string

* Fix ArgumentException for relativeTo

Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Herman Eldering a555a5b5b3 ArgumentException: use system-supplied message if message is null (#25115)
Enable using a system-supplied message while also providing an argument/parameter name by passing in a null message. Made to match the behavior of FileNotFoundException.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Santiago Fernandez Madero 9ac62ea31a Address nullable feedback for System.Diagnostics.Tracing and StackTrace (#25303)
* Address nullable feedback for System.Diagnostics.Tracing and StackTrace

* Disable corefx tests that need to be updated

Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Stephen Toub 7d4ce9cd8c Remove several unnecessary string allocations (dotnet/coreclr#25305)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Stephen Toub 366c80aed8 Reduce string allocation in DiagnosticCounter.GetMetadataString (#25219)
When the _metadata dictionary contains a single key/value pair, the method ends up allocating an unnecessary StringBuilder, char[] beneath it, and input string.

When the _metadata dictionary contains more key/value pairs, the method ends up allocating an unnecessary string per key/value pair.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-24 21:12:12 +02:00
Zoltan Varga 1150d4a3e9 [netcore] Disable more runtime functionality. (#15369) 2019-06-24 14:47:00 -04:00
Alexander Köplinger 80db1ef59f [sdks] Do the WATCHOS5_VERSION -> WATCHOS64_32_VERSION rename in run-jenkins.sh too
It was missed in https://github.com/mono/mono/pull/15202
2019-06-24 19:14:54 +02:00
dotnet-maestro 683db00b2a Update dependencies from https://github.com/dotnet/arcade build 20190623.4
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19323.4
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19323.4
2019-06-24 17:25:34 +02:00
Thays Grazia 057f51d833 [wasm][debugger] Adding support to debug local vars in async methods (#15357)
- Improving performance calling only once mono_wasm_get_var_info.
- Adding support to debug local vars in async methods. They are special in the way that local variables can be lifted to generated class fields.
2019-06-24 10:34:42 -03:00
Johan Lorensson de90561fbd Fix race related to final event signaling in RegisteredWaitHandle. (#15280)
We have seen sporadic failures in thread pool tests on CI related to
test case:

System.Threading.ThreadPools.Tests.ThreadPoolTests.QueueRegisterPositiveAndFlowTest [FAIL]
      Assert.Equal() Failure
      Expected: 0
      Actual:   1
      Stack Trace:
          at System.Threading.ThreadPools.Tests.ThreadPoolTests.QueueRegisterPositiveAndFlowTest () [0x00143] in D:\j\workspace\z3\label\w64\external\corefx\src\System.Threading.ThreadPool\tests\ThreadPoolTests.cs:337
          at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
          at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in D:\j\workspace\z3\label\w64\mcs\class\corlib\System.Reflection\RuntimeMethodInfo.cs:395

Finally managed to track down the issue to a race when using the same final
event in sequential calls to RegisterWaitForSingleObject. The event could, depending on
timing, get signaled multiple times for the same RegisterWaitHandle instance
causing a thread waiting for completion on another RegisterWaitHandle using same event
to be signaled before that callback was completed. That will cause the race seen in the
failing test above.

Fix make sure we only signal the final event one time per RegisterWaitHandle
instance.
2019-06-24 10:56:21 +02:00
Bernhard Urban 7d5daa2f77 [arm] set exception handling model to dwarf for iOS
We recently switched the AOT compiler for iOS armv7 from 32bit host to 64bit host. At the same time we _also_ switched from LLVM 3.6 to the newer LLVM 6.0 fork we support.

In a Xamarin.iOS Release build for iOS armv7 exception handling would crash. Specifically the problem was that the exception object wasn't properly injected into the handler block. The way it works is, that the exception handler machinery passes the pointer to the exception object via `r0`.

With the newer LLVM the generated code of the exception handling block
looks like this:
```
LBB1_15:                                @ %EH_CLAUSE0_BB3
Ltmp8:
	ldr	r0, [sp, #24]
	str	r0, [sp, #4]
	ldr	r0, [sp, #28]
	ldr	r0, [sp, #12]
	ldr	r0, [r0]
	cmp	r0, #0
	beq	LBB1_17
```
thus overwriting `r0`, so that the pointer to the exception object is lost.  With the older LLVM 3.6 the generated code looks like this:
```
LBB1_8:                                 @ %EH_CLAUSE0_BB3
Ltmp8:
	str	r0, [sp, #4]
	ldr	r0, [r6]
	cmp	r0, #0
	beq	LBB1_10
```
correctly storing the exception object into a stack slot for later usage.

After some time I figured out that there are _different_ exception handling models. Depending on the model, the exception pointer is passed in `r0` or not:
https://github.com/mono/llvm/blob/2bd2f1db1803f7b36687e5abf912c69baa848305/lib/Target/ARM/ARMISelLowering.cpp#L14416-L14428

`SjLj` stands for "SetJump / LongJump" and  means that exception handling is implemented with this. On iOS this is the default model that is used. We want `dwarf` instead, so we tell this `llc` now and the generated code handles it correctly.

So why was it working before? In our older LLVM 3.6 fork we hardcoded it:
https://github.com/mono/llvm/blob/f80899cb3eb75f7f5640b4519e83bd96991bffb8/lib/Target/ARM/ARMISelLowering.cpp#L756-L762

The `-exception-model=` option is also not available in LLVM 3.6.

Contributes to https://github.com/mono/mono/issues/15058 and https://github.com/mono/mono/issues/9621
2019-06-24 09:48:45 +02:00
dotnet-maestro d027cbbc06 Update dependencies from https://github.com/dotnet/arcade build 20190622.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19322.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19322.2
2019-06-24 09:12:13 +02:00
dotnet-maestro 33a4a35826 Update dependencies from https://github.com/dotnet/arcade build 20190621.75
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19321.75
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19321.75
2019-06-24 09:12:13 +02:00
Zoltan Varga bbfce00878 [netcore] Remove unused icalls. 2019-06-23 10:05:22 +02:00
Zebediah Figura 9f49cc85af [mini] Support tracing pointer return values. (#15356) 2019-06-22 12:57:49 -04:00
Zoltan Varga c3161826e3 [aot] Fix a deadlock in init_plt () by calling create_trampoline () outside the lock. (#15332)
Fixes https://github.com/mono/mono/issues/15330.
2019-06-21 23:35:57 -04:00
Zoltan Varga f42fcc0459 [sdks] Avoid building everything on make all. (#15296)
* [sdks] Avoid building everything on make all.

* Add a dummy all target.
2019-06-21 23:35:42 -04:00
Vlad Brezae 0cf363c4db [arm64] Add location of this and rgctx arg
Used to fetch the value from async suspend stack frame, during exception handling.
2019-06-21 15:47:44 -05:00
Vlad Brezae a7a884e19e [arm] Add location of this and rgctx arg
Used to fetch the value from async suspend stack frame, during exception handling.
2019-06-21 15:47:44 -05:00
Vlad Brezae e1e26b87b5 [amd64] Fix location saving for *this*
With static methods we were saving location for irrelevant argument.
2019-06-21 15:47:44 -05:00
Jay Krell ab16b39a65 Remove three seemingly unused functions:
mono_aot_init_gshared_method_this
  mono_aot_init_gshared_method_mrgctx
  mono_aot_init_gshared_method_vtable

Update comments that refer to them, to refer to the renames.
 mini_llvm_init instead of mono_aot_init.

See 80bc0069e4 and 04d65f2986.

I'm here because I broke something nearby in a work-in-progress PR
and the existance of these functions made me look into them.
2019-06-21 15:46:24 -05:00
Ankit Jain 81f529689c Bump msbuild to track xplat-master (#15295)
* Bump msbuild to track xplat-master

* [msbuild] Bump to track xplat-master

.. which effectively enables use of the shared compiler.
2019-06-21 21:36:43 +02:00
Filip Navara 42eb919d52 Add basic implementation of Environment.FailFast (#15279)
* Add basic implementation of Environment.FailFast

* Add comment about __failfast on Windows 8+

* Re-add some test exclusions and clarify the comment around them

* Update icall.c
2019-06-21 18:52:12 +02:00
Aleksey Kliger (λgeek) 71ceefccf6 [api] Add a mono/metadata/profiler-legacy.h header (#15098)
* [api] Add mono/metadata/profiler-legacy.h header

Add a header with the legacy Mono profiler API.  New code should use the API
from mono/metadata/profiler.h.

* [profiler] Mark the legacy profiler API with MONO_DEPRECATED

* [runtime] Don't install the profiler-legacy.h header

Make the decision later whether these should be in the set of public API headers
2019-06-21 18:47:26 +02:00
monojenkins 3d48d85472 [ci] One more workaround for Git 2.22.0 (#15326)
Homebrew Git 2.22.0 misparses the submodule command and passes arguments like --hard and -xdff to git-submodule instead of to git-reset or git-clean.  Passing the entire command as a single argument seems to help.

Git mailing list bug report: https://public-inbox.org/git/[email protected]/
2019-06-21 10:57:38 -04:00
dotnet-maestro c6b8e90230 Update dependencies from https://github.com/dotnet/arcade build 20190620.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19320.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19320.1
2019-06-21 16:26:01 +02:00
monojenkins 304899de1b [bcl] Update BCL Linked Size 2019-06-21 13:56:27 +02:00
Egor Bogatov 9eb1f19909 Update Makefile 2019-06-21 13:55:33 +02:00
EgorBo 44cba4e442 fix build-test-corefx command 2019-06-21 13:55:33 +02:00
Kenneth Pouncey b32b5ceba2 Make sure that bindings are initialized in mono_wasm_new. (#15274)
- Fixes `this.mono_string_get_utf8 is not a function`.
2019-06-21 13:38:50 +02:00
Dmitry Kalyanov 480f636808 TransactionScope now actually uses IsolationLevel that was specified in TransactionOptions
Previously, using TransactionScope would always produce transactions
that use serializable isolation level even when user specified another
level (like ReadCommited).

fixes #13945
2019-06-21 11:27:59 +02:00
Stephen Toub a8b1b2ed20 Fix visibility on Exception.InnerExceptionPrefix (dotnet/coreclr#25278)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-21 08:34:24 +02:00
Santiago Fernandez Madero 93fdf6489c Address nullable feedback for S.T.Overlapped, S.Memory, S.R.InteropServices (#25214)
* Address nullable feedback for System.Threading.Overlapped

* Address nullable feedback for System.Memory

* Address nullable for System.Runtime.InteropServices

* Update xml comments and make CultureInfo nullable to match String.ToLower/Upper feedback

* PR feedback: revert accepting null comparer in BinarySearch

* Disable test that needs to be updated in corefx

Signed-off-by: dotnet-bot <[email protected]>
2019-06-21 08:34:24 +02:00
Dan Moseley 5dee50f30c Exception format cleanup subset (dotnet/coreclr#25185)
* Change ArgumentException message to one line

* Disable 2 tests

* Remove duplication in AggregateException.ToString()

* Inner exceptions on new lines

* Caps letter

* Typo

Signed-off-by: dotnet-bot <[email protected]>
2019-06-21 08:34:24 +02:00
lateralusX ad90ebd3ab Make copy_stack_data support configurable.
By default when called through macros like MONO_ENTER_GC_UNSAFE
code will always dump current registers into stack space on hybrid/coop.
The registers will be scanned but only when hitting a GC and when running
in GC unsafe, that will only happen when we block in the enter or hit a safe
point at a later point in time. There are currently a couple of frequent
scenarios where we go into GC safe when thread won't be suspended and in
that case the copy of the registers will only reflect the state when
entering GC unsafe.

Commits add option to enable/disable copy_stack_data support in configure step:
--enable-copy-stack-data, --disable-copy-stack-data.

copy_stack_data is enabled by default on all platforms except desktop platforms
macos, linux and windows (both 32/64-bit), since these platforms already support
full context as well as capabilities to scan the stack of a running thread.
2019-06-20 23:34:56 -05:00
Larry Ewing 7af0e36db3 Merge pull request #15293 from lewing/wasm-clean
[wasm] Add some missing directories to the clean target
2019-06-20 22:21:08 -05:00
Larry Ewing efa06b3ecd Merge pull request #15291 from lewing/doublecheck-290
[wasm] Add an explicit test for https://github.com/dotnet/try/issues/290
2019-06-20 20:46:39 -05:00
Aleksey Kliger (λgeek) 18ce655751 [loader] remap only System.Threading.Tasks.Dataflow older than 4.0.0.0 (#15266)
[loader] remap only System.Threading.Tasks.Dataflow older than 4.0.0.0

Allow through requests for newer versions unchanged.
2019-06-20 19:25:43 -04:00
Thays Grazia 405d521149 [debugger] Debugger doesn't break on unhandled exceptions (#15234)
* When the catch found is in a MONO_WRAPPER_RUNTIME_INVOKE the exception should be treated as an UNHANDLED by the debugger.

* Adding unit test.

* trying to fix side effect.

* I've tested the MonoTests.DebuggerTests.UnhandledException_2 test on VsWin using .net Framework and I think the test is wrong because the first break is in throw and the next break will be on breakpoint.
In our implementation we were ignoring the unhandled exception and stopping only on breakpoint.
2019-06-20 18:48:13 -04:00
Larry Ewing b20ef4cc36 [wasm] Add some missing directories to the clean target 2019-06-20 14:28:20 -05:00
Vlad Brezae b4e43abbcc [jit] Make alias analysis properly handle alias cloberring (#15255)
Alias analysis attempts to remove indirection when using OP_LDADDR (which fetches the address of a variable). For example :

	ldaddr r1 <- r0
	load_mem r2 <- r1

is equivalent to

	mov r2 <- r0

The remembered r1 alias needs to be forgotten in case r1 is changed. We were handling this for direct assignment with MOV, but not for the more subtle case where an alias to r1 would be passed to a call, which could lead to changing r1.

https://github.com/mono/mono/issues/14872
2019-06-20 21:35:18 +03:00
Larry Ewing 653a12ad3c Add an explicit test for https://github.com/dotnet/try/issues/290 2019-06-20 13:25:29 -05:00
dotnet-maestro 6023f36749 Update dependencies from https://github.com/dotnet/arcade build 20190619.25
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19319.25
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19319.25
2019-06-20 18:29:47 +02:00
Vlad Brezae 1120e82312 [jit] Add debug option for using clr memory model (#15019)
* [jit] Move value storing in a new write barrier emitting method

Brings together ref storing and the write barrier generation.

* [jit] Add debug option to attempt using the CLR memory model

Which prevents reordering of stores. Part of the way this is done on CoreCLR is by adding memory barriers to the write barrier, so we attempt a similar behavior.

This is not a complete implementation.

* [build] Add memory model flag to csc when building the bcl

This should prevent random crashes during the build

* [build] Add memory model flag to compiler server

* [build] Add memory model flag to test building
2019-06-20 19:18:26 +03:00
Jay Krell fb6ce0df91 [Coop] Establish handle frame in reflection_setup_internal_class. (#15248)
It is called in a loop by ves_icall_TypeBuilder_create_runtime_class.
See https://github.com/mono/mono/issues/15247.
2019-06-20 11:00:36 -04:00
Jay Krell 2104d1d957 Write to the same union member that is later read. (#15269)
It should not matter in this case, but it is the usual practise,
and not strictly valid otherwise.
2019-06-20 10:57:04 -04:00
Jay Krell e24f1ed945 [interp] Optimize CEE_MONO_TLS due their being only one live producer. (#15245)
There is a dead producer in Boehm. (see https://github.com/mono/mono/pull/15241)
This combined with https://github.com/mono/mono/pull/15226
will leave no remaining uses of mono_tls_get_tls_getter.

If there were really multiple values of the enum, consider
doing the switch in transform instead of interp.
2019-06-20 16:39:20 +03:00
Radek Doulik 688d7f0938 [Mono.Profiler.Aot] Add profile writer
It writes the profile data to given stream. It comes from
https://github.com/radekdoulik/aotprofile-tool
2019-06-20 14:13:34 +02:00
Egor Bogatov 5a21eb4288 Fix arcade stuff 2019-06-20 14:07:13 +02:00
Johan Lorensson fb35615c56 Interpreter PR builds run to many test suites. (#15251)
Fix makes sure we don't run full test suite on PR builds or when targeting
arm architectures or Windows.
2019-06-20 13:30:47 +02:00
monojenkins 3b53959f1e [csproj] Update project files 2019-06-20 12:04:07 +02:00
Marek Safar 7373266eb5 Bump linker & cecil 2019-06-20 12:04:07 +02:00
Johan Lorensson dfb46dad7d Add Windows x64 Full AOT Interpreter support on CI. (#15127)
Add support to run full interpreter test suite on CI for Windows x64 Full AOT.
Since Windows x64 Full AOT uses a different full AOT profile WinAOT a separate
testing profile was setup for the interpreter testing. NOTE, this profile is
pure for testing, inline with the other testing profiles. It is also reusing
most of its sources from other sources files (mainly WinAOT) to reduce maintenance
of the profile.

Commit also includes some smaller adjustments needed in order to get full
pass rate for Windows x64 Full AOT + Interpreter on CI.
2019-06-20 09:23:39 +02:00
Aleksey Kliger b2a860c949 [coop] Mark a few functions with MONO_PROFILER_API 2019-06-20 00:22:01 +02:00
Aleksey Kliger cf3bb20575 [runtime] Don't do GC Unsafe transition in mono_gchandle_free
Xamarin.Mac can call back here from a native thread that isn't attached to the
runtime.  SGen gchandle code is lockfree, and the profiler event can fire
without involving Mono.
2019-06-20 00:22:01 +02:00
Aleksey Kliger ee74ee90b3 [profiler] Don't switch to GC Safe when locking if thread isn't attached to the
runtime.

Some profiler events (for example gc_handle_deleted) could be raised on threads
that aren't attached to the runtime.  Since the thread won't participate in
Mono's stop the world (since the runtime can't see it), there's no need to do
the transition to GC Safe while the thread is trying to grab the profiler
buffer lock.
2019-06-20 00:22:01 +02:00
Jay Krell 09869a9c8b Fix compiler warnings. (#15196)
* Fix compiler warnings.
 unused variable: save_sigint
 unused variable: mono_environ
 uprototyed function: mono_marshal_xdomain_copy_value

* add static
2019-06-19 18:18:31 -04:00
Jay Krell 6e1cc91d8d Remove unused MONO_PATCH_INFO_SET_TLS_TRAMP, corresponding unused JIT icalls, etc. (#15201) 2019-06-19 16:25:34 -04:00
Marek Safar a4ef5c3590 Update CODEOWNERS 2019-06-19 20:39:03 +02:00
dotnet-maestro 7390b78b2d Update dependencies from https://github.com/dotnet/arcade build 20190619.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19319.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19319.1
2019-06-19 19:10:45 +02:00
Ryan Lucia 2a82614f98 Correctly set ReflectionType with inherited generic methods (#15233)
* Correctly set ReflectionType with inherited generic methods

* Allow ValueType

* Re-enable relevant test

* Switch to mono_class_from_mono_type_internal
2019-06-19 13:08:39 -04:00
Johan Lorensson 7ac0287a7b Increase timeout for interpreter fullaotmixed regression. (#15225)
On Windows (partly due to slow shell execution) this test take longer to
complete than current given timeout.
2019-06-19 17:45:10 +02:00
Zoltan Varga 7341c9f636 [jit] Avoid calling mini_jit_info_table_find () in mini_add_method_trampoline () unless needed. (#15239) 2019-06-19 10:52:27 -04:00
Filip Navara c1068f9db5 [netcore] Update the checks for ByRef return type in reflection invocation (#14967)
* Update the checks for ByRef return type in reflection invocation to also check for IsByRefLike types. This was missed as part of #13901 and noted in the description.

Fixes #14959, #14960, #14961, #14963

* Modify the reflection checks for IsByRef/IsByRefLike to check for same conditions as CoreCLR

* Handle reflection invocation with ref void return type

* Update test-ref-07 to have Main method that is valid to invoke through reflection (as the test runner does)

* Update expected IL
2019-06-19 08:51:43 +02:00
Zoltan Varga 611ba9a018 [interp] Implement tracing of return values. Improve printing of arrays. (#15217) 2019-06-18 23:03:13 -04:00
Alexis Christoforides 7c4300aa7f [filewatcher] Fall back to default if a new instance cannot be created 2019-06-19 05:26:57 +03:00
Alexis Christoforides cc6a2d4606 Improve robustness of post-install script (#15213)
We have several issues (e.g. https://github.com/mono/mono/issues/14181) where the installer occasionally fails in the postinstall script for unknown causes, on some hosts.

This seems to be sometimes the culpable section and this patch should help trace the issue or alleviate the common symptoms of it (see https://github.com/mono/mono/issues/14181)
2019-06-19 02:21:38 +03:00
Bernhard Urban e3f8596156 [arm] fix some more host/target pointer size issues (#15223)
[arm] fix some more host/target pointer size issues

As suggested by Jay in https://github.com/mono/mono/issues/15058#issuecomment-501995400

I haven't seen fixing it any specific issue, but we should still backport it to `2019-06` in order to avoid hard-to-debug regressions.

Contributes to https://github.com/mono/mono/issues/9621
2019-06-18 17:45:59 -04:00
Bernhard Urban fe7027935b [mini] fix OP_SEQ_POINT of other backends regarding target pointer size (#15222)
See https://github.com/mono/mono/pull/15205#issuecomment-502925368

Theoretically fixes cross compilation on a 32bit host to a 64bit target.
2019-06-19 00:06:54 +03:00
monojenkins 95259f9947 Bump API snapshot submodule 2019-06-18 20:53:25 +02:00
Steve Pfister 2d94e79f5b Bump mono/corefx to fix https://github.com/mono/mono/issues/14864 2019-06-18 20:53:25 +02:00
Ryan Lucia 7a1605cb07 [netcore] Don't default to an empty array for a null publicKey 2019-06-18 19:44:51 +02:00
dotnet-maestro d3d499f34e Update dependencies from https://github.com/dotnet/arcade build 20190618.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19318.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19318.2
2019-06-18 19:35:04 +02:00
Ryan Lucia 6c5bbbd757 [eglib] Don't escape chars in argv parsing enclosed in single quotes (#15047)
Fixes #14724

This may need to be reverted if customers are relying on the existing behavior, but we can cross that bridge when we come to it.

The larger issue of incompatibility with .NET Core should be addressed later.
2019-06-18 13:30:31 -04:00
Marek Safar 3428cec003 Mirror changes from mono/corefx,corert,coreclr (#15221)
Mirror changes from mono/corefx,corert,coreclr
2019-06-18 12:44:36 +02:00
Marek Safar 7052e60600 [netcore] Excluded tests update 2019-06-18 11:25:51 +02:00
Marek Safar d44da802a9 [System.Private.CoreLib] Merge fixes 2019-06-18 11:10:59 +02:00
Marek Safar e29f79e68e Merge remote-tracking branch 'upstream/master' into mirror-merge-10235436 2019-06-18 10:54:06 +02:00
Marek Safar 3d311876d2 [netcore] Reflect shared partition changes 2019-06-18 10:52:05 +02:00
Marek Safar 879c8501c9 [System.Private.CoreLib] Align on CA naming for easier sharing 2019-06-18 10:10:16 +02:00
naricc ac2894920a Implement GC.GetAllocatedBytes (#14779) 2019-06-18 09:08:21 +02:00
Bernhard Urban d5a35798c6 [arm] use target_mgreg_t instead of plain pointer type in sdb breakpoint (#15205)
[arm] use target_mgreg_t instead of plain pointer type in sdb breakpoint

Fixes Debug mode for iOS 32bit.

Contributes to https://github.com/mono/mono/issues/15058 & https://github.com/mono/mono/issues/9621

Diff before (left old cross32, right new cross32 running on amd64 host _before_ this fix):
<img width="1257" alt="Screenshot 2019-06-17 at 14 09 51" src="https://user-images.githubusercontent.com/75403/59603413-a9bd4f00-9109-11e9-8f18-aa7b4ca5817f.png">

/cc @mandel-macaque
2019-06-18 02:46:00 -04:00
Jay Krell fc74334e20 Allocate MonoJumpInfo instead of MonoAotCompile. 2019-06-17 23:41:26 -05:00
Kenneth Pouncey 67b4d55d91 Simplify header item fetch using the Headers entries iterator.
- Use the Headers `entries{}` iterator object.
- This replaces the `foreach` delegate call where the object returned in the delegate was being disposed of too early.
- The foreach delegate takes three objects name, value, other.  The `other` being disposed was causing a problem when calling back into the delegate later.
- Removes the lamda expression called by the delegate without the worry of a memory leak if the finally is removed.
2019-06-17 21:56:47 -05:00
Kenneth Pouncey f7bba7172e Add tests to the IssuesTestSuite to catch regressions
- See issue https://github.com/mono/mono/issues/14940
2019-06-17 21:56:47 -05:00
Kenneth Pouncey 8f864e4d92 Fix problem with fetch response header iteration prematurely disposing of the header object.
- Use the iterator of the headers object do iteration over the fetch response headers.
2019-06-17 21:56:47 -05:00
Jay Krell a97408ac1e Revert "threads.c:6403:6: warning: 'current_idx' may be used uninitialized in this function [-Wmaybe-uninitialized]"
This reverts commit bf2f1abe01978102c22d76b4a10996e8d8b50b0f.

The logic is not clear as to if there is a bug, so leave the warning.
There are two uses of the possibly uninitialized variable.
One is guarded and not a bug.
The other is not clear, and don't want to blindly use 0.
2019-06-17 21:53:08 -05:00
Jay Krell af2c235f31 PR: Restore nearby unusual formatting. 2019-06-17 21:53:08 -05:00
Jay Krell 9c70b53cc3 intrinsics.c: In function 'mini_emit_inst_for_method':
intrinsics.c:1580:11: warning: 'result' may be used uninitialized in this function [-Wmaybe-uninitialized]
     *dest = result;
     ~~~~~~^~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 6e19637797 debugger-engine.c: In function 'set_bp_in_method':
debugger-engine.c:354:11: warning: variable 'code' set but not used [-Wunused-but-set-variable]
  gpointer code;
           ^~~~
2019-06-17 21:53:08 -05:00
Jay Krell 496cb4cfce tramp-arm64-gsharedvt.c: In function 'mono_arch_get_gsharedvt_trampoline':
tramp-arm64-gsharedvt.c:217:54: warning: variable 'callee_stack_area_offset' set but not used [-Wunused-but-set-variable]
  int caller_reg_area_offset, callee_reg_area_offset, callee_stack_area_offset;
                                                      ^~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 179b5e85cf mini-arm64-gsharedvt.c: In function 'mono_arch_get_gsharedvt_call_info':
mini-arm64-gsharedvt.c:142:29: warning: variable 'gsig' set but not used [-Wunused-but-set-variable]
  MonoMethodSignature *sig, *gsig;
                             ^~~~
2019-06-17 21:53:08 -05:00
Jay Krell b504d7e6d8 interp/mintops.c: In function 'mono_interp_dis_mintop':
interp/mintops.c:87:37: warning: format '%lld' expects argument of type 'long long int', but argument 3 has type 'long int' [-Wformat=]
   g_string_append_printf (str, " %lld", (gint64)READ64 (ip + 1));
2019-06-17 21:53:08 -05:00
Jay Krell 452209414e In file included from object.c:40:0:
object.c: In function 'mono_class_proxy_vtable':
../../mono/metadata/profiler-private.h:191:4: warning: 'pvt' may be used uninitialized in this function [-Wmaybe-uninitialized]
    mono_profiler_raise_ ## name args; \
    ^~~~~~~~~~~~~~~~~~~~
object.c:2338:19: note: 'pvt' was declared here
  MonoVTable *vt, *pvt;
                   ^~~
2019-06-17 21:53:08 -05:00
Jay Krell bdb20ebd80 w32file-unix.c: In function 'mono_w32file_get_file_size':
w32file-unix.c:4994:19: warning: 'length_hi' may be used uninitialized in this function [-Wmaybe-uninitialized]
  return length | ((gint64)length_hi << 32);
                   ^~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 457d0f02c5 interp/interp.c: In function 'interp_entry.constprop':
interp/interp.c:1847:3: warning: 'orig_domain' may be used uninitialized in this function [-Wmaybe-uninitialized]
   mono_threads_detach_coop (orig_domain, &attach_cookie);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 3357a1a611 image.c:1351:20: warning: variable 'header' set but not used [-Wunused-but-set-variable]
MonoDotNetHeader *header;
                    ^~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 00570db6a4 exception.c:747:1: warning: 'mono_new_exception_argument_out_of_range' defined but not used [-Wunused-function]
mono_new_exception_argument_out_of_range (const char *arg, MonoError *error)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell bc5d1a48d8 os-event-unix.c: In function 'mono_os_event_wait_multiple':
os-event-unix.c:195:12: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]
    elapsed = mono_msec_ticks () - start;
    ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 96129ba873 In file included from ../../mono/eglib/glib.h:45:0,
from os-event.h:9,
                 from os-event-unix.c:11:
../../mono/eglib/eglib-remap.h:146:25: warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define g_ptr_array_add monoeg_g_ptr_array_add
                         ^~~~~~~~~~~~~~~~~~~~~~
os-event-unix.c:121:19: note: 'data' was declared here
  OSEventWaitData *data;
                   ^~~~
2019-06-17 21:53:08 -05:00
Jay Krell faadb64774 marshal.c: In function 'mono_marshal_get_runtime_invoke_full':
marshal.c:2662:8: warning: 'sig_cache' may be used uninitialized in this function [-Wmaybe-uninitialized]
    res = (MonoMethod *)g_hash_table_lookup (sig_cache, sig_key);
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 64c321293b sgen-mono.c:260:1: warning: 'install_noilgen' defined but not used [-Wunused-function]
install_noilgen (void)
2019-06-17 21:53:08 -05:00
Jay Krell 0b5b42f6c7 In file included from sgen-new-bridge.c:31:0:
sgen-dynarray.h:331:1: warning: 'dyn_array_ptr_set_all' defined but not used [-Wunused-function]
 dyn_array_ptr_set_all (DynPtrArray *dst, DynPtrArray *src)
 ^~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell e94887a18c threads.c:6403:6: warning: 'current_idx' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (i == current_idx)
      ^
threads.c:6549:6: note: 'current_idx' was declared here
  int current_idx;
      ^~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 67680a2e81 sgen-dynarray.h:248:1: warning: 'dyn_array_ptr_set' defined but not used [-Wunused-function]
dyn_array_ptr_set (DynPtrArray *da, int x, void *ptr)
 ^~~~~~~~~~~~~~~~~

sgen-dynarray.h:202:1: warning: 'dyn_array_ptr_init' defined but not used [-Wunused-function]
 dyn_array_ptr_init (DynPtrArray *da)
 ^~~~~~~~~~~~~~~~~~

sgen-dynarray.h:194:1: warning: 'dyn_array_int_is_copy' defined but not used [-Wunused-function]
 dyn_array_int_is_copy (DynIntArray *da)
 ^~~~~~~~~~~~~~~~~~~~~

sgen-dynarray.h:188:1: warning: 'dyn_array_int_copy' defined but not used [-Wunused-function]
 dyn_array_int_copy (DynIntArray *dst, DynIntArray *src)
 ^~~~~~~~~~~~~~~~~~

sgen-dynarray.h:182:1: warning: 'dyn_array_int_ensure_independent' defined but not used [-Wunused-function]
 dyn_array_int_ensure_independent (DynIntArray *da)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sgen-dynarray.h:168:1: warning: 'dyn_array_int_get' defined but not used [-Wunused-function]
dyn_array_int_get (DynIntArray *da, int x)
 ^~~~~~~~~~~~~~~~~

sgen-dynarray.h:161:1: warning: 'dyn_array_int_add' defined but not used [-Wunused-function]
 dyn_array_int_add (DynIntArray *da, int x)
 ^~~~~~~~~~~~~~~~~

sgen-dynarray.h:147:1: warning: 'dyn_array_int_size' defined but not used [-Wunused-function]
 dyn_array_int_size (DynIntArray *da)
 ^~~~~~~~~~~~~~~~~~
sgen-dynarray.h:141:1: warning: 'dyn_array_int_uninit' defined but not used [-Wunused-function]
 dyn_array_int_uninit (DynIntArray *da)
 ^~~~~~~~~~~~~~~~~~~~
sgen-dynarray.h:135:1: warning: 'dyn_array_int_init' defined but not used [-Wunused-function]
 dyn_array_int_init (DynIntArray *da)
 ^~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell ae357bebbd In file included from sre.c:30:0:
../../mono/metadata/reflection-cache.h:43:1: warning: 'free_reflected_entry' defined but not used [-Wunused-function]
 free_reflected_entry (ReflectedEntry *entry)
 ^~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell cc60fe04d0 sre.c:2067:1: warning: 'is_sr_mono_field' defined but not used [-Wunused-function]
is_sr_mono_field (MonoClass *klass)
 ^~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 54366ee658 w32handle.c: In function 'mono_w32handle_wait_multiple':
w32handle.c:1146:13: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]
     elapsed = mono_msec_ticks () - start;
     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell f2f5c45d9d custom-attrs.c:269:1: warning: 'load_cattr_type_object' defined but not used [-Wunused-function]
load_cattr_type_object (MonoImage *image, MonoType *t, gboolean header, const char *p, const char *boundp, const char **end, MonoError *error, guint32 *slen)
 ^~~~~~~~~~~~~~~~~~~~~~
2019-06-17 21:53:08 -05:00
Jay Krell 267a75f365 sre-save.c:114:1: warning: 'swap_with_size' defined but not used [-Wunused-function]
swap_with_size (char *dest, const char* val, int len, int nelem) {
2019-06-17 21:53:08 -05:00
Jay Krell 404a03b87e mono-mmap.c: In function 'mono_file_map_error':
mono-mmap.c:401:82: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 5 has type 'guint64 {aka long unsigned int}' [-Wformat=]
    *error_message = g_strdup_printf ("%s failed file:%s length:0x%zX offset:0x%lluX error:%s(0x%X)\n",
2019-06-17 21:53:08 -05:00
Jay Krell a37f71a4ea threadpool.c: In function 'mono_threadpool_remove_domain_jobs':
threadpool.c:571:91: warning: 'end' may be used uninitialized in this function [-Wmaybe-uninitialized]
    res = mono_coop_cond_timedwait (&tpdomain->cleanup_cond, &threadpool.domains_lock, end - now);
2019-06-17 21:53:08 -05:00
Sung Yoon Whang e734fca321 make DiagnosticCounter and its children lock 'this' instead of an arbitrary String (#25173)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:13 +00:00
Ben Adams 0ca0d1dfd9 IndexOfAny(values.Length == 0) == -1 (dotnet/coreclr#25075)
* IndexOfAny(values.Length == 0) == -1

* Skip tests

Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:12 +00:00
Adam Sitnik b58c351daf don't use var
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:10 +00:00
Adam SitnikandJan Kotas 62f597ea23 Apply suggestions from code review
Co-Authored-By: Jan Kotas <[email protected]>

Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:09 +00:00
Adam Sitnik 2597806f5f set the charset to Ansi
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:08 +00:00
Adam Sitnik a22d66c98c simplify the code
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:07 +00:00
Adam Sitnik 0dcea57a81 lock the dictionary
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:07 +00:00
Adam Sitnik fd52429be9 move the sort key logic to a dedicated helper type to avoid static field initialization order issues
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:06 +00:00
Adam Sitnik 3a45ebfa72 introduce cache for sort handles to prevent from memory leak in certain scenarios
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:05 +00:00
Adam Sitnik d7506847fe use IntPtr instead of CriticalHandle to avoid resurrection issues. It's ok to never free the handle
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:05 +00:00
Adam Sitnik ba42c41536 seal the CriticalSortHandle class
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:04 +00:00
Adam Sitnik 67e2d3ff62 change SafeSortHandle to be CriticalSortHandle to avoid expensive ref counting
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:03 +00:00
Marek Safar 3e3925ff93 Move parts of RuntimeType to shared partition (dotnet/coreclr#25176)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:02 +00:00
Sung Yoon Whang b723b841c0 Make DisplayUnits string.Empty by default instead of null (#25104)
* Make DisplayUnits string.Empty by default instead of null

* PR feedback on DisplayName and setter validation

Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:01 +00:00
Tarek Mahmoud Sayed 321b02ce2c Fix French Decimal number parsing (dotnet/coreclr#25154)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:01 +00:00
Jan Kotas 18a4099fbd Optimize Activator.CreateInstance (dotnet/coreclr#25145)
* Optimize Activator.CreateInstance
- Short-circuit Activator.CreateInstance<T>() for value types without default constructor
- Cache default constructor delegate on RuntimeType instead of fixed-size singleton cache

Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:37:00 +00:00
Stephen Toub 4a29e94abb Update Corelib to adapt to compiler nullability updates
Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:36:59 +00:00
Viktor Hofer ee64a8364f Delete dead uapaot code (dotnet/corefx#38330)
* Delete dead uapaot code

Signed-off-by: dotnet-bot <[email protected]>
2019-06-17 22:36:58 +00:00
Egor Bogatov c04dc84a9f fix RuntimeType.cs 2019-06-17 21:14:06 +02:00
Bernhard Urban 1e5ca1479c [watch] consistent naming for watchOS min version (#15202)
[watch] consistent naming for watchOS min version

See https://github.com/xamarin/xamarin-macios/pull/6307
2019-06-17 13:26:09 -04:00
Jay Krell 7d824dc2ae Fix race conditions in mono_lazy_initialize,
which is meant to be all about handling race conditions.

1. Less severe:
Add missing read barrier to mono_lazy_initialize().

This is unfortunate.

The general pattern of:

if initialized
  use the data
else:
  initialize the data, possibly with lots of locks and barriers
  mark initialized

is racy, because "use the data" can be scheduled ahead of "if initialized".

"Barriers come in pairs" generally, and this was missing one.

It depends somewhat. If the data is all pointers, initialized in the else path,
from null to non-null, and use includes dereferencing, which is a common
but not universal case, then it is ok on all non-Alpha processors, due
to "data dependency".

But if the data includes reading globals, then there is a race.

This is a bit of a slow down on fast paths on arm, and possibly
other architectures.

There are barrier-free ways to solve this, involving a thread local,
that should seriously be considered, and applied throughout the runtime.

The runtime has a lot of on-demand initialization and a lot of looks racy.

See www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm.
Which would have to be adopted to be coop-friendly which should not be difficult.

Notice that the existing "lazy" mechanism is also not coop-friendly.
That is not changed by this PR.

2. Change `status` to `*lazy_init` to fix severe race condition.
2019-06-17 15:31:35 +02:00
dotnet-maestro 6bd68bc2a4 Update dependencies from https://github.com/dotnet/arcade build 20190615.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19315.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19315.2
2019-06-17 15:30:58 +02:00
Jay Krell 8966528c21 Replace MONO_PATCH_INFO_TRAMPOLINE_FUNC_ADDR with MONO_PATCH_INFO_JIT_ICALL_ADDR. (#15053)
* Replace MONO_PATCH_INFO_TRAMPOLINE_FUNC_ADDR with MONO_PATCH_INFO_JIT_ICALL_ADDR.

* PR: Abstract the TrampolineType / jit_icall_id translation.
2019-06-17 01:25:53 -04:00
Vlad Brezae fd089b6e4d [interp] Prefer interp_in wrappers over trampolines (#14684)
[interp] Prefer interp_in wrappers over trampolines
2019-06-15 17:25:06 -04:00
Katelyn Gadd 59a0d1e70f Add the compiler server log to the gitignore 2019-06-15 16:16:12 -05:00
dotnet-maestro 7269db058e Update dependencies from https://github.com/dotnet/arcade build 20190614.27
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19314.27
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19314.27
2019-06-15 16:08:10 +02:00
Aleksey Kliger 8a0495ea3b [debugger-agent] Ignore thread_end event if thread is detached
The thread_stopped profiler event can be raised by the thread_info_key_dtor tls
key destructor when the thread is already doesn't have a domain set.  In that
case, don't call process_profiler_event since it cannot handle a thread with
null TLS values.

Addresses https://github.com/xamarin/xamarin-android/issues/2920
with the following stack trace

```
* thread #20, name = 'Filter', stop reason = signal SIGSEGV: invalid address (fault address: 0xbc)
  * frame #0: libmonosgen-2.0.so`mono_class_vtable_checked(domain=0x0000000000000000, klass=0x0000007200230648, error=0x00000071e92f9178) at object.c:1890
    frame #1: libmonosgen-2.0.so`get_current_thread_ptr_for_domain(domain=0x0000000000000000, thread=0x00000071ebfec508) at threads.c:595
    frame #2: libmonosgen-2.0.so`mono_thread_current at threads.c:1939
    frame #3: libmonosgen-2.0.so`process_event(event=<unavailable>, arg=<unavailable>, il_offset=<unavailable>, ctx=<unavailable>, events=<unavailable>, suspend_policy=<unavailable>) at debugger-agent.c:3715
    frame #4: libmonosgen-2.0.so`thread_end [inlined] process_profiler_event(event=EVENT_KIND_THREAD_DEATH, arg=0x00000071ebfec508) at debugger-agent.c:3875
    frame #5: libmonosgen-2.0.so`thread_end(prof=<unavailable>, tid=<unavailable>) at debugger-agent.c:3991
    frame #6: libmonosgen-2.0.so`mono_profiler_raise_thread_stopped(tid=<unavailable>) at profiler-events.h:105
    frame #7: libmonosgen-2.0.so`mono_thread_detach_internal(thread=<unavailable>) at threads.c:979
    frame #8: libmonosgen-2.0.so`thread_detach(info=0x00000071e949a000) at threads.c:3215
    frame #9: libmonosgen-2.0.so`unregister_thread(arg=<unavailable>) at mono-threads.c:544
    frame #10: libmonosgen-2.0.so`thread_info_key_dtor(arg=0x00000071e949a000) at mono-threads.c:774
    frame #11: 0x00000072899c58e8 libc.so`pthread_key_clean_all() + 124
    frame #12: 0x00000072899c5374 libc.so`pthread_exit + 76
    frame #13: 0x00000072899c5264 libc.so`__pthread_start(void*) + 44
    frame #14: 0x000000728996617c libc.so`__start_thread + 72
```
2019-06-15 09:31:05 +02:00
Marek Safar b5b58d67cf [System.Private.CoreLib] Extract RuntimeType for easier refactoring 2019-06-15 09:28:47 +02:00
Egor Bogatov 26f0222284 [netcore] Fix CI build script (#15130) 2019-06-15 09:27:15 +02:00
Jay Krell eafcbfd6ed Read only interp callbacks, option 4, without ordering sensitivity. 2019-06-14 18:51:56 -05:00
Jay Krell 1fe336691e Cleanup AIX code a little. 2019-06-14 18:43:36 -05:00
Aleksey Kliger (λgeek) 94725cb85e [llvm] bump to mono/llvm@2bd2f1db18 (#15049)
Emit .fnend directives on arm even for functions which don't have a corresponding mono method.

Fixes https://github.com/mono/mono/issues/15048
2019-06-14 16:17:07 -04:00
Marek Safar ef4c8bbbb0 [netcore] Arcade does not yet have CLSCompliant support, revert to manual settings 2019-06-14 22:00:40 +02:00
Thays Grazia a81cc67327 Implementing reabstraction of default interface methods. (#14790)
Implementing reabstraction of default interface methods.
Fix #14495
2019-06-14 16:15:38 -03:00
Marek Safar 49dc99be58 [netcore] Add more Arcade magic for signing 2019-06-14 21:10:20 +02:00
Alexander Kyte 877a2b6548 [metadata] Move problematic image out-param usage (#15131) 2019-06-14 14:38:09 -04:00
dotnet-maestro 377030eaab Update dependencies from https://github.com/dotnet/arcade build 20190613.18
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19313.18
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19313.18
2019-06-14 18:41:59 +02:00
Aleksey Kliger (λgeek) 0e0f1b9be0 [mini] Move some MONO_API functions to public header (#15105)
* [mini] Move some MONO_API functions to public header

And mark them all MONO_RT_EXTERNAL_ONLY.

mono_set_use_llvm is new - Xamarin.Android previously assigned to mono_use_llvm
directly.
2019-06-14 11:33:11 -04:00
Johan Lorensson b33c379057 Enable aotcheck and test-aot CI tests on Windows x64. (#15062) 2019-06-14 15:56:24 +02:00
Egor Bogatov 4212270b23 Fix csproj 2019-06-14 13:16:46 +02:00
Johan Lorensson a382edc9e1 Deadlock in loader when using bundling. (#15061)
We can hit the following deadlock when loading assemblies (using reflection)
together with bundling:

One thread calls mono_assembly_open_from_bundle, that will take assemblies lock
and then try to load assembly. If this race with a different load of the
same assemblies, one will lose, and that method will call mono_image_close that
in turn will call unload hook (mono_class_unregister_image_generic_subclasses)
that will take loader lock.

If we at the same time have a different thread that calls mono_class_create_from_typedef
, it will take loader lock and then it might end up calling mono_assembly_load_reference
that will take assemblies lock, but since that thread takes the locks
in different order compare to first thread, they could deadlock.

Looking into the use of assemblies lock in mono_assembly_open_from_bundle it
uses a static variable, bundles, that is not protected in other scenarios
and only set by mono_register_bundled_assemblies, normally called during
boot. The method called in the loop mono_image_open_from_data_internal is called
at several places without locks (and looks internal using image lock), so that
doesn't need to be protected. The rest is local data access and the only thing the
lock could do is serialize the whole loop between threads (but that shouldn't be needed).

Fix will remove the locking and also eliminating the incorrect lock order
causing the deadlock.
2019-06-14 11:20:28 +02:00
Marek Safar 9010d2f290 [netcore] Clean up netcore build 2019-06-14 11:03:35 +02:00
Ben Adams 12b737d980 Intrinsicify SpanHelpers.IndexOf(char) (dotnet/coreclr#22505)
* Helpers to support Intrinsics in SpanHelpers.Char

* Intrinsicify SpanHelpers.IndexOf(char)

* Feedback

* fix

* Fix assert

* Improve comment warning

* fix

* fix

* Fix

* Fix

Signed-off-by: dotnet-bot <[email protected]>
2019-06-14 09:37:52 +02:00
Jay Krell 467fd6516b Fix S390x compile since #14870 and a warning. (#15056) 2019-06-14 00:37:06 -05:00
Larry Ewing 56e27ca309 [wasm] fix most cases of numeric debugging for wasm
Fix the signededness of numeric types and use double
for the display of everthing since we are stuck with that
on the js side.
2019-06-13 22:25:23 -05:00
imhameed e6e9d5f6eb Don't create a cycle when translating IL break to IR. (#14980)
Don't create a cycle when translating IL `break` to IR.

`mono_emit_jit_icall` adds the instruction it generates to the current
basic block, and the redundant use of `MONO_ADD_INS` on an instruction
that has already been added to a BB will create a cycle in the `prev`
link chain.

Fixes #9706.
2019-06-13 13:56:07 -04:00
Jo Shields 1e0890f61f Ensure start-compiler-server.sh is in tarballs (#15071) 2019-06-13 13:10:38 -04:00
Jo Shields 7c99f6f249 [netcore] Add native ARM64 build to --with-core=only matrix (#14536)
* [netcore] Add native ARM64 build to `--with-core=only` matrix
2019-06-13 13:06:56 -04:00
dotnet-maestro 8affbbe98d Update dependencies from https://github.com/dotnet/arcade build 20190612.21
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19312.21
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19312.21
2019-06-13 17:32:22 +02:00
Ryan Lucia 20d83c24d6 Propagate error in mono_unicode_to_external (#14879)
* Add internal version of mono_unicode_to_external to propagate error

* Migrate things to _error version where sensible

* Remove redundant goto

* Print input string when conversion fails

* Remove todos

* Switch everything to MonoError

* Naming: err -> error

* Actually print out *filename correctly
2019-06-13 17:03:34 +02:00
Kenneth Pouncey e795253dc7 Fix generated warning of driver.c (#15036)
The following warning is generated when building master for interpreter as well as during AOT build of driver.c

```
driver.c:346:31: warning: initializing 'const MonoBundledAssembly **' with an expression of type 'MonoBundledAssembly **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
                const MonoBundledAssembly **bundle_array = g_new0 (MonoBundledAssembly*, assembly_count + 1);
                                            ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2019-06-13 15:15:30 +02:00
Marek Safar ffe5166a9b [System.Private.CoreLib] Add licence headers 2019-06-13 09:45:50 +02:00
Marek Safar f2c74837d2 [netcore] Bump roslyn version 2019-06-13 09:44:12 +02:00
Stephen Toub 5eedd4f813 Fix nullable annotations on Binder.ReorderArgumentArray
Signed-off-by: dotnet-bot <[email protected]>
2019-06-13 09:44:12 +02:00
Stephen Toub 001844340a Remove defunct !s and update some TODO-NULLABLE comments
Signed-off-by: dotnet-bot <[email protected]>
2019-06-13 09:44:12 +02:00
dotnet-maestro[bot] 8eec14a2f1 Update dependencies from dotnet/arcade (dotnet/corefx#38474)
* Update dependencies from https://github.com/dotnet/arcade build 20190611.2

- Microsoft.DotNet.XUnitExtensions - 2.4.1-beta.19311.2
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.19311.2
- Microsoft.DotNet.VersionTools.Tasks - 1.0.0-beta.19311.2
- Microsoft.DotNet.ApiCompat - 1.0.0-beta.19311.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Configuration - 1.0.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19311.2
- Microsoft.DotNet.CodeAnalysis - 1.0.0-beta.19311.2
- Microsoft.DotNet.CoreFxTesting - 1.0.0-beta.19311.2
- Microsoft.DotNet.GenAPI - 1.0.0-beta.19311.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19311.2
- Microsoft.DotNet.RemoteExecutor - 1.0.0-beta.19311.2
- Microsoft.DotNet.GenFacades - 1.0.0-beta.19311.2

* Update `where T : object` constraint to be `where T : notnull`

* Update several TODO-NULLABLE comments

Signed-off-by: dotnet-bot <[email protected]>
2019-06-13 09:44:12 +02:00
Alexander Kyte 4ba594ad25 [crash] Print native module name when crash privacy disabled (#14986)
This makes it so that disabling crash privacy ensures we get the full native symbols printed regardless of allow and deny lists.

Before: https://gist.github.com/alexanderkyte/2b1f38a880c61ea15aa4c851e44af578

After: https://gist.github.com/alexanderkyte/ce80788a51761d91890d812874fa2da2
2019-06-13 10:07:10 +03:00
Marek Safar ad3150a5c5 Convert PermissionSet NIE to PlatformNotSupportedException (#25114)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-13 08:49:27 +02:00
Alexis Christoforides 167564efc6 Another speculative fix for 'pkg-config' sometimes getting built as a 32-bit package regardless of arch configuration (#14955)
Mono issue: https://github.com/mono/mono/issues/13804

The hypothesis is that at reconfigure using the configure cache file, the lack of explicit setting of the host somehow breaks the build process.
2019-06-13 06:34:03 +03:00
Zoltan Varga f87af4bfef [wasm] Simplify AOT profiling initialization. (#15038)
Current steps:
- Call MONO.mono_wasm_init_aot_profiler (null) before calling MONO.mono_load_runtime_and_bcl ().
- Call WebAssembly.Runtime.StopProfile () from the c# code to stop profiling.
- The profile data will be in Module.aot_profile_data.
2019-06-12 18:07:24 -04:00
Kenneth Pouncey 7eadeb3747 Add DataView test cases to BindingsTestSuite. 2019-06-12 16:40:46 -05:00
Kenneth Pouncey 98092c280b Add a private routine UnBoxValue to fix cast exceptions. 2019-06-12 16:40:46 -05:00
Kenneth Pouncey ce1d92568c [wasm][bindings] Add binding support for DataView 2019-06-12 16:40:46 -05:00
Jo Shields 607bd23f2e Install bc as a Linux prerequisite (#15046)
Our run-step logic uses `bc` to calculate step times, so `bc` is
needed to avoid ugly things on the console like:
```
../scripts/ci/./run-step.sh: line 59: echo: write error: Broken pipe
```
2019-06-12 15:45:22 -04:00
Jo Shields 698aed3946 Increase timeout on --core=only CI to 90 minutes, for ARM's benefit (#15044) 2019-06-12 15:27:00 -04:00
dotnet-maestro cf87874290 Update dependencies from https://github.com/dotnet/arcade build 20190611.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19311.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19311.2
2019-06-12 19:00:44 +02:00
Stephen Toub 6a2f0d94d1 Add missing TraceOperationCreation log event in GetStateMachineBox (#25097)
This was removed accidentally as part of overhauling the async infrastructure in 2.1. VS depends on it for some task tracking logic.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-12 18:59:56 +02:00
monojenkins 4471332fd9 Bump API snapshot submodule 2019-06-12 18:57:17 +02:00
Zoltan Varga 918d7b0aaa [corlib] Add missing Unsafe.Unbox () method.
Fixes https://github.com/mono/mono/issues/14871.
2019-06-12 18:57:17 +02:00
Egor Bogatov 3a0191194b [netcore] Enable CoreFX tests on CI for Linux (#15015)
* Enable CoreFX tests on CI for Linux

* implement NativeLibrary.Unix.cs

* add missing libc

* add few -nonamespace

* more flaky tests
2019-06-12 18:55:44 +02:00
Larry Ewing bd7cb7e4d4 Enable the compiler server by default 2019-06-12 10:58:25 -05:00
Marek Safar 225890a180 [System.Private.CoreLib] Clean up few not implemented exceptions 2019-06-12 15:35:29 +02:00
Zoltan Varga a9949782d6 [runtime] Fix gshared support for BeginInvoke ()/EndInvoke () wrappers. (#14985)
Fixes https://github.com/mono/mono/issues/14972.
2019-06-12 09:18:14 -04:00
Vlad Brezae 9c265ace06 [jit] Fix interface cast (#14978)
* [jit] Throw exception if casting fails for special array interface

After the standard interface check (mini_emit_iface_cast), for special interfaces we need to do additional checks. We were skipping these checks if the object was not an array, without throwing a cast exception. This code path is reached for configurations where remoting is disabled.

Fixes https://github.com/mono/mono/issues/14729

* [tests] Add test for interface casting case

This test would have failed on fullaot lane for example.
2019-06-12 15:42:46 +03:00
Marius Ungureanu 669629330f Plug leak of ppdb_filename
mono_image_open_metadata_only and its callees all dupe the filename string, so free the string after mono_image_open_metadata_only is done with it:

```
      1 (128 bytes) ROOT LEAK: 0x7fb07f086c80 [128]  length: 105  "/Users/therzok/Work/md/md-addins/external-addins/MonoDevelop.MonoDroid/build/Xamarin.Installer.Common.pdb"
```
2019-06-12 14:22:24 +02:00
Maxim Lipnin 578b91eb07 Fix some warning related to nullability of reference types 2019-06-12 14:20:09 +02:00
Aleksey Kliger cd8b760220 [runtime] Switch to GC Unsafe for all GC external API functions
Fixes https://github.com/mono/mono/issues/14975
2019-06-12 14:11:01 +02:00
Martin Baulig a44db72a1c [System.Net.Http]: Add hack to the legacy HttpClient to pass down Timeout property. #12577. (#14970)
* [System.Net.Http]: Add hack to the legacy HttpClient to pass down Timeout property. #12577.

* `HttpClientHandler`, `IMonoHttpClientHandler`: add new internal `MonoSetTimeout (TimeSpan)` function.

* `HttpClient.SendAsyncWorker()`: if `handler` is `HttpClientHandler`, call the new internal
  `MonoSetTimeout()` function to pass down the timeout.

* `MonoWebRequestHandler.SendAsync()`: this is only used here to pass the timeout to the `HttpWebRequest`.

* Address feedback.

* Update HttpMessageInvoker.cs

* Make it build.

* Really make it build (forgot monotouch_watch).
2019-06-12 09:42:20 +02:00
Koundinya Veluri 2c7c7398bb Track timer count and add Timer.ActiveCount (dotnet/coreclr#25061)
* Track timer count and add Timer.Count

Part of https://github.com/dotnet/corefx/issues/38422

* Use lock to prevent tearing

* Add assert

* Rename Count to ActiveCount

* Fix build

Signed-off-by: dotnet-bot <[email protected]>
2019-06-12 09:41:15 +02:00
Egor Bogatov 56398813ae [netcore] Run CoreFX tests on CI (macOS) (#14849) 2019-06-12 09:40:15 +02:00
Zoltan Varga dd0f7eb2e1 [corlib] Preserve System.RuntimeType. 2019-06-12 08:50:06 +02:00
Aleksey Kliger bf61c7c973 [.github] Update CODEOWNERS 2019-06-12 08:46:16 +02:00
Zoltan Varga bcd14601c2 [aot] Open AOT profile files using "rb" so it works on windows.
Fixes https://github.com/xamarin/xamarin-android/issues/3168.
2019-06-12 08:31:05 +02:00
Stephen Toub d2e9be7d08 Update IEquatable/IComparable<T> for nullability (dotnet/coreclr#25053)
We need to revise our use of nullable for `IComparable<T>` and `IEquatable<T>`:
- For reference types that implement `IComparable<T>`, the implementation should use `IComparable<T?>`, e.g. `String : IComparable<String?>`, so that the type can be used in methods with a `where T : IComparable<T>` constraint: `IComparable<T>`'s contravariance then allows both `T` and `T?` to work as generic type arguments.
- For reference types that implement `IEquatable<T>`, we can't take advantage of such contravariance, as by design `IEquatable<T>` is invariant (it would be a breaking change to make it contravariant, and even if it wasn't doing so is of questionable design given that equality and inheritance don't mix well).  Given the current language design, we have little option but to explicitly make any reference type implementations of `IEquatable<T>` be oblivious, and also make all `where T : IEquatable<T>` constraints be oblivious.  Otherwise, regardless nullable annotations, a developer will get a warning for using either or both of `T`/`T?` with any given method employing such a constraint.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-11 20:10:51 +02:00
Acid Chicken (硫酸鶏) c31180acc5 Fix Japan's new era fallback isn't reflected in Mono (#14896)
* Fix Japan's new era fallback isn't reflected in Mono

refs: <https://github.com/dotnet/coreclr/pull/23614>

* Fix array length

* Fix MonoTests.System.Globalization.CalendarTest

* Fix MonoTests.System.Globalization.EastAsianLunisolarCalendarTest

* Fix era index

refs: 1715e1d0e738ce95382ba372c24502967002a2f0

* Amend fixing

refs: 05af6e6f75fcea76e3d9e9f2f95f0caedb753aa7
2019-06-11 19:16:56 +02:00
Maryam Ariyan 9c542c174d Make Debug.Print(string) behavior consistent with .NET Framework (#25036)
*     Debug.Print should call Debug.WriteLine
    - to behave similar to .NET Framework

* temporarily disable tests
- Waiting for coreclr/fx changes to propagate

Signed-off-by: dotnet-bot <[email protected]>
2019-06-11 18:56:15 +02:00
Zoltan Varga 23ab664623 Revert some changes which don't have proper dependencies. 2019-06-11 11:51:10 -05:00
Zoltan Varga 1f289c9e44 Add a rule to create /aot-in. 2019-06-11 11:51:10 -05:00
Zoltan Varga 16c1682494 Make the creation of the dummy assemblies deterministic. 2019-06-11 11:51:10 -05:00
Zoltan Varga 23573b5348 [wasm] Avoid rebuilding the wasm files for the aot images if the aot image hasn't changed. 2019-06-11 11:51:10 -05:00
Zoltan Varga 0af5b236f9 [wasm] Make the cross compiler emit a depfile, not used yet. 2019-06-11 11:51:10 -05:00
Zoltan Varga 6b5779a956 [wasm] Fix dependencies for mscorlib. 2019-06-11 11:51:10 -05:00
Zoltan Varga d010cf5048 [aot] Avoid recompiling the dedup image if it hadn't changed. 2019-06-11 11:51:10 -05:00
Zoltan Varga d22e537c4e [wasm] Make the linker output deterministic. Avoid AOTing mscorlib if it havent' changed. 2019-06-11 11:51:10 -05:00
Zoltan Varga 8326c11779 [wasm] Compile the dedup image to wasm as well. Fix the dependencies of the dedup image. Fix a typo. 2019-06-11 11:51:10 -05:00
Alexander Kyte e4d3752684 [llvm] Fix disabling direct calls and inlining (#14880)
* [llvm] Enable disabling inlining on llvm

* [llvm] Fix disabling direct calls on llvm

* [llvm] Rename mono_inited even when doing self_init (generated init functions refer to it)
2019-06-11 12:30:04 -04:00
dotnet-maestro 22887567e1 Update dependencies from https://github.com/dotnet/arcade build 20190610.24
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19310.24
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19310.24
2019-06-11 17:17:07 +02:00
Aleksey Kliger (λgeek) 5440491ae8 [install] Include .exe extension when symlinking the mono binary (#14958)
Prevent the SDKs from making dangling symlinks when packaging the MXE
cross-compilers: should hav

    mono.exe -> mono-sgen.exe

rather than

    mono -> mono-sgen (dangling).
2019-06-11 09:42:24 -04:00
Johan Lorensson 3a193b7ae5 Merge pull request #14811 from lateralusX/lateralusX/fix-lmf-with-ctx-windows-msvc
Fix interpreter failure in install_eh_callback.exe under Windows x64 MSVC.
2019-06-11 13:22:18 +02:00
Jay Krell c398e19d35 Remove JIT icall hashing by address. (#14870)
* Work toward removing JIT icall hashing by address.

* Remove JIT icall hashing by address.

* Cleanup amd64 emit_call use.

* Move MonoJumpInfoTarget to among types, not functions.
If mini.h includes mini-runtime.h, then can move it nearer MonoJumpInfo.
Or if returned by out parameter (pointer) instead of struct by value.
Or pair of out parameters instead of struct.

* Closer to historical semantics, at least to avoid assertion failure, will try to refine in a later PR.

* Remove new comments about partial barriers, I think the comments are wrong and the code is correct (except that lock/unlock probably need to be full barriers, if they are not.)

* PR: Don't worry about size of MonoCallInst.jit_icall_id. Let it be 32 or 64 bits instead of 9.
2019-06-11 07:40:39 +03:00
dotnet-maestro 3dd5240c72 Update dependencies from https://github.com/dotnet/arcade build 20190609.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19309.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19309.1
2019-06-10 17:34:18 +02:00
dotnet-maestro 3ec86e017f Update dependencies from https://github.com/dotnet/arcade build 20190608.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19308.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19308.1
2019-06-10 13:36:50 +02:00
Marek Safar 7f2d519b0d [System.Private.CoreLib] Update public APIs 2019-06-09 13:01:50 +02:00
Zoltan Varga 23a928826c [wasm] Prototype for collecting aot profile data. (#14865)
* [runtime] Add some options to the aot profiler:
- write-at-method=<METHOD> Write the data when <METHOD> is compiled.
- send-to-method=<METHOD> Call <METHOD> with the collected data.

* [wasm] Fix profiler support in the packager.

* [wasm] Add prototype for generating aot profile data.

* Fix indentation.
2019-06-08 23:16:18 -04:00
dotnet-maestro bcf03bc442 Update dependencies from https://github.com/dotnet/arcade build 20190607.62
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19307.62
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19307.62
2019-06-08 22:51:37 +02:00
dotnet-maestro 4469cdaffc Update dependencies from https://github.com/dotnet/arcade build 20190606.12
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19306.12
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19306.12
2019-06-08 22:51:37 +02:00
Michal Strehovský b2768ac469 Move Marshal class to S.P.CoreLib (dotnet/corert#7502)
After this change, CoreRT only uses S.P.Interop to host the interop hashtable readers. Those can't move to CoreLib because they call into the type loader.

I didn't touch ProjectN's version of Marshal and I left the `PInvokeMarshal` class in place to help with that. I guess we'll need to make a call at some point on what to do with S.P.Interop since without MCG the code in it is kind of useless.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-08 22:50:24 +02:00
Jay Krell 440764a82e g_new/g_new0 in wasm/driver.c (#14890) 2019-06-08 13:38:20 -04:00
Jay Krell 63f17d2f55 Cleanup amd64 emit_call / emit_call_body -- last parameter always FALSE. (#14897)
And it is reasonable to expect that to remain the case, as C compilers
do not generate code as would occur with the last parameter = TRUE.

They allocate the room for their maximum outgoing parameters at function entry,
and keep a constant stack, except for functions that call _alloca,
and this code risks but not necessarily breaks ABI compliance.

In particular, the rsp adjustment either needs unwind codes, or needs
to only occur in a function with a frame pointer other than RSP.

And the uwind codes for adding to RSP are very tricky to impossible.
Normally you only ever subtract from RSP. There is an unwind code for that.
But there isn't really for add.
You might be able to simulate it with chained unwind, making these
regions look kinda like end of function.
But this is all most unlikely.
2019-06-08 13:38:00 -04:00
monojenkins 609878dcb5 [bcl] Update BCL Linked Size 2019-06-08 09:35:38 +02:00
Steve MacLean 11761ebd7f Fix AppDomain issues (dotnet/coreclr#25019)
Populate AppDomain.CurrentDomain when invoking events
Make AppDomain method implemented in AssemblyLoadContext internal

Signed-off-by: dotnet-bot <[email protected]>
2019-06-08 09:34:45 +02:00
Carlos Sanchez Lopez 132969ee3e Fix issue in NamedPipeServerStream.GetImpersonationUserName() (#37676)
Fix for issue where NamedPipeServerStream.GetImpersonationUserName() throws unexpected InvalidationOperationException("The operation completed successfully") when impersonation is not allowed, when in fact it should simply return an empty string.

The fix will call GetNamedPipeHandleStateW once. If it fails, it will try to load sspicli.dll if it was not loaded, and will reattempt the call to GetNamedPipeHandleStateW.

This fix is only for Win32: UAP does not allow calling LoadLibraryEx, and Windows Nano says denies access to GetNamedPipeHandleStateW even after attempting to load sspicli.dll.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-08 08:52:42 +02:00
Zoltan Varga 16532397c3 [wasm] Switch to the LLVM wasm backend. (#14734)
* [wasm] Switch to the llvm wasm backend.

* [wasm] Packager changes for the wasm backend.

* -s EMULATED_FUNCTION_POINTERS=1 no longer needed.
* Run wasm-strip on the final binary.
* Run opt during AOT.
* Disable the dynamic build for now, it doesn't seem to work with the wasm backend.

* [wasm] Use STACK_MAX instead of STACK_BASE for the bottom limit of the stack.

* [aot] Handle llvmopts= in llvmonly mode as well.

* [wasm] Disable an assertion which is no longer true with the wasm backend.

* [wasm] Disable computed gotos in the interpreter, the wasm backend doesn't support it.

Fix llvm target layout so its compatible with clang compiled code.

* [wasm] Pass llvm-path to the cross compiler.

* [wasm] Fix some problems with the dynamic build, still doesn't work. Fix packaging.

* [wasm] Pass -s DISABLE_EXCEPTION_CATCHING=0 to the runtime build, otherwise catch clauses are not generated in llvm-runtime.cpp.

* [aot] Allow llvmopts= argument multiple times.

* Bump emscripten version to 1.38.34.

* [wasm] Add https://github.com/emscripten-core/emscripten/pull/8457 as a patch.

* [wasm] Compile the aot .bc files to .o in a separate step using emcc, this will help with incremental compilation later.

* [wasm] Source emsdk_set_env.sh instead of emsdk_env.sh the latter calls emsdk construct_env to construct emsdk_set_env.sh which is racy.
2019-06-08 00:46:56 -04:00
Jerome Laban f5cfc67c8e [Wasm] Fix memory override in mono_wasm_add_assembly 2019-06-07 22:00:31 -05:00
Jeremy Kuhne 4102c7fd90 Fix redist
Signed-off-by: dotnet-bot <[email protected]>
2019-06-07 23:17:51 +02:00
Santiago Fernandez Madero 355d611e94 Address nullable feedback for System.Runtime and System.Runtime.Extensions (#25017)
* Address last nullable feedback from System.Runtime

* Address nullable feedback for System.Runtime.Extensions

* PR Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-06-07 23:17:51 +02:00
Stephen Toub 3f1bca5a34 Add [NotNull] to syncLock parameter of EnsureInitialized (#25012)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-07 23:17:51 +02:00
Sung Yoon Whang cf93ce4fce Add DisplayUnits property to DiagnosticCounter (dotnet/coreclr#24981)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-07 23:17:51 +02:00
Ankit Jain 46108fd7de Bump msbuild to track xplat-master (#14814)
Picks up changes in msbuild after:
	[mono] Update SDKs to track cli branch `release/2.1.8xx`

(https://github.com/mono/msbuild/pull/110)
2019-06-07 21:54:03 +02:00
Alexander Kyte d54a6544b3 [crash] Move /proc/self/maps crash collection to created JSON blob (#14704)
* [runtime] Don't print /proc/self/maps on Android

* [runtime] Add proc mapping to crash JSON output

* [runtime] Zero initialize locals in threading macros

* [crash] Filter out illegal characters from process_maps

* [crash] Prevent concurrent reads from /proc/self/maps

* [crash] Clean up memset in g_async_safe_fgets

* [crash] Remove stack staging array in async_safe_fgets

* Revert "[crash] Prevent concurrent reads from /proc/self/maps"

This reverts commit f65166559ad24ad65c530f7abbc096e4d4634878.
2019-06-07 15:18:57 -04:00
Calvin Buckley 18e0ebfe89 AIX/PASE integration improvements (#14652)
* Allow using SysV-style sonames on AIX/PASE

This uses a far saner naming convention with libtool, and is
consistent with the official PASE RPM repository. However, some
loader changes are required to make it "just work" and workaround
some real dumb behaviour on AIX's part.

Note that while Mono works when built without the different soname
tweak, it won't when installed, because the convention is strange
and the libtool .la archives won't be installed. It's recommended
as such that installation of Mono keeps the libtool files or just
uses SVR4 sonames like the rest of the world, even if they're made
strange like AIX.

* Specify a specific version of unixODBC, make an include

A workaround against PASE RPMs of unixODBC not including the just
"libodbc.so" except in the development version. If a platform needs
a specific version (the macOS reference not changed in the DllMap)
then it can be specified in the configure script.

AIX doesn't need a special name because both AIX Toolbox and Perzl
include non-archive libraries in /opt/freeware/lib - unexpected.

* Don't try to use shm_open on PASE due to it not being implemented

All this will do is cause a coredump if running the script on PASE,
and write an entry to the SLIC diagnostic logs. This test could be
re-enabled if i 7.4 supports it properly.

* fix ODBC include

* Check for what library to use for libintl when dlopenning on AIX

These checks are for the benefit of the DllMap. The construct used
is kinda hacky, IMHO, but it resolves the concerns of hardcoding.
In the event that this doesn't work (it does for me), it falls back
to what the IBM RPMs seem to use for linking gettext et al.

Not sure of the utility for other platforms, since they usually
use sane soname conventions and the one-liner here depends heavily
on an AIX developer tool and its output format.

The use of cut/awk should work with the stock AIX utils, no GNU
necessarily needed.
2019-06-07 20:02:43 +02:00
Martin Baulig 96125c693c Bump CoreFX to pickup https://github.com/mono/corefx/pull/298. (#14851) 2019-06-07 13:14:21 -04:00
Martin Baulig ac908dd334 Implement RSACertificateExtensions.CopyWithPrivateKey(). #14152. (#14860)
* Implement RSACertificateExtensions.CopyWithPrivateKey().  #14152.

* RSACertificateExtensions.CopyWithPrivateKey(): implement.

Since `RSACertificateExtensions` lives in `System.Core` and only `mscorlib`
internals (but not `System` internals) are visible to it, we need to use a
little trick here:

* System.Security.Cryptography.X509Certificates.X509CertificateImpl:
  add new abstract methods CopyWithPrivateKey() and CreateCertificate().

* System.Security.Cryptography.X509Certificates.X509Certificate2Impl:
  sealed implement them here.

The `httpcfg` tool, only checks whether the key is valid, so we don't really
need to call `CopyWithPrivateKey()` (which requires us to take a dependency
on `System.Core`).

* Do the same thing in HttpListener.
2019-06-07 13:13:48 -04:00
Aleksey Kliger (λgeek) 277bbdaada [runtime] Make cross-appdomain wrappers throw NIE for methods with ref struct args (#14863)
* [AppDomain] Cross-appdomain wrapper throws NIE for methods with ref struct arguments

If we have a ref struct and a method that takes it as an argument:

```
[Serializable]
public ref struct R {
  public int i;
}

public interface I {
  public void M1 (R r, SomeClass o);
}

public class M : MarshalByRefObject, I {
  public void M1 (R r, SomeClass o) { ... }
}
```

If we create an instance of M in another domain and try to call it:
```
  I obj = (I)otherDomain.CreateInstanceAndUnwrap (typeof(M).Assembly.FullName,
  nameof(M));
  R r;
  r.i = 42;
  SomeClass o = ...;
  obj.M1 (r, o);
```

Mono will need to create a wrapper that can invoke M.M1 in the other domain.
The way the wrapper works in `mono_marshal_get_xappdomain_invoke` is by
creating an array of all the arguments that need to be serialized (see
`mono_get_xdomain_marshal_type`) and then serializing the whole array (by
calling out to `System.Runtime.Remoting.RemotingServices.SerializeCallData`).
In the example it would make a two element array and try to serialize `r` and
`o` into it. For valuetypes it normally does this by boxing the argument.
However since `R` is a ref-struct, boxing it is not allowed.

This works on .NET Framework.

However for Mono we would need to serilize `R` without boxing it, which seems
challenging with our current setup.

So for now we generate a wrapper that just throws a NotImplementedException if
it is ever called.

This fixes https://github.com/mono/mono/issues/14809 (in that marshalling a
TextWriter across domains works again) but in an unsatisfactory way (because
you can't call any of the ReadOnlySpan<char> overloads on the transparent proxy
object).

* [corlib] Add back Serializable attribute on some reflection classes

Tests that use https://www.nuget.org/packages/NUnit.ApplicationDomain/
need to serialize MethodInfo (and hence MethodBase).

* [corlib] Add test for transparent proxies for classes with methods that take
ref struct args

Regression test for https://github.com/mono/mono/issues/14809

* Bump API snapshot submodule
2019-06-07 13:06:32 +02:00
Ryan Lucia 65608fe3f4 Remove exclusions for resolved issue 2019-06-07 09:31:43 +02:00
Tanner Gooding e0471729b0 Marking Vector128<T>.Count and Vector256<T>.Count as [Intrinsic] (#24991)
* Marking Vector128<T>.Count and Vector256<T>.Count as [Intrinsic]

* Fixing NI_Vector128_Count and NI_Vector256_Count to use clsHnd when getting the simdSize and baseType

* Applying the formatting patch.

* Changing some comments to just be "vector element count".

* Fixing impBaseIntrinsic to set the baseType so Vector128_Count and Vector256_Count don't return nullptr

Signed-off-by: dotnet-bot <[email protected]>
2019-06-07 07:10:14 +02:00
Zoltan Varga bd1ad0089f Switch Hashtables to Dictionary in the encoding classes so Hashtable can be linked out. (#14774) 2019-06-06 23:03:22 -04:00
Bernhard Urban 03c6855d05 [ios] switch cross32/crosswatch to be executed on x86_64 and use newer LLVM (#14852)
Contributes to https://github.com/mono/mono/issues/9621
Fixes https://github.com/mono/mono/issues/14841

Note that it breaks iOS 32bit on devices. The Apple Watch _might_ still works (only tested on `2019-02`).  It unblocks some build related issues on the Xamarin.iOS `2019-06` integration, and we have to do it anyway. I'll come back to it to fix device related issues.
2019-06-07 00:01:00 +02:00
Ryan Lucia a5a26a2f92 Add logic to object array typecheck to handle arrays of unmanaged pointers (#14733)
Fixes #14555 

The NULL check alone is not enough, because interfaces are also parented to NULL for some reason, and so I've moved `class_kind` out from the bitfield section to make it accessible from IR. The beginning of the struct is going to be padded to 32 bits anyway at the least, so this move should save space if anything.

Our type checking overall is not very robust, and in particular the supertype comparison doesn't work well for anything that isn't an object, so it's possible there are some other weird corner cases. As far as I can tell looking through the array of objects stuff though, we should have reasonable coverage with the existing tests + the stuff I added.
2019-06-06 15:38:57 -04:00
Ryan Lucia 6d2c77fb33 Switch supported runtimes storage from an array to a list (#14777)
Fixes #12141 

Switched to a list because in theory any number of tags can be present. Old behavior was to put them into an array of size 3 and zero the byte following them, which was causing the crash with more than two tags. There's no null check for the default runtime because that should never happen, and the list is reversed to preserve the order from the XML. Changing the signature of `get_runtimes_from_exe` should be fine because it's static and only called in the one place.
2019-06-06 15:02:57 -04:00
Jan Kotas 4d5807110f Delete unnecessary security transparency attributes (dotnet/coreclr#25007)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 20:57:11 +02:00
Bernhard Urban 812357ec51 [mach] cast objc_msgSend{,Super} usages (#14836)
Fixes #14792
2019-06-06 20:14:59 +02:00
Martin Baulig 88c05a8910 Bump CoreFX to pickup https://github.com/mono/corefx/pull/298. 2019-06-06 13:45:29 -04:00
Bernhard Urban e8367ce3d7 [llvm] emit call to mini_llvmonly_throw_nullref_exception without exceptions in mind (#14840)
Fixes https://github.com/mono/mono/issues/14243
2019-06-06 19:24:20 +02:00
Alexander Kyte 364a8423e3 [runtime] Gracefully skip AOTing problematic assemblies (#14232) 2019-06-06 12:07:31 -04:00
Egor Bogatov b861cacd48 [netcore] Improve netcore/build.sh script (#14835)
* Improve netcore/build.sh

* bump corefx tests version

* ignore StringTests failures

* Ignore more tests for xtestall

* Implement Environment.TickCount64

* cleanup

* Add two debug-* rules
2019-06-06 17:43:57 +02:00
dotnet-maestro 636e06334f Update dependencies from https://github.com/dotnet/arcade build 20190605.13
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19305.13
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19305.13
2019-06-06 17:28:03 +02:00
Thays Grazia 2da7707373 [Mono.Debugger.Soft] Properly close connections
This PR fixes #7377
2019-06-06 11:12:47 -03:00
dotnet-maestro 2e4b6b34ac Update dependencies from https://github.com/dotnet/arcade build 20190604.23
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19304.23
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19304.23
2019-06-06 13:47:26 +02:00
dotnet-maestro f02d09f7f6 Update dependencies from https://github.com/dotnet/arcade build 20190604.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19304.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19304.1
2019-06-06 13:47:26 +02:00
Martin Baulig 3998dc01c9 Make CalendarData more linker friendly.
See https://github.com/mono/corefx/pull/298 for a description of the
technique that we're using here to make it more linker friendly.
2019-06-06 13:40:53 +02:00
Alexander Köplinger 51202617a1 [sdks] Use 7z format for the android/ios/mac archives (#14837)
It has way better compression performance.
Kept WebAssembly on .zip for now since external users took dependencies on it [1].

Fixes https://github.com/mono/mono/issues/14215

[1] https://github.com/nventive/Uno.Wasm.Bootstrap/blob/e2bf8946e162642ca1bdf4f003f8de4a94954f73/Readme.md#updating-the-mono-sdk-build
2019-06-06 12:24:56 +02:00
Santiago Fernandez Madero 504a1a30fa More PR Feedback
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 10:32:52 +02:00
Santiago Fernandez Madero 420a9da24a PR Feedback
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 10:32:52 +02:00
Santiago Fernandez Madero eab7775571 PR Feedback
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 10:32:52 +02:00
Santiago Fernandez Madero c2796feb97 Fix some nullable annotations from API Review
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 10:32:52 +02:00
Santiago Fernandez Madero a8fd49434f Remove stale Task async extension methods from TaskExtensions (#24958)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 10:07:27 +02:00
Santiago Fernandez Madero 992eacfac9 Remove Collection<T> range APIs (dotnet/coreclr#24938)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-06 10:07:27 +02:00
Jay Krell 515234a128 [thread] Print function name when asserting MonoThreadInfo is non-NULL (#13814)
https://github.com/mono/mono/issues/13813.
2019-06-06 10:40:39 +03:00
monojenkins bf78c04740 [bcl] Update BCL Linked Size 2019-06-06 09:31:40 +02:00
Kenneth Pouncey 0562fde077 [wasm][bcl] Use zlib for DeflateStream on WASM profile (#14308)
* [wasm][bcl] Use zlib for DeflateStream on WASM profile

- Add `-s USE-ZLIB=1` flag for the emscripten build of `mono.js`
- Add new `zlib-helper` module build that is included in the `mono` wasm build.
- This adds roughly 300 kb to the size.

* Add zlib calls to `icall` for `WASM` profile

* Address comments use `TARGET_WASM` instead of `HOST_WASM`

* Hack around JS exception: RuntimeError: indirect call signature mismatch

- Instead of using the function pointer from DeflateStream (Marshal.GetFunctionPointerForDelegate) obtain the callback functions from the object itself.

* Update error messages and add exception parameter to `mono_runtime_invoke`.

* Add `mono/support` zlib include sources files to make `package` target.

* Add `zlib-helper` build to packager.

- Note: Right now only supports zlib build from mono tree build.
- Add `zlibtest.cs` scenario to compress and uncompress using DeflateStream and GZip.
- Add test to make file to build and run aot version of ziplibtest.

* Add copy of zlib header support files to `package-wasm-runtime`

- The support library is not built for wasm but the zlib include files are needed to build support during wasm build.
- See mono.js build and the use of the `-s USE_ZLIB=1` flag.
- The include files will be used in packager.exe to build zlib support for wasm.

* Use the zlib includes from support to build the zlib support.

* Setup base tests for testing System.IO.Compression integration

* Formatting

* Add more ziparchive tests

* Formatting and indentation

* Add more Zip tests

* Add more tests.

- Add more tests for ZipArchive.
- Add tests for Deflate - small, large and very large strings.
- Add tests for GZipStream - small, large and very large strings.

* Fix merge of EMCC_FLAGS

* Add new option to packager to enable the use of zlib

-   --enable-zlib (enable the use of zlib for System.IO.Compression support)
        type: bool  default: false

- update packager doc

* Address review comments

- Change `enable-zlib` to `zlib`
2019-06-06 05:07:56 +02:00
Martin Baulig 2b3a23c511 Bump CoreFX to pickup the fix for #14214. (#14821)
HttpClient.SendAsync() should not attempt to read response body on a HEAD request.

* CoreFX PR https://github.com/dotnet/corefx/pull/38129.

* Backported in https://github.com/mono/corefx/pull/297.

* Fixes https://github.com/mono/mono/issues/14214.
2019-06-05 22:14:14 -04:00
Egor Bogatov 181a602ace Fix build on macOS 10.15 Catalina + xcode 11 (#14820)
1) CC_MD5_Init, CC_MD5_Update and CC_MD5_Final are deprecated.

```c
mono-md5.c:45:2: error: 'CC_MD5_Init' is deprecated: first deprecated in macOS 10.15 - This function is
      cryptographically broken and should not be used in security contexts. Clients should migrate to SHA256
      (or stronger). [-Werror,-Wdeprecated-declarations]
        CC_MD5_Init (ctx);
        ^
```

2) objc_msgSend is deprecated
```
mono-threads-mach-helper.c:95:17: error: too many arguments to function call, expected 0, have 2
                objc_msgSend (value, release);
                ~~~~~~~~~~~~  ^~~~~~~~~~~~~~
```
XCode has a special switch `Enable Strict Checking of objc_msgSend Calls` which is now `true` by default. It's fixed by `-DOBJC_OLD_DISPATCH_PROTOTYPES=1` flag to clang or the corresponding define in the source file.

3) Fixes https://github.com/mono/mono/issues/14793

It worked on pre 10.15 without `-framework GSS`, because it got pulled in through the dependencies. You can see it by running DYLD_PRINT_LIBRARIES=1 csharp and then trace it back. On Mojave /System/Library/Frameworks/GSS.framework/Versions/A/GSS got loaded as dependency of /usr/lib/libcups.2.dylib and so on. Unlike Windows, macOS will resolve the symbols to whatever is already available so it was just happy that someone loaded GSS before libmono-native[-compat/-unified].
2019-06-06 00:39:04 +02:00
Vlad Brezae e548a7d231 [interp] Inline more methods (#14755)
* [interp] Add support for inlining methods with locals

For each local in the inlined method we allocate a new local in the parent method.

* [interp] Enable inlining of methods using ldarga opcode

* [interp] Don't inline methods that do localloc

Inlining localloc in a loop leads to stack overflows. JIT has same behavior.
2019-06-05 22:05:30 +02:00
Alexander Köplinger a83f700546 [tests] Exclude more nunit categories on ios/mac (#14807)
A few more that we missed adding to the exclude file in the sdks archive.

(cherry picked from commit 3d9513efd4)
2019-06-05 21:14:53 +02:00
Egor Bogatov c5ed9bfc0d Reflect recent NS2.1 changes (#14679)
Due to few recent updates to dotnet/standard (NETStandard 2.1) we had 40 apicompat issues.
Mostly copy-pasted from dotnet/corefx.
Didn't implement Cryptography stuff yet.
Checked all profiles.

Implements #14609
2019-06-05 20:44:46 +02:00
Jerome Laban f7042d48a5 Enforce C++ exception support for the release-dynamic configuration 2019-06-05 11:19:21 -05:00
imhameed 993d484285 [jit] Treat ternary operations as non-constant during constant evaluation and propagation (#14782)
* Treat ternary operations as non-constant... (#13873)

...during constant evaluation and propagation.

* Move ternary SSA cfold test from basic.cs to objects.cs.
2019-06-05 17:42:18 +02:00
Brendan Zagaeski 888a8d44f6 [arm64] Correct exception filter stack frame size (#14757)
* [arm64] Correct exception filter stack frame size

Fixes: https://github.com/mono/mono/issues/14170
Fixes: https://github.com/xamarin/xamarin-android/issues/3112

The `call_filter()` function generated by `mono_arch_get_call_filter()`
was overwriting a part of the previous stack frame because it was not
creating a large enough new stack frame for itself.  This had been
working by luck before the switch to building the runtime with Android
NDK r19.

I used a local build of [xamarin/xamarin-android/d16-1@87a80b][0] to
verify that this change resolved both of the issues linked above.  I
also confirmed that I was able to reintroduce the issues in my local
environment by removing the change and rebuilding.

After this change, the generated `call_filter()` function now starts by
reserving sufficient space on the stack to hold a 64-bit value at the
`ctx_offset` location.  The 64-bit `ctx` value is saved to the
`ctx_offset` location (offset 344 in the new stack frame) shortly
afterwards:

    stp	x29, x30, [sp,#-352]!
    mov	x29, sp
    str	x0, [x29,#344]

As expected, the invocation of `call_filter()` now no longer modifies
the top of the previous stack frame.

Top of the stack before `call_filter()`:

    (gdb) x/8x $sp
    0x7fcd2774a0:	0x7144d250	0x00000000	0x2724b700	0x00000000
    0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

Top of the stack after `call_filter()` (unchanged):

    (gdb) x/8x $sp
    0x7fcd2774a0:	0x7144d250	0x00000000	0x2724b700	0x00000000
    0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

Additional background information
=================================

The original lucky, "good" behavior worked as follows for
[mono/mono/2018-08@725ba2a built with Android NDK r14][1]:

 1. The `resume` parameter for `mono_handle_exception_internal()` is
    held in register `w23`.

 2. That register is saved into the current stack frame at offset 20 by
    a `str` instruction:

           0x00000000000bc1bc <+3012>:	str	w23, [sp,#20]

 3. `handle_exception_first_pass()` invokes `call_filter()` via a `blr`
    instruction:

        2279							filtered = call_filter (ctx, ei->data.filter);
           0x00000000000bc60c <+4116>:	add	x9, x22, x24, lsl #6
           0x00000000000bc610 <+4120>:	ldr	x8, [x8,#3120]
           0x00000000000bc614 <+4124>:	ldr	x1, [x9,#112]
           0x00000000000bc618 <+4128>:	add	x0, sp, #0x110
           0x00000000000bc61c <+4132>:	blr	x8

    Before the `blr` instruction, the top of the stack looks like this:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0x0a8b31d8	0x00000071
        0x7fcd2774b0:	0x00000000	0x00000000	0x1ef51980	0x00000071

 4. `call_filter()` runs.  This function is generated by
    `mono_arch_get_call_filter()` and starts with:

           stp	x29, x30, [sp,#-336]!
           mov	x29, sp
           str	x0, [x29,#344]

    Note in particular how the first line subtracts 336 from `sp` to
    start a new stack frame, but the third line writes to a position
    that is 344 bytes beyond that, back within the *previous* stack
    frame.

 5. After the invocations of `call_filter()` and
    `handle_exception_first_pass()`, `w23` is restored from the stack:

           0x00000000000bc820 <+4648>:	ldr	w23, [sp,#20]

    At this step, the top of the stack looks like this:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0xcd2775b0	0x0000007f
        0x7fcd2774b0:	0x00000000	0x00000000	0x1ef51980	0x00000071

    Notice how `call_filter()` has overwritten bytes 8 through 15 of the
    stack frame.  In this original lucky scenario, this does not affect
    the value restored into register `w23` because that value starts at
    byte 20.

 6. `mono_handle_exception_internal()` tests the value of `w23` to
    decide how to set the `ji` local variable:

        2574			if (resume) {
           0x00000000000bb960 <+872>:	cbz	w23, 0xbb9c4 <mono_handle_exception_internal+972>

    Since `w23` is `0`, `mono_handle_exception_internal()` correctly
    continues into the `else` branch.

The bad behavior for
[mono/mono/2018-08@725ba2a built with Android NDK r19][2]
works just slightly differently:

 1. As before, the local `resume` parameter starts in register `w23`.
 2. This time, the register is saved into the stack frame at offset 12
    (instead of 20):

           0x00000000000bed7c <+3200>:	str	w23, [sp,#12]

 3. As before, `handle_exception_first_pass()` invokes `call_filter()`
    via a `blr` instruction.

    At this step, the top of the stack looks like this:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0x2724b700	0x00000000
        0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

 4. `call_filter()` runs as before.  And the first few instructions of
    that function are the same as before:

        stp	x29, x30, [sp,#-336]!
        mov	x29, sp
        str	x0, [x29,#344]

 5. `w23` is again restored from the stack, but this time from offset 12:

           0x00000000000bf2c0 <+4548>:	ldr	w23, [sp,#12]

    The problem is that `call_filter()` has again overwritten bytes 8
    through 15 of the stack frame:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0xcd2775b0	0x0000007f
        0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

    So after the `ldr` instruction, `w23` has an incorrect value of
    `0x7f` rather than the correct value `0`.

 6. As before, `mono_handle_exception_internal()` tests the value of `w23` to
    decide how to set the `ji` local variable:

        2574			if (resume) {
           0x00000000000be430 <+820>:	cbz	w23, 0xbe834 <mono_handle_exception_internal+1848>

    But this time because `w23` is *not* zero, execution continues
    *incorrectly* into the `if` branch rather than the `else` branch.
    The result is that `ji` is set to `0` rather than a valid
    `(MonoJitInfo *)` value.  This incorrect value for `ji` leads to a
    null pointer dereference, as seen in the bug reports.

[0]: https://github.com/xamarin/xamarin-android/tree/xamarin-android-9.3.0.22
[1]: https://jenkins.xamarin.com/view/Xamarin.Android/job/xamarin-android-freestyle/1432/Azure/
[2]: https://jenkins.xamarin.com/view/Xamarin.Android/job/xamarin-android-freestyle/1436/Azure/

* reduce frame size
2019-06-05 17:38:06 +02:00
lateralusX ae84befc0f Fix interpreter failure in install_eh_callback.exe under Windows MSVC.
INTERP_PUSH_LMF_WITH_CTX_BODY is not fully supported under Windows MSVC
since that compiler doesn't support taking address from a label, needed
by current implementation to correctly resume after unwinding exceptions
happening in native frames as tested by install_eh_callback.exe.

This fix add support to restore to a known location and use a flag
indicating if we have been resumed to the location or just passing by
for the first time. If we resume it will transfer control to specified label.
This will mimic the behavior of taking the address of a label and use that
address as the restore point and works like how setjmp/longjmp work.

I also considered switching to setjmp/longjmp but that would have had a bigger
impact on all platforms and needed changes into the resume context
machinery as well.

While doing the implementation I also found an interesting issue with
MONO_CONTEXT_GET_CURRENT under Windows x64. On most other platforms it is
implemented as inline assembler, but on MSVC x64 inline assembler is not
supported so it is implemented as a function. Problem with that is how IP
was resolved, since it won't be resolved to the last instruction in the
expanded macro, but to the IP within the mono_context_get_current. This has
not had any visible effects in the past since it will just do the ret and get
back to the call site, but when this was used in INTERP_PUSH_LMF_WITH_CTX_BODY
it caused some issues. This was fixed to make sure rsp and rip reflect location
in caller frame and not within mono_context_get_current, similar to how
it works on all platforms with inline assembler support.
2019-06-05 17:32:02 +02:00
Kenneth Pouncey 7a74dd65ff [wasm][sdk] Clean the managed directory files on /t:Clean build target (#14756)
* Clean the `managed` directory files on `/t:Clean` build target

* Modify the `CleanManaged` target to `_CleanManagedOutputDir`.

- Address comments by Mikayla.
2019-06-05 15:53:35 +02:00
Bijan Tabatabai a3de0304a1 Align mcs's tuple deconstruction behavior with csc
Before the code
(a, b) = (b, a);
was the equivalent of
a = b;
b = a;

now, it evaluates it to so something like
tmp1 = a;
tmp2 = b;
a = tmp2;
b = tmp1;

Signed-off-by: Bijan Tabatabai <[email protected]>
2019-06-05 13:08:59 +02:00
Johan Lorensson 644bfc93d4 Merge pull request #14760 from lateralusX/lateralusX/increase-windows-main-thread-stack-size
Increase main thread stack size on Windows.
2019-06-05 12:26:50 +02:00
Egor Bogatov d3101fbaeb [netcore] Download and use local .NET Core SDK (#14696)
* Download and use local .NET Core SDK

* depend on 'all' rule in nupkg

* fix build error

* Windows support

* use InitializeToolset function

* ouput full path of dotnet in init-tools.sh

* remove init-tools

* Add init-tools.ps1 (Windows)

* fix / issue on cygwin

* address Jo's feedback

* add powershell to PATH for make nupkg

* add netcore/build.sh

* handle pack and test commands

* Update tools.ps1

* Update tools.ps1
2019-06-05 11:52:00 +02:00
Youssef1313 9e5c2c1e52 Being consistent (dotnet/coreclr#24927)
Being consistent using all if statement with curly braces.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-05 10:31:21 +02:00
Adam Sitnik 9fb74fb894 follow the ICU User Guide recommendation to optimize the perf of InvariantCultureIgnoreCase on Linux (#24889)
* follow the ICU User Guide recommendation to optimize the perf of InvariantCultureIgnoreCase on Linux:

1. try to guess the max size and call ucol_getSortKey just once
2. if the buffer is not big enough, call the method again providing the actual sort key length

* handle 0 case

* handle integer overflow

* shorten the time the buffers are pinned

* use the cheapest pinning

* code review fixes: don't use variable length stackalloc, don't copy text from docs (licensing) + don't try to go with the fast path when it would require allocating more managed memory for big strings

* simplify the condition

Signed-off-by: dotnet-bot <[email protected]>
2019-06-05 10:31:21 +02:00
Stephen Toub 5e1dd8d78d Remove unnecessary Shared<T> class from Task (dotnet/coreclr#24931)
It's just StrongBox<T>.

Signed-off-by: dotnet-bot <[email protected]>
2019-06-05 10:31:21 +02:00
Stephen Toub b4aa38f0c2 Adjust several where T : class? constraints (dotnet/coreclr#24894)
* Adjust several `where T : class?` constraints

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-06-05 10:31:21 +02:00
Michal Strehovsky 76526cf1c9 Work around ProjectN compiler bug
[tfs-changeset: 1738641]

Signed-off-by: dotnet-bot <[email protected]>
2019-06-05 10:31:21 +02:00
Aleksey Kliger be92baf12d [runtime] Autoconf check for pthread_mutexattr_setprotocol
Android doesn't always declare that function.
2019-06-05 09:55:34 +02:00
Johan Lorensson a76fc055cf Merge pull request #14694 from lateralusX/lateralusX/fix-llvm-build-path-msvc
Fix LLVM build break on Windows MSVC.
2019-06-04 11:16:49 +02:00
lateralusX 29a2383333 Increase main thread stack size on Windows.
On Windows default thread stack size has been 1MB for a long time
(both 32/64-bit). When starting to use interpreter some of the tests
include deep recursions that will hit stackoverflow on Windows
(ackermann.exe as one example). This commit adjust the default reserved
stack size to 8MB for debug builds and 1.5MB (same as coreclr), for main
thread only. All other threads will still default to 1MB stack size
(both debug/release).
2019-06-04 09:37:39 +02:00
Tanner Gooding 4b81fcbcd7 Removing the TestAllOnes, TestAllZeros, and TestMixOnesZeros methods from the Sse41 class (#24886)
* Removing the TestAllOnes, TestAllZeros, and TestMixOnesZeros methods from the Sse41 class

* Removing JIT support for the SSE41_TestAllOnes, SSE41_TestAllZeros, and SSE41_TestMixOnesZeros intrinsics

* Removing tests for the Sse41.TestAllOnes, Sse41.TestAllZeros, and Sse41.TestMixOnesZeros methods

Signed-off-by: dotnet-bot <[email protected]>
2019-06-04 09:20:29 +02:00
Rich Lander 697c1402ea Update license to match directory 2019-06-04 09:06:40 +02:00
Rich Lander f0ef7aa4df Update license to match directory 2019-06-04 09:06:40 +02:00
Johan Lorensson 0fa59f11ea Merge pull request #14766 from lateralusX/lateralusX/fix-win-32-createprocess-error
Change in process_complete_path exposed uninitialized variable error.
2019-06-04 08:49:02 +02:00
monojenkins deb0227a78 Bump roslyn to release 3.1.0 (#14778) 2019-06-03 22:41:42 +02:00
Alexander Köplinger 098de8b1ee [ci] Remove spaces in pipeline-netcore-runtime.yml
According to docs "names must contain only basic Latin alphabet letters (A-Z, a-z), numbers, and underscores (_)"
2019-06-03 19:56:37 +02:00
lateralusX 85bdaee7a5 Change in process_complete_path exposed uninitialized variable error.
https://github.com/mono/mono/commit/5d088cf0de7f3e50e3547dba361af4401e938dd4
exposed a problem with an uninitialized variable, only exposed on some
build configurations, 32-bit Windows release builds.
2019-06-03 16:04:32 +02:00
dotnet-maestro 369777b246 Update dependencies from https://github.com/dotnet/arcade build 20190602.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19302.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19302.2
2019-06-03 15:26:33 +02:00
monojenkins 283261cd1c [csproj] Update project files 2019-06-03 14:36:00 +02:00
Marek Safar eb99fdeb1a Update API 2019-06-03 14:36:00 +02:00
Marek Safar c84dc2ec55 [Mono.Profiler.Log] Add profiled data reader APIs 2019-06-03 14:36:00 +02:00
Katelyn Gadd 888c8b4621 Basic CI test coverage verifying that we can compile msbuild (#14242)
This adds a basic CI pass that attempts to compile the latest revision of msbuild and verifies that it produced an MSBuild.dll.
2019-06-03 12:03:36 +02:00
Rich Lander cab30bcecc Update TPN with Mono entry (#14744)
* Update TPN with Mono entry

* Update THIRD-PARTY-NOTICES.TXT

Add additional notice for Mono

* Update THIRD-PARTY-NOTICES.TXT

Update the Novell MIT-specific license

* Update THIRD-PARTY-NOTICES.TXT

Group various patterns of Mono license together
2019-06-03 09:05:18 +02:00
Jay Krell 018940f1bc Remove W32_UPDATE_LAST_ERROR_RESTORE_POINT that is not used and does not make sense to me, as to when it would be useful, having preserved LastError around many code paths through the years. 2019-06-03 09:04:16 +02:00
Jay Krell c5a628e86f Do not change Win32 lasterror in the first MONO_EXIT_GC_SAFE. 2019-06-03 09:04:16 +02:00
Aleksey Kliger a7578081e1 [sdks] Bump Android NDK, build tools and platform tools versions
Try to match Xamarin.Android master

Build tools and Platform tools: https://github.com/xamarin/xamarin-android/blob/f9f5b6cd120484b13df74e94638e07411d8693fa/Configuration.props#L100-L102

NDK: https://github.com/xamarin/xamarin-android/blob/f9f5b6cd120484b13df74e94638e07411d8693fa/build-tools/scripts/Ndk.targets#L4
2019-06-03 09:02:07 +02:00
Rich Lander 7c6efec792 Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/new/master/mcs/class/System.Data/Test
2019-06-03 08:57:09 +02:00
Rich Lander 474f20c5ea Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/tree/61559965a188d03456d6f7840a0cdabdf35c2400/mcs/tools/sqlsharp
2019-06-03 08:56:48 +02:00
Marek Safar 33136e3601 Merge pull request #14754 from Dotnet-GitSync-Bot/mirror-merge-10213317
Mirror changes from mono/coreclr
2019-06-03 08:47:04 +02:00
dotnet-maestro 0cab992234 Update dependencies from https://github.com/dotnet/arcade build 20190601.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19301.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19301.2
2019-06-03 08:45:59 +02:00
Dan Moseley 0e1b88b8ed Improve fatal err msg (dotnet/coreclr#24390)
* Improve fatal err msg

* Match SO format

* a

* Remove dead define

* More adjustments to ex msg

* And PAL

* Remove special case for SOE

* Remove excess Debug.Assert newline

* Remove excess newline

* typo

* New format

* Remove DebugProvider redundancy

* Adjustments

* Remove preceding newline

* Make other SOE and OOM consistent

* Tidy up assertion msg

* Fix missing newline after inner exception divider

* CR when no inner exception

* ToString never CR terminated

* disable corefx tests temporarily

Signed-off-by: dotnet-bot <[email protected]>
2019-06-02 13:57:10 +00:00
Rich Lander e27cda23e0 Update THIRD-PARTY-NOTICES.TXT
Add usage link
2019-06-01 20:41:40 +02:00
Rich Lander 015560df3d Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/blob/0f9bb15622b649db81974057f66669674ea47923/mcs/class/I18N/tools/cvt.sh
2019-06-01 20:41:40 +02:00
Rich Lander 72dfea91df Update THIRD-PARTY-NOTICES.TXT
Add entry for https://github.com/mono/mono/blob/a34c9c79c07156797499b6ed2ce43c5897263b57/mono/benchmark/logic.cs
2019-06-01 20:40:57 +02:00
dotnet-maestro 860cb934ec Update dependencies from https://github.com/dotnet/arcade build 20190531.5
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19281.5
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19281.5
2019-06-01 20:40:09 +02:00
Zoltan Varga 7e0585fa35 [wasm] Add document with wasm feature requests. 2019-06-01 10:42:46 -05:00
Zoltan Varga b0d2edff27 [arm64] Set a llvm target layout. Assert in llvm if the target layout is not set, the defaults used by 'opt' are not correct. (#14714)
* [arm64] Set a llvm target layout. Assert in llvm if the target layout is not set, the defaults used by 'opt' are not correct.

* Add a llvm target layout for amd64.
2019-06-01 01:33:57 -04:00
Stephen Toub 7294bbc140 Fix FileStream.FlushAsync() to behave like Flush() (dotnet/coreclr#24902)
Flush() behaves like Flush(false) and writes out any buffered data but doesn't P/Invoke to FlushFileBuffers/FSync to flush the OS buffers.

But whereas FlushAsync() is supposed to just be an async equivalent of Flush(), it's actually behaving like Flush(true).  This makes FlushAsync() inconsistent and much more expensive.  (This is separate from FlushAsync not actually being async, which is an impactful problem to be solved separately.)

This changes FlushAsync to behave like Flush()/Flush(false) rather than Flush(true).  If someone wants the FlushFileBuffers/FSync behavior, they can call Flush(true).

Signed-off-by: dotnet-bot <[email protected]>
2019-06-01 07:11:46 +02:00
Alexis Christoforides 7300066faa [MacSDK] Properly handle PATHs with spaces during package post-install (#14735) 2019-05-31 20:49:10 -07:00
Kenneth Pouncey df402845f2 [wasm][bindings] Add support for marshaling DateTime and DateTimeOffset (#14722)
* Add support for marshalling DateTime and DateTimeOffset

* Add type checking to Runtime.GetDateValue

- Update to use clr ToUnixTimeMillisecons and FromUnixTimeMilliseonds to replace manual calculations.
- Moved magic numbers to managed side to address comments left by Katelyn and Jay.
2019-06-01 05:11:59 +02:00
Ryan Lucia 43aeac9e1e Propagate error in mono_file_map_error on posix (#14710) 2019-05-31 17:19:32 -04:00
Ryan Lucia 5d088cf0de [coop] Add GC safe transitions around blocking OS API calls (#14612)
If this was not possible due to them being called during runtime initialization, a short comment was left noting the specific reason why.

Fixes #14377

This includes a couple other random fixes I noticed on the way, most notably replacing SEE_MASK_FLAG_DDEWAIT with SEE_MASK_FLAG_NOASYNC as the former is deprecated.
2019-05-31 14:39:22 -04:00
Jo Shields 0f4ac3f13e Bump version to 6.5.0 (#14728) 2019-05-31 12:59:57 -04:00
lateralusX 0a6b13f83a Fix LLVM build break on Windows MSVC.
https://github.com/mono/mono/pull/14607 broke LLVM build on Windows MSVC.
This is just a quick fix falling back to old behavior on Windows MSVC. Since
all LLVM tools will be available in the same folder as mono runtime binary
there is no specific need to point out other build folders hosting LLVM tooling.
2019-05-29 12:09:59 +02:00
Jonathan Chambers 9de58a07c0 Don't try to access metadata for dynamic method added to non-dynamic image. Fixes issue #10201. 2018-08-20 16:51:18 -04:00
1456 changed files with 45338 additions and 20886 deletions

No files matched your search

+26 -24
View File
@@ -31,16 +31,16 @@
/external/bockbuild @akoeplinger @alexischr
/external/boringssl @baulig
/external/cecil @marek-safar @akoeplinger
/external/corefx @akoeplinger @marek-safar @egorbo @alexischr
/external/corert @akoeplinger @marek-safar @egorbo @alexischr
/external/corefx @akoeplinger @marek-safar @egorbo @steveisok
/external/corert @akoeplinger @marek-safar @egorbo @steveisok
/external/linker @marek-safar
/external/llvm @alexanderkyte @vargaz
/external/llvm @SamMonoRT @vargaz
/external/nuget-buildtasks @radical @akoeplinger
/external/roslyn-binaries @kg @marek-safar @akoeplinger
/external/roslyn-binaries @kg @marek-safar @akoeplinger @lewing
/libgc @BrzVlad @vargaz
/libgc @BrzVlad @vargaz @naricc
/llvm @vargaz @alexanderkyte
/llvm @vargaz @SamMonoRT
/man @marek-safar @miguel
/man/*prof* @alexrp
@@ -49,21 +49,21 @@
/mcs/build @marek-safar @akoeplinger
/mcs/class @marek-safar @akoeplinger
/mcs/class @steveisok @akoeplinger
/mcs/class/corlib/System.Reflection*/ @vargaz @lambdageek
/mcs/class/corlib/System.Security.Cryptography.X509Certificates @baulig @marek-safar
/mcs/class/Mono.Btls.Interface @bauligg @marek-safar
/mcs/class/corlib/System.Security.Cryptography.X509Certificates @baulig @steveisok
/mcs/class/Mono.Btls.Interface @baulig @steveisok
/mcs/class/Mono.Data.Tds @egorbo
/mcs/class/Mono.Debugger.Soft @vargaz @thaystg
/mcs/class/Mono.Options @jonpryor @marek-safar
/mcs/class/Mono.Profiler.Log @lambdageek
/mcs/class/Mono.Security/Mono.Security/Interface @baulig @marek-safar
/mcs/class/Mono.Security/Mono.Security/Interface @baulig @steveisok
/mcs/class/System/Mono.AppleTls @baulig @rolf
/mcs/class/System/Mono.Btls @baulig @marek-safar
/mcs/class/System/Mono.Net.Security @baulig @marek-safar
/mcs/class/System/Mono.Security.Interface @baulig @marek-safar
/mcs/class/System/System.Security.Cryptography.X509Certificates @baulig @marek-safar
/mcs/class/System.Data* @egorbo @marek-safar
/mcs/class/System/Mono.Btls @baulig @marek-safar
/mcs/class/System/Mono.Net.Security @baulig @steveisok
/mcs/class/System/Mono.Security.Interface @baulig @steveisok
/mcs/class/System/System.Security.Cryptography.X509Certificates @baulig @steveisok
/mcs/class/System.Data* @egorbo @steveisok
/mcs/errors @marek-safar @lewurm
/mcs/ilasm @marek-safar @lewurm
@@ -71,10 +71,10 @@
/mcs/mcs @marek-safar @lewurm
/mcs/tests @marek-safar @lewurm
/mcs/tools @marek-safar @akoeplinger
/mcs/tools @marek-safar @akoeplinger @steveisok
/mcs/tools/gensources @kg @akoeplinger
/mcs/tools/resx2sr @baulig
/mcs/tools/upload-to-sentry @alexanderkyte @akoeplinger
/mcs/tools/upload-to-sentry @directhex @akoeplinger
/mono/arch @vargaz @lewurm
@@ -82,18 +82,18 @@
/mono/dis @lambdageek @vargaz
/mono/eglib @vargaz @lambdageek
/mono/benchmark @alexanderkyte @lewurm
/mono/benchmark @SamMonoRT @lewurm
/mono/metadata @vargaz @lambdageek @thaystg
/mono/metadata/*profiler* @lambdageek
/mono/metadata/handle* @lambdageek @vargaz
/mono/metadata/monitor* @brzvlad @vargaz
/mono/metadata/sgen* @brzvlad @vargaz
/mono/metadata/sgen* @brzvlad @vargaz @naricc
/mono/metadata/thread* @lateralusX @lambdageek
/mono/metadata/w32* @lateralusX @lambdageek
/mono/metadata/*-win* @lateralusX @lambdageek
/mono/mini @vargaz @lewurm @lambdageek
/mono/mini @vargaz @lewurm @lambdageek @SamMonoRT
/mono/mini/*cfgdump* @lewurm @vargaz
/mono/mini/*exceptions* @lewurm @vargaz
/mono/mini/*ppc* @lewurm @vargaz
@@ -101,7 +101,7 @@
/mono/mini/*type-check* @lewurm @lambdageek
/mono/mini/interp/* @lewurm @BrzVlad
/mono/mini/*profiler* @alexrp @lambdageek
/mono/mini/debugger-agent.c @vargaz @thaystg @DavidKarlas
/mono/mini/debugger-agent.c @vargaz @thaystg @DavidKarlas @lambdageek
/mono/native @baulig @egorbo @alexischr @marek-safar
@@ -113,13 +113,15 @@
/mono/utils/atomic* @lewurm @vargaz
/mono/utils/mono-hwcap* @lewurm @vargaz
/mono/utils/mono-mem* @lewurm @vargaz
/mono/utils/mono-merp* @alexischr @lambdageek
/mono/utils/mono-state* @alexischr @lambdageek
/mono/utils/mono-threads* @lambdageek @vargaz
/mono/utils/*-win* @lateralusX @lambdageek
/msvc @lateralusX @kg @akoeplinger
/msvc/scripts @akoeplinger @kg
/netcore @marek-safar @akoeplinger @egorbo
/netcore @marek-safar @akoeplinger @egorbo @vargaz @steveisok
/packaging @alexischr @akoeplinger @directhex
/packaging/MacSDK/msbuild.py @radical @akoeplinger
@@ -133,7 +135,7 @@
/scripts @akoeplinger @directhex
/scripts/ci @akoeplinger @directhex
/sdks @marek-safar @lewurm @vargaz
/sdks @marek-safar @lewurm @vargaz @lambdageek
/sdks/builds/android* @alexischr @jonpryor
/sdks/builds/mxe* @alexischr @jonpryor
/sdks/builds/ios* @vargaz @rolfbjarne
@@ -149,4 +151,4 @@
/tools/nuget-hash-extractor @marek-safar @radical @akoeplinger
/tools/offsets-tool @lewurm @rolfbjarne
/tools/pedump @lambdageek @lewurm
/tools/sgen @brzvlad @vargaz
/tools/sgen @brzvlad @vargaz @naricc
+2 -1
View File
@@ -138,6 +138,7 @@ llvm/build/
llvm/usr/
sdks/builds/llvm-*/
sdks/builds/android-*/
mcs/build/compiler-server.log
##############################################################################
@@ -146,4 +147,4 @@ sdks/builds/android-*/
.packages
artifacts
.dotnet
.dotnet
+2 -1
View File
@@ -21,11 +21,12 @@ endif
if ENABLE_NETCORE
update_submodules =
SUBDIRS = mk llvm mono runtime netcore
else
update_submodules = update_submodules
SUBDIRS = $(build_with_msvc) mk po $(libgc_dir) llvm mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) $(build_without_msvc) $(docs_dir) acceptance-tests
endif
SUBDIRS = $(build_with_msvc) mk po $(libgc_dir) llvm mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) $(build_without_msvc) $(docs_dir) acceptance-tests
# Keep in sync with SUBDIRS
DIST_SUBDIRS = $(build_with_msvc) m4 mk po $(libgc_dir) llvm mono ikvm-native support data runtime scripts man samples tools $(build_without_msvc) docs acceptance-tests netcore
+4 -1
View File
@@ -30,7 +30,8 @@ The Mono project is part of the [.NET Foundation](https://www.dotnetfoundation.o
| Windows | i386 | [![windows-i386][17]][18] |
| CentOS | s390x (cs) | [![centos-s390x][19]][20] |
| Debian 9 | ppc64el (cs) | [![debian-9-ppc64el][21]][22]|
| AIX | ppc64 (cs) | [![aix-ppc64][23]][24] |
| AIX 6.1 | ppc64 (cs) | [![aix-ppc64][23]][24] |
| FreeBSD 12 | amd64 (cs) | [![freebsd-amd64][25]][26] |
_(cs) = community supported architecture_
@@ -58,6 +59,8 @@ _(cs) = community supported architecture_
[22]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-9-ppc64el
[23]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=aix-ppc64/badge/icon
[24]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=aix-ppc64
[25]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=freebsd-12-amd64/badge/icon
[26]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=freebsd-12-amd64
Compilation and Installation
============================
+172 -5
View File
@@ -1,18 +1,185 @@
Mono uses third-party libraries or other resources that may be
distributed under licenses different than the .NET Core software.
distributed under licenses different than the Mono software.
Attributions and license notices for test cases originally authored by
Attributions and license notices for test cases originally authored by
third parties can be found in the respective test directories.
In the event that we accidentally failed to list a required notice, please
In the event that we accidentally failed to list a required notice, please
bring it to our attention. Post an issue or email us:
[email protected]
The attached notices are provided for information only.
License notice for Apple
License notice for Mono
-----------------------
Note: multiple license notices are provided that occure in source code.
They are equivalent forms of the the MIT license from various copyright holders.
// Dual licensed under the terms of the MIT X11 or GNU GPL
// Copyright 2003-2011 Novell, Inc.
// Copyright 2011 Xamarin Inc
/**
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
* Copyright (C) 2012 Xamarin Inc
*
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
/******************************************************************************
* The MIT License
* Copyright (c) 2003 Novell Inc. www.novell.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the Software), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*******************************************************************************/
License notice for Apple
-------------------------
Content: https://github.com/mono/mono/blob/435f968102d0820ca65d63e1e741e4130b4d1303/support/ios/net/route.h
License: https://opensource.apple.com/apsl/
License for GCC
---------------
License: http://gcc.gnu.org/onlinedocs/gcc-4.6.4/libstdc++/manual/manual/license.html
Content: https://github.com/mono/mono/blob/c398e19d3515c6bbb6046ed014b2095594a15229/mono/mini
Example: https://github.com/mono/mono/blob/c398e19d3515c6bbb6046ed014b2095594a15229/mono/mini/decompose.c#L967
GCC RUNTIME LIBRARY EXCEPTION
Version 3.1, 31 March 2009
Copyright (C) 2009 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
This GCC Runtime Library Exception ("Exception") is an additional
permission under section 7 of the GNU General Public License, version
3 ("GPLv3"). It applies to a given file (the "Runtime Library") that
bears a notice placed by the copyright holder of the file stating that
the file is governed by GPLv3 along with this Exception.
When you use GCC to compile a program, GCC may combine portions of
certain GCC header files and runtime libraries with the compiled
program. The purpose of this Exception is to allow compilation of
non-GPL (including proprietary) programs to use, in this way, the
header files and runtime libraries covered by this Exception.
0. Definitions.
A file is an "Independent Module" if it either requires the Runtime
Library for execution after a Compilation Process, or makes use of an
interface provided by the Runtime Library, but is not otherwise based
on the Runtime Library.
"GCC" means a version of the GNU Compiler Collection, with or without
modifications, governed by version 3 (or a specified later version) of
the GNU General Public License (GPL) with the option of using any
subsequent versions published by the FSF.
"GPL-compatible Software" is software whose conditions of propagation,
modification and use would permit combination with GCC in accord with
the license of GCC.
"Target Code" refers to output from any compiler for a real or virtual
target processor architecture, in executable form or suitable for
input to an assembler, loader, linker and/or execution
phase. Notwithstanding that, Target Code does not include data in any
format that is used as a compiler intermediate representation, or used
for producing a compiler intermediate representation.
The "Compilation Process" transforms code entirely represented in
non-intermediate languages designed for human-written code, and/or in
Java Virtual Machine byte code, into Target Code. Thus, for example,
use of source code generators and preprocessors need not be considered
part of the Compilation Process, since the Compilation Process can be
understood as starting with the output of the generators or
preprocessors.
A Compilation Process is "Eligible" if it is done using GCC, alone or
with other GPL-compatible software, or if it is done without using any
work based on GCC. For example, using non-GPL-compatible Software to
optimize any GCC intermediate representations would not qualify as an
Eligible Compilation Process.
1. Grant of Additional Permission.
You have permission to propagate a work of Target Code formed by
combining the Runtime Library with Independent Modules, even if such
propagation would otherwise violate the terms of GPLv3, provided that
all Target Code was generated by Eligible Compilation Processes. You
may then convey such a combination under terms of your choice,
consistent with the licensing of the Independent Modules.
2. No Weakening of GCC Copyleft.
The availability of this Exception does not imply any general
presumption that third-party software is unaffected by the copyleft
requirements of the license of GCC.
Hopefully that text is self-explanatory. If it isn't, you need to speak to your lawyer, or the Free Software Foundation.
License notice for Silicon Graphics and HP
------------------------------------------
/*
* Copyright (c) 1996-1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* Copyright (c) 2002
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
/*
* This implements standard-conforming allocators that interact with
* the garbage collector. Gc_alloctor<T> allocates garbage-collectable
* objects of type T. Traceable_allocator<T> allocates objects that
* are not temselves garbage collected, but are scanned by the
* collector for pointers to collectable objects. Traceable_alloc
* should be used for explicitly managed STL containers that may
* point to collectable objects.
*
* This code was derived from an earlier version of the GNU C++ standard
* library, which itself was derived from the SGI STL implementation.
*/
Content: https://github.com/mono/mono/blob/d58dfa185af1d48fb93efdef1d046762f214f0a7/libgc/include/gc_allocator.h
+1 -1
View File
@@ -2,7 +2,7 @@
{
"name": "roslyn",
"url": "git://github.com/mono/roslyn.git",
"rev": "13a40eedacc799a78710aba5c8e4b2dcc80a7e61",
"rev": "6bfcd4e770609a38b8523e83ce1ec943162f30bb",
"remote-branch": "origin/mono-testing",
"branch": "mono-testing",
"directory": "roslyn"
+94 -86
View File
@@ -574,6 +574,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ilasm", "mcs/ilasm/ilasm.cs
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "al", "mcs/tools/al/al.csproj", "{0A20671F-CCA9-457D-886C-0828C7D64128}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "aprofutil", "mcs/tools/aprofutil/aprofutil.csproj", "{658B566B-CED1-4C42-9926-C1AA930BA368}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "monolinker", "mcs/tools/linker/monolinker.csproj", "{D60432F1-3C12-4235-A1CC-4CA5575403BD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "culevel", "mcs/tools/culevel/culevel.csproj", "{E8E246BD-CD0C-4734-A3C2-7F44796EC47B}"
@@ -1534,10 +1536,8 @@ Global
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Debug|unreal.Build.0 = Debug|unreal
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Release|unreal.ActiveCfg = Release|unreal
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Release|unreal.Build.0 = Release|unreal
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Debug|wasm.ActiveCfg = Debug|wasm
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Debug|wasm.Build.0 = Debug|wasm
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Release|wasm.ActiveCfg = Release|wasm
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Release|wasm.Build.0 = Release|wasm
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Debug|wasm.ActiveCfg = Debug|net_4_x
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Release|wasm.ActiveCfg = Release|net_4_x
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Debug|winaot.ActiveCfg = Debug|winaot
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Debug|winaot.Build.0 = Debug|winaot
{2281525D-7F2E-41C1-982F-E612AF3ECF61}.Release|winaot.ActiveCfg = Release|winaot
@@ -1662,10 +1662,8 @@ Global
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Debug|unreal.Build.0 = Debug|unreal
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Release|unreal.ActiveCfg = Release|unreal
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Release|unreal.Build.0 = Release|unreal
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Debug|wasm.ActiveCfg = Debug|wasm
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Debug|wasm.Build.0 = Debug|wasm
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Release|wasm.ActiveCfg = Release|wasm
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Release|wasm.Build.0 = Release|wasm
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Debug|wasm.ActiveCfg = Debug|net_4_x
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Release|wasm.ActiveCfg = Release|net_4_x
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Debug|winaot.ActiveCfg = Debug|winaot
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Debug|winaot.Build.0 = Debug|winaot
{7395C26D-7C2A-4F7F-AB7D-CE0B50BDFF38}.Release|winaot.ActiveCfg = Release|winaot
@@ -2212,10 +2210,8 @@ Global
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Debug|unreal.Build.0 = Debug|unreal
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Release|unreal.ActiveCfg = Release|unreal
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Release|unreal.Build.0 = Release|unreal
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Debug|wasm.ActiveCfg = Debug|wasm
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Debug|wasm.Build.0 = Debug|wasm
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Release|wasm.ActiveCfg = Release|wasm
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Release|wasm.Build.0 = Release|wasm
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Debug|wasm.ActiveCfg = Debug|net_4_x
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Release|wasm.ActiveCfg = Release|net_4_x
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Debug|winaot.ActiveCfg = Debug|winaot
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Debug|winaot.Build.0 = Debug|winaot
{2401CC34-7A55-4EC4-B8BF-6E846245F5FE}.Release|winaot.ActiveCfg = Release|winaot
@@ -2274,10 +2270,8 @@ Global
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Debug|unreal.Build.0 = Debug|unreal
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Release|unreal.ActiveCfg = Release|unreal
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Release|unreal.Build.0 = Release|unreal
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Debug|wasm.ActiveCfg = Debug|wasm
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Debug|wasm.Build.0 = Debug|wasm
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Release|wasm.ActiveCfg = Release|wasm
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Release|wasm.Build.0 = Release|wasm
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Debug|wasm.ActiveCfg = Debug|net_4_x
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Release|wasm.ActiveCfg = Release|net_4_x
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Debug|winaot.ActiveCfg = Debug|winaot
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Debug|winaot.Build.0 = Debug|winaot
{89CDEBFC-EF90-4437-9D6B-439277F2C7E5}.Release|winaot.ActiveCfg = Release|winaot
@@ -2380,10 +2374,8 @@ Global
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Debug|unreal.Build.0 = Debug|unreal
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Release|unreal.ActiveCfg = Release|unreal
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Release|unreal.Build.0 = Release|unreal
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Debug|wasm.ActiveCfg = Debug|wasm
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Debug|wasm.Build.0 = Debug|wasm
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Release|wasm.ActiveCfg = Release|wasm
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Release|wasm.Build.0 = Release|wasm
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Debug|wasm.ActiveCfg = Debug|net_4_x
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Release|wasm.ActiveCfg = Release|net_4_x
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Debug|winaot.ActiveCfg = Debug|winaot
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Debug|winaot.Build.0 = Debug|winaot
{182E5AD7-2F59-48E5-B338-C515733AE79B}.Release|winaot.ActiveCfg = Release|winaot
@@ -2574,10 +2566,8 @@ Global
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Debug|unreal.Build.0 = Debug|unreal
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Release|unreal.ActiveCfg = Release|unreal
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Release|unreal.Build.0 = Release|unreal
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Debug|wasm.ActiveCfg = Debug|wasm
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Debug|wasm.Build.0 = Debug|wasm
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Release|wasm.ActiveCfg = Release|wasm
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Release|wasm.Build.0 = Release|wasm
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Debug|wasm.ActiveCfg = Debug|net_4_x
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Release|wasm.ActiveCfg = Release|net_4_x
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Debug|winaot.ActiveCfg = Debug|winaot
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Debug|winaot.Build.0 = Debug|winaot
{B6102416-28B0-44C3-88A6-84B8C6B5E7EF}.Release|winaot.ActiveCfg = Release|winaot
@@ -3642,10 +3632,8 @@ Global
{49AC287E-29E1-4683-98B8-6E65DA581854}.Debug|unreal.Build.0 = Debug|unreal
{49AC287E-29E1-4683-98B8-6E65DA581854}.Release|unreal.ActiveCfg = Release|unreal
{49AC287E-29E1-4683-98B8-6E65DA581854}.Release|unreal.Build.0 = Release|unreal
{49AC287E-29E1-4683-98B8-6E65DA581854}.Debug|wasm.ActiveCfg = Debug|wasm
{49AC287E-29E1-4683-98B8-6E65DA581854}.Debug|wasm.Build.0 = Debug|wasm
{49AC287E-29E1-4683-98B8-6E65DA581854}.Release|wasm.ActiveCfg = Release|wasm
{49AC287E-29E1-4683-98B8-6E65DA581854}.Release|wasm.Build.0 = Release|wasm
{49AC287E-29E1-4683-98B8-6E65DA581854}.Debug|wasm.ActiveCfg = Debug|net_4_x
{49AC287E-29E1-4683-98B8-6E65DA581854}.Release|wasm.ActiveCfg = Release|net_4_x
{49AC287E-29E1-4683-98B8-6E65DA581854}.Debug|winaot.ActiveCfg = Debug|winaot
{49AC287E-29E1-4683-98B8-6E65DA581854}.Debug|winaot.Build.0 = Debug|winaot
{49AC287E-29E1-4683-98B8-6E65DA581854}.Release|winaot.ActiveCfg = Release|winaot
@@ -3968,10 +3956,8 @@ Global
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Debug|unreal.Build.0 = Debug|unreal
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Release|unreal.ActiveCfg = Release|unreal
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Release|unreal.Build.0 = Release|unreal
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Debug|wasm.ActiveCfg = Debug|wasm
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Debug|wasm.Build.0 = Debug|wasm
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Release|wasm.ActiveCfg = Release|wasm
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Release|wasm.Build.0 = Release|wasm
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Debug|wasm.ActiveCfg = Debug|net_4_x
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Release|wasm.ActiveCfg = Release|net_4_x
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Debug|winaot.ActiveCfg = Debug|winaot
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Debug|winaot.Build.0 = Debug|winaot
{B949A52E-3240-4BD3-B57B-89C78D9EB9D4}.Release|winaot.ActiveCfg = Release|winaot
@@ -4028,24 +4014,42 @@ Global
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|net_4_x.Build.0 = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|net_4_x.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|net_4_x.Build.0 = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monodroid.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|orbis.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|orbis.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|unreal.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|unreal.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|wasm.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|wasm.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|winaot.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|winaot.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|xammac.ActiveCfg = Debug|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|xammac.ActiveCfg = Release|net_4_x
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monodroid.ActiveCfg = Debug|monodroid
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monodroid.Build.0 = Debug|monodroid
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monodroid.ActiveCfg = Release|monodroid
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monodroid.Build.0 = Release|monodroid
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch.ActiveCfg = Debug|monotouch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch.Build.0 = Debug|monotouch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch.ActiveCfg = Release|monotouch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch.Build.0 = Release|monotouch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch_tv.ActiveCfg = Debug|monotouch_tv
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch_tv.Build.0 = Debug|monotouch_tv
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch_tv.ActiveCfg = Release|monotouch_tv
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch_tv.Build.0 = Release|monotouch_tv
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch_watch.ActiveCfg = Debug|monotouch_watch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|monotouch_watch.Build.0 = Debug|monotouch_watch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch_watch.ActiveCfg = Release|monotouch_watch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|monotouch_watch.Build.0 = Release|monotouch_watch
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|orbis.ActiveCfg = Debug|orbis
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|orbis.Build.0 = Debug|orbis
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|orbis.ActiveCfg = Release|orbis
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|orbis.Build.0 = Release|orbis
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|unreal.ActiveCfg = Debug|unreal
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|unreal.Build.0 = Debug|unreal
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|unreal.ActiveCfg = Release|unreal
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|unreal.Build.0 = Release|unreal
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|wasm.ActiveCfg = Debug|wasm
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|wasm.Build.0 = Debug|wasm
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|wasm.ActiveCfg = Release|wasm
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|wasm.Build.0 = Release|wasm
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|winaot.ActiveCfg = Debug|winaot
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|winaot.Build.0 = Debug|winaot
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|winaot.ActiveCfg = Release|winaot
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|winaot.Build.0 = Release|winaot
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|xammac.ActiveCfg = Debug|xammac
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Debug|xammac.Build.0 = Debug|xammac
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|xammac.ActiveCfg = Release|xammac
{AC3AC4DA-7C10-4AE9-A131-6DBBE61432E3}.Release|xammac.Build.0 = Release|xammac
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|net_4_x.Build.0 = Debug|net_4_x
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|net_4_x.ActiveCfg = Release|net_4_x
@@ -4074,10 +4078,8 @@ Global
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|unreal.Build.0 = Debug|unreal
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|unreal.ActiveCfg = Release|unreal
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|unreal.Build.0 = Release|unreal
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|wasm.ActiveCfg = Debug|wasm
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|wasm.Build.0 = Debug|wasm
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|wasm.ActiveCfg = Release|wasm
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|wasm.Build.0 = Release|wasm
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|wasm.ActiveCfg = Debug|net_4_x
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|wasm.ActiveCfg = Release|net_4_x
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|winaot.ActiveCfg = Debug|winaot
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Debug|winaot.Build.0 = Debug|winaot
{7C660E7A-C89B-4ACA-9458-492B6D14B168}.Release|winaot.ActiveCfg = Release|winaot
@@ -4198,10 +4200,8 @@ Global
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Debug|unreal.Build.0 = Debug|unreal
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Release|unreal.ActiveCfg = Release|unreal
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Release|unreal.Build.0 = Release|unreal
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Debug|wasm.ActiveCfg = Debug|wasm
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Debug|wasm.Build.0 = Debug|wasm
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Release|wasm.ActiveCfg = Release|wasm
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Release|wasm.Build.0 = Release|wasm
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Debug|wasm.ActiveCfg = Debug|net_4_x
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Release|wasm.ActiveCfg = Release|net_4_x
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Debug|winaot.ActiveCfg = Debug|winaot
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Debug|winaot.Build.0 = Debug|winaot
{7B3EB110-1E57-4CA0-B65B-DB51B7F95D4D}.Release|winaot.ActiveCfg = Release|winaot
@@ -4238,10 +4238,8 @@ Global
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Debug|unreal.Build.0 = Debug|unreal
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Release|unreal.ActiveCfg = Release|unreal
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Release|unreal.Build.0 = Release|unreal
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Debug|wasm.ActiveCfg = Debug|wasm
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Debug|wasm.Build.0 = Debug|wasm
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Release|wasm.ActiveCfg = Release|wasm
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Release|wasm.Build.0 = Release|wasm
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Debug|wasm.ActiveCfg = Debug|net_4_x
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Release|wasm.ActiveCfg = Release|net_4_x
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Debug|winaot.ActiveCfg = Debug|winaot
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Debug|winaot.Build.0 = Debug|winaot
{E161C076-8631-4D5D-96BD-2B2FB2CEE76D}.Release|winaot.ActiveCfg = Release|winaot
@@ -4498,10 +4496,8 @@ Global
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Debug|unreal.Build.0 = Debug|unreal
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Release|unreal.ActiveCfg = Release|unreal
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Release|unreal.Build.0 = Release|unreal
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Debug|wasm.ActiveCfg = Debug|wasm
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Debug|wasm.Build.0 = Debug|wasm
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Release|wasm.ActiveCfg = Release|wasm
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Release|wasm.Build.0 = Release|wasm
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Debug|wasm.ActiveCfg = Debug|net_4_x
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Release|wasm.ActiveCfg = Release|net_4_x
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Debug|winaot.ActiveCfg = Debug|winaot
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Debug|winaot.Build.0 = Debug|winaot
{0F4B1E4B-86CA-43CE-B773-BD942E71B990}.Release|winaot.ActiveCfg = Release|winaot
@@ -6016,10 +6012,8 @@ Global
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Debug|unreal.Build.0 = Debug|unreal
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Release|unreal.ActiveCfg = Release|unreal
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Release|unreal.Build.0 = Release|unreal
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Debug|wasm.ActiveCfg = Debug|wasm
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Debug|wasm.Build.0 = Debug|wasm
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Release|wasm.ActiveCfg = Release|wasm
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Release|wasm.Build.0 = Release|wasm
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Debug|wasm.ActiveCfg = Debug|net_4_x
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Release|wasm.ActiveCfg = Release|net_4_x
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Debug|winaot.ActiveCfg = Debug|winaot
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Debug|winaot.Build.0 = Debug|winaot
{7D51E040-A2D0-4F86-9B1F-C010AB99396B}.Release|winaot.ActiveCfg = Release|winaot
@@ -6056,10 +6050,8 @@ Global
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Debug|unreal.Build.0 = Debug|unreal
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Release|unreal.ActiveCfg = Release|unreal
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Release|unreal.Build.0 = Release|unreal
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Debug|wasm.ActiveCfg = Debug|wasm
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Debug|wasm.Build.0 = Debug|wasm
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Release|wasm.ActiveCfg = Release|wasm
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Release|wasm.Build.0 = Release|wasm
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Debug|wasm.ActiveCfg = Debug|net_4_x
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Release|wasm.ActiveCfg = Release|net_4_x
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Debug|winaot.ActiveCfg = Debug|winaot
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Debug|winaot.Build.0 = Debug|winaot
{6E922C6D-E914-45AD-A5E0-4DCC6CB8C469}.Release|winaot.ActiveCfg = Release|winaot
@@ -6536,10 +6528,8 @@ Global
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Debug|unreal.Build.0 = Debug|unreal
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Release|unreal.ActiveCfg = Release|unreal
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Release|unreal.Build.0 = Release|unreal
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Debug|wasm.ActiveCfg = Debug|wasm
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Debug|wasm.Build.0 = Debug|wasm
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Release|wasm.ActiveCfg = Release|wasm
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Release|wasm.Build.0 = Release|wasm
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Debug|wasm.ActiveCfg = Debug|net_4_x
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Release|wasm.ActiveCfg = Release|net_4_x
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Debug|winaot.ActiveCfg = Debug|winaot
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Debug|winaot.Build.0 = Debug|winaot
{7EC5DC98-75BE-44FB-9D99-056044EC18BD}.Release|winaot.ActiveCfg = Release|winaot
@@ -6576,10 +6566,8 @@ Global
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Debug|unreal.Build.0 = Debug|unreal
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Release|unreal.ActiveCfg = Release|unreal
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Release|unreal.Build.0 = Release|unreal
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Debug|wasm.ActiveCfg = Debug|wasm
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Debug|wasm.Build.0 = Debug|wasm
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Release|wasm.ActiveCfg = Release|wasm
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Release|wasm.Build.0 = Release|wasm
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Debug|wasm.ActiveCfg = Debug|net_4_x
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Release|wasm.ActiveCfg = Release|net_4_x
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Debug|winaot.ActiveCfg = Debug|winaot
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Debug|winaot.Build.0 = Debug|winaot
{7B87655B-F9BB-48FB-88FF-CB92582C4F89}.Release|winaot.ActiveCfg = Release|winaot
@@ -9856,10 +9844,8 @@ Global
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Debug|unreal.Build.0 = Debug|unreal
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Release|unreal.ActiveCfg = Release|unreal
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Release|unreal.Build.0 = Release|unreal
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Debug|wasm.ActiveCfg = Debug|wasm
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Debug|wasm.Build.0 = Debug|wasm
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Release|wasm.ActiveCfg = Release|wasm
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Release|wasm.Build.0 = Release|wasm
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Debug|wasm.ActiveCfg = Debug|net_4_x
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Release|wasm.ActiveCfg = Release|net_4_x
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Debug|winaot.ActiveCfg = Debug|winaot
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Debug|winaot.Build.0 = Debug|winaot
{4F62F70F-FD2B-45E5-8A62-9ABFB6A29FC5}.Release|winaot.ActiveCfg = Release|winaot
@@ -10134,6 +10120,28 @@ Global
{0A20671F-CCA9-457D-886C-0828C7D64128}.Release|winaot.ActiveCfg = Release|net_4_x
{0A20671F-CCA9-457D-886C-0828C7D64128}.Debug|xammac.ActiveCfg = Debug|net_4_x
{0A20671F-CCA9-457D-886C-0828C7D64128}.Release|xammac.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|net_4_x.Build.0 = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|net_4_x.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|net_4_x.Build.0 = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|monodroid.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|monotouch.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|orbis.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|orbis.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|unreal.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|unreal.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|wasm.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|wasm.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|winaot.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|winaot.ActiveCfg = Release|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Debug|xammac.ActiveCfg = Debug|net_4_x
{658B566B-CED1-4C42-9926-C1AA930BA368}.Release|xammac.ActiveCfg = Release|net_4_x
{D60432F1-3C12-4235-A1CC-4CA5575403BD}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{D60432F1-3C12-4235-A1CC-4CA5575403BD}.Debug|net_4_x.Build.0 = Debug|net_4_x
{D60432F1-3C12-4235-A1CC-4CA5575403BD}.Release|net_4_x.ActiveCfg = Release|net_4_x
+353 -115
View File
@@ -4,7 +4,7 @@
# This line is parsed by tools besides autoconf, such as msvc/mono.winconfig.targets.
# It should remain in the format they expect.
#
AC_INIT(mono, [6.4.0],
AC_INIT(mono, [6.6.0],
[https://github.com/mono/mono/issues/new])
AC_CONFIG_SRCDIR([README.md])
@@ -62,7 +62,7 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
# This line is parsed by tools besides autoconf, such as msvc/mono.winconfig.targets.
# It should remain in the format they expect.
#
MONO_CORLIB_VERSION=62731146-81CF-4D61-826D-9A8DDED14432
MONO_CORLIB_VERSION=A144A63D-652C-4CCF-A9EE-8E5A091547F1
#
# Put a quoted #define in config.h.
@@ -142,7 +142,6 @@ case "$host" in
wasm32*)
CFLAGS="$CFLAGS -D_REENTRANT -D_GNU_SOURCE -s WASM=1"
CPPFLAGS="$CPPFLAGS -D_REENTRANT -DUSE_MMAP -s WASM=1"
libdl="-ldl"
libgc_threads=pthreads
platform_wasm=yes
;;
@@ -181,7 +180,6 @@ case "$host" in
LDFLAGS="$LDFLAGS $WIN32_LDFLAGS"
libmono_cflags="-mms-bitfields -mwindows"
libmono_ldflags="-mms-bitfields -mwindows"
libdl=
libgc_threads=win32
with_sigaltstack=no
with_tls=pthread
@@ -198,7 +196,6 @@ case "$host" in
CPPFLAGS="$CPPFLAGS -DHOST_BSD"
libmono_ldflags="-pthread"
need_link_unlink=yes
libdl="-ldl"
libgc_threads=pthreads
with_sigaltstack=no
use_sigposix=yes
@@ -208,7 +205,6 @@ case "$host" in
CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP -DTHREAD_LOCAL_ALLOC -pthread"
libmono_cflags="-D_REENTRANT -DTHREAD_LOCAL_ALLOC -pthread"
libmono_ldflags="-lpthread -pthread"
libdl="-ldl"
libgc_threads=pthreads
need_link_unlink=yes
with_sigaltstack=no
@@ -235,7 +231,6 @@ case "$host" in
CPPFLAGS="$CPPFLAGS -DHOST_BSD -D_WITH_GETLINE"
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID, 1, [pthread is a pointer])
libdl=
libgc_threads=pthreads
use_sigposix=yes
has_dtrace=yes
@@ -261,7 +256,6 @@ case "$host" in
LDFLAGS="$LDFLAGS -pthread"
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID)
libdl=
libgc_threads=pthreads
with_tls=pthread
with_sigaltstack=no
@@ -278,7 +272,6 @@ case "$host" in
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
fi
libmono_cflags="-D_REENTRANT"
libdl="-ldl"
libgc_threads=pthreads
use_sigposix=yes
@@ -299,6 +292,12 @@ case "$host" in
CFLAGS="$CFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
CXXFLAGS="$CXXFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
# FIXME? Only if __ANDROID_API__ < 24?
# FILE32API means "long", which is stuck at 32bits for 32bit ABI (64bits for 64bit ABI).
# ABI 24 introduces the "o" for "file offset" variations, which can be widened to 64bits for 32bit ABI (and still 64bits for 64bit).
# Android itself uses FILE32API, and mono should use system zlib on Android anyway.
ZLIB_CFLAGS="$ZLIB_CFLAGS -DUSE_FILE32API"
# to bypass the underscore linker check, can't work when cross-compiling
mono_cv_uscore=yes
mono_cv_clang=no
@@ -310,7 +309,6 @@ case "$host" in
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
fi
libmono_cflags="-D_REENTRANT"
libdl="-ldl"
libgc_threads=pthreads
CORETARGETS="-p:TargetsUnix=true"
use_sigposix=yes
@@ -405,7 +403,6 @@ case "$host" in
AC_DEFINE(PTHREAD_POINTER_ID)
AC_DEFINE(USE_MACH_SEMA, 1, [...])
CORETARGETS="-p:TargetsUnix=true -p:TargetsOSX=true"
libdl=
libgc_threads=pthreads
has_dtrace=yes
if test "x$cross_compiling" = "xyes"; then
@@ -447,7 +444,6 @@ case "$host" in
dnl BSD_SOURCE is for getifaddrs
CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE -D_REENTRANT -D_THREAD_SAFE"
libmono_cflags="-D_REENTRANT -D_THREAD_SAFE"
libdl=
LIBS="$LIBS -lnetwork -ltextencoding"
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID)
@@ -470,22 +466,64 @@ case "$host" in
mono_cv_clang=no
;;
*-*-aix*|*-*-os400*)
dnl Set up a 64-bit build
dnl IMPORTANT: For svr4 sonames on AIX, you should set
dnl `OBJECT_MODE=64` when configuring.
dnl libtool cannot generate functioning svr4 sonames on
dnl 64-bit without it.
dnl Unfortunately, everything is complicated by the fact that
dnl gcc doesn't respect this variable. (otherwise we could set
dnl it for build time for configure and make)
dnl On IBM i PASE using IBM's packages, GCC *does* respect this
dnl variable, and builds are 64-bit by default. svr4 sonames
dnl must still be specified when configuring on i, however.
dnl As such, because Mono doesn't support 32-bit AIX or PASE,
dnl set up a 64-bit build (assming GCC; XLC not supported)
dnl regardless of what variable is used.
case $host_os in
aix*)
if test "x$OBJECT_MODE" = "x64" && test "x$CC" = "x" && test "x$CXX" = "x"; then
dnl HACK: Set -maix64 at the GCC invocation
dnl level explicitly to work around the fact
dnl GCC in default maix32 mode explodes when
dnl binutils respects OBJECT_MODE.
dnl When that check occurs, flags are not
dnl passed to to the compiler, so GCC has no
dnl chance to change its mode.
dnl Otherwise, it may enter a state where it
dnl runs, but uses the libtool "compile"
dnl wrapper, which subtly breaks other things.
dnl This should propagate to all uses of CC.
dnl This is only set if not manually set.
CC="gcc -maix64"
CXX="g++ -maix64"
echo
fi
;;
dnl Not needed on i because it defaults to 64-bit and
dnl has a GCC smart enough to respect OBJECT_MODE.
esac
dnl We still set this for *FLAGS, however, because we may not
dnl be setting OBJECT_MODE.
LDFLAGS="$LDFLAGS -maix64"
CPPFLAGS="$CPPFLAGS -maix64 -DGC_AIX_THREADS -D_ALL_SOURCE -D_THREAD_SAFE -D_LARGE_FILES -D_REENTRANT"
LDFLAGS="-maix64"
libmono_cflags="-D_THREAD_SAFE -D_REENTRANT"
dnl Would you believe GNU nm doesn't know how to process AIX libraries?
dnl Hardcode IBM binutils in case GNU ones end up on our path. Also
dnl specifiy 64-bit mode for tools.
dnl specifiy 64-bit mode for tools. (OBJECT_MODE is finicky with cmake.)
dnl XXX: We should stop the hardcoding madness
AR="/usr/bin/ar -X64"
NM="/usr/bin/nm -X64"
STRIP="/usr/bin/strip -X64"
RANLIB="/usr/bin/ranlib -X64"
dnl SGen is the future (changes to Boehm support code would be
dnl required if you wish to re-enable Boehm)
support_boehm=no
with_gc=sgen
need_link_unlink=yes
use_sigposix=yes
dnl the valloc call to alloc the guard page bombs out, even with extending the data area
dnl Similar limitation to macOS about the first thread and the
dnl guard page, except sometimes the runtime hangs. Disable for
dnl now until cause can be determined or it seems OK enough.
with_sigaltstack=no
dnl use pthread TLS, __thread has issues with the compiler flags we use
with_tls=pthread
@@ -496,7 +534,6 @@ case "$host" in
;;
*)
AC_MSG_WARN([*** Please add $host to configure.ac checks!])
libdl="-ldl"
;;
esac
@@ -628,8 +665,16 @@ AC_PROG_LD_GNU
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h sys/sysctl.h libproc.h sys/prctl.h copyfile.h)
AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h complex.h unwind.h)
AC_CHECK_HEADER(unistd.h, [HAVE_UNISTD_H=1], [HAVE_UNISTD_H=0])
# zlib/configure checks for unistd.h existance and defines HAVE_UNISTD_H on the compiler
# command line (not config.h) if it is present.
AC_CHECK_HEADER(unistd.h,
[HAVE_UNISTD_H=1
ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_UNISTD_H"],
[HAVE_UNISTD_H=0])
AC_SUBST(HAVE_UNISTD_H)
AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],
[], [], [#include <stddef.h>
#include <sys/socket.h>
@@ -644,34 +689,53 @@ AC_CHECK_HEADERS(sys/user.h, [], [],
AC_CHECK_HEADERS(linux/serial.h)
AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
if test x$have_zlib = xyes; then
AC_TRY_COMPILE([#include <zlib.h>], [
#if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
#else
#error No good zlib found
#endif
],[
AC_MSG_RESULT(Using system zlib)
zlib_msg="system zlib"
AC_DEFINE(HAVE_SYS_ZLIB,1,[Have system zlib])
],[
AC_MSG_RESULT(Using embedded zlib)
have_zlib=no
zlib_msg="bundled zlib"
])
fi
case "$host" in
# Use bundled zlib on Windows to be sure it is static.
*-mingw*|*-cygwin*)
have_sys_zlib=no
zlib_msg="bundled zlib"
;;
*)
AC_CHECK_HEADER(zlib.h, [have_sys_zlib=yes], [have_sys_zlib=no])
if test x$have_sys_zlib = xyes; then
AC_TRY_COMPILE([#include <zlib.h>], [
#if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
#else
#error No good zlib found
#endif
],[
AC_MSG_RESULT(Using system zlib)
zlib_msg="system zlib"
have_sys_zlib=yes
],[
AC_MSG_RESULT(zlib too old, using embedded zlib)
have_sys_zlib=no
zlib_msg="bundled zlib"
])
else
AC_MSG_RESULT(zlib not found, using embedded zlib)
have_sys_zlib=no
zlib_msg="bundled zlib"
fi
;;
esac
AC_ARG_WITH(static-zlib, [ --with-static-zlib=PATH use the specified static zlib instead of -lz],[STATIC_ZLIB_PATH=$with_static_zlib],[STATIC_ZLIB_PATH=])
if test "x$STATIC_ZLIB_PATH" != "x"; then
have_static_zlib=yes
have_sys_zlib=no
zlib_msg="static zlib from $STATIC_ZLIB_PATH"
AC_SUBST(STATIC_ZLIB_PATH)
fi
AM_CONDITIONAL(HAVE_STATIC_ZLIB, test x$have_static_zlib = xyes)
AM_CONDITIONAL(HAVE_ZLIB, test x$have_zlib = xyes)
AC_DEFINE(HAVE_ZLIB,1,[Have system zlib])
AM_CONDITIONAL(HAVE_SYS_ZLIB, test x$have_sys_zlib = xyes)
if test x$have_static_zlib = xyes; then
AC_DEFINE(HAVE_STATIC_ZLIB, 1, [Use static zlib])
fi
if test x$have_sys_zlib = xyes; then
AC_DEFINE(HAVE_SYS_ZLIB, 1, [Use OS-provided zlib])
fi
# for mono/metadata/debug-symfile.c
AC_CHECK_HEADERS(elf.h)
@@ -1192,12 +1256,13 @@ AC_ARG_WITH(testing_aot_full_interp, [ --with-testing_aot_full_interp=yes,no
AC_ARG_WITH(testing_aot_hybrid, [ --with-testing_aot_hybrid=yes,no If you want to build the testing_aot_hybrid assemblies (defaults to no)], [], [with_testing_aot_hybrid=default])
AC_ARG_WITH(testing_aot_full, [ --with-testing_aot_full=yes,no If you want to build the testing_aot_full assemblies (defaults to no)], [], [with_testing_aot_full=default])
AC_ARG_WITH(winaot, [ --with-winaot=yes,no If you want to build the Windows friendly AOT assemblies (defaults to no)], [], [with_winaot=default])
AC_ARG_WITH(testing_winaot_interp, [ --with-testing_winaot_interp=yes,no If you want to build the Windows friendly AOT + Interpreter testing assemblies (defaults to no)], [], [with_testing_winaot_interp=default])
AC_ARG_WITH(orbis, [ --with-orbis=yes,no If you want to build the Orbis assemblies (defaults to no)], [], [with_orbis=default])
AC_ARG_WITH(unreal, [ --with-unreal=yes,no If you want to build the Unreal assemblies (defaults to no)], [], [with_unreal=default])
AC_ARG_WITH(wasm, [ --with-wasm=yes,no If you want to build the WebAssembly (defaults to no)], [], [with_wasm=default])
AC_ARG_WITH(runtime-preset, [ --with-runtime-preset=net_4_x,all,aot,aot_llvm,hybridaot,hybridaot_llvm,fullaot,fullaot_llvm,winaot,winaot_llvm,bitcode,bitcodeinterp,unreal,fullaotinterp,fullaotinterp_llvm Which default profile to build (defaults to net_4_x)], [], [with_runtime_preset=net_4_x])
AC_ARG_WITH(runtime-preset, [ --with-runtime-preset=net_4_x,all,aot,aot_llvm,hybridaot,hybridaot_llvm,fullaot,fullaot_llvm,winaot,winaotinterp,winaot_llvm,winaotinterp_llvm,bitcode,bitcodeinterp,unreal,fullaotinterp,fullaotinterp_llvm Which default profile to build (defaults to net_4_x)], [], [with_runtime_preset=net_4_x])
AC_ARG_WITH(spectre-mitigation, [ --with-spectre-mitigation=yes,no If you want to build the runtime with compiler flags that enable Spectre mitigation (defaults to no)], [], [with_spectre_mitigation=default])
AC_ARG_WITH(spectre-indirect-branch-choice, [ --with-spectre-indirect-branch-choice=keep,thunk,inline,extern Convert indirect branches to the specified kind of thunk (defaults to inline)], [], [with_spectre_indirect_branch_choice=inline])
AC_ARG_WITH(spectre-function-return-choice, [ --with-spectre-function-return-choice=keep,thunk,inline,extern Convert function return instructions to the specified kind of thunk (defaults to inline)], [], [with_spectre_function_return_choice=inline])
@@ -1261,6 +1326,7 @@ with_testing_aot_full_interp_default=no
with_testing_aot_hybrid_default=no
with_testing_aot_full_default=no
with_winaot_default=no
with_testing_winaot_interp_default=no
with_orbis_default=no
with_unreal_default=no
with_wasm_default=no
@@ -1270,7 +1336,7 @@ enable_cooperative_suspend_default=no
enable_hybrid_suspend_default=no
# For the sake of clearer error messages, these numbers should all be different from each other.
INVARIANT_AOT_OPTIONS=nimt-trampolines=2000,ntrampolines=10000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=4400,nftnptr-arg-trampolines=4000
INVARIANT_AOT_OPTIONS=nimt-trampolines=2000,ntrampolines=10000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=4400,nftnptr-arg-trampolines=4000,nrgctx-trampolines=21000
AOT_BUILD_ATTRS=$INVARIANT_AOT_OPTIONS
@@ -1280,12 +1346,19 @@ if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
DISABLE_MCS_DOCS_default=yes
elif test x$with_runtime_preset = xnetcore; then
DISABLE_MCS_DOCS_default=yes
BTLS_SUPPORTED=no
enable_mcs_build=no
enable_support_build=no
mono_feature_disable_remoting='yes'
mono_feature_disable_reflection_emit_save='yes'
mono_feature_disable_appdomains='yes'
mono_feature_disable_cleanup='yes'
mono_feature_disable_assembly_remapping='yes'
mono_feature_disable_security='yes'
mono_feature_disable_mdb='yes'
mono_feature_disable_com='yes'
mono_feature_disable_gac='yes'
disable_mono_native=yes
support_boehm=no
elif test x$with_runtime_preset = xnet_4_x; then
@@ -1299,6 +1372,7 @@ elif test x$with_runtime_preset = xall; then
with_monotouch_tv_default=yes
with_xammac_default=yes
with_winaot_default=yes
with_testing_winaot_interp_default=yes
with_orbis_default=yes
with_unreal_default=yes
with_wasm_default=yes
@@ -1429,6 +1503,29 @@ elif test x$with_runtime_preset = xwinaot; then
AOT_BUILD_FLAGS="--runtime=mobile -O=gsharedvt --aot=full,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--runtime=mobile --full-aot"
AOT_MODE="full"
elif test x$with_runtime_preset = xwinaotinterp; then
DISABLE_MCS_DOCS_default=yes
with_testing_winaot_interp_default=yes
TEST_PROFILE=testing_winaot_interp
mono_feature_disable_com='yes'
mono_feature_disable_remoting='yes'
mono_feature_disable_appdomains='yes'
AOT_BUILD_FLAGS="--aot=full,interp,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--full-aot-interp"
elif test x$with_runtime_preset = xwinaotinterp_llvm; then
DISABLE_MCS_DOCS_default=yes
with_testing_winaot_interp_default=yes
TEST_PROFILE=testing_winaot_interp
mono_feature_disable_com='yes'
mono_feature_disable_remoting='yes'
mono_feature_disable_appdomains='yes'
INVARIANT_AOT_OPTIONS="llvmllc=-mattr=sse4.1,$INVARIANT_AOT_OPTIONS"
AOT_BUILD_FLAGS="-O=gsharedvt --llvm --aot=full,interp,$INVARIANT_AOT_OPTIONS"
AOT_RUN_FLAGS="--full-aot-interp"
elif test x$with_runtime_preset = xwinaot_llvm; then
DISABLE_MCS_DOCS_default=yes
with_winaot_default=yes
@@ -1529,6 +1626,9 @@ fi
if test "x$with_winaot" = "xdefault"; then
with_winaot=$with_winaot_default
fi
if test "x$with_testing_winaot_interp" = "xdefault"; then
with_testing_winaot_interp=$with_testing_winaot_interp_default
fi
if test "x$with_orbis" = "xdefault"; then
with_orbis=$with_orbis_default
fi
@@ -1551,6 +1651,7 @@ AM_CONDITIONAL(INSTALL_TESTING_AOT_FULL_INTERP, [test "x$with_testing_aot_full_i
AM_CONDITIONAL(INSTALL_TESTING_AOT_HYBRID, [test "x$with_testing_aot_hybrid" != "xno"])
AM_CONDITIONAL(INSTALL_TESTING_AOT_FULL, [test "x$with_testing_aot_full" != "xno"])
AM_CONDITIONAL(INSTALL_WINAOT, [test "x$with_winaot" != "xno"])
AM_CONDITIONAL(INSTALL_TESTING_WINAOT_INTERP, [test "x$with_testing_winaot_interp" != "xno"])
AM_CONDITIONAL(INSTALL_ORBIS, [test "x$with_orbis" != "xno"])
AM_CONDITIONAL(INSTALL_UNREAL, [test "x$with_unreal" != "xno"])
AM_CONDITIONAL(INSTALL_WASM, [test "x$with_wasm" != "xno"])
@@ -1558,7 +1659,7 @@ AM_CONDITIONAL(INSTALL_NETCORE, [test "x$with_core" != "xno"])
AM_CONDITIONAL(HYBRID_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_hybrid"] || [test "x$TEST_PROFILE" = "xunreal"])
AM_CONDITIONAL(FULL_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_full"] || [test "x$TEST_PROFILE" = "xtesting_aot_bitcode"] || [test "x$TEST_PROFILE" = "xwinaot"] || [test "x$TEST_PROFILE" = "xorbis"] || [test "x$TEST_PROFILE" = "xwasm"])
AM_CONDITIONAL(FULL_AOT_INTERP_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_full_interp"] || [test "x$TEST_PROFILE" = "xtesting_aot_bitcode_interp"])
AM_CONDITIONAL(FULL_AOT_INTERP_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_full_interp"] || [test "x$TEST_PROFILE" = "xtesting_aot_bitcode_interp"] || [test "x$TEST_PROFILE" = "xtesting_winaot_interp"])
AM_CONDITIONAL(DEFAULT_TESTS, [test "x$TEST_PROFILE" = "xnet_4_x"])
default_profile=net_4_x
@@ -1583,6 +1684,9 @@ fi
if test -z "$INSTALL_WINAOT_TRUE"; then :
default_profile=winaot
fi
if test -z "$INSTALL_TESTING_WINAOT_INTERP_TRUE"; then :
default_profile=testing_winaot_interp
fi
if test -z "$INSTALL_ORBIS_TRUE"; then :
default_profile=orbis
fi
@@ -1630,7 +1734,7 @@ AM_CONDITIONAL(ENABLE_STATIC_GCC_LIBS, test "x$enable_static_gcc_libs" = "xyes")
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, interpreter, simd, soft_debug, perfcounters, normalization, desktop_loader, shared_perfcounters, remoting,
security, lldb, mdb, assert_messages, cleanup, sgen_marksweep_conc, sgen_split_nursery, sgen_gc_bridge, sgen_debug_helpers, sockets.],
security, lldb, mdb, assert_messages, cleanup, sgen_marksweep_conc, sgen_split_nursery, sgen_gc_bridge, sgen_debug_helpers, sockets, gac.],
[
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
eval "mono_feature_disable_$feature='yes'"
@@ -1837,6 +1941,11 @@ if test "x$mono_feature_disable_sockets" = "xyes"; then
AC_MSG_NOTICE([Disabled sockets])
fi
if test "x$mono_feature_disable_gac" = "xyes"; then
AC_DEFINE(DISABLE_GAC, 1, [Disable GAC])
AC_MSG_NOTICE([Disabled GAC support])
fi
AC_ARG_ENABLE(executables, [ --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes)
AM_CONDITIONAL(DISABLE_EXECUTABLES, test x$enable_executables = xno)
@@ -2049,30 +2158,31 @@ if test x$host_win32 = xno; then
AC_MSG_WARN([No dynamic loading support available])
else
LIBS="$LIBS $DL_LIB"
AC_DEFINE(HAVE_DL_LOADER,1,[dlopen-based dynamic loader available])
dnl from glib's configure.ac
AC_CACHE_CHECK([for preceeding underscore in symbols],
mono_cv_uscore,[
AC_TRY_RUN([#include <dlfcn.h>
int mono_underscore_test (void) { return 42; }
int main() {
void *f1 = (void*)0, *f2 = (void*)0, *handle;
handle = dlopen ((void*)0, 0);
if (handle) {
f1 = dlsym (handle, "mono_underscore_test");
f2 = dlsym (handle, "_mono_underscore_test");
} return (!f2 || f1);
}],
if test "x$cross_compiling" = "xyes"; then
AC_MSG_RESULT(cross compiling, assuming no)
mono_cv_uscore=no
else
AC_CACHE_CHECK([for preceeding underscore in symbols],
mono_cv_uscore,[
AC_TRY_RUN([#include <dlfcn.h>
int mono_underscore_test (void) { return 42; }
int main() {
void *f1 = (void*)0, *f2 = (void*)0, *handle;
handle = dlopen ((void*)0, 0);
if (handle) {
f1 = dlsym (handle, "mono_underscore_test");
f2 = dlsym (handle, "_mono_underscore_test");
} return (!f2 || f1);
}],
[mono_cv_uscore=yes],
[mono_cv_uscore=no],
[])
])
[])
])
fi
if test "x$mono_cv_uscore" = "xyes"; then
MONO_DL_NEED_USCORE=1
else
MONO_DL_NEED_USCORE=0
AC_DEFINE(MONO_DL_NEED_USCORE, 1, [Does dlsym require leading underscore.])
fi
AC_SUBST(MONO_DL_NEED_USCORE)
AC_CHECK_FUNC(dlerror)
fi
@@ -2135,6 +2245,7 @@ if test x$host_win32 = xno; then
AC_CHECK_FUNCS(openlog closelog)
AC_CHECK_FUNCS(atexit)
AC_CHECK_FUNCS(popen)
AC_FUNC_STRERROR_R()
@@ -2820,6 +2931,13 @@ if test x$host_win32 = xno; then
AC_SEARCH_LIBS(shm_open, pthread rt posix4)
AC_CHECK_FUNCS(shm_open)
dnl ********************************
dnl *** Checks for gettext lib ***
dnl ********************************
# This is needed for some hackery for AIX;
# Mono itself doesn't use it, but DllMap includes it
AC_SEARCH_LIBS([gettext], [intl])
dnl ********************************
dnl *** Checks for timezone stuff **
dnl ********************************
@@ -3240,6 +3358,7 @@ if test x$host_win32 = xno; then
AC_CHECK_DECL(F_DUPFD_CLOEXEC, [AC_DEFINE(HAVE_F_DUPFD_CLOEXEC, 1, [F_DUPFD_CLOEXEC])], [], [[#include <fcntl.h>]])
# AC_CHECK_FUNC(getifaddrs, [AC_DEFINE(HAVE_GETIFADDRS, 1, [getifaddrs])]) # already done above
AC_CHECK_FUNC(Qp2getifaddrs, [AC_DEFINE(HAVE_QP2GETIFADDRS, 1, [Qp2getifaddrs])])
AC_CHECK_FUNC(lseek64, [AC_DEFINE(HAVE_LSEEK64, 1, [lseek64])])
AC_CHECK_FUNC(mmap64, [AC_DEFINE(HAVE_MMAP64, 1, [mmap64])])
@@ -3272,13 +3391,29 @@ if test x$host_win32 = xno; then
AC_CHECK_DECL(ICANON, [AC_DEFINE(HAVE_ICANON, 1, [ICANON])], [], [[#include <termios.h>]])
AC_CHECK_DECL(TCSANOW, [AC_DEFINE(HAVE_TCSANOW, 1, [TCSANOW])], [], [[#include <termios.h>]])
AC_CHECK_MEMBER(struct stat.st_birthtimespec, [AC_DEFINE(HAVE_STAT_BIRTHTIME, 1, [struct stat.st_birthtime])], [], [[#include <sys/types.h>], [#include <sys/stat.h>]])
AC_CHECK_MEMBER(struct stat.st_atimespec, [AC_DEFINE(HAVE_STAT_TIMESPEC, 1, [struct stat.st_atimespec])], [], [[#include <sys/types.h>], [#include <sys/stat.h>]])
AC_CHECK_MEMBER(struct stat.st_atim, [AC_DEFINE(HAVE_STAT_TIM, 1, [struct stat.st_atim])], [], [[#include <sys/types.h>], [#include <sys/stat.h>]])
AC_CHECK_MEMBER(struct stat.st_atimensec, [AC_DEFINE(HAVE_STAT_NSEC, 1, [struct stat.st_atimensec])], [], [[#include <sys/types.h>], [#include <sys/stat.h>]])
AC_CHECK_MEMBER(struct dirent.d_namlen, [AC_DEFINE(HAVE_DIRENT_NAME_LEN, 1, [struct dirent.d_namlen])], [], [[#include <dirent.h>]])
AC_CHECK_MEMBER(struct statfs.f_fstypename, [AC_DEFINE(HAVE_STATFS_FSTYPENAME, 1, [struct statfs.f_fstypename])], [], [[#include <sys/mount.h>]])
AC_CHECK_MEMBER(struct statvfs.f_fstypename, [AC_DEFINE(HAVE_STATVFS_FSTYPENAME, 1, [struct statvfs.f_fstypename])], [], [[#include <sys/mount.h>]])
AC_CHECK_MEMBER(struct stat.st_birthtimespec,
[AC_DEFINE(HAVE_STAT_BIRTHTIME, 1, [struct stat.st_birthtimespec])],
[],
[#include <sys/types.h>
#include <sys/stat.h>])
AC_CHECK_MEMBER(struct stat.st_atimespec,
[AC_DEFINE(HAVE_STAT_TIMESPEC, 1, [struct stat.st_atimespec])],
[],
[#include <sys/types.h>
#include <sys/stat.h>])
AC_CHECK_MEMBER(struct stat.st_atim,
[AC_DEFINE(HAVE_STAT_TIM, 1, [struct stat.st_atim])],
[],
[#include <sys/types.h>
#include <sys/stat.h>])
AC_CHECK_MEMBER(struct stat.st_atimensec,
[AC_DEFINE(HAVE_STAT_NSEC, 1, [struct stat.st_atimensec])],
[],
[#include <sys/types.h>
#include <sys/stat.h>])
AC_CHECK_MEMBER(struct dirent.d_namlen, [AC_DEFINE(HAVE_DIRENT_NAME_LEN, 1, [struct dirent.d_namlen])], [], [#include <dirent.h>])
AC_CHECK_MEMBER(struct statfs.f_fstypename, [AC_DEFINE(HAVE_STATFS_FSTYPENAME, 1, [struct statfs.f_fstypename])], [], [#include <sys/mount.h>])
AC_CHECK_MEMBER(struct statvfs.f_fstypename, [AC_DEFINE(HAVE_STATVFS_FSTYPENAME, 1, [struct statvfs.f_fstypename])], [], [#include <sys/mount.h>])
AC_MSG_CHECKING(for struct statfs)
AC_TRY_COMPILE([
@@ -3479,6 +3614,10 @@ if test x$host_win32 = xno; then
int main ()
{
#ifdef __PASE__
/* IBM i doesn't implement this and returns SIGILL */
return -1;
#endif
int fd = shm_open("/mono_configure_shm_open", O_CREAT | O_RDWR, 0777);
if (fd == -1)
return -1;
@@ -3639,6 +3778,7 @@ if test x$host_win32 = xno; then
AC_DEFINE(HAVE_GSSFW_HEADERS, 1, [GSS/GSS.h])
AC_DEFINE(HAVE_GSS_SPNEGO_MECHANISM, 1, [GSS_SPNEGO_MECHANISM])
enable_gss=yes
AC_DEFINE(ENABLE_GSS, 1, [ENABLE_GSS])
], [
AC_MSG_RESULT(no)
])
@@ -3650,6 +3790,7 @@ if test x$host_win32 = xno; then
],[
AC_MSG_RESULT(yes)
enable_gss=yes
AC_DEFINE(ENABLE_GSS, 1, [ENABLE_GSS])
], [
AC_MSG_RESULT(no)
])
@@ -3841,14 +3982,6 @@ else
], [
AC_MSG_RESULT(no)
])
AC_CHECK_DECLS(InterlockedExchange64, [], [], [[#include <windows.h>]])
AC_CHECK_DECLS(InterlockedCompareExchange64, [], [], [[#include <windows.h>]])
AC_CHECK_DECLS(InterlockedDecrement64, [], [], [[#include <windows.h>]])
AC_CHECK_DECLS(InterlockedIncrement64, [], [], [[#include <windows.h>]])
AC_CHECK_DECLS(InterlockedAdd, [], [], [[#include <windows.h>]])
AC_CHECK_DECLS(InterlockedAdd64, [], [], [[#include <windows.h>]])
AC_CHECK_DECLS(__readfsdword, [], [], [[#include <windows.h>]])
fi
dnl socklen_t check
@@ -4155,6 +4288,7 @@ LIBC="libc.so.6"
INTL="libc.so.6"
SQLITE="libsqlite.so.0"
SQLITE3="libsqlite3.so.0"
ODBC="libodbc.so.2"
X11="libX11.so"
GDKX11="libgdk-x11-2.0.so.0"
GTKX11="libgtk-x11-2.0.so.0"
@@ -4327,11 +4461,6 @@ case "$host" in
aix*|os400*)
BTLS_SUPPORTED=yes
BTLS_PLATFORM=powerpc
dnl on AIX/PASE, shared libraries can be inside archives
dnl if they are, we specify them by lib.a(lib.so)
dnl we may hardcode 64-bit names at times, but we don't do 32-bit AIX, so
LIBC="libc.a(shr_64.o)"
INTL="libintl.a(libintl.so.8)"
;;
linux*)
BTLS_SUPPORTED=yes
@@ -4495,6 +4624,7 @@ if test "x$host" != "x$target"; then
aarch64*darwin*_ilp32)
TARGET=ARM6432;
AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
sizeof_register=8
AC_DEFINE(TARGET_WATCHOS, 1, [...])
;;
aarch64-*)
@@ -4758,8 +4888,11 @@ else
AC_DEFINE_UNQUOTED(SIZEOF_REGISTER,${target_sizeof_void_p},[size of target machine integer registers])
fi
# zlib/configure detects visibility support similarly and defines HAVE_HIDDEN
# on the compiler command line (not config.h).
if test "x$have_visibility_hidden" = "xyes"; then
AC_DEFINE(HAVE_VISIBILITY_HIDDEN, 1, [Support for the visibility ("hidden") attribute])
ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_HIDDEN"
fi
if test "x$have_deprecated" = "xyes"; then
@@ -4796,6 +4929,44 @@ jit_status="Building and using the JIT"
libsuffix=".so"
case "$host" in
*-*-aix*)
dnl on AIX/PASE, shared libraries can be and usually are inside archives
dnl so, we specify them by libfoo.a(libfoo.so.0) for libtool's conventions,
dnl or libfoo.a(shr[_64].o) for the AIX system convention,
dnl or lib.so[.0](shr[_64].o) for libtool's hybrid convention
dnl we may hardcode 64-bit names at times, but we don't do 32-bit AIX
LIBC="libc.a(shr_64.o)"
# Thanks, I hate it! This is crumbly, especially the one-liner.
AC_MSG_CHECKING([how to dlopen libintl])
AC_LINK_IFELSE([AC_LANG_SOURCE([
/* XXX: Check for libintl header/gettext func better? */
#include <libintl.h>
int main (void) {
gettext("Dummy for autoconf");
return 1;
}
])],
[
INTL="$(dump -X64 -Hp conftest$EXEEXT | grep libintl | cut -c 38- | tr -s " " | awk '{print $1"("$2")"}')"
AC_MSG_RESULT([yes, $INTL])
],
[
INTL="libintl.a(libintl.so.8)"
AC_MSG_RESULT([no, falling back to $INTL])
])
SQLITE3="libsqlite3.a(libsqlite3.so.0)"
# it's very tempting to set a libsuffix, but it depends on the soname value
;;
*-*-os400*)
dnl However, IBM's packages for i try to be more "normal" than the AIX world, naming wise.
dnl The library archives has "normal" .so names, but they're members with predictable "shr" names for fat libraries.
LIBC="libc.a(shr_64.o)"
INTL="libintl.so(shr_64.o)"
SQLITE3="libsqlite3.so(shr_64.o)"
# likewise, it's safer to assume ".so(shr_64.o)" due to official IBM packages being built this way, but as with AIX, others may not be guaranteed
# it may be worth revisiting this in the future
;;
*-*-darwin*)
libsuffix=".dylib"
LIBC="libc.dylib"
@@ -4952,25 +5123,12 @@ AC_SEARCH_LIBS(sqrtf, m)
AC_SEARCH_LIBS(nanosleep, rt)
AC_SEARCH_LIBS(dlopen, dl)
old_ldflags="${LDFLAGS}"
# GNU specific option, this confuses IBM ld, but do offer alternatives when possible
if test $lt_cv_prog_gnu_ld = yes; then
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic,-Bsymbolic"
else
case $host in
*-*-aix*|*-*-os400*)
LDFLAGS="${LDFLAGS} -bsymbolic"
;;
*)
dnl Try to use export-dynamic anyways
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic,-Bsymbolic"
;;
esac
fi
AC_TRY_LINK(, [int i;], found_export_dynamic=yes, found_export_dynamic=no)
if test $found_export_dynamic = no; then
LDFLAGS="${old_ldflags}"
fi
# AIX/OS400 -bsymbolic
# Apple -bind_at_load
# The rest GNU.
#
AX_APPEND_LINK_FLAGS([-Wl,--export-dynamic -Wl,-Bsymbolic -bsymbolic -Wl,-z,now -Wl,-bind_at_load])
AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h iconv.h sys/types.h sys/resource.h)
dnl giconv.c will check on HAVE_ICONV_H but we need this for link time
@@ -5707,7 +5865,7 @@ if test "x$enable_btls" = "xyes"; then
case $host_os in
aix*|os400*)
btls_cflags="$btls_cflags -maix64 -mminimal-toc -pthread -D_ALL_SOURCE -D_THREAD_SAFE -D_REENTRANT"
BTLS_CMAKE_ARGS="-DCMAKE_AR=/usr/bin/ar -DCMAKE_C_ARCHIVE_CREATE=\"<CMAKE_AR> -X64 cr <TARGET> <LINK_FLAGS> <OBJECTS>\""
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCMAKE_AR=/usr/bin/ar -DCMAKE_C_ARCHIVE_CREATE=\"<CMAKE_AR> -X64 cr <TARGET> <LINK_FLAGS> <OBJECTS>\""
esac
;;
android-armv5)
@@ -5817,6 +5975,7 @@ AC_SUBST(LIBC)
AC_SUBST(INTL)
AC_SUBST(SQLITE)
AC_SUBST(SQLITE3)
AC_SUBST(ODBC)
AC_SUBST(X11)
AC_SUBST(GDKX11)
AC_SUBST(GTKX11)
@@ -5867,8 +6026,8 @@ fi
AC_SUBST(mono_runtime)
AC_SUBST(mono_runtime_wrapper)
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.1/csc.exe
VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.1/VBCSCompiler.exe
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csc.exe
VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/VBCSCompiler.exe
if test $csc_compiler = mcs; then
CSC=$mcs_topdir/class/lib/build/mcs.exe
@@ -5905,6 +6064,7 @@ AC_CONFIG_FILES([po/mcs/Makefile.in])
AC_CONFIG_FILES([acceptance-tests/microbench-perf.sh],[chmod +x acceptance-tests/microbench-perf.sh])
AC_CONFIG_FILES([runtime/mono-wrapper],[chmod +x runtime/mono-wrapper])
AC_CONFIG_FILES([runtime/monodis-wrapper],[chmod +x runtime/monodis-wrapper])
AC_CONFIG_FILES([runtime/bin/mono-hang-watchdog],[chmod +x runtime/bin/mono-hang-watchdog])
AC_CONFIG_COMMANDS([runtime/etc/mono/1.0/machine.config],
[ depth=../../../..
@@ -6233,7 +6393,11 @@ elif test x$host_linux = xyes; then
MONO_NATIVE_CXXFLAGS=$CXXFLAGS
MONO_NATIVE_CFLAGS=$CFLAGS
MONO_NATIVE_LDFLAGS=$LDFLAGS
if test x$enable_gss = xyes; then
MONO_NATIVE_LDFLAGS="$MONO_NATIVE_LDFLAGS -lgssapi_krb5"
else
AC_MSG_WARN([GSS is not enabled, it requires libkrb5-dev package])
fi
mono_native=yes
mono_native_compat=no
MONO_NATIVE_PLATFORM=linux
@@ -6263,6 +6427,15 @@ elif case $host_os in aix*|os400*) true;; *) false;; esac; then
MONO_NATIVE_CPPFLAGS=$CPPFLAGS
MONO_NATIVE_CXXFLAGS=$CXXFLAGS
MONO_NATIVE_CFLAGS=$CFLAGS
dnl nosymbolic- is a hack in case -G for linking is used, as -G seems
dnl to change the way unresolved symbols work on library load in an
dnl incompatible manner. (as references to runtime functions are
dnl resolved later) Default params otherwise are that, so seems OK.
dnl Likewise, we don't seem to need to cover the entire runtime with
dnl it either, on both AIX and PASE. -brtl from -G does seem to spew
dnl Big Scary TOC Warnings (tm) from the linker, but it doesn't seem
dnl problematic with gcc's -mminimal-toc.
dnl ----
dnl flock in AIX exists in libbsd (not the same as freedesktop.org
dnl libbsd) which Mono.Native needs.
dnl Because of the way that the library is built by default, unresolved
@@ -6271,7 +6444,7 @@ elif case $host_os in aix*|os400*) true;; *) false;; esac; then
dnl better to explicitly link it, even though it has it shadows libc's
dnl ioctl with its own. (As for the other unresolved imports, those
dnl should be provided by the Mono runtime loaded.)
MONO_NATIVE_LDFLAGS="$LDFLAGS -lbsd"
MONO_NATIVE_LDFLAGS="$LDFLAGS -lbsd -Wl,-bnosymbolic-"
mono_native=yes
mono_native_compat=no
@@ -6294,6 +6467,22 @@ elif case $host_os in freebsd*) true;; *) false;; esac; then
AC_MSG_RESULT(freebsd)
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_FREEBSD"
elif case $host_os in haiku*) true;; *) false;; esac; then
mono_native_text="Haiku"
MONO_NATIVE_CC=$CC
MONO_NATIVE_CXX=$CXX
MONO_NATIVE_CPPFLAGS=$CPPFLAGS
MONO_NATIVE_CXXFLAGS=$CXXFLAGS
MONO_NATIVE_CFLAGS=$CFLAGS
MONO_NATIVE_LDFLAGS=$LDFLAGS
mono_native=yes
mono_native_compat=no
MONO_NATIVE_PLATFORM=haiku
AC_MSG_CHECKING([Mono.Native support])
AC_MSG_RESULT(haiku)
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_HAIKU"
elif test x$platform_android = xyes; then
mono_native_text="Android"
MONO_NATIVE_CC=$CC
@@ -6351,6 +6540,7 @@ AM_CONDITIONAL(MONO_NATIVE_PLATFORM_LINUX, test x$MONO_NATIVE_PLATFORM = xlinux)
AM_CONDITIONAL(MONO_NATIVE_PLATFORM_AIX, test x$MONO_NATIVE_PLATFORM = xaix)
AM_CONDITIONAL(MONO_NATIVE_PLATFORM_ANDROID, test x$MONO_NATIVE_PLATFORM = xandroid)
AM_CONDITIONAL(MONO_NATIVE_PLATFORM_FREEBSD, test x$MONO_NATIVE_PLATFORM = xfreebsd)
AM_CONDITIONAL(MONO_NATIVE_PLATFORM_HAIKU, test x$MONO_NATIVE_PLATFORM = xhaiku)
MONO_NATIVE_PLATFORM_TYPE_COMPAT="$MONO_NATIVE_PLATFORM_TYPE | MONO_NATIVE_PLATFORM_TYPE_COMPAT"
MONO_NATIVE_PLATFORM_TYPE_UNIFIED="$MONO_NATIVE_PLATFORM_TYPE | MONO_NATIVE_PLATFORM_TYPE_UNIFIED"
@@ -6425,9 +6615,26 @@ if test x"$GCC" = xyes; then
JAY_CFLAGS="-Wno-implicit-function-declaration"
fi
# zlib/configure checks if this program compiles and if so
# defines _LARGEFILE64_SOURCE on the compiler command line (not config.h).
#
AC_MSG_CHECKING([for large file support])
AC_COMPILE_IFELSE(
[
#include <sys/types.h>
off64_t dummy = 0;
], [
AC_MSG_RESULT(yes)
# FIXME The ramifications of _LARGEFILE64_SOURCE are not understood.
# ZLIB_CFLAGS="$ZLIB_CFLAGS -D_LARGEFILE64_SOURCE=1"
], [
AC_MSG_RESULT(no)
])
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(ZLIB_CFLAGS)
# Update all submodules recursively to ensure everything is checked out
if test "x$with_core" != "xonly"; then
@@ -6516,6 +6723,7 @@ tools/Makefile
tools/locale-builder/Makefile
tools/sgen/Makefile
tools/pedump/Makefile
tools/mono-hang-watchdog/Makefile
runtime/Makefile
msvc/Makefile
po/Makefile
@@ -6535,21 +6743,35 @@ if test x$host_darwin = xyes; then
sed -e 's,lock_old_archive_extraction=yes,lock_old_archive_extraction=no,g' < libtool > libtool.new && mv libtool.new libtool && chmod +x libtool
fi
force_enable_compiler_server=no;
AC_MSG_CHECKING([compiler server])
AC_ARG_WITH(compiler-server, [ --with-compiler-server=yes,no,default Enables or disables compiler server],[
AC_ARG_WITH(compiler-server, [ --with-compiler-server=yes,no,default,force Enables or disables compiler server],[
if test x$withval = xyes; then
enable_compiler_server=yes;
# force will bypass any automatic disables to allow you to test the compiler server
# in scenarios where it is disabled
elif test x$withval = xforce; then
enable_compiler_server=yes;
force_enable_compiler_server=yes;
elif test x$withval = xno; then
enable_compiler_server=no;
elif test x$withval = xdefault; then
enable_compiler_server=no;
enable_compiler_server=yes;
else
AC_MSG_ERROR([You must supply one of "yes", "no" or "default" to the --with-compiler-server option])
AC_MSG_ERROR([You must supply one of "yes", "no", "default" or "force" to the --with-compiler-server option])
fi
],[enable_compiler_server=no])
],[enable_compiler_server=yes])
AC_MSG_RESULT($enable_compiler_server)
if test x$enable_compiler_server = xyes; then
if test x$csc_compiler = xmcs; then
if test x$force_enable_compiler_server = xyes; then
AC_MSG_WARN([forcing compiler server to stay enabled])
elif test x$host_darwin = xyes; then
AC_MSG_WARN([compiler server temporarily disabled on darwin])
enable_compiler_server=no;
elif test x$csc_compiler = xmcs; then
AC_MSG_WARN([mcs does not support the compiler server])
enable_compiler_server=no;
fi
@@ -6581,9 +6803,6 @@ fi
echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $mcs_topdir/build/config.make
echo "ILDISASM = $mono_build_root/runtime/monodis-wrapper" >> $mcs_topdir/build/config.make
echo "JAY_CFLAGS = $JAY_CFLAGS" >> $mcs_topdir/build/config.make
echo "RID = $RID" >> $mcs_topdir/build/config.make
echo "COREARCH = $COREARCH" >> $mcs_topdir/build/config.make
echo "CORETARGETS = $CORETARGETS" >> $mcs_topdir/build/config.make
echo "VERSION = $VERSION" >> $mcs_topdir/build/config.make
case $INSTALL in
@@ -6662,7 +6881,7 @@ fi
echo "AOT_RUN_FLAGS=$AOT_RUN_FLAGS" >> $srcdir/$mcsdir/build/config.make
echo "AOT_BUILD_ATTRS=$AOT_BUILD_ATTRS" >> $srcdir/$mcsdir/build/config.make
if test "x$internal_llvm" != "xno"; then
if test "x$internal_llvm" != "xno" && test "x$enable_llvm_msvc_only" = "xno"; then
echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS,$MONO_LLVM_PATH_OPTION" >> $srcdir/$mcsdir/build/config.make
else
echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS" >> $srcdir/$mcsdir/build/config.make
@@ -6723,6 +6942,25 @@ if test x$buildsgen = xyes; then
thread_suspend_msg="Suspend: Preemptive"
fi
fi
if test "x$with_core" = "xonly"; then
echo "VERSION = $VERSION" > netcore/config.make
echo "RID = $RID" >> netcore/config.make
echo "COREARCH = $COREARCH" >> netcore/config.make
echo "CORETARGETS = $CORETARGETS" >> netcore/config.make
echo "MONO_CORLIB_VERSION = $MONO_CORLIB_VERSION" >> netcore/config.make
if test x$host_darwin = xyes; then
echo "HOST_PLATFORM ?= macos" >> netcore/config.make
elif test x$host_win32 = xyes; then
echo "HOST_PLATFORM ?= win32" >> netcore/config.make
elif test x$host_linux = xyes; then
echo "HOST_PLATFORM ?= linux" >> netcore/config.make
else
echo "HOST_PLATFORM ?= unix" >> netcore/config.make
fi
fi
echo "
mcs source: $mcsdir
@@ -6754,7 +6992,7 @@ echo "
Orbis: $with_orbis
Unreal: $with_unreal
WebAssembly: $with_wasm
Test profiles: AOT Full ($with_testing_aot_full), AOT Hybrid ($with_testing_aot_hybrid)
Test profiles: AOT Full ($with_testing_aot_full), AOT Hybrid ($with_testing_aot_hybrid), AOT Full Interp ($with_testing_aot_full_interp), Windows Full AOT Interp ($with_testing_winaot_interp)
JNI support: $jdk_headers_found
libgdiplus: $libgdiplus_msg
zlib: $zlib_msg
+1 -1
View File
@@ -6,7 +6,7 @@
<dllmap dll="libintl" name="bind_textdomain_codeset" target="@LIBC@" os="solaris"/>
<dllmap dll="libintl" target="@INTL@" os="!windows"/>
<dllmap dll="i:libxslt.dll" target="libxslt@libsuffix@" os="!windows"/>
<dllmap dll="i:odbc32.dll" target="libodbc@libsuffix@" os="!windows"/>
<dllmap dll="i:odbc32.dll" target="@ODBC@" os="!windows"/>
<dllmap dll="i:odbc32.dll" target="libiodbc.dylib" os="osx"/>
<dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
+23
View File
@@ -18,6 +18,27 @@ convert.exe: $(srcdir)/convert.cs AgilityPack.dll
AgilityPack.dll:
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
ifdef MCS_MODE
monoapi.zip:
touch $@
monoapi.tree: monoapi.zip
touch $@
mono-tools.zip:
touch $@
mono-tools.tree: mono-tools.zip
touch $@
mono-file-formats.zip:
touch $@
mono-file-formats.tree: mono-file-formats.zip
touch $@
else
monoapi.zip: monoapi.tree
@test -f $@ || { rm -f $< && $(MAKE) $<; }
@@ -36,5 +57,7 @@ mono-file-formats.zip: mono-file-formats.tree
mono-file-formats.tree: $(srcdir)/mono-file-formats.config $(srcdir)/docs.make
$(MDOC) assemble -o mono-file-formats -f man $<
endif
.doc-stamp:
+16 -4
View File
@@ -1,15 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.Private.CoreFx.NETCoreApp" Version="5.0.0-alpha1.19375.11">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>97d5957fc71853961082e22873d926269b291b92</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App" Version="5.0.0-alpha1.19375.9">
<Uri>https://github.com/dotnet/core-setup</Uri>
<Sha>2977763fd35b8dc120f4eac94314aba7b05ae9ee</Sha>
</Dependency>
<Dependency Name="Microsoft.Net.Compilers" Version="3.3.0-beta2-19381-14">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>ef3a7a3863ae53b610a4b0c3682a35cad0829583</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19279.5">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19379.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>fb62c6377a6bd163af2a7516260f064498942585</Sha>
<Sha>193793488c727c2d12a04b4abe5e6ea63ad20526</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.19279.5">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.19379.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>fb62c6377a6bd163af2a7516260f064498942585</Sha>
<Sha>193793488c727c2d12a04b4abe5e6ea63ad20526</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
+7
View File
@@ -3,5 +3,12 @@
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<PreReleaseVersionLabel>prerelease</PreReleaseVersionLabel>
<!-- Package versions -->
<!-- corefx -->
<MicrosoftPrivateCoreFxNETCoreAppVersion>5.0.0-alpha1.19375.11</MicrosoftPrivateCoreFxNETCoreAppVersion>
<!-- core-setup -->
<MicrosoftNETCoreAppVersion>5.0.0-alpha1.19375.9</MicrosoftNETCoreAppVersion>
<!-- roslyn -->
<MicrosoftNetCompilersVersion>3.3.0-beta2-19374-02</MicrosoftNetCompilersVersion>
</PropertyGroup>
</Project>
+11
View File
@@ -0,0 +1,11 @@
@{
IncludeRules=@('PSAvoidUsingCmdletAliases',
'PSAvoidUsingWMICmdlet',
'PSAvoidUsingPositionalParameters',
'PSAvoidUsingInvokeExpression',
'PSUseDeclaredVarsMoreThanAssignments',
'PSUseCmdletCorrectly',
'PSStandardDSCFunctionsInResource',
'PSUseIdenticalMandatoryParametersForDSC',
'PSUseIdenticalParametersForDSC')
}
+1 -1
View File
@@ -3,7 +3,7 @@
<!--
This MSBuild file is intended to be used as the body of the default
publishing release pipeline. The release pipeline will use this file
to invoke the the SignCheck tool to validate that packages about to
to invoke the SignCheck tool to validate that packages about to
be published are correctly signed.
Parameters:
+1 -2
View File
@@ -133,9 +133,8 @@ try {
Build
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category "InitializeToolset" -Message $_
ExitWithExitCode 1
}
+3 -3
View File
@@ -157,15 +157,15 @@ fetch_tizen_pkgs()
Inform "Initialize arm base"
fetch_tizen_pkgs_init standard base
Inform "fetch common packages"
fetch_tizen_pkgs armv7l gcc glibc glibc-devel libicu libicu-devel
fetch_tizen_pkgs armv7l gcc glibc glibc-devel libicu libicu-devel libatomic
fetch_tizen_pkgs noarch linux-glibc-devel
Inform "fetch coreclr packages"
fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel tizen-release lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
Inform "fetch corefx packages"
fetch_tizen_pkgs armv7l libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel krb5 krb5-devel libcurl libcurl-devel
Inform "Initialize standard unified"
fetch_tizen_pkgs_init standard unified
Inform "fetch corefx packages"
fetch_tizen_pkgs armv7l gssdp gssdp-devel
fetch_tizen_pkgs armv7l gssdp gssdp-devel tizen-release
+2 -1
View File
@@ -181,7 +181,7 @@ if [ -z "$__RootfsDir" ] && [ ! -z "$ROOTFS_DIR" ]; then
fi
if [ -z "$__RootfsDir" ]; then
__RootfsDir="$__CrossDir/rootfs/$__BuildArch"
__RootfsDir="$__CrossDir/../../../.tools/rootfs/$__BuildArch"
fi
if [ -d "$__RootfsDir" ]; then
@@ -203,6 +203,7 @@ if [[ "$__LinuxCodeName" == "alpine" ]]; then
-X http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/main \
-X http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/community \
-X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
-X http://dl-cdn.alpinelinux.org/alpine/edge/main \
-U --allow-untrusted --root $__RootfsDir --arch $__AlpineArch --initdb \
add $__AlpinePackages
rm -r $__ApkToolsDir
+4 -4
View File
@@ -11,10 +11,10 @@ function InstallDarcCli ($darcVersion) {
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
$toolList = Invoke-Expression "& `"$dotnet`" tool list -g"
$toolList = & "$dotnet" tool list -g
if ($toolList -like "*$darcCliPackageName*") {
Invoke-Expression "& `"$dotnet`" tool uninstall $darcCliPackageName -g"
& "$dotnet" tool uninstall $darcCliPackageName -g
}
# If the user didn't explicitly specify the darc version,
@@ -22,12 +22,12 @@ function InstallDarcCli ($darcVersion) {
if (-not $darcVersion) {
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
}
$arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json'
Write-Host "Installing Darc CLI version $darcVersion..."
Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed."
Invoke-Expression "& `"$dotnet`" tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g"
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g
}
InstallDarcCli $darcVersion
+10 -10
View File
@@ -25,7 +25,7 @@ function CheckExitCode ([string]$stage)
try {
Push-Location $PSScriptRoot
Write-Host "Installing darc..."
. .\darc-init.ps1 -darcVersion $darcVersion
CheckExitCode "Running darc-init"
@@ -40,9 +40,9 @@ try {
$darcExe = "$env:USERPROFILE\.dotnet\tools"
$darcExe = Resolve-Path "$darcExe\darc.exe"
Create-Directory $outputFolder
# Generate 3 graph descriptions:
# 1. Flat with coherency information
# 2. Graphviz (dot) file
@@ -51,26 +51,26 @@ try {
$graphVizImageFilePath = "$outputFolder\graph.png"
$normalGraphFilePath = "$outputFolder\graph-full.txt"
$flatGraphFilePath = "$outputFolder\graph-flat.txt"
$baseOptions = "get-dependency-graph --github-pat $gitHubPat --azdev-pat $azdoPat --password $barToken"
$baseOptions = @( "--github-pat", "$gitHubPat", "--azdev-pat", "$azdoPat", "--password", "$barToken" )
if ($includeToolset) {
Write-Host "Toolsets will be included in the graph..."
$baseOptions += " --include-toolset"
$baseOptions += @( "--include-toolset" )
}
Write-Host "Generating standard dependency graph..."
Invoke-Expression "& `"$darcExe`" $baseOptions --output-file $normalGraphFilePath"
& "$darcExe" get-dependency-graph @baseOptions --output-file $normalGraphFilePath
CheckExitCode "Generating normal dependency graph"
Write-Host "Generating flat dependency graph and graphviz file..."
Invoke-Expression "& `"$darcExe`" $baseOptions --flat --coherency --graphviz $graphVizFilePath --output-file $flatGraphFilePath"
& "$darcExe" get-dependency-graph @baseOptions --flat --coherency --graphviz $graphVizFilePath --output-file $flatGraphFilePath
CheckExitCode "Generating flat and graphviz dependency graph"
Write-Host "Generating graph image $graphVizFilePath"
$dotFilePath = Join-Path $installBin "graphviz\$graphvizVersion\release\bin\dot.exe"
Invoke-Expression "& `"$dotFilePath`" -Tpng -o'$graphVizImageFilePath' `"$graphVizFilePath`""
& "$dotFilePath" -Tpng -o"$graphVizImageFilePath" "$graphVizFilePath"
CheckExitCode "Generating graphviz image"
Write-Host "'$graphVizFilePath', '$flatGraphFilePath', '$normalGraphFilePath' and '$graphVizImageFilePath' created!"
}
catch {
+17 -12
View File
@@ -79,32 +79,37 @@ try {
$NativeTools.PSObject.Properties | ForEach-Object {
$ToolName = $_.Name
$ToolVersion = $_.Value
$LocalInstallerCommand = $InstallerPath
$LocalInstallerCommand += " -ToolName $ToolName"
$LocalInstallerCommand += " -InstallPath $InstallBin"
$LocalInstallerCommand += " -BaseUri $BaseUri"
$LocalInstallerCommand += " -CommonLibraryDirectory $EngCommonBaseDir"
$LocalInstallerCommand += " -Version $ToolVersion"
$LocalInstallerArguments = @{ ToolName = "$ToolName" }
$LocalInstallerArguments += @{ InstallPath = "$InstallBin" }
$LocalInstallerArguments += @{ BaseUri = "$BaseUri" }
$LocalInstallerArguments += @{ CommonLibraryDirectory = "$EngCommonBaseDir" }
$LocalInstallerArguments += @{ Version = "$ToolVersion" }
if ($Verbose) {
$LocalInstallerCommand += " -Verbose"
$LocalInstallerArguments += @{ Verbose = $True }
}
if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') {
if($Force) {
$LocalInstallerCommand += " -Force"
$LocalInstallerArguments += @{ Force = $True }
}
}
if ($Clean) {
$LocalInstallerCommand += " -Clean"
$LocalInstallerArguments += @{ Clean = $True }
}
Write-Verbose "Installing $ToolName version $ToolVersion"
Write-Verbose "Executing '$LocalInstallerCommand'"
Invoke-Expression "$LocalInstallerCommand"
Write-Verbose "Executing '$InstallerPath $($LocalInstallerArguments.Keys.ForEach({"-$_ '$($LocalInstallerArguments.$_)'"}) -join ' ')'"
& $InstallerPath @LocalInstallerArguments
if ($LASTEXITCODE -Ne "0") {
$errMsg = "$ToolName installation failed"
if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) {
Write-Warning $errMsg
$showNativeToolsWarning = $true
if ((Get-Variable 'DoNotDisplayNativeToolsInstallationWarnings' -ErrorAction 'SilentlyContinue') -and $DoNotDisplayNativeToolsInstallationWarnings) {
$showNativeToolsWarning = $false
}
if ($showNativeToolsWarning) {
Write-Warning $errMsg
}
$toolInstallationFailure = $true
} else {
Write-Error $errMsg
+1 -1
View File
@@ -71,7 +71,7 @@ function ReadGlobalJsonNativeTools {
local native_tools_list=$(echo $native_tools_section | awk -F"[{}]" '{print $2}')
native_tools_list=${native_tools_list//[\" ]/}
native_tools_list=${native_tools_list//,/$'\n'}
native_tools_list="$(echo -e "${native_tools_list}" | tr -d '[:space:]')"
native_tools_list="$(echo -e "${native_tools_list}" | tr -d '[[:space:]]')"
local old_IFS=$IFS
while read -r line; do
+135
View File
@@ -0,0 +1,135 @@
param(
[Parameter(Mandatory=$true)][string] $Operation,
[string] $AuthToken,
[string] $CommitSha,
[string] $RepoName,
[switch] $IsFeedPrivate
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version 2.0
. $PSScriptRoot\tools.ps1
# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed
# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in
# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. This should ONLY be called from identified
# internal builds
function SetupCredProvider {
param(
[string] $AuthToken
)
# Install the Cred Provider NuGet plugin
Write-Host "Setting up Cred Provider NuGet plugin in the agent..."
Write-Host "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..."
$url = 'https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1'
Write-Host "Writing the contents of 'installcredprovider.ps1' locally..."
Invoke-WebRequest $url -OutFile installcredprovider.ps1
Write-Host "Installing plugin..."
.\installcredprovider.ps1 -Force
Write-Host "Deleting local copy of 'installcredprovider.ps1'..."
Remove-Item .\installcredprovider.ps1
if (-Not("$env:USERPROFILE\.nuget\plugins\netcore")) {
Write-Host "CredProvider plugin was not installed correctly!"
ExitWithExitCode 1
}
else {
Write-Host "CredProvider plugin was installed correctly!"
}
# Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable
# feeds successfully
$nugetConfigPath = "$RepoRoot\NuGet.config"
if (-Not (Test-Path -Path $nugetConfigPath)) {
Write-Host "NuGet.config file not found in repo's root!"
ExitWithExitCode 1
}
$endpoints = New-Object System.Collections.ArrayList
$nugetConfigPackageSources = Select-Xml -Path $nugetConfigPath -XPath "//packageSources/add[contains(@key, 'darc-int-')]/@value" | foreach{$_.Node.Value}
if (($nugetConfigPackageSources | Measure-Object).Count -gt 0 ) {
foreach ($stableRestoreResource in $nugetConfigPackageSources) {
$trimmedResource = ([string]$stableRestoreResource).Trim()
[void]$endpoints.Add(@{endpoint="$trimmedResource"; password="$AuthToken"})
}
}
if (($endpoints | Measure-Object).Count -gt 0) {
# Create the JSON object. It should look like '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}'
$endpointCredentials = @{endpointCredentials=$endpoints} | ConvertTo-Json -Compress
# Create the environment variables the AzDo way
Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $endpointCredentials -Properties @{
'variable' = 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS'
'issecret' = 'false'
}
# We don't want sessions cached since we will be updating the endpoints quite frequently
Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data 'False' -Properties @{
'variable' = 'NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED'
'issecret' = 'false'
}
}
else
{
Write-Host "No internal endpoints found in NuGet.config"
}
}
#Workaround for https://github.com/microsoft/msbuild/issues/4430
function InstallDotNetSdkAndRestoreArcade {
$dotnetTempDir = "$RepoRoot\dotnet"
$dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*)
$dotnet = "$dotnetTempDir\dotnet.exe"
$restoreProjPath = "$PSScriptRoot\restore.proj"
Write-Host "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..."
InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion"
'<Project Sdk="Microsoft.DotNet.Arcade.Sdk"/>' | Out-File "$restoreProjPath"
& $dotnet restore $restoreProjPath
Write-Host "Arcade SDK restored!"
if (Test-Path -Path $restoreProjPath) {
Remove-Item $restoreProjPath
}
if (Test-Path -Path $dotnetTempDir) {
Remove-Item $dotnetTempDir -Recurse
}
}
try {
Push-Location $PSScriptRoot
if ($Operation -like "setup") {
SetupCredProvider $AuthToken
}
elseif ($Operation -like "install-restore") {
InstallDotNetSdkAndRestoreArcade
}
else {
Write-Host "Unknown operation '$Operation'!"
ExitWithExitCode 1
}
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}
finally {
Pop-Location
}
+142
View File
@@ -0,0 +1,142 @@
#!/usr/bin/env bash
set -e
# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed
# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in
# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables.
# This should ONLY be called from identified internal builds
function SetupCredProvider {
local authToken=$1
# Install the Cred Provider NuGet plugin
echo "Setting up Cred Provider NuGet plugin in the agent..."...
echo "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..."
local url="https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh"
echo "Writing the contents of 'installcredprovider.ps1' locally..."
local installcredproviderPath="installcredprovider.sh"
if command -v curl > /dev/null; then
curl $url > "$installcredproviderPath"
else
wget -q -O "$installcredproviderPath" "$url"
fi
echo "Installing plugin..."
. "$installcredproviderPath"
echo "Deleting local copy of 'installcredprovider.sh'..."
rm installcredprovider.sh
if [ ! -d "$HOME/.nuget/plugins" ]; then
echo "CredProvider plugin was not installed correctly!"
ExitWithExitCode 1
else
echo "CredProvider plugin was installed correctly!"
fi
# Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable
# feeds successfully
local nugetConfigPath="$repo_root/NuGet.config"
if [ ! "$nugetConfigPath" ]; then
echo "NuGet.config file not found in repo's root!"
ExitWithExitCode 1
fi
local endpoints='['
local nugetConfigPackageValues=`cat "$nugetConfigPath" | grep "key=\"darc-int-"`
local pattern="value=\"(.*)\""
for value in $nugetConfigPackageValues
do
if [[ $value =~ $pattern ]]; then
local endpoint="${BASH_REMATCH[1]}"
endpoints+="{\"endpoint\": \"$endpoint\", \"password\": \"$authToken\"},"
fi
done
endpoints=${endpoints%?}
endpoints+=']'
if [ ${#endpoints} -gt 2 ]; then
# Create the JSON object. It should look like '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}'
local endpointCredentials="{\"endpointCredentials\": "$endpoints"}"
echo "##vso[task.setvariable variable=VSS_NUGET_EXTERNAL_FEED_ENDPOINTS]$endpointCredentials"
echo "##vso[task.setvariable variable=NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED]False"
else
echo "No internal endpoints found in NuGet.config"
fi
}
# Workaround for https://github.com/microsoft/msbuild/issues/4430
function InstallDotNetSdkAndRestoreArcade {
local dotnetTempDir="$repo_root/dotnet"
local dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*)
local restoreProjPath="$repo_root/eng/common/restore.proj"
echo "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..."
echo "<Project Sdk=\"Microsoft.DotNet.Arcade.Sdk\"/>" > "$restoreProjPath"
InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion"
local res=`$dotnetTempDir/dotnet restore $restoreProjPath`
echo "Arcade SDK restored!"
# Cleanup
if [ "$restoreProjPath" ]; then
rm "$restoreProjPath"
fi
if [ "$dotnetTempDir" ]; then
rm -r $dotnetTempDir
fi
}
source="${BASH_SOURCE[0]}"
operation=''
authToken=''
repoName=''
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
case "$opt" in
--operation)
operation=$2
shift
;;
--authtoken)
authToken=$2
shift
;;
*)
echo "Invalid argument: $1"
usage
exit 1
;;
esac
shift
done
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. "$scriptroot/tools.sh"
if [ "$operation" = "setup" ]; then
SetupCredProvider $authToken
elif [ "$operation" = "install-restore" ]; then
InstallDotNetSdkAndRestoreArcade
else
echo "Unknown operation '$operation'!"
fi
+32 -3
View File
@@ -59,9 +59,38 @@ function DownloadAndExtract {
-Verbose:$Verbose
if ($UnzipStatus -Eq $False) {
Write-Error "Unzip failed"
return $False
# Retry Download one more time with Force=true
$DownloadRetryStatus = CommonLibrary\Get-File -Uri $Uri `
-Path $TempToolPath `
-DownloadRetries 1 `
-RetryWaitTimeInSeconds $RetryWaitTimeInSeconds `
-Force:$True `
-Verbose:$Verbose
if ($DownloadRetryStatus -Eq $False) {
Write-Error "Last attempt of download failed as well"
return $False
}
# Retry unzip again one more time with Force=true
$UnzipRetryStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath `
-OutputDirectory $InstallDirectory `
-Force:$True `
-Verbose:$Verbose
if ($UnzipRetryStatus -Eq $False)
{
Write-Error "Last attempt of unzip failed as well"
# Clean up partial zips and extracts
if (Test-Path $TempToolPath) {
Remove-Item $TempToolPath -Force
}
if (Test-Path $InstallDirectory) {
Remove-Item $InstallDirectory -Force -Recurse
}
return $False
}
}
return $True
}
@@ -209,7 +238,7 @@ function New-ScriptShim {
Remove-Item (Join-Path $ShimDirectory "$ShimName.exe")
}
Invoke-Expression "$ShimDirectory\WinShimmer\winshimmer.exe $ShimName $ToolFilePath $ShimDirectory"
& "$ShimDirectory\WinShimmer\winshimmer.exe" $ShimName $ToolFilePath $ShimDirectory
return $True
}
catch {
@@ -0,0 +1,77 @@
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">
<PropertyGroup Condition="'$(AGENT_OS)' == 'Windows_NT'">
<WorkItemCommand>%HELIX_CORRELATION_PAYLOAD%\performance\scripts\benchmarks_ci.py --csproj %HELIX_CORRELATION_PAYLOAD%\performance\$(TargetCsproj)</WorkItemCommand>
<CliArguments>--dotnet-versions %DOTNET_VERSION% --cli-source-info args --cli-branch %PERFLAB_BRANCH% --cli-commit-sha %PERFLAB_HASH% --cli-repository https://github.com/%PERFLAB_REPO% --cli-source-timestamp %PERFLAB_BUILDTIMESTAMP%</CliArguments>
<Python>py -3</Python>
<CoreRun>%HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe</CoreRun>
<HelixPreCommands>$(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd</HelixPreCommands>
<ArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts</ArtifactsDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT' and '$(RunFromPerfRepo)' == 'false'">
<BaseDirectory>$HELIX_CORRELATION_PAYLOAD</BaseDirectory>
<PerformanceDirectory>$(BaseDirectory)/performance</PerformanceDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT' and '$(RunFromPerfRepo)' == 'true'">
<BaseDirectory>$HELIX_WORKITEM_PAYLOAD</BaseDirectory>
<PerformanceDirectory>$(BaseDirectory)</PerformanceDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT'">
<WorkItemCommand>$(PerformanceDirectory)/scripts/benchmarks_ci.py --csproj $(PerformanceDirectory)/$(TargetCsproj)</WorkItemCommand>
<CliArguments>--dotnet-versions $DOTNET_VERSION --cli-source-info args --cli-branch $PERFLAB_BRANCH --cli-commit-sha $PERFLAB_HASH --cli-repository https://github.com/$PERFLAB_REPO --cli-source-timestamp $PERFLAB_BUILDTIMESTAMP</CliArguments>
<Python>python3</Python>
<CoreRun>$(BaseDirectory)/Core_Root/corerun</CoreRun>
<HelixPreCommands>$(HelixPreCommands);chmod +x $(PerformanceDirectory)/tools/machine-setup.sh;. $(PerformanceDirectory)/tools/machine-setup.sh</HelixPreCommands>
<ArtifactsDirectory>$(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts</ArtifactsDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(UseCoreRun)' == 'true'">
<CoreRunArgument>--corerun $(CoreRun)</CoreRunArgument>
</PropertyGroup>
<PropertyGroup Condition="'$(WorkItemCommand)' != ''">
<WorkItemCommand>$(Python) $(WorkItemCommand) --incremental no --architecture $(Architecture) -f $(_Framework) $(PerfLabArguments)</WorkItemCommand>
</PropertyGroup>
<PropertyGroup Condition="'$(_Framework)' != 'net461'">
<WorkItemCommand>$(WorkItemCommand) $(CliArguments)</WorkItemCommand>
</PropertyGroup>
<ItemGroup>
<HelixCorrelationPayload Include="$(CorrelationPayloadDirectory)">
<PayloadDirectory>%(Identity)</PayloadDirectory>
</HelixCorrelationPayload>
</ItemGroup>
<PropertyGroup>
<PartitionCount>5</PartitionCount>
</PropertyGroup>
<ItemGroup>
<Partition Include="$(BuildConfig).Partition0" Index="0" />
<Partition Include="$(BuildConfig).Partition1" Index="1" />
<Partition Include="$(BuildConfig).Partition2" Index="2" />
<Partition Include="$(BuildConfig).Partition3" Index="3" />
<Partition Include="$(BuildConfig).Partition4" Index="4" />
</ItemGroup>
<!--
Partition the Microbenchmarks project, but nothing else
-->
<ItemGroup Condition="$(TargetCsproj.Contains('MicroBenchmarks.csproj'))">
<HelixWorkItem Include="@(Partition)">
<PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
<Command>$(WorkItemCommand) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --artifacts $(ArtifactsDirectory) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"</Command>
<Timeout>4:00</Timeout>
</HelixWorkItem>
</ItemGroup>
<ItemGroup Condition="!$(TargetCsproj.Contains('MicroBenchmarks.csproj'))">
<HelixWorkItem Include="$(BuildConfig).WorkItem">
<PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
<Command>$(WorkItemCommand) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --artifacts $(ArtifactsDirectory)"</Command>
<Timeout>4:00</Timeout>
</HelixWorkItem>
</ItemGroup>
</Project>
@@ -0,0 +1,91 @@
Param(
[string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY,
[string] $CoreRootDirectory,
[string] $Architecture="x64",
[string] $Framework="netcoreapp3.0",
[string] $CompilationMode="Tiered",
[string] $Repository=$env:BUILD_REPOSITORY_NAME,
[string] $Branch=$env:BUILD_SOURCEBRANCH,
[string] $CommitSha=$env:BUILD_SOURCEVERSION,
[string] $BuildNumber=$env:BUILD_BUILDNUMBER,
[string] $RunCategories="coreclr corefx",
[string] $Csproj="src\benchmarks\micro\MicroBenchmarks.csproj",
[string] $Kind="micro",
[switch] $Internal,
[string] $Configurations="CompilationMode=$CompilationMode"
)
$RunFromPerformanceRepo = ($Repository -eq "dotnet/performance")
$UseCoreRun = ($CoreRootDirectory -ne [string]::Empty)
$PayloadDirectory = (Join-Path $SourceDirectory "Payload")
$PerformanceDirectory = (Join-Path $PayloadDirectory "performance")
$WorkItemDirectory = (Join-Path $SourceDirectory "workitem")
$ExtraBenchmarkDotNetArguments = "--iterationCount 1 --warmupCount 0 --invocationCount 1 --unrollFactor 1 --strategy ColdStart --stopOnFirstError true"
$Creator = $env:BUILD_DEFINITIONNAME
$PerfLabArguments = ""
$HelixSourcePrefix = "pr"
$Queue = "Windows.10.Amd64.ClientRS4.DevEx.15.8.Open"
if ($Framework.StartsWith("netcoreapp")) {
$Queue = "Windows.10.Amd64.ClientRS4.Open"
}
if ($Internal) {
$Queue = "Windows.10.Amd64.ClientRS5.Perf"
$PerfLabArguments = "--upload-to-perflab-container"
$ExtraBenchmarkDotNetArguments = ""
$Creator = ""
$HelixSourcePrefix = "official"
}
$CommonSetupArguments="--frameworks $Framework --queue $Queue --build-number $BuildNumber --build-configs $Configurations"
$SetupArguments = "--repository https://github.com/$Repository --branch $Branch --get-perf-hash --commit-sha $CommitSha $CommonSetupArguments"
if ($RunFromPerformanceRepo) {
$SetupArguments = "--perf-hash $CommitSha $CommonSetupArguments"
robocopy $SourceDirectory $PerformanceDirectory /E /XD $PayloadDirectory $SourceDirectory\artifacts $SourceDirectory\.git
}
else {
git clone --branch master --depth 1 --quiet https://github.com/dotnet/performance $PerformanceDirectory
}
if ($UseCoreRun) {
$NewCoreRoot = (Join-Path $PayloadDirectory "Core_Root")
Move-Item -Path $CoreRootDirectory -Destination $NewCoreRoot
}
$DocsDir = (Join-Path $PerformanceDirectory "docs")
robocopy $DocsDir $WorkItemDirectory
# Set variables that we will need to have in future steps
$ci = $true
. "$PSScriptRoot\..\pipeline-logging-functions.ps1"
# Directories
Write-PipelineSetVariable -Name 'PayloadDirectory' -Value "$PayloadDirectory" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'PerformanceDirectory' -Value "$PerformanceDirectory" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'WorkItemDirectory' -Value "$WorkItemDirectory" -IsMultiJobVariable $false
# Script Arguments
Write-PipelineSetVariable -Name 'Python' -Value "py -3" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'ExtraBenchmarkDotNetArguments' -Value "$ExtraBenchmarkDotNetArguments" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'SetupArguments' -Value "$SetupArguments" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'PerfLabArguments' -Value "$PerfLabArguments" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'BDNCategories' -Value "$RunCategories" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'TargetCsproj' -Value "$Csproj" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'Kind' -Value "$Kind" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'Architecture' -Value "$Architecture" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'UseCoreRun' -Value "$UseCoreRun" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'RunFromPerfRepo' -Value "$RunFromPerformanceRepo" -IsMultiJobVariable $false
# Helix Arguments
Write-PipelineSetVariable -Name 'Creator' -Value "$Creator" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'Queue' -Value "$Queue" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name 'HelixSourcePrefix' -Value "$HelixSourcePrefix" -IsMultiJobVariable $false
Write-PipelineSetVariable -Name '_BuildConfig' -Value "$Architecture.$Kind.$Framework" -IsMultiJobVariable $false
exit 0
+176
View File
@@ -0,0 +1,176 @@
#!/usr/bin/env bash
source_directory=$BUILD_SOURCESDIRECTORY
core_root_directory=
architecture=x64
framework=netcoreapp3.0
compilation_mode=tiered
repository=$BUILD_REPOSITORY_NAME
branch=$BUILD_SOURCEBRANCH
commit_sha=$BUILD_SOURCEVERSION
build_number=$BUILD_BUILDNUMBER
internal=false
kind="micro"
run_categories="coreclr corefx"
csproj="src\benchmarks\micro\MicroBenchmarks.csproj"
configurations=
run_from_perf_repo=false
use_core_run=true
while (($# > 0)); do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
--sourcedirectory)
source_directory=$2
shift 2
;;
--corerootdirectory)
core_root_directory=$2
shift 2
;;
--architecture)
architecture=$2
shift 2
;;
--framework)
framework=$2
shift 2
;;
--compilationmode)
compilation_mode=$2
shift 2
;;
--repository)
repository=$2
shift 2
;;
--branch)
branch=$2
shift 2
;;
--commitsha)
commit_sha=$2
shift 2
;;
--buildnumber)
build_number=$2
shift 2
;;
--kind)
kind=$2
shift 2
;;
--runcategories)
run_categories=$2
shift 2
;;
--csproj)
csproj=$2
shift 2
;;
--internal)
internal=true
shift 1
;;
--configurations)
configurations=$2
shift 2
;;
--help)
echo "Common settings:"
echo " --corerootdirectory <value> Directory where Core_Root exists, if running perf testing with --corerun"
echo " --architecture <value> Architecture of the testing being run"
echo " --configurations <value> List of key=value pairs that will be passed to perf testing infrastructure."
echo " ex: --configurations \"CompilationMode=Tiered OptimzationLevel=PGO\""
echo " --help Print help and exit"
echo ""
echo "Advanced settings:"
echo " --framework <value> The framework to run, if not running in master"
echo " --compliationmode <value> The compilation mode if not passing --configurations"
echo " --sourcedirectory <value> The directory of the sources. Defaults to env:BUILD_SOURCESDIRECTORY"
echo " --repository <value> The name of the repository in the <owner>/<repository name> format. Defaults to env:BUILD_REPOSITORY_NAME"
echo " --branch <value> The name of the branch. Defaults to env:BUILD_SOURCEBRANCH"
echo " --commitsha <value> The commit sha1 to run against. Defaults to env:BUILD_SOURCEVERSION"
echo " --buildnumber <value> The build number currently running. Defaults to env:BUILD_BUILDNUMBER"
echo " --csproj The relative path to the benchmark csproj whose tests should be run. Defaults to src\benchmarks\micro\MicroBenchmarks.csproj"
echo " --kind <value> Related to csproj. The kind of benchmarks that should be run. Defaults to micro"
echo " --runcategories <value> Related to csproj. Categories of benchmarks to run. Defaults to \"coreclr corefx\""
echo " --internal If the benchmarks are running as an official job."
echo ""
exit 0
;;
esac
done
if [[ "$repository" == "dotnet/performance" ]]; then
run_from_perf_repo=true
fi
if [ -z "$configurations" ]; then
configurations="CompliationMode=$compilation_mode"
fi
if [ -z "$core_root_directory" ]; then
use_core_run=false
fi
payload_directory=$source_directory/Payload
performance_directory=$payload_directory/performance
workitem_directory=$source_directory/workitem
extra_benchmark_dotnet_arguments="--iterationCount 1 --warmupCount 0 --invocationCount 1 --unrollFactor 1 --strategy ColdStart --stopOnFirstError true"
perflab_arguments=
queue=Ubuntu.1804.Amd64.Open
creator=$BUILD_DEFINITIONNAME
helix_source_prefix="pr"
if [[ "$internal" == true ]]; then
perflab_arguments="--upload-to-perflab-container"
helix_source_prefix="official"
creator=
extra_benchmark_dotnet_arguments=
if [[ "$architecture" = "arm64" ]]; then
queue=Ubuntu.1804.Arm64.Perf
else
queue=Ubuntu.1804.Amd64.Perf
fi
fi
common_setup_arguments="--frameworks $framework --queue $queue --build-number $build_number --build-configs $configurations"
setup_arguments="--repository https://github.com/$repository --branch $branch --get-perf-hash --commit-sha $commit_sha $common_setup_arguments"
if [[ "$run_from_perf_repo" = true ]]; then
payload_directory=
workitem_directory=$source_directory
performance_directory=$workitem_directory
setup_arguments="--perf-hash $commit_sha $common_setup_arguments"
else
git clone --branch master --depth 1 --quiet https://github.com/dotnet/performance $performance_directory
docs_directory=$performance_directory/docs
mv $docs_directory $workitem_directory
fi
if [[ "$use_core_run" = true ]]; then
new_core_root=$payload_directory/Core_Root
mv $core_root_directory $new_core_root
fi
# Make sure all of our variables are available for future steps
echo "##vso[task.setvariable variable=UseCoreRun]$use_core_run"
echo "##vso[task.setvariable variable=Architecture]$architecture"
echo "##vso[task.setvariable variable=PayloadDirectory]$payload_directory"
echo "##vso[task.setvariable variable=PerformanceDirectory]$performance_directory"
echo "##vso[task.setvariable variable=WorkItemDirectory]$workitem_directory"
echo "##vso[task.setvariable variable=Queue]$queue"
echo "##vso[task.setvariable variable=SetupArguments]$setup_arguments"
echo "##vso[task.setvariable variable=Python]python3"
echo "##vso[task.setvariable variable=PerfLabArguments]$perflab_arguments"
echo "##vso[task.setvariable variable=ExtraBenchmarkDotNetArguments]$extra_benchmark_dotnet_arguments"
echo "##vso[task.setvariable variable=BDNCategories]$run_categories"
echo "##vso[task.setvariable variable=TargetCsproj]$csproj"
echo "##vso[task.setvariable variable=RunFromPerfRepo]$run_from_perf_repo"
echo "##vso[task.setvariable variable=Creator]$creator"
echo "##vso[task.setvariable variable=HelixSourcePrefix]$helix_source_prefix"
echo "##vso[task.setvariable variable=Kind]$kind"
echo "##vso[task.setvariable variable=_BuildConfig]$architecture.$kind.$framework"
+234
View File
@@ -0,0 +1,234 @@
# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1 and modified.
# NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1
$script:loggingCommandPrefix = '##vso['
$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"?
New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' }
New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' }
New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' }
New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' }
)
# TODO: BUG: Escape % ???
# TODO: Add test to verify don't need to escape "=".
function Write-PipelineTelemetryError {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Category,
[Parameter(Mandatory = $true)]
[string]$Message,
[Parameter(Mandatory = $false)]
[string]$Type = 'error',
[string]$ErrCode,
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput)
$PSBoundParameters.Remove("Category") | Out-Null
$Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message"
$PSBoundParameters.Remove("Message") | Out-Null
$PSBoundParameters.Add("Message", $Message)
Write-PipelineTaskError @PSBoundParameters
}
function Write-PipelineTaskError {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Message,
[Parameter(Mandatory = $false)]
[string]$Type = 'error',
[string]$ErrCode,
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput)
if(!$ci) {
if($Type -eq 'error') {
Write-Host $Message -ForegroundColor Red
return
}
elseif ($Type -eq 'warning') {
Write-Host $Message -ForegroundColor Yellow
return
}
}
if(($Type -ne 'error') -and ($Type -ne 'warning')) {
Write-Host $Message
return
}
if(-not $PSBoundParameters.ContainsKey('Type')) {
$PSBoundParameters.Add('Type', 'error')
}
Write-LogIssue @PSBoundParameters
}
function Write-PipelineSetVariable {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Name,
[string]$Value,
[switch]$Secret,
[switch]$AsOutput,
[bool]$IsMultiJobVariable=$true)
if($ci) {
Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{
'variable' = $Name
'isSecret' = $Secret
'isOutput' = $IsMultiJobVariable
} -AsOutput:$AsOutput
}
}
function Write-PipelinePrependPath {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$Path,
[switch]$AsOutput)
if($ci) {
Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput
}
}
<########################################
# Private functions.
########################################>
function Format-LoggingCommandData {
[CmdletBinding()]
param([string]$Value, [switch]$Reverse)
if (!$Value) {
return ''
}
if (!$Reverse) {
foreach ($mapping in $script:loggingCommandEscapeMappings) {
$Value = $Value.Replace($mapping.Token, $mapping.Replacement)
}
} else {
for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) {
$mapping = $script:loggingCommandEscapeMappings[$i]
$Value = $Value.Replace($mapping.Replacement, $mapping.Token)
}
}
return $Value
}
function Format-LoggingCommand {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Area,
[Parameter(Mandatory = $true)]
[string]$Event,
[string]$Data,
[hashtable]$Properties)
# Append the preamble.
[System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder
$null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event)
# Append the properties.
if ($Properties) {
$first = $true
foreach ($key in $Properties.Keys) {
[string]$value = Format-LoggingCommandData $Properties[$key]
if ($value) {
if ($first) {
$null = $sb.Append(' ')
$first = $false
} else {
$null = $sb.Append(';')
}
$null = $sb.Append("$key=$value")
}
}
}
# Append the tail and output the value.
$Data = Format-LoggingCommandData $Data
$sb.Append(']').Append($Data).ToString()
}
function Write-LoggingCommand {
[CmdletBinding(DefaultParameterSetName = 'Parameters')]
param(
[Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
[string]$Area,
[Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
[string]$Event,
[Parameter(ParameterSetName = 'Parameters')]
[string]$Data,
[Parameter(ParameterSetName = 'Parameters')]
[hashtable]$Properties,
[Parameter(Mandatory = $true, ParameterSetName = 'Object')]
$Command,
[switch]$AsOutput)
if ($PSCmdlet.ParameterSetName -eq 'Object') {
Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput
return
}
$command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties
if ($AsOutput) {
$command
} else {
Write-Host $command
}
}
function Write-LogIssue {
[CmdletBinding()]
param(
[ValidateSet('warning', 'error')]
[Parameter(Mandatory = $true)]
[string]$Type,
[string]$Message,
[string]$ErrCode,
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput)
$command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{
'type' = $Type
'code' = $ErrCode
'sourcepath' = $SourcePath
'linenumber' = $LineNumber
'columnnumber' = $ColumnNumber
}
if ($AsOutput) {
return $command
}
if ($Type -eq 'error') {
$foregroundColor = $host.PrivateData.ErrorForegroundColor
$backgroundColor = $host.PrivateData.ErrorBackgroundColor
if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
$foregroundColor = [System.ConsoleColor]::Red
$backgroundColor = [System.ConsoleColor]::Black
}
} else {
$foregroundColor = $host.PrivateData.WarningForegroundColor
$backgroundColor = $host.PrivateData.WarningBackgroundColor
if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
$foregroundColor = [System.ConsoleColor]::Yellow
$backgroundColor = [System.ConsoleColor]::Black
}
}
Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor
}
+172
View File
@@ -0,0 +1,172 @@
#!/usr/bin/env bash
function Write-PipelineTelemetryError {
local telemetry_category=''
local function_args=()
local message=''
while [[ $# -gt 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-category|-c)
telemetry_category=$2
shift
;;
-*)
function_args+=("$1 $2")
shift
;;
*)
message=$*
;;
esac
shift
done
if [[ "$ci" != true ]]; then
echo "$message" >&2
return
fi
message="(NETCORE_ENGINEERING_TELEMETRY=$telemetry_category) $message"
function_args+=("$message")
Write-PipelineTaskError $function_args
}
function Write-PipelineTaskError {
if [[ "$ci" != true ]]; then
echo "$@" >&2
return
fi
local message_type="error"
local sourcepath=''
local linenumber=''
local columnnumber=''
local error_code=''
while [[ $# -gt 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-type|-t)
message_type=$2
shift
;;
-sourcepath|-s)
sourcepath=$2
shift
;;
-linenumber|-ln)
linenumber=$2
shift
;;
-columnnumber|-cn)
columnnumber=$2
shift
;;
-errcode|-e)
error_code=$2
shift
;;
*)
break
;;
esac
shift
done
local message="##vso[task.logissue"
message="$message type=$message_type"
if [ -n "$sourcepath" ]; then
message="$message;sourcepath=$sourcepath"
fi
if [ -n "$linenumber" ]; then
message="$message;linenumber=$linenumber"
fi
if [ -n "$columnnumber" ]; then
message="$message;columnnumber=$columnnumber"
fi
if [ -n "$error_code" ]; then
message="$message;code=$error_code"
fi
message="$message]$*"
echo "$message"
}
function Write-PipelineSetVariable {
if [[ "$ci" != true ]]; then
return
fi
local name=''
local value=''
local secret=false
local as_output=false
local is_multi_job_variable=true
while [[ $# -gt 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-name|-n)
name=$2
shift
;;
-value|-v)
value=$2
shift
;;
-secret|-s)
secret=true
;;
-as_output|-a)
as_output=true
;;
-is_multi_job_variable|-i)
is_multi_job_variable=$2
shift
;;
esac
shift
done
value=${value/;/%3B}
value=${value/\\r/%0D}
value=${value/\\n/%0A}
value=${value/]/%5D}
local message="##vso[task.setvariable variable=$name;isSecret=$secret;isOutput=$is_multi_job_variable]$value"
if [[ "$as_output" == true ]]; then
$message
else
echo "$message"
fi
}
function Write-PipelinePrependPath {
local prepend_path=''
while [[ $# -gt 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-path|-p)
prepend_path=$2
shift
;;
esac
shift
done
export PATH="$prepend_path:$PATH"
if [[ "$ci" == true ]]; then
echo "##vso[task.prependpath]$prepend_path"
fi
}
@@ -0,0 +1,35 @@
param(
[Parameter(Mandatory=$true)][int] $BarBuildId, # ID of the build which assets should be downloaded
[Parameter(Mandatory=$true)][string] $DropLocation, # Where the assets should be downloaded to
[Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, # Token used to access Maestro API
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = "https://maestro-prod.westus2.cloudapp.azure.com", # Maestro API URL
[Parameter(Mandatory=$false)][string] $MaestroApiVersion = "2019-01-16" # Version of Maestro API to use
)
. $PSScriptRoot\post-build-utils.ps1
try {
Write-Host "Installing DARC ..."
. $PSScriptRoot\..\darc-init.ps1
$exitCode = $LASTEXITCODE
if ($exitCode -ne 0) {
Write-PipelineTaskError "Something failed while running 'darc-init.ps1'. Check for errors above. Exiting now..."
ExitWithExitCode $exitCode
}
darc gather-drop --non-shipping `
--continue-on-error `
--id $BarBuildId `
--output-dir $DropLocation `
--bar-uri $MaestroApiEndpoint `
--password $MaestroApiAccessToken `
--latest-location
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}
@@ -0,0 +1,25 @@
# This script validates NuGet package metadata information using this
# tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage
param(
[Parameter(Mandatory=$true)][string] $PackagesPath, # Path to where the packages to be validated are
[Parameter(Mandatory=$true)][string] $ToolDestinationPath # Where the validation tool should be downloaded to
)
. $PSScriptRoot\post-build-utils.ps1
try {
$url = "https://raw.githubusercontent.com/NuGet/NuGetGallery/jver-verify/src/VerifyMicrosoftPackage/verify.ps1"
New-Item -ItemType "directory" -Path ${ToolDestinationPath} -Force
Invoke-WebRequest $url -OutFile ${ToolDestinationPath}\verify.ps1
& ${ToolDestinationPath}\verify.ps1 ${PackagesPath}\*.nupkg
}
catch {
Write-PipelineTaskError "NuGet package validation failed. Please check error logs."
Write-Host $_
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}
@@ -0,0 +1,90 @@
# Most of the functions in this file require the variables `MaestroApiEndPoint`,
# `MaestroApiVersion` and `MaestroApiAccessToken` to be globally available.
$ErrorActionPreference = "Stop"
Set-StrictMode -Version 2.0
# `tools.ps1` checks $ci to perform some actions. Since the post-build
# scripts don't necessarily execute in the same agent that run the
# build.ps1/sh script this variable isn't automatically set.
$ci = $true
. $PSScriptRoot\..\tools.ps1
function Create-MaestroApiRequestHeaders([string]$ContentType = "application/json") {
Validate-MaestroVars
$headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]'
$headers.Add('Accept', $ContentType)
$headers.Add('Authorization',"Bearer $MaestroApiAccessToken")
return $headers
}
function Get-MaestroChannel([int]$ChannelId) {
Validate-MaestroVars
$apiHeaders = Create-MaestroApiRequestHeaders
$apiEndpoint = "$MaestroApiEndPoint/api/channels/${ChannelId}?api-version=$MaestroApiVersion"
$result = try { Invoke-WebRequest -Method Get -Uri $apiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" }
return $result
}
function Get-MaestroBuild([int]$BuildId) {
Validate-MaestroVars
$apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken
$apiEndpoint = "$MaestroApiEndPoint/api/builds/${BuildId}?api-version=$MaestroApiVersion"
$result = try { return Invoke-WebRequest -Method Get -Uri $apiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" }
return $result
}
function Get-MaestroSubscriptions([string]$SourceRepository, [int]$ChannelId) {
Validate-MaestroVars
$SourceRepository = [System.Web.HttpUtility]::UrlEncode($SourceRepository)
$apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken
$apiEndpoint = "$MaestroApiEndPoint/api/subscriptions?sourceRepository=$SourceRepository&channelId=$ChannelId&api-version=$MaestroApiVersion"
$result = try { Invoke-WebRequest -Method Get -Uri $apiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" }
return $result
}
function Trigger-Subscription([string]$SubscriptionId) {
Validate-MaestroVars
$apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken
$apiEndpoint = "$MaestroApiEndPoint/api/subscriptions/$SubscriptionId/trigger?api-version=$MaestroApiVersion"
Invoke-WebRequest -Uri $apiEndpoint -Headers $apiHeaders -Method Post | Out-Null
}
function Assign-BuildToChannel([int]$BuildId, [int]$ChannelId) {
Validate-MaestroVars
$apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken
$apiEndpoint = "$MaestroApiEndPoint/api/channels/${ChannelId}/builds/${BuildId}?api-version=$MaestroApiVersion"
Invoke-WebRequest -Method Post -Uri $apiEndpoint -Headers $apiHeaders | Out-Null
}
function Validate-MaestroVars {
try {
Get-Variable MaestroApiEndPoint -Scope Global | Out-Null
Get-Variable MaestroApiVersion -Scope Global | Out-Null
Get-Variable MaestroApiAccessToken -Scope Global | Out-Null
if (!($MaestroApiEndPoint -Match "^http[s]?://maestro-(int|prod).westus2.cloudapp.azure.com$")) {
Write-PipelineTaskError "MaestroApiEndPoint is not a valid Maestro URL. '$MaestroApiEndPoint'"
ExitWithExitCode 1
}
if (!($MaestroApiVersion -Match "^[0-9]{4}-[0-9]{2}-[0-9]{2}$")) {
Write-PipelineTaskError "MaestroApiVersion does not match a version string in the format yyyy-MM-DD. '$MaestroApiVersion'"
ExitWithExitCode 1
}
}
catch {
Write-PipelineTaskError "Error: Variables `MaestroApiEndPoint`, `MaestroApiVersion` and `MaestroApiAccessToken` are required while using this script."
Write-Host $_
ExitWithExitCode 1
}
}
+48
View File
@@ -0,0 +1,48 @@
param(
[Parameter(Mandatory=$true)][int] $BuildId,
[Parameter(Mandatory=$true)][int] $ChannelId,
[Parameter(Mandatory=$true)][string] $MaestroApiAccessToken,
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = "https://maestro-prod.westus2.cloudapp.azure.com",
[Parameter(Mandatory=$false)][string] $MaestroApiVersion = "2019-01-16"
)
. $PSScriptRoot\post-build-utils.ps1
try {
# Check that the channel we are going to promote the build to exist
$channelInfo = Get-MaestroChannel -ChannelId $ChannelId
if (!$channelInfo) {
Write-Host "Channel with BAR ID $ChannelId was not found in BAR!"
ExitWithExitCode 1
}
# Get info about which channels the build has already been promoted to
$buildInfo = Get-MaestroBuild -BuildId $BuildId
if (!$buildInfo) {
Write-Host "Build with BAR ID $BuildId was not found in BAR!"
ExitWithExitCode 1
}
# Find whether the build is already assigned to the channel or not
if ($buildInfo.channels) {
foreach ($channel in $buildInfo.channels) {
if ($channel.Id -eq $ChannelId) {
Write-Host "The build with BAR ID $BuildId is already on channel $ChannelId!"
ExitWithExitCode 0
}
}
}
Write-Host "Promoting build '$BuildId' to channel '$ChannelId'."
Assign-BuildToChannel -BuildId $BuildId -ChannelId $ChannelId
Write-Host "done."
}
catch {
Write-Host "There was an error while trying to promote build '$BuildId' to channel '$ChannelId'"
Write-Host $_
Write-Host $_.ScriptStackTrace
}
@@ -0,0 +1,26 @@
param(
[Parameter(Mandatory=$true)][string] $ReleaseConfigsPath # Full path to ReleaseConfigs.txt asset
)
. $PSScriptRoot\post-build-utils.ps1
try {
$Content = Get-Content $ReleaseConfigsPath
$BarId = $Content | Select -Index 0
$Channels = ""
$Content | Select -Index 1 | ForEach-Object { $Channels += "$_ ," }
$IsStableBuild = $Content | Select -Index 2
Write-PipelineSetVariable -Name 'BARBuildId' -Value $BarId
Write-PipelineSetVariable -Name 'InitialChannels' -Value "$Channels"
Write-PipelineSetVariable -Name 'IsStableBuild' -Value $IsStableBuild
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}
@@ -0,0 +1,227 @@
param(
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where Symbols.NuGet packages to be checked are stored
[Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
[Parameter(Mandatory=$true)][string] $GHRepoName, # GitHub name of the repo including the Org. E.g., dotnet/arcade
[Parameter(Mandatory=$true)][string] $GHCommit, # GitHub commit SHA used to build the packages
[Parameter(Mandatory=$true)][string] $SourcelinkCliVersion # Version of SourceLink CLI to use
)
. $PSScriptRoot\post-build-utils.ps1
# Cache/HashMap (File -> Exist flag) used to consult whether a file exist
# in the repository at a specific commit point. This is populated by inserting
# all files present in the repo at a specific commit point.
$global:RepoFiles = @{}
$ValidatePackage = {
param(
[string] $PackagePath # Full path to a Symbols.NuGet package
)
. $using:PSScriptRoot\..\tools.ps1
# Ensure input file exist
if (!(Test-Path $PackagePath)) {
Write-PipelineTaskError "Input file does not exist: $PackagePath"
ExitWithExitCode 1
}
# Extensions for which we'll look for SourceLink information
# For now we'll only care about Portable & Embedded PDBs
$RelevantExtensions = @(".dll", ".exe", ".pdb")
Write-Host -NoNewLine "Validating" ([System.IO.Path]::GetFileName($PackagePath)) "... "
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId
$FailedFiles = 0
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Directory]::CreateDirectory($ExtractPath);
try {
$zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath)
$zip.Entries |
Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} |
ForEach-Object {
$FileName = $_.FullName
$Extension = [System.IO.Path]::GetExtension($_.Name)
$FakeName = -Join((New-Guid), $Extension)
$TargetFile = Join-Path -Path $ExtractPath -ChildPath $FakeName
# We ignore resource DLLs
if ($FileName.EndsWith(".resources.dll")) {
return
}
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true)
$ValidateFile = {
param(
[string] $FullPath, # Full path to the module that has to be checked
[string] $RealPath,
[ref] $FailedFiles
)
$sourcelinkExe = "$env:USERPROFILE\.dotnet\tools"
$sourcelinkExe = Resolve-Path "$sourcelinkExe\sourcelink.exe"
$SourceLinkInfos = & $sourcelinkExe print-urls $FullPath | Out-String
if ($LASTEXITCODE -eq 0 -and -not ([string]::IsNullOrEmpty($SourceLinkInfos))) {
$NumFailedLinks = 0
# We only care about Http addresses
$Matches = (Select-String '(http[s]?)(:\/\/)([^\s,]+)' -Input $SourceLinkInfos -AllMatches).Matches
if ($Matches.Count -ne 0) {
$Matches.Value |
ForEach-Object {
$Link = $_
$CommitUrl = "https://raw.githubusercontent.com/${using:GHRepoName}/${using:GHCommit}/"
$FilePath = $Link.Replace($CommitUrl, "")
$Status = 200
$Cache = $using:RepoFiles
if ( !($Cache.ContainsKey($FilePath)) ) {
try {
$Uri = $Link -as [System.URI]
# Only GitHub links are valid
if ($Uri.AbsoluteURI -ne $null -and ($Uri.Host -match "github" -or $Uri.Host -match "githubusercontent")) {
$Status = (Invoke-WebRequest -Uri $Link -UseBasicParsing -Method HEAD -TimeoutSec 5).StatusCode
}
else {
$Status = 0
}
}
catch {
write-host $_
$Status = 0
}
}
if ($Status -ne 200) {
if ($NumFailedLinks -eq 0) {
if ($FailedFiles.Value -eq 0) {
Write-Host
}
Write-Host "`tFile $RealPath has broken links:"
}
Write-Host "`t`tFailed to retrieve $Link"
$NumFailedLinks++
}
}
}
if ($NumFailedLinks -ne 0) {
$FailedFiles.value++
$global:LASTEXITCODE = 1
}
}
}
&$ValidateFile $TargetFile $FileName ([ref]$FailedFiles)
}
}
catch {
}
finally {
$zip.Dispose()
}
if ($FailedFiles -eq 0) {
Write-Host "Passed."
}
else {
Write-PipelineTaskError "$PackagePath has broken SourceLink links."
}
}
function ValidateSourceLinkLinks {
if (!($GHRepoName -Match "^[^\s\/]+/[^\s\/]+$")) {
if (!($GHRepoName -Match "^[^\s-]+-[^\s]+$")) {
Write-PipelineTaskError "GHRepoName should be in the format <org>/<repo> or <org>-<repo>"
ExitWithExitCode 1
}
else {
$GHRepoName = $GHRepoName -replace '^([^\s-]+)-([^\s]+)$', '$1/$2';
}
}
if (!($GHCommit -Match "^[0-9a-fA-F]{40}$")) {
Write-PipelineTaskError "GHCommit should be a 40 chars hexadecimal string"
ExitWithExitCode 1
}
$RepoTreeURL = -Join("http://api.github.com/repos/", $GHRepoName, "/git/trees/", $GHCommit, "?recursive=1")
$CodeExtensions = @(".cs", ".vb", ".fs", ".fsi", ".fsx", ".fsscript")
try {
# Retrieve the list of files in the repo at that particular commit point and store them in the RepoFiles hash
$Data = Invoke-WebRequest $RepoTreeURL -UseBasicParsing | ConvertFrom-Json | Select-Object -ExpandProperty tree
foreach ($file in $Data) {
$Extension = [System.IO.Path]::GetExtension($file.path)
if ($CodeExtensions.Contains($Extension)) {
$RepoFiles[$file.path] = 1
}
}
}
catch {
Write-PipelineTaskError "Problems downloading the list of files from the repo. Url used: $RepoTreeURL"
Write-Host $_
ExitWithExitCode 1
}
if (Test-Path $ExtractPath) {
Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue
}
# Process each NuGet package in parallel
$Jobs = @()
Get-ChildItem "$InputPath\*.symbols.nupkg" |
ForEach-Object {
$Jobs += Start-Job -ScriptBlock $ValidatePackage -ArgumentList $_.FullName
}
foreach ($Job in $Jobs) {
Wait-Job -Id $Job.Id | Receive-Job
}
}
function InstallSourcelinkCli {
$sourcelinkCliPackageName = "sourcelink"
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
$toolList = & "$dotnet" tool list --global
if (($toolList -like "*$sourcelinkCliPackageName*") -and ($toolList -like "*$sourcelinkCliVersion*")) {
Write-Host "SourceLink CLI version $sourcelinkCliVersion is already installed."
}
else {
Write-Host "Installing SourceLink CLI version $sourcelinkCliVersion..."
Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed."
& "$dotnet" tool install $sourcelinkCliPackageName --version $sourcelinkCliVersion --verbosity "minimal" --global
}
}
try {
InstallSourcelinkCli
ValidateSourceLinkLinks
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}
@@ -0,0 +1,189 @@
param(
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored
[Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
[Parameter(Mandatory=$true)][string] $DotnetSymbolVersion # Version of dotnet symbol to use
)
. $PSScriptRoot\post-build-utils.ps1
Add-Type -AssemblyName System.IO.Compression.FileSystem
function FirstMatchingSymbolDescriptionOrDefault {
param(
[string] $FullPath, # Full path to the module that has to be checked
[string] $TargetServerParam, # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols
[string] $SymbolsPath
)
$FileName = [System.IO.Path]::GetFileName($FullPath)
$Extension = [System.IO.Path]::GetExtension($FullPath)
# Those below are potential symbol files that the `dotnet symbol` might
# return. Which one will be returned depend on the type of file we are
# checking and which type of file was uploaded.
# The file itself is returned
$SymbolPath = $SymbolsPath + "\" + $FileName
# PDB file for the module
$PdbPath = $SymbolPath.Replace($Extension, ".pdb")
# PDB file for R2R module (created by crossgen)
$NGenPdb = $SymbolPath.Replace($Extension, ".ni.pdb")
# DBG file for a .so library
$SODbg = $SymbolPath.Replace($Extension, ".so.dbg")
# DWARF file for a .dylib
$DylibDwarf = $SymbolPath.Replace($Extension, ".dylib.dwarf")
$dotnetsymbolExe = "$env:USERPROFILE\.dotnet\tools"
$dotnetsymbolExe = Resolve-Path "$dotnetsymbolExe\dotnet-symbol.exe"
& $dotnetsymbolExe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath | Out-Null
if (Test-Path $PdbPath) {
return "PDB"
}
elseif (Test-Path $NGenPdb) {
return "NGen PDB"
}
elseif (Test-Path $SODbg) {
return "DBG for SO"
}
elseif (Test-Path $DylibDwarf) {
return "Dwarf for Dylib"
}
elseif (Test-Path $SymbolPath) {
return "Module"
}
else {
return $null
}
}
function CountMissingSymbols {
param(
[string] $PackagePath # Path to a NuGet package
)
# Ensure input file exist
if (!(Test-Path $PackagePath)) {
Write-PipelineTaskError "Input file does not exist: $PackagePath"
ExitWithExitCode 1
}
# Extensions for which we'll look for symbols
$RelevantExtensions = @(".dll", ".exe", ".so", ".dylib")
# How many files are missing symbol information
$MissingSymbols = 0
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$PackageGuid = New-Guid
$ExtractPath = Join-Path -Path $ExtractPath -ChildPath $PackageGuid
$SymbolsPath = Join-Path -Path $ExtractPath -ChildPath "Symbols"
[System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath)
Get-ChildItem -Recurse $ExtractPath |
Where-Object {$RelevantExtensions -contains $_.Extension} |
ForEach-Object {
if ($_.FullName -Match "\\ref\\") {
Write-Host "`t Ignoring reference assembly file" $_.FullName
return
}
$SymbolsOnMSDL = FirstMatchingSymbolDescriptionOrDefault $_.FullName "--microsoft-symbol-server" $SymbolsPath
$SymbolsOnSymWeb = FirstMatchingSymbolDescriptionOrDefault $_.FullName "--internal-server" $SymbolsPath
Write-Host -NoNewLine "`t Checking file" $_.FullName "... "
if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) {
Write-Host "Symbols found on MSDL (" $SymbolsOnMSDL ") and SymWeb (" $SymbolsOnSymWeb ")"
}
else {
$MissingSymbols++
if ($SymbolsOnMSDL -eq $null -and $SymbolsOnSymWeb -eq $null) {
Write-Host "No symbols found on MSDL or SymWeb!"
}
else {
if ($SymbolsOnMSDL -eq $null) {
Write-Host "No symbols found on MSDL!"
}
else {
Write-Host "No symbols found on SymWeb!"
}
}
}
}
Pop-Location
return $MissingSymbols
}
function CheckSymbolsAvailable {
if (Test-Path $ExtractPath) {
Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue
}
Get-ChildItem "$InputPath\*.nupkg" |
ForEach-Object {
$FileName = $_.Name
# These packages from Arcade-Services include some native libraries that
# our current symbol uploader can't handle. Below is a workaround until
# we get issue: https://github.com/dotnet/arcade/issues/2457 sorted.
if ($FileName -Match "Microsoft\.DotNet\.Darc\.") {
Write-Host "Ignoring Arcade-services file: $FileName"
Write-Host
return
}
elseif ($FileName -Match "Microsoft\.DotNet\.Maestro\.Tasks\.") {
Write-Host "Ignoring Arcade-services file: $FileName"
Write-Host
return
}
Write-Host "Validating $FileName "
$Status = CountMissingSymbols "$InputPath\$FileName"
if ($Status -ne 0) {
Write-PipelineTaskError "Missing symbols for $Status modules in the package $FileName"
ExitWithExitCode $exitCode
}
Write-Host
}
}
function Installdotnetsymbol {
$dotnetsymbolPackageName = "dotnet-symbol"
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
$toolList = & "$dotnet" tool list --global
if (($toolList -like "*$dotnetsymbolPackageName*") -and ($toolList -like "*$dotnetsymbolVersion*")) {
Write-Host "dotnet-symbol version $dotnetsymbolVersion is already installed."
}
else {
Write-Host "Installing dotnet-symbol version $dotnetsymbolVersion..."
Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed."
& "$dotnet" tool install $dotnetsymbolPackageName --version $dotnetsymbolVersion --verbosity "minimal" --global
}
}
try {
Installdotnetsymbol
CheckSymbolsAvailable
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}
@@ -0,0 +1,57 @@
param(
[Parameter(Mandatory=$true)][string] $SourceRepo,
[Parameter(Mandatory=$true)][int] $ChannelId,
[Parameter(Mandatory=$true)][string] $MaestroApiAccessToken,
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = "https://maestro-prod.westus2.cloudapp.azure.com",
[Parameter(Mandatory=$false)][string] $MaestroApiVersion = "2019-01-16"
)
. $PSScriptRoot\post-build-utils.ps1
# Get all the $SourceRepo subscriptions
$normalizedSourceRepo = $SourceRepo.Replace('dnceng@', '')
$subscriptions = Get-MaestroSubscriptions -SourceRepository $normalizedSourceRepo -ChannelId $ChannelId
if (!$subscriptions) {
Write-Host "No subscriptions found for source repo '$normalizedSourceRepo' in channel '$ChannelId'"
ExitWithExitCode 0
}
$subscriptionsToTrigger = New-Object System.Collections.Generic.List[string]
$failedTriggeredSubscription = $false
# Get all enabled subscriptions that need dependency flow on 'everyBuild'
foreach ($subscription in $subscriptions) {
if ($subscription.enabled -and $subscription.policy.updateFrequency -like 'everyBuild' -and $subscription.channel.id -eq $ChannelId) {
Write-Host "Should trigger this subscription: $subscription.id"
[void]$subscriptionsToTrigger.Add($subscription.id)
}
}
foreach ($subscriptionToTrigger in $subscriptionsToTrigger) {
try {
Write-Host "Triggering subscription '$subscriptionToTrigger'."
Trigger-Subscription -SubscriptionId $subscriptionToTrigger
Write-Host "done."
}
catch
{
Write-Host "There was an error while triggering subscription '$subscriptionToTrigger'"
Write-Host $_
Write-Host $_.ScriptStackTrace
$failedTriggeredSubscription = $true
}
}
if ($subscriptionsToTrigger.Count -eq 0) {
Write-Host "No subscription matched source repo '$normalizedSourceRepo' and channel ID '$ChannelId'."
}
elseif ($failedTriggeredSubscription) {
Write-Host "At least one subscription failed to be triggered..."
ExitWithExitCode 1
}
else {
Write-Host "All subscriptions were triggered successfully!"
}
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<clear />
<add key="guardian" value="https://securitytools.pkgs.visualstudio.com/_packaging/Guardian/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
+99
View File
@@ -0,0 +1,99 @@
Param(
[string] $GuardianPackageName, # Required: the name of guardian CLI package (not needed if GuardianCliLocation is specified)
[string] $NugetPackageDirectory, # Required: directory where NuGet packages are installed (not needed if GuardianCliLocation is specified)
[string] $GuardianCliLocation, # Optional: Direct location of Guardian CLI executable if GuardianPackageName & NugetPackageDirectory are not specified
[string] $Repository=$env:BUILD_REPOSITORY_NAME, # Required: the name of the repository (e.g. dotnet/arcade)
[string] $BranchName=$env:BUILD_SOURCEBRANCH, # Optional: name of branch or version of gdn settings; defaults to master
[string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, # Required: the directory where source files are located
[string] $ArtifactsDirectory = (Join-Path $env:BUILD_SOURCESDIRECTORY ("artifacts")), # Required: the directory where build artifacts are located
[string] $AzureDevOpsAccessToken, # Required: access token for dnceng; should be provided via KeyVault
[string[]] $SourceToolsList, # Optional: list of SDL tools to run on source code
[string[]] $ArtifactToolsList, # Optional: list of SDL tools to run on built artifacts
[bool] $TsaPublish=$False, # Optional: true will publish results to TSA; only set to true after onboarding to TSA; TSA is the automated framework used to upload test results as bugs.
[string] $TsaBranchName=$env:BUILD_SOURCEBRANCH, # Optional: required for TSA publish; defaults to $(Build.SourceBranchName); TSA is the automated framework used to upload test results as bugs.
[string] $TsaRepositoryName=$env:BUILD_REPOSITORY_NAME, # Optional: TSA repository name; will be generated automatically if not submitted; TSA is the automated framework used to upload test results as bugs.
[string] $BuildNumber=$env:BUILD_BUILDNUMBER, # Optional: required for TSA publish; defaults to $(Build.BuildNumber)
[bool] $UpdateBaseline=$False, # Optional: if true, will update the baseline in the repository; should only be run after fixing any issues which need to be fixed
[bool] $TsaOnboard=$False, # Optional: if true, will onboard the repository to TSA; should only be run once; TSA is the automated framework used to upload test results as bugs.
[string] $TsaInstanceUrl, # Optional: only needed if TsaOnboard or TsaPublish is true; the instance-url registered with TSA; TSA is the automated framework used to upload test results as bugs.
[string] $TsaCodebaseName, # Optional: only needed if TsaOnboard or TsaPublish is true; the name of the codebase registered with TSA; TSA is the automated framework used to upload test results as bugs.
[string] $TsaProjectName, # Optional: only needed if TsaOnboard or TsaPublish is true; the name of the project registered with TSA; TSA is the automated framework used to upload test results as bugs.
[string] $TsaNotificationEmail, # Optional: only needed if TsaOnboard is true; the email(s) which will receive notifications of TSA bug filings (e.g. [email protected]); TSA is the automated framework used to upload test results as bugs.
[string] $TsaCodebaseAdmin, # Optional: only needed if TsaOnboard is true; the aliases which are admins of the TSA codebase (e.g. DOMAIN\alias); TSA is the automated framework used to upload test results as bugs.
[string] $TsaBugAreaPath, # Optional: only needed if TsaOnboard is true; the area path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs.
[string] $TsaIterationPath, # Optional: only needed if TsaOnboard is true; the iteration path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs.
[string] $GuardianLoggerLevel="Standard", # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error
[string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional Params to custom build a CredScan run config in the format @("xyz:abc","sdf:1")
[string[]] $PoliCheckAdditionalRunConfigParams # Optional: Additional Params to custom build a Policheck run config in the format @("xyz:abc","sdf:1")
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version 2.0
$LASTEXITCODE = 0
#Replace repo names to the format of org/repo
if (!($Repository.contains('/'))) {
$RepoName = $Repository -replace '(.*?)-(.*)', '$1/$2';
}
else{
$RepoName = $Repository;
}
if ($GuardianPackageName) {
$guardianCliLocation = Join-Path $NugetPackageDirectory (Join-Path $GuardianPackageName (Join-Path "tools" "guardian.cmd"))
} else {
$guardianCliLocation = $GuardianCliLocation
}
$ValidPath = Test-Path $guardianCliLocation
if ($ValidPath -eq $False)
{
Write-Host "Invalid Guardian CLI Location."
exit 1
}
& $(Join-Path $PSScriptRoot "init-sdl.ps1") -GuardianCliLocation $guardianCliLocation -Repository $RepoName -BranchName $BranchName -WorkingDirectory $ArtifactsDirectory -AzureDevOpsAccessToken $AzureDevOpsAccessToken -GuardianLoggerLevel $GuardianLoggerLevel
$gdnFolder = Join-Path $ArtifactsDirectory ".gdn"
if ($TsaOnboard) {
if ($TsaCodebaseName -and $TsaNotificationEmail -and $TsaCodebaseAdmin -and $TsaBugAreaPath) {
Write-Host "$guardianCliLocation tsa-onboard --codebase-name `"$TsaCodebaseName`" --notification-alias `"$TsaNotificationEmail`" --codebase-admin `"$TsaCodebaseAdmin`" --instance-url `"$TsaInstanceUrl`" --project-name `"$TsaProjectName`" --area-path `"$TsaBugAreaPath`" --iteration-path `"$TsaIterationPath`" --working-directory $ArtifactsDirectory --logger-level $GuardianLoggerLevel"
& $guardianCliLocation tsa-onboard --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $ArtifactsDirectory --logger-level $GuardianLoggerLevel
if ($LASTEXITCODE -ne 0) {
Write-Host "Guardian tsa-onboard failed with exit code $LASTEXITCODE."
exit $LASTEXITCODE
}
} else {
Write-Host "Could not onboard to TSA -- not all required values ($$TsaCodebaseName, $$TsaNotificationEmail, $$TsaCodebaseAdmin, $$TsaBugAreaPath) were specified."
exit 1
}
}
if ($ArtifactToolsList -and $ArtifactToolsList.Count -gt 0) {
& $(Join-Path $PSScriptRoot "run-sdl.ps1") -GuardianCliLocation $guardianCliLocation -WorkingDirectory $ArtifactsDirectory -TargetDirectory $ArtifactsDirectory -GdnFolder $gdnFolder -ToolsList $ArtifactToolsList -AzureDevOpsAccessToken $AzureDevOpsAccessToken -UpdateBaseline $UpdateBaseline -GuardianLoggerLevel $GuardianLoggerLevel -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams
}
if ($SourceToolsList -and $SourceToolsList.Count -gt 0) {
& $(Join-Path $PSScriptRoot "run-sdl.ps1") -GuardianCliLocation $guardianCliLocation -WorkingDirectory $ArtifactsDirectory -TargetDirectory $SourceDirectory -GdnFolder $gdnFolder -ToolsList $SourceToolsList -AzureDevOpsAccessToken $AzureDevOpsAccessToken -UpdateBaseline $UpdateBaseline -GuardianLoggerLevel $GuardianLoggerLevel -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams
}
if ($UpdateBaseline) {
& (Join-Path $PSScriptRoot "push-gdn.ps1") -Repository $RepoName -BranchName $BranchName -GdnFolder $GdnFolder -AzureDevOpsAccessToken $AzureDevOpsAccessToken -PushReason "Update baseline"
}
if ($TsaPublish) {
if ($TsaBranchName -and $BuildNumber) {
if (-not $TsaRepositoryName) {
$TsaRepositoryName = "$($Repository)-$($BranchName)"
}
Write-Host "$guardianCliLocation tsa-publish --all-tools --repository-name `"$TsaRepositoryName`" --branch-name `"$TsaBranchName`" --build-number `"$BuildNumber`" --codebase-name `"$TsaCodebaseName`" --notification-alias `"$TsaNotificationEmail`" --codebase-admin `"$TsaCodebaseAdmin`" --instance-url `"$TsaInstanceUrl`" --project-name `"$TsaProjectName`" --area-path `"$TsaBugAreaPath`" --iteration-path `"$TsaIterationPath`" --working-directory $SourceDirectory --logger-level $GuardianLoggerLevel"
& $guardianCliLocation tsa-publish --all-tools --repository-name "$TsaRepositoryName" --branch-name "$TsaBranchName" --build-number "$BuildNumber" --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $ArtifactsDirectory --logger-level $GuardianLoggerLevel
if ($LASTEXITCODE -ne 0) {
Write-Host "Guardian tsa-publish failed with exit code $LASTEXITCODE."
exit $LASTEXITCODE
}
} else {
Write-Host "Could not publish to TSA -- not all required values ($$TsaBranchName, $$BuildNumber) were specified."
exit 1
}
}
@@ -0,0 +1,70 @@
param(
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where artifact packages are stored
[Parameter(Mandatory=$true)][string] $ExtractPath # Full path to directory where the packages will be extracted
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version 2.0
$ExtractPackage = {
param(
[string] $PackagePath # Full path to a NuGet package
)
if (!(Test-Path $PackagePath)) {
Write-PipelineTaskError "Input file does not exist: $PackagePath"
ExitWithExitCode 1
}
$RelevantExtensions = @(".dll", ".exe", ".pdb")
Write-Host -NoNewLine "Extracting" ([System.IO.Path]::GetFileName($PackagePath)) "... "
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Directory]::CreateDirectory($ExtractPath);
try {
$zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath)
$zip.Entries |
Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} |
ForEach-Object {
$TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.Name
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true)
}
}
catch {
}
finally {
$zip.Dispose()
}
}
function ExtractArtifacts {
if (!(Test-Path $InputPath)) {
Write-Host "Input Path does not exist: $InputPath"
ExitWithExitCode 0
}
$Jobs = @()
Get-ChildItem "$InputPath\*.nupkg" |
ForEach-Object {
$Jobs += Start-Job -ScriptBlock $ExtractPackage -ArgumentList $_.FullName
}
foreach ($Job in $Jobs) {
Wait-Job -Id $Job.Id | Receive-Job
}
}
try {
Measure-Command { ExtractArtifacts }
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}
+48
View File
@@ -0,0 +1,48 @@
Param(
[string] $GuardianCliLocation,
[string] $Repository,
[string] $BranchName="master",
[string] $WorkingDirectory,
[string] $AzureDevOpsAccessToken,
[string] $GuardianLoggerLevel="Standard"
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version 2.0
$LASTEXITCODE = 0
# Construct basic auth from AzDO access token; construct URI to the repository's gdn folder stored in that repository; construct location of zip file
$encodedPat = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$AzureDevOpsAccessToken"))
$escapedRepository = [Uri]::EscapeDataString("/$Repository/$BranchName/.gdn")
$uri = "https://dev.azure.com/dnceng/internal/_apis/git/repositories/sdl-tool-cfg/Items?path=$escapedRepository&versionDescriptor[versionOptions]=0&`$format=zip&api-version=5.0-preview.1"
$zipFile = "$WorkingDirectory/gdn.zip"
Add-Type -AssemblyName System.IO.Compression.FileSystem
$gdnFolder = (Join-Path $WorkingDirectory ".gdn")
Try
{
# We try to download the zip; if the request fails (e.g. the file doesn't exist), we catch it and init guardian instead
Write-Host "Downloading gdn folder from internal config repostiory..."
Invoke-WebRequest -Headers @{ "Accept"="application/zip"; "Authorization"="Basic $encodedPat" } -Uri $uri -OutFile $zipFile
if (Test-Path $gdnFolder) {
# Remove the gdn folder if it exists (it shouldn't unless there's too much caching; this is just in case)
Remove-Item -Force -Recurse $gdnFolder
}
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipFile, $WorkingDirectory)
Write-Host $gdnFolder
} Catch [System.Net.WebException] {
# if the folder does not exist, we'll do a guardian init and push it to the remote repository
Write-Host "Initializing Guardian..."
Write-Host "$GuardianCliLocation init --working-directory $WorkingDirectory --logger-level $GuardianLoggerLevel"
& $GuardianCliLocation init --working-directory $WorkingDirectory --logger-level $GuardianLoggerLevel
if ($LASTEXITCODE -ne 0) {
Write-Error "Guardian init failed with exit code $LASTEXITCODE."
}
# We create the mainbaseline so it can be edited later
Write-Host "$GuardianCliLocation baseline --working-directory $WorkingDirectory --name mainbaseline"
& $GuardianCliLocation baseline --working-directory $WorkingDirectory --name mainbaseline
if ($LASTEXITCODE -ne 0) {
Write-Error "Guardian baseline failed with exit code $LASTEXITCODE."
}
& $(Join-Path $PSScriptRoot "push-gdn.ps1") -Repository $Repository -BranchName $BranchName -GdnFolder $gdnFolder -AzureDevOpsAccessToken $AzureDevOpsAccessToken -PushReason "Initialize gdn folder"
}
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Guardian.Cli" version="0.6.0"/>
</packages>
+51
View File
@@ -0,0 +1,51 @@
Param(
[string] $Repository,
[string] $BranchName="master",
[string] $GdnFolder,
[string] $AzureDevOpsAccessToken,
[string] $PushReason
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version 2.0
$LASTEXITCODE = 0
# We create the temp directory where we'll store the sdl-config repository
$sdlDir = Join-Path $env:TEMP "sdl"
if (Test-Path $sdlDir) {
Remove-Item -Force -Recurse $sdlDir
}
Write-Host "git clone https://dnceng:`$[email protected]/dnceng/internal/_git/sdl-tool-cfg $sdlDir"
git clone https://dnceng:$AzureDevOpsAccessToken@dev.azure.com/dnceng/internal/_git/sdl-tool-cfg $sdlDir
if ($LASTEXITCODE -ne 0) {
Write-Error "Git clone failed with exit code $LASTEXITCODE."
}
# We copy the .gdn folder from our local run into the git repository so it can be committed
$sdlRepositoryFolder = Join-Path (Join-Path (Join-Path $sdlDir $Repository) $BranchName) ".gdn"
if (Get-Command Robocopy) {
Robocopy /S $GdnFolder $sdlRepositoryFolder
} else {
rsync -r $GdnFolder $sdlRepositoryFolder
}
# cd to the sdl-config directory so we can run git there
Push-Location $sdlDir
# git add . --> git commit --> git push
Write-Host "git add ."
git add .
if ($LASTEXITCODE -ne 0) {
Write-Error "Git add failed with exit code $LASTEXITCODE."
}
Write-Host "git -c user.email=`"[email protected]`" -c user.name=`"Dotnet Bot`" commit -m `"$PushReason for $Repository/$BranchName`""
git -c user.email="[email protected]" -c user.name="Dotnet Bot" commit -m "$PushReason for $Repository/$BranchName"
if ($LASTEXITCODE -ne 0) {
Write-Error "Git commit failed with exit code $LASTEXITCODE."
}
Write-Host "git push"
git push
if ($LASTEXITCODE -ne 0) {
Write-Error "Git push failed with exit code $LASTEXITCODE."
}
# Return to the original directory
Pop-Location
+67
View File
@@ -0,0 +1,67 @@
Param(
[string] $GuardianCliLocation,
[string] $WorkingDirectory,
[string] $TargetDirectory,
[string] $GdnFolder,
[string[]] $ToolsList,
[string] $UpdateBaseline,
[string] $GuardianLoggerLevel="Standard",
[string[]] $CrScanAdditionalRunConfigParams,
[string[]] $PoliCheckAdditionalRunConfigParams
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version 2.0
$LASTEXITCODE = 0
# We store config files in the r directory of .gdn
Write-Host $ToolsList
$gdnConfigPath = Join-Path $GdnFolder "r"
$ValidPath = Test-Path $GuardianCliLocation
if ($ValidPath -eq $False)
{
Write-Host "Invalid Guardian CLI Location."
exit 1
}
foreach ($tool in $ToolsList) {
$gdnConfigFile = Join-Path $gdnConfigPath "$tool-configure.gdnconfig"
$config = $False
Write-Host $tool
# We have to manually configure tools that run on source to look at the source directory only
if ($tool -eq "credscan") {
Write-Host "$GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args `" TargetDirectory : $TargetDirectory `" $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams})"
& $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " TargetDirectory : $TargetDirectory " $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams})
if ($LASTEXITCODE -ne 0) {
Write-Host "Guardian configure for $tool failed with exit code $LASTEXITCODE."
exit $LASTEXITCODE
}
$config = $True
}
if ($tool -eq "policheck") {
Write-Host "$GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args `" Target : $TargetDirectory `" $(If ($PoliCheckAdditionalRunConfigParams) {$PoliCheckAdditionalRunConfigParams})"
& $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " Target : $TargetDirectory " $(If ($PoliCheckAdditionalRunConfigParams) {$PoliCheckAdditionalRunConfigParams})
if ($LASTEXITCODE -ne 0) {
Write-Host "Guardian configure for $tool failed with exit code $LASTEXITCODE."
exit $LASTEXITCODE
}
$config = $True
}
Write-Host "$GuardianCliLocation run --working-directory $WorkingDirectory --tool $tool --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel --config $gdnConfigFile $config"
if ($config) {
& $GuardianCliLocation run --working-directory $WorkingDirectory --tool $tool --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel --config $gdnConfigFile
if ($LASTEXITCODE -ne 0) {
Write-Host "Guardian run for $tool using $gdnConfigFile failed with exit code $LASTEXITCODE."
exit $LASTEXITCODE
}
} else {
& $GuardianCliLocation run --working-directory $WorkingDirectory --tool $tool --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel
if ($LASTEXITCODE -ne 0) {
Write-Host "Guardian run for $tool failed with exit code $LASTEXITCODE."
exit $LASTEXITCODE
}
}
}
+54
View File
@@ -0,0 +1,54 @@
parameters:
overrideParameters: '' # Optional: to override values for parameters.
additionalParameters: '' # Optional: parameters that need user specific values eg: '-SourceToolsList @("abc","def") -ArtifactToolsList @("ghi","jkl")'
continueOnError: false # optional: determines whether to continue the build if the step errors;
dependsOn: '' # Optional: dependencies of the job
jobs:
- job: Run_SDL
dependsOn: ${{ parameters.dependsOn }}
displayName: Run SDL tool
variables:
- group: DotNet-VSTS-Bot
steps:
- checkout: self
clean: true
- task: DownloadBuildArtifacts@0
displayName: Download Build Artifacts
inputs:
buildType: current
downloadType: specific files
matchingPattern: "**"
downloadPath: $(Build.SourcesDirectory)\artifacts
- powershell: eng/common/sdl/extract-artifact-packages.ps1
-InputPath $(Build.SourcesDirectory)\artifacts\BlobArtifacts
-ExtractPath $(Build.SourcesDirectory)\artifacts\BlobArtifacts
displayName: Extract Blob Artifacts
continueOnError: ${{ parameters.continueOnError }}
- powershell: eng/common/sdl/extract-artifact-packages.ps1
-InputPath $(Build.SourcesDirectory)\artifacts\PackageArtifacts
-ExtractPath $(Build.SourcesDirectory)\artifacts\PackageArtifacts
displayName: Extract Package Artifacts
continueOnError: ${{ parameters.continueOnError }}
- task: NuGetToolInstaller@1
displayName: 'Install NuGet.exe'
- task: NuGetCommand@2
displayName: 'Install Guardian'
inputs:
restoreSolution: $(Build.SourcesDirectory)\eng\common\sdl\packages.config
feedsToUse: config
nugetConfigPath: $(Build.SourcesDirectory)\eng\common\sdl\NuGet.config
externalFeedCredentials: GuardianConnect
restoreDirectory: $(Build.SourcesDirectory)\.packages
- ${{ if ne(parameters.overrideParameters, '') }}:
- powershell: eng/common/sdl/execute-all-sdl-tools.ps1 ${{ parameters.overrideParameters }}
displayName: Execute SDL
continueOnError: ${{ parameters.continueOnError }}
- ${{ if eq(parameters.overrideParameters, '') }}:
- powershell: eng/common/sdl/execute-all-sdl-tools.ps1
-GuardianPackageName Microsoft.Guardian.Cli.0.6.0
-NugetPackageDirectory $(Build.SourcesDirectory)\.packages
-AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw)
${{ parameters.additionalParameters }}
displayName: Execute SDL
continueOnError: ${{ parameters.continueOnError }}
+93
View File
@@ -0,0 +1,93 @@
parameters:
steps: [] # optional -- any additional steps that need to happen before pulling down the performance repo and sending the performance benchmarks to helix (ie building your repo)
variables: [] # optional -- list of additional variables to send to the template
jobName: '' # required -- job name
displayName: '' # optional -- display name for the job. Will use jobName if not passed
pool: '' # required -- name of the Build pool
container: '' # required -- name of the container
extraSetupParameters: '' # optional -- extra arguments to pass to the setup script
frameworks: ['netcoreapp3.0'] # optional -- list of frameworks to run against
continueOnError: 'false' # optional -- determines whether to continue the build if the step errors
dependsOn: '' # optional -- dependencies of the job
timeoutInMinutes: 320 # optional -- timeout for the job
enableTelemetry: false # optional -- enable for telemetry
jobs:
- template: ../jobs/jobs.yml
parameters:
dependsOn: ${{ parameters.dependsOn }}
enableTelemetry: ${{ parameters.enableTelemetry }}
enablePublishBuildArtifacts: true
continueOnError: ${{ parameters.continueOnError }}
jobs:
- job: '${{ parameters.jobName }}'
${{ if ne(parameters.displayName, '') }}:
displayName: '${{ parameters.displayName }}'
${{ if eq(parameters.displayName, '') }}:
displayName: '${{ parameters.jobName }}'
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
variables:
- ${{ each variable in parameters.variables }}:
- ${{ if ne(variable.name, '') }}:
- name: ${{ variable.name }}
value: ${{ variable.value }}
- ${{ if ne(variable.group, '') }}:
- group: ${{ variable.group }}
- IsInternal: ''
- HelixApiAccessToken: ''
- HelixPreCommand: ''
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- ${{ if eq(variables['Agent.Os'], 'Windows_NT') }}:
- HelixPreCommand: 'set "PERFLAB_UPLOAD_TOKEN=$(PerfCommandUploadToken)"'
- IsInternal: -Internal
- ${{ if ne(variables['Agent.Os'], 'Windows_NT') }}:
- HelixPreCommand: 'export PERFLAB_UPLOAD_TOKEN="$(PerfCommandUploadTokenLinux)"'
- IsInternal: --internal
- group: DotNet-HelixApi-Access
- group: dotnet-benchview
workspace:
clean: all
pool:
${{ parameters.pool }}
container: ${{ parameters.container }}
strategy:
matrix:
${{ each framework in parameters.frameworks }}:
${{ framework }}:
_Framework: ${{ framework }}
steps:
- checkout: self
clean: true
# Run all of the steps to setup repo
- ${{ each step in parameters.steps }}:
- ${{ step }}
- powershell: $(Build.SourcesDirectory)\eng\common\performance\performance-setup.ps1 $(IsInternal) -Framework $(_Framework) ${{ parameters.extraSetupParameters }}
displayName: Performance Setup (Windows)
condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT'))
continueOnError: ${{ parameters.continueOnError }}
- script: $(Build.SourcesDirectory)/eng/common/performance/performance-setup.sh $(IsInternal) --framework $(_Framework) ${{ parameters.extraSetupParameters }}
displayName: Performance Setup (Unix)
condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
continueOnError: ${{ parameters.continueOnError }}
- script: $(Python) $(PerformanceDirectory)/scripts/ci_setup.py $(SetupArguments)
displayName: Run ci setup script
# Run perf testing in helix
- template: /eng/common/templates/steps/perf-send-to-helix.yml
parameters:
HelixSource: '$(HelixSourcePrefix)/$(Build.Repository.Name)/$(Build.SourceBranch)' # sources must start with pr/, official/, prodcon/, or agent/
HelixType: 'test/performance/$(Kind)/$(_Framework)/$(Architecture)'
HelixAccessToken: $(HelixApiAccessToken)
HelixTargetQueues: $(Queue)
HelixPreCommands: $(HelixPreCommand)
Creator: $(Creator)
WorkItemTimeout: 4:00 # 4 hours
WorkItemDirectory: '$(WorkItemDirectory)' # WorkItemDirectory can not be empty, so we send it some docs to keep it happy
CorrelationPayloadDirectory: '$(PayloadDirectory)' # it gets checked out to a folder with shorter path than WorkItemDirectory so we can avoid file name too long exceptions
@@ -59,6 +59,20 @@ jobs:
/p:Configuration=$(_BuildConfig)
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
- task: powershell@2
displayName: Create ReleaseConfigs Artifact
inputs:
targetType: inline
script: |
Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(BARBuildId)
Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value "$(DefaultChannels)"
Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(IsStableBuild)
- task: PublishBuildArtifacts@1
displayName: Publish ReleaseConfigs Artifact
inputs:
PathtoPublish: '$(Build.StagingDirectory)/ReleaseConfigs.txt'
PublishLocation: Container
ArtifactName: ReleaseConfigs
- ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}:
- task: PublishBuildArtifacts@1
displayName: Publish Logs to VSTS
@@ -0,0 +1,147 @@
parameters:
enableSymbolValidation: true
stages:
- stage: IS_Publish
dependsOn: validate
variables:
- template: ../common-variables.yml
displayName: Internal Servicing
jobs:
- template: ../setup-maestro-vars.yml
- job:
displayName: Symbol Publishing
dependsOn: setupMaestroVars
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id)
variables:
- group: DotNet-Symbol-Server-Pats
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Artifacts
inputs:
downloadType: specific files
matchingPattern: "*Artifacts*"
- task: PowerShell@2
displayName: Publish
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/'
/p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/'
/p:Configuration=Release
- job: publish_assets
displayName: Publish Assets
dependsOn: setupMaestroVars
variables:
- group: DotNet-Blob-Feed
- group: AzureDevOps-Artifact-Feeds-Pats
- name: BARBuildId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
- name: IsStableBuild
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ]
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id)
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Package Artifacts
inputs:
buildType: current
artifactName: PackageArtifacts
- task: DownloadBuildArtifacts@0
displayName: Download Blob Artifacts
inputs:
buildType: current
artifactName: BlobArtifacts
- task: DownloadBuildArtifacts@0
displayName: Download Asset Manifests
inputs:
buildType: current
artifactName: AssetManifests
- task: PowerShell@2
displayName: Add Assets Location
env:
AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw)
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet
/p:ChannelId=$(InternalServicing_30_Channel_Id)
/p:IsStableBuild=$(IsStableBuild)
/p:IsInternalBuild=$(IsInternalBuild)
/p:RepositoryName=$(Build.Repository.Name)
/p:CommitSha=$(Build.SourceVersion)
/p:AzureStorageAccountName=$(ProxyBackedFeedsAccountName)
/p:AzureStorageAccountKey=$(dotnetfeed-storage-access-key-1)
/p:AzureDevOpsFeedsBaseUrl=$(dotnetfeed-internal-private-feed-url)
/p:StaticInternalFeed=$(dotnetfeed-internal-nonstable-feed-url)
/p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe
/p:BARBuildId=$(BARBuildId)
/p:MaestroApiEndpoint='$(MaestroApiEndPoint)'
/p:BuildAssetRegistryToken='$(MaestroApiAccessToken)'
/p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/'
/p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts'
/p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts'
/p:Configuration=Release
- task: NuGetCommand@2
displayName: Publish Packages to AzDO Feed
condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com')
inputs:
command: push
vstsFeed: $(AzDoFeedName)
packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg
publishVstsFeed: $(AzDoFeedName)
- task: PowerShell@2
displayName: Publish Blobs to AzDO Feed
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1
arguments: -FeedName $(AzDoFeedName)
-SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/
-PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw)
enabled: false
- template: ../trigger-subscription.yml
parameters:
ChannelId: ${{ variables.InternalServicing_30_Channel_Id }}
- stage: IS_PublishValidation
displayName: Publish Validation
variables:
- template: ../common-variables.yml
jobs:
- template: ../setup-maestro-vars.yml
- ${{ if eq(parameters.enableSymbolValidation, 'true') }}:
- job:
displayName: Symbol Availability
dependsOn: setupMaestroVars
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id)
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Package Artifacts
inputs:
buildType: current
artifactName: PackageArtifacts
- task: PowerShell@2
displayName: Check Symbol Availability
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1
arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion)
- template: ../promote-build.yml
parameters:
ChannelId: ${{ variables.InternalServicing_30_Channel_Id }}
@@ -0,0 +1,148 @@
parameters:
enableSymbolValidation: true
stages:
- stage: Publish
dependsOn: validate
variables:
- template: ../common-variables.yml
displayName: Developer Channel
jobs:
- template: ../setup-maestro-vars.yml
- job:
displayName: Symbol Publishing
dependsOn: setupMaestroVars
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicDevRelease_30_Channel_Id)
variables:
- group: DotNet-Symbol-Server-Pats
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Artifacts
inputs:
downloadType: specific files
matchingPattern: "*Artifacts*"
- task: PowerShell@2
displayName: Publish
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/'
/p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/'
/p:Configuration=Release
- job:
displayName: Publish Assets
dependsOn: setupMaestroVars
variables:
- group: DotNet-Blob-Feed
- group: AzureDevOps-Artifact-Feeds-Pats
- name: BARBuildId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
- name: IsStableBuild
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ]
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicDevRelease_30_Channel_Id)
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Package Artifacts
inputs:
buildType: current
artifactName: PackageArtifacts
- task: DownloadBuildArtifacts@0
displayName: Download Blob Artifacts
inputs:
buildType: current
artifactName: BlobArtifacts
- task: DownloadBuildArtifacts@0
displayName: Download Asset Manifests
inputs:
buildType: current
artifactName: AssetManifests
- task: PowerShell@2
displayName: Add Assets Location
env:
AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw)
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet
/p:ChannelId=$(PublicDevRelease_30_Channel_Id)
/p:ArtifactsCategory=$(_DotNetArtifactsCategory)
/p:IsStableBuild=$(IsStableBuild)
/p:IsInternalBuild=$(IsInternalBuild)
/p:RepositoryName=$(Build.Repository.Name)
/p:CommitSha=$(Build.SourceVersion)
/p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe
/p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)'
/p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)'
/p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)'
/p:BARBuildId=$(BARBuildId)
/p:MaestroApiEndpoint='$(MaestroApiEndPoint)'
/p:BuildAssetRegistryToken='$(MaestroApiAccessToken)'
/p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/'
/p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/'
/p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/'
/p:Configuration=Release
- task: NuGetCommand@2
displayName: Publish Packages to AzDO Feed
condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com')
inputs:
command: push
vstsFeed: $(AzDoFeedName)
packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg
publishVstsFeed: $(AzDoFeedName)
- task: PowerShell@2
displayName: Publish Blobs to AzDO Feed
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1
arguments: -FeedName $(AzDoFeedName)
-SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/
-PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw)
enabled: false
- stage: PublishValidation
displayName: Publish Validation
variables:
- template: ../common-variables.yml
jobs:
- template: ../setup-maestro-vars.yml
- ${{ if eq(parameters.enableSymbolValidation, 'true') }}:
- job:
displayName: Symbol Availability
dependsOn: setupMaestroVars
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicDevRelease_30_Channel_Id)
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Package Artifacts
inputs:
buildType: current
artifactName: PackageArtifacts
- task: PowerShell@2
displayName: Check Symbol Availability
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1
arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion)
- template: ../darc-gather-drop.yml
parameters:
ChannelId: ${{ variables.PublicDevRelease_30_Channel_Id }}
- template: ../promote-build.yml
parameters:
ChannelId: ${{ variables.PublicDevRelease_30_Channel_Id }}
@@ -0,0 +1,147 @@
parameters:
enableSymbolValidation: true
stages:
- stage: PubRel_Publish
dependsOn: validate
variables:
- template: ../common-variables.yml
displayName: Public Release
jobs:
- template: ../setup-maestro-vars.yml
- job:
displayName: Symbol Publishing
dependsOn: setupMaestroVars
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id)
variables:
- group: DotNet-Symbol-Server-Pats
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Artifacts
inputs:
downloadType: specific files
matchingPattern: "*Artifacts*"
- task: PowerShell@2
displayName: Publish
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/'
/p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/'
/p:Configuration=Release
- job: publish_assets
displayName: Publish Assets
dependsOn: setupMaestroVars
variables:
- group: DotNet-Blob-Feed
- group: AzureDevOps-Artifact-Feeds-Pats
- name: BARBuildId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
- name: IsStableBuild
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ]
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id)
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Package Artifacts
inputs:
buildType: current
artifactName: PackageArtifacts
- task: DownloadBuildArtifacts@0
displayName: Download Blob Artifacts
inputs:
buildType: current
artifactName: BlobArtifacts
- task: DownloadBuildArtifacts@0
displayName: Download Asset Manifests
inputs:
buildType: current
artifactName: AssetManifests
- task: PowerShell@2
displayName: Publish
env:
AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw)
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet
/p:ChannelId=$(PublicRelease_30_Channel_Id)
/p:IsStableBuild=$(IsStableBuild)
/p:IsInternalBuild=$(IsInternalBuild)
/p:RepositoryName=$(Build.Repository.Name)
/p:CommitSha=$(Build.SourceVersion)
/p:AzureStorageAccountName=$(ProxyBackedFeedsAccountName)
/p:AzureStorageAccountKey=$(dotnetfeed-storage-access-key-1)
/p:AzureDevOpsFeedsBaseUrl=$(dotnetfeed-internal-private-feed-url)
/p:StaticInternalFeed=$(dotnetfeed-internal-nonstable-feed-url)
/p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe
/p:BARBuildId=$(BARBuildId)
/p:MaestroApiEndpoint='$(MaestroApiEndPoint)'
/p:BuildAssetRegistryToken='$(MaestroApiAccessToken)'
/p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/'
/p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts'
/p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts'
/p:Configuration=Release
- task: NuGetCommand@2
displayName: Publish Packages to AzDO Feed
condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com')
inputs:
command: push
vstsFeed: $(AzDoFeedName)
packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg
publishVstsFeed: $(AzDoFeedName)
- task: PowerShell@2
displayName: Publish Blobs to AzDO Feed
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1
arguments: -FeedName $(AzDoFeedName)
-SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/
-PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw)
enabled: false
- template: ../trigger-subscription.yml
parameters:
ChannelId: ${{ variables.PublicRelease_30_Channel_Id }}
- stage: PubRel_PublishValidation
displayName: Publish Validation
variables:
- template: ../common-variables.yml
jobs:
- template: ../setup-maestro-vars.yml
- ${{ if eq(parameters.enableSymbolValidation, 'true') }}:
- job:
displayName: Symbol Availability
dependsOn: setupMaestroVars
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id)
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Package Artifacts
inputs:
buildType: current
artifactName: PackageArtifacts
- task: PowerShell@2
displayName: Check Symbol Availability
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1
arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion)
- template: ../promote-build.yml
parameters:
ChannelId: ${{ variables.PublicRelease_30_Channel_Id }}
@@ -0,0 +1,99 @@
stages:
- stage: PVR_Publish
dependsOn: validate
variables:
- template: ../common-variables.yml
displayName: Validation Channel
jobs:
- template: ../setup-maestro-vars.yml
- job:
displayName: Publish Assets
dependsOn: setupMaestroVars
variables:
- group: DotNet-Blob-Feed
- group: AzureDevOps-Artifact-Feeds-Pats
- name: BARBuildId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
- name: IsStableBuild
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ]
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicValidationRelease_30_Channel_Id)
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Package Artifacts
inputs:
buildType: current
artifactName: PackageArtifacts
- task: DownloadBuildArtifacts@0
displayName: Download Blob Artifacts
inputs:
buildType: current
artifactName: BlobArtifacts
- task: DownloadBuildArtifacts@0
displayName: Download Asset Manifests
inputs:
buildType: current
artifactName: AssetManifests
- task: PowerShell@2
displayName: Add Assets Location
env:
AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw)
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet
/p:ChannelId=$(PublicValidationRelease_30_Channel_Id)
/p:ArtifactsCategory=$(_DotNetValidationArtifactsCategory)
/p:IsStableBuild=$(IsStableBuild)
/p:IsInternalBuild=$(IsInternalBuild)
/p:RepositoryName=$(Build.Repository.Name)
/p:CommitSha=$(Build.SourceVersion)
/p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe
/p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)'
/p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)'
/p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)'
/p:BARBuildId=$(BARBuildId)
/p:MaestroApiEndpoint='$(MaestroApiEndPoint)'
/p:BuildAssetRegistryToken='$(MaestroApiAccessToken)'
/p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/'
/p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts'
/p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts'
/p:Configuration=Release
- task: NuGetCommand@2
displayName: Publish Packages to AzDO Feed
condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com')
inputs:
command: push
vstsFeed: $(AzDoFeedName)
packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg
publishVstsFeed: $(AzDoFeedName)
- task: PowerShell@2
displayName: Publish Blobs to AzDO Feed
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1
arguments: -FeedName $(AzDoFeedName)
-SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/
-PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw)
enabled: false
- stage: PVR_PublishValidation
displayName: Publish Validation
variables:
- template: ../common-variables.yml
jobs:
- template: ../setup-maestro-vars.yml
- template: ../darc-gather-drop.yml
parameters:
ChannelId: ${{ variables.PublicValidationRelease_30_Channel_Id }}
- template: ../promote-build.yml
parameters:
ChannelId: ${{ variables.PublicValidationRelease_30_Channel_Id }}
@@ -0,0 +1,39 @@
variables:
- group: Publish-Build-Assets
# .NET Core 3 Dev
- name: PublicDevRelease_30_Channel_Id
value: 3
# .NET Tools - Validation
- name: PublicValidationRelease_30_Channel_Id
value: 9
# .NET Core 3.0 Internal Servicing
- name: InternalServicing_30_Channel_Id
value: 184
# .NET Core 3.0 Release
- name: PublicRelease_30_Channel_Id
value: 19
# Whether the build is internal or not
- name: IsInternalBuild
value: ${{ and(ne(variables['System.TeamProject'], 'public'), contains(variables['Build.SourceBranch'], 'internal')) }}
# Storage account name for proxy-backed feeds
- name: ProxyBackedFeedsAccountName
value: dotnetfeed
# Default Maestro++ API Endpoint and API Version
- name: MaestroApiEndPoint
value: "https://maestro-prod.westus2.cloudapp.azure.com"
- name: MaestroApiAccessToken
value: $(MaestroAccessToken)
- name: MaestroApiVersion
value: "2019-01-16"
- name: SourceLinkCLIVersion
value: 3.0.0
- name: SymbolToolVersion
value: 1.0.1
@@ -0,0 +1,23 @@
parameters:
ChannelId: 0
jobs:
- job: gatherDrop
displayName: Gather Drop
dependsOn: setupMaestroVars
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], ${{ parameters.ChannelId }})
variables:
- name: BARBuildId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
pool:
vmImage: 'windows-2019'
steps:
- task: PowerShell@2
displayName: Darc gather-drop
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/darc-gather-drop.ps1
arguments: -BarBuildId $(BARBuildId)
-DropLocation $(Agent.BuildDirectory)/Temp/Drop/
-MaestroApiAccessToken $(MaestroApiAccessToken)
-MaestroApiEndPoint $(MaestroApiEndPoint)
-MaestroApiVersion $(MaestroApiVersion)
@@ -0,0 +1,94 @@
parameters:
enableSourceLinkValidation: true
enableSigningValidation: true
enableSymbolValidation: true
enableNugetValidation: true
SDLValidationParameters:
enable: false
params: ''
# Which stages should finish execution before post-build stages start
dependsOn: [build]
stages:
- stage: validate
dependsOn: ${{ parameters.dependsOn }}
displayName: Validate
jobs:
- ${{ if eq(parameters.enableNugetValidation, 'true') }}:
- job:
displayName: NuGet Validation
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Package Artifacts
inputs:
buildType: current
artifactName: PackageArtifacts
- task: PowerShell@2
displayName: Validate
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1
arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/
-ToolDestinationPath $(Agent.BuildDirectory)/Extract/
- ${{ if eq(parameters.enableSigningValidation, 'true') }}:
- job:
displayName: Signing Validation
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Package Artifacts
inputs:
buildType: current
artifactName: PackageArtifacts
- task: PowerShell@2
displayName: Validate
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task SigningValidation -restore -msbuildEngine dotnet
/p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts'
/p:Configuration=Release
- ${{ if eq(parameters.enableSourceLinkValidation, 'true') }}:
- job:
displayName: SourceLink Validation
variables:
- template: common-variables.yml
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Blob Artifacts
inputs:
buildType: current
artifactName: BlobArtifacts
- task: PowerShell@2
displayName: Validate
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1
arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/
-ExtractPath $(Agent.BuildDirectory)/Extract/
-GHRepoName $(Build.Repository.Name)
-GHCommit $(Build.SourceVersion)
-SourcelinkCliVersion $(SourceLinkCLIVersion)
- ${{ if eq(parameters.SDLValidationParameters.enable, 'true') }}:
- template: /eng/common/templates/job/execute-sdl.yml
parameters:
additionalParameters: ${{ parameters.SDLValidationParameters.params }}
- template: \eng\common\templates\post-build\channels\public-dev-release.yml
parameters:
enableSymbolValidation: ${{ parameters.enableSymbolValidation }}
- template: \eng\common\templates\post-build\channels\public-validation-release.yml
- template: \eng\common\templates\post-build\channels\public-release.yml
- template: \eng\common\templates\post-build\channels\internal-servicing.yml
@@ -0,0 +1,25 @@
parameters:
ChannelId: 0
jobs:
- job:
displayName: Promote Build
dependsOn: setupMaestroVars
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], ${{ parameters.ChannelId }})
variables:
- name: BARBuildId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
- name: ChannelId
value: ${{ parameters.ChannelId }}
pool:
vmImage: 'windows-2019'
steps:
- task: PowerShell@2
displayName: Add Build to Channel
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/promote-build.ps1
arguments: -BuildId $(BARBuildId)
-ChannelId $(ChannelId)
-MaestroApiAccessToken $(MaestroApiAccessToken)
-MaestroApiEndPoint $(MaestroApiEndPoint)
-MaestroApiVersion $(MaestroApiVersion)
@@ -0,0 +1,18 @@
jobs:
- job: setupMaestroVars
displayName: Setup Maestro Vars
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download Release Configs
inputs:
buildType: current
artifactName: ReleaseConfigs
- task: PowerShell@2
name: setReleaseVars
displayName: Set Release Configs Vars
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/setup-maestro-vars.ps1
arguments: -ReleaseConfigsPath '$(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt'
@@ -0,0 +1,13 @@
parameters:
ChannelId: 0
steps:
- task: PowerShell@2
displayName: Triggering subscriptions
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/trigger-subscriptions.ps1
arguments: -SourceRepo $(Build.Repository.Uri)
-ChannelId ${{ parameters.ChannelId }}
-MaestroApiAccessToken $(MaestroAccessToken)
-MaestroApiEndPoint $(MaestroApiEndPoint)
-MaestroApiVersion $(MaestroApiVersion)
@@ -0,0 +1,66 @@
# Please remember to update the documentation if you make changes to these parameters!
parameters:
HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/
HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/'
HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number
HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/ for a list of queues
HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group
HelixPreCommands: '' # optional -- commands to run before Helix work item execution
HelixPostCommands: '' # optional -- commands to run after Helix work item execution
WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects
CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload
IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion
DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json
DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json
EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control
WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget."
Creator: '' # optional -- if the build is external, use this to specify who is sending the job
DisplayNamePrefix: 'Send job to Helix' # optional -- rename the beginning of the displayName of the steps in AzDO
condition: succeeded() # optional -- condition for step to execute; defaults to succeeded()
continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false
steps:
- powershell: $(Build.SourcesDirectory)\eng\common\msbuild.ps1 $(Build.SourcesDirectory)\eng\common\performance\perfhelixpublish.proj /restore /t:Test /bl:$(Build.SourcesDirectory)\artifacts\log\$env:BuildConfig\SendToHelix.binlog
displayName: ${{ parameters.DisplayNamePrefix }} (Windows)
env:
BuildConfig: $(_BuildConfig)
HelixSource: ${{ parameters.HelixSource }}
HelixType: ${{ parameters.HelixType }}
HelixBuild: ${{ parameters.HelixBuild }}
HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
HelixAccessToken: ${{ parameters.HelixAccessToken }}
HelixPreCommands: ${{ parameters.HelixPreCommands }}
HelixPostCommands: ${{ parameters.HelixPostCommands }}
WorkItemDirectory: ${{ parameters.WorkItemDirectory }}
CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }}
IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }}
DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }}
DotNetCliVersion: ${{ parameters.DotNetCliVersion }}
EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }}
WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }}
Creator: ${{ parameters.Creator }}
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT'))
continueOnError: ${{ parameters.continueOnError }}
- script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/performance/perfhelixpublish.proj /restore /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog
displayName: ${{ parameters.DisplayNamePrefix }} (Unix)
env:
BuildConfig: $(_BuildConfig)
HelixSource: ${{ parameters.HelixSource }}
HelixType: ${{ parameters.HelixType }}
HelixBuild: ${{ parameters.HelixBuild }}
HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
HelixAccessToken: ${{ parameters.HelixAccessToken }}
HelixPreCommands: ${{ parameters.HelixPreCommands }}
HelixPostCommands: ${{ parameters.HelixPostCommands }}
WorkItemDirectory: ${{ parameters.WorkItemDirectory }}
CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }}
IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }}
DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }}
DotNetCliVersion: ${{ parameters.DotNetCliVersion }}
EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }}
WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }}
Creator: ${{ parameters.Creator }}
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
condition: and(${{ parameters.condition }}, ne(variables['Agent.Os'], 'Windows_NT'))
continueOnError: ${{ parameters.continueOnError }}
+50 -49
View File
@@ -35,7 +35,7 @@
# Specifies which msbuild engine to use for build: 'vs', 'dotnet' or unspecified (determined based on presence of tools.vs in global.json).
[string]$msbuildEngine = if (Test-Path variable:msbuildEngine) { $msbuildEngine } else { $null }
# True to attempt using .NET Core already that meets requirements specified in global.json
# True to attempt using .NET Core already that meets requirements specified in global.json
# installed on the machine instead of downloading one.
[bool]$useInstalledDotNetCli = if (Test-Path variable:useInstalledDotNetCli) { $useInstalledDotNetCli } else { $true }
@@ -76,7 +76,7 @@ function Exec-Process([string]$command, [string]$commandArgs) {
$finished = $false
try {
while (-not $process.WaitForExit(100)) {
while (-not $process.WaitForExit(100)) {
# Non-blocking loop done to allow ctr-c interrupts
}
@@ -84,7 +84,7 @@ function Exec-Process([string]$command, [string]$commandArgs) {
return $global:LASTEXITCODE = $process.ExitCode
}
finally {
# If we didn't finish then an error occured or the user hit ctrl-c. Either
# If we didn't finish then an error occurred or the user hit ctrl-c. Either
# way kill the process
if (-not $finished) {
$process.Kill()
@@ -134,7 +134,7 @@ function InitializeDotNetCli([bool]$install) {
if ($install) {
InstallDotNetSdk $dotnetRoot $dotnetSdkVersion
} else {
Write-Host "Unable to find dotnet with SDK version '$dotnetSdkVersion'" -ForegroundColor Red
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Unable to find dotnet with SDK version '$dotnetSdkVersion'"
ExitWithExitCode 1
}
}
@@ -147,12 +147,10 @@ function InitializeDotNetCli([bool]$install) {
# It also ensures that VS msbuild will use the downloaded sdk targets.
$env:PATH = "$dotnetRoot;$env:PATH"
if ($ci) {
# Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build
Write-Host "##vso[task.prependpath]$dotnetRoot"
Write-Host "##vso[task.setvariable variable=DOTNET_MULTILEVEL_LOOKUP]0"
Write-Host "##vso[task.setvariable variable=DOTNET_SKIP_FIRST_TIME_EXPERIENCE]1"
}
# Make Sure that our bootstrapped dotnet cli is available in future steps of the Azure Pipelines build
Write-PipelinePrependPath -Path $dotnetRoot
Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0'
Write-PipelineSetVariable -Name 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE' -Value '1'
return $global:_DotNetInstallDir = $dotnetRoot
}
@@ -171,7 +169,7 @@ function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $arc
InstallDotNet $dotnetRoot $version $architecture
}
function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $architecture = "", [string] $runtime = "", [bool] $skipNonVersionedFiles = $false) { $installScript = GetDotNetInstallScript $dotnetRoot
function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $architecture = "", [string] $runtime = "", [bool] $skipNonVersionedFiles = $false) {
$installScript = GetDotNetInstallScript $dotnetRoot
$installParameters = @{
Version = $version
@@ -184,13 +182,13 @@ function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $archit
& $installScript @installParameters
if ($lastExitCode -ne 0) {
Write-Host "Failed to install dotnet cli (exit code '$lastExitCode')." -ForegroundColor Red
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Failed to install dotnet cli (exit code '$lastExitCode')."
ExitWithExitCode $lastExitCode
}
}
#
# Locates Visual Studio MSBuild installation.
# Locates Visual Studio MSBuild installation.
# The preference order for MSBuild to use is as follows:
#
# 1. MSBuild from an active VS command prompt
@@ -207,7 +205,7 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs }
$vsMinVersionStr = if ($vsRequirements.version) { $vsRequirements.version } else { "15.9" }
$vsMinVersion = [Version]::new($vsMinVersionStr)
$vsMinVersion = [Version]::new($vsMinVersionStr)
# Try msbuild command available in the environment.
if ($env:VSINSTALLDIR -ne $null) {
@@ -256,7 +254,7 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
function InitializeVisualStudioEnvironmentVariables([string] $vsInstallDir, [string] $vsMajorVersion) {
$env:VSINSTALLDIR = $vsInstallDir
Set-Item "env:VS$($vsMajorVersion)0COMNTOOLS" (Join-Path $vsInstallDir "Common7\Tools\")
$vsSdkInstallDir = Join-Path $vsInstallDir "VSSDK\"
if (Test-Path $vsSdkInstallDir) {
Set-Item "env:VSSDK$($vsMajorVersion)0Install" $vsSdkInstallDir
@@ -291,13 +289,13 @@ function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) {
# Locates Visual Studio instance that meets the minimal requirements specified by tools.vs object in global.json.
#
# The following properties of tools.vs are recognized:
# "version": "{major}.{minor}"
# "version": "{major}.{minor}"
# Two part minimal VS version, e.g. "15.9", "16.0", etc.
# "components": ["componentId1", "componentId2", ...]
# "components": ["componentId1", "componentId2", ...]
# Array of ids of workload components that must be available in the VS instance.
# See e.g. https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-enterprise?view=vs-2017
#
# Returns JSON describing the located VS instance (same format as returned by vswhere),
# Returns JSON describing the located VS instance (same format as returned by vswhere),
# or $null if no instance meeting the requirements is found on the machine.
#
function LocateVisualStudio([object]$vsRequirements = $null){
@@ -317,8 +315,8 @@ function LocateVisualStudio([object]$vsRequirements = $null){
}
if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs }
$args = @("-latest", "-prerelease", "-format", "json", "-requires", "Microsoft.Component.MSBuild")
$args = @("-latest", "-prerelease", "-format", "json", "-requires", "Microsoft.Component.MSBuild", "-products", "*")
if (Get-Member -InputObject $vsRequirements -Name "version") {
$args += "-version"
$args += $vsRequirements.version
@@ -328,7 +326,7 @@ function LocateVisualStudio([object]$vsRequirements = $null){
foreach ($component in $vsRequirements.components) {
$args += "-requires"
$args += $component
}
}
}
$vsInfo =& $vsWhereExe $args | ConvertFrom-Json
@@ -358,7 +356,7 @@ function InitializeBuildTool() {
if ($msbuildEngine -eq "dotnet") {
if (!$dotnetRoot) {
Write-Host "/global.json must specify 'tools.dotnet'." -ForegroundColor Red
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "/global.json must specify 'tools.dotnet'."
ExitWithExitCode 1
}
@@ -367,13 +365,13 @@ function InitializeBuildTool() {
try {
$msbuildPath = InitializeVisualStudioMSBuild -install:$restore
} catch {
Write-Host $_ -ForegroundColor Red
Write-PipelineTelemetryError -Category "InitializeToolset" -Message $_
ExitWithExitCode 1
}
$buildTool = @{ Path = $msbuildPath; Command = ""; Tool = "vs"; Framework = "net472" }
} else {
Write-Host "Unexpected value of -msbuildEngine: '$msbuildEngine'." -ForegroundColor Red
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Unexpected value of -msbuildEngine: '$msbuildEngine'."
ExitWithExitCode 1
}
@@ -385,12 +383,12 @@ function GetDefaultMSBuildEngine() {
if (Get-Member -InputObject $GlobalJson.tools -Name "vs") {
return "vs"
}
if (Get-Member -InputObject $GlobalJson.tools -Name "dotnet") {
return "dotnet"
}
Write-Host "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'." -ForegroundColor Red
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'."
ExitWithExitCode 1
}
@@ -415,11 +413,13 @@ function GetSdkTaskProject([string]$taskName) {
function InitializeNativeTools() {
if (Get-Member -InputObject $GlobalJson -Name "native-tools") {
$nativeArgs=""
$nativeArgs= @{}
if ($ci) {
$nativeArgs = "-InstallDirectory $ToolsDir"
$nativeArgs = @{
InstallDirectory = "$ToolsDir"
}
}
Invoke-Expression "& `"$PSScriptRoot/init-tools-native.ps1`" $nativeArgs"
& "$PSScriptRoot/init-tools-native.ps1" @nativeArgs
}
}
@@ -441,7 +441,7 @@ function InitializeToolset() {
}
if (-not $restore) {
Write-Host "Toolset version $toolsetVersion has not been restored." -ForegroundColor Red
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Toolset version $toolsetVersion has not been restored."
ExitWithExitCode 1
}
@@ -501,11 +501,13 @@ function MSBuild() {
function MSBuild-Core() {
if ($ci) {
if (!$binaryLog) {
throw "Binary log must be enabled in CI build."
Write-PipelineTaskError -Message "Binary log must be enabled in CI build."
ExitWithExitCode 1
}
if ($nodeReuse) {
throw "Node reuse must be disabled in CI build."
Write-PipelineTaskError -Message "Node reuse must be disabled in CI build."
ExitWithExitCode 1
}
}
@@ -513,8 +515,8 @@ function MSBuild-Core() {
$cmdArgs = "$($buildTool.Command) /m /nologo /clp:Summary /v:$verbosity /nr:$nodeReuse /p:ContinuousIntegrationBuild=$ci"
if ($warnAsError) {
$cmdArgs += " /warnaserror /p:TreatWarningsAsErrors=true"
if ($warnAsError) {
$cmdArgs += " /warnaserror /p:TreatWarningsAsErrors=true"
}
foreach ($arg in $args) {
@@ -522,29 +524,29 @@ function MSBuild-Core() {
$cmdArgs += " `"$arg`""
}
}
$exitCode = Exec-Process $buildTool.Path $cmdArgs
if ($exitCode -ne 0) {
Write-Host "Build failed." -ForegroundColor Red
Write-PipelineTaskError -Message "Build failed."
$buildLog = GetMSBuildBinaryLogCommandLineArgument $args
if ($buildLog -ne $null) {
Write-Host "See log: $buildLog" -ForegroundColor DarkGray
if ($buildLog -ne $null) {
Write-Host "See log: $buildLog" -ForegroundColor DarkGray
}
ExitWithExitCode $exitCode
}
}
function GetMSBuildBinaryLogCommandLineArgument($arguments) {
function GetMSBuildBinaryLogCommandLineArgument($arguments) {
foreach ($argument in $arguments) {
if ($argument -ne $null) {
$arg = $argument.Trim()
if ($arg.StartsWith("/bl:", "OrdinalIgnoreCase")) {
return $arg.Substring("/bl:".Length)
}
}
if ($arg.StartsWith("/binaryLogger:", "OrdinalIgnoreCase")) {
return $arg.Substring("/binaryLogger:".Length)
}
@@ -554,6 +556,8 @@ function GetMSBuildBinaryLogCommandLineArgument($arguments) {
return $null
}
. $PSScriptRoot\pipeline-logging-functions.ps1
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..\..")
$EngRoot = Resolve-Path (Join-Path $PSScriptRoot "..")
$ArtifactsDir = Join-Path $RepoRoot "artifacts"
@@ -569,11 +573,8 @@ Create-Directory $ToolsetDir
Create-Directory $TempDir
Create-Directory $LogDir
if ($ci) {
Write-Host "##vso[task.setvariable variable=Artifacts]$ArtifactsDir"
Write-Host "##vso[task.setvariable variable=Artifacts.Toolset]$ToolsetDir"
Write-Host "##vso[task.setvariable variable=Artifacts.Log]$LogDir"
$env:TEMP = $TempDir
$env:TMP = $TempDir
}
Write-PipelineSetVariable -Name 'Artifacts' -Value $ArtifactsDir
Write-PipelineSetVariable -Name 'Artifacts.Toolset' -Value $ToolsetDir
Write-PipelineSetVariable -Name 'Artifacts.Log' -Value $LogDir
Write-PipelineSetVariable -Name 'TEMP' -Value $TempDir
Write-PipelineSetVariable -Name 'TMP' -Value $TempDir
Regular → Executable
+19 -92
View File
@@ -52,78 +52,6 @@ else
use_global_nuget_cache=${use_global_nuget_cache:-true}
fi
function EmitError {
if [[ "$ci" != true ]]; then
echo "$@" >&2
return
fi
message_type="error"
sourcepath=''
linenumber=''
columnnumber=''
error_code=''
while [[ $# -gt 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-type|-t)
message_type=$2
shift
;;
-sourcepath|-s)
sourcepath=$2
shift
;;
-linenumber|-l)
linenumber=$2
shift
;;
-columnnumber|-col)
columnnumber=$2
shift
;;
-code|-c)
error_code=$2
shift
;;
*)
break
;;
esac
shift
done
message='##vso[task.logissue'
message="$message type=$message_type"
if [ -n "$sourcepath" ]; then
message="$message;sourcepath=$sourcepath"
else
message="$message;sourcepath=${BASH_SOURCE[1]}"
fi
if [ -n "$linenumber" ]; then
message="$message;linenumber=$linenumber"
else
message="$message;linenumber=${BASH_LINENO[0]}"
fi
if [ -n "$columnnumber" ]; then
message="$message;columnnumber=$columnnumber"
fi
if [ -n "$error_code" ]; then
message="$message;code=$error_code"
fi
message="$message]$*"
echo "$message"
}
# Resolve any symlinks in the given path.
function ResolvePath {
local path=$1
@@ -149,7 +77,7 @@ function ReadGlobalVersion {
local pattern="\"$key\" *: *\"(.*)\""
if [[ ! $line =~ $pattern ]]; then
EmitError "Error: Cannot find \"$key\" in $global_json_file"
Write-PipelineTelemetryError -category 'InitializeToolset' "Error: Cannot find \"$key\" in $global_json_file"
ExitWithExitCode 1
fi
@@ -210,7 +138,7 @@ function InitializeDotNetCli {
if [[ "$install" == true ]]; then
InstallDotNetSdk "$dotnet_root" "$dotnet_sdk_version"
else
EmitError "Unable to find dotnet with SDK version '$dotnet_sdk_version'"
Write-PipelineTelemetryError -category 'InitializeToolset' "Unable to find dotnet with SDK version '$dotnet_sdk_version'"
ExitWithExitCode 1
fi
fi
@@ -218,14 +146,10 @@ function InitializeDotNetCli {
# Add dotnet to PATH. This prevents any bare invocation of dotnet in custom
# build steps from using anything other than what we've downloaded.
export PATH="$dotnet_root:$PATH"
Write-PipelinePrependPath -path "$dotnet_root"
if [[ $ci == true ]]; then
# Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build
echo "##vso[task.prependpath]$dotnet_root"
echo "##vso[task.setvariable variable=DOTNET_MULTILEVEL_LOOKUP]0"
echo "##vso[task.setvariable variable=DOTNET_SKIP_FIRST_TIME_EXPERIENCE]1"
fi
Write-PipelineSetVariable -name "DOTNET_MULTILEVEL_LOOKUP" -value "0"
Write-PipelineSetVariable -name "DOTNET_SKIP_FIRST_TIME_EXPERIENCE" -value "1"
# return value
_InitializeDotNetCli="$dotnet_root"
@@ -263,7 +187,7 @@ function InstallDotNet {
fi
bash "$install_script" --version $version --install-dir "$root" $archArg $runtimeArg $skipNonVersionedFilesArg || {
local exit_code=$?
EmitError "Failed to install dotnet SDK (exit code '$exit_code')."
Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to install dotnet SDK (exit code '$exit_code')."
ExitWithExitCode $exit_code
}
}
@@ -321,7 +245,7 @@ function InitializeNativeTools() {
then
local nativeArgs=""
if [[ "$ci" == true ]]; then
nativeArgs="-InstallDirectory $tools_dir"
nativeArgs="--installDirectory $tools_dir"
fi
"$_script_dir/init-tools-native.sh" $nativeArgs
fi
@@ -349,7 +273,7 @@ function InitializeToolset {
fi
if [[ "$restore" != true ]]; then
EmitError "Toolset version $toolsetVersion has not been restored."
Write-PipelineTelemetryError -category 'InitializeToolset' "Toolset version $toolset_version has not been restored."
ExitWithExitCode 2
fi
@@ -366,7 +290,7 @@ function InitializeToolset {
local toolset_build_proj=`cat "$toolset_location_file"`
if [[ ! -a "$toolset_build_proj" ]]; then
EmitError "Invalid toolset path: $toolset_build_proj"
Write-PipelineTelemetryError -category 'InitializeToolset' "Invalid toolset path: $toolset_build_proj"
ExitWithExitCode 3
fi
@@ -404,12 +328,12 @@ function MSBuild {
function MSBuild-Core {
if [[ "$ci" == true ]]; then
if [[ "$binary_log" != true ]]; then
EmitError "Binary log must be enabled in CI build."
Write-PipelineTaskError "Binary log must be enabled in CI build."
ExitWithExitCode 1
fi
if [[ "$node_reuse" == true ]]; then
EmitError "Node reuse must be disabled in CI build."
Write-PipelineTaskError "Node reuse must be disabled in CI build."
ExitWithExitCode 1
fi
fi
@@ -423,7 +347,7 @@ function MSBuild-Core {
"$_InitializeBuildTool" "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@" || {
local exit_code=$?
EmitError "Build failed (exit code '$exit_code')."
Write-PipelineTaskError "Build failed (exit code '$exit_code')."
ExitWithExitCode $exit_code
}
}
@@ -431,6 +355,8 @@ function MSBuild-Core {
ResolvePath "${BASH_SOURCE[0]}"
_script_dir=`dirname "$_ResolvePath"`
. "$_script_dir/pipeline-logging-functions.sh"
eng_root=`cd -P "$_script_dir/.." && pwd`
repo_root=`cd -P "$_script_dir/../.." && pwd`
artifacts_dir="$repo_root/artifacts"
@@ -457,7 +383,8 @@ mkdir -p "$toolset_dir"
mkdir -p "$temp_dir"
mkdir -p "$log_dir"
if [[ $ci == true ]]; then
export TEMP="$temp_dir"
export TMP="$temp_dir"
fi
Write-PipelineSetVariable -name "Artifacts" -value "$artifacts_dir"
Write-PipelineSetVariable -name "Artifacts.Toolset" -value "$toolset_dir"
Write-PipelineSetVariable -name "Artifacts.Log" -value "$log_dir"
Write-PipelineSetVariable -name "Temp" -value "$temp_dir"
Write-PipelineSetVariable -name "TMP" -value "$temp_dir"
+1 -1
+1 -1
+1 -1
+1 -1
+3 -3
View File
@@ -1,9 +1,9 @@
{
"tools": {
"dotnet": "3.0.100-preview5-011568"
"dotnet": "5.0.100-alpha1-013628"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19279.5",
"Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19279.5"
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19379.1",
"Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19379.1"
}
}
+1 -1
View File
@@ -1106,7 +1106,7 @@ extern "C" {
|| defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__))
/* win32S may not free all resources on process exit. */
/* This explicitly deallocates the heap. */
GC_API void GC_win32_free_heap ();
GC_API void GC_win32_free_heap (void);
#endif
#ifdef __cplusplus
-243
View File
@@ -1,243 +0,0 @@
/*
* Copyright (c) 1996-1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* Copyright (c) 2002
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
/*
* This implements standard-conforming allocators that interact with
* the garbage collector. Gc_alloctor<T> allocates garbage-collectable
* objects of type T. Traceable_allocator<T> allocates objects that
* are not temselves garbage collected, but are scanned by the
* collector for pointers to collectable objects. Traceable_alloc
* should be used for explicitly managed STL containers that may
* point to collectable objects.
*
* This code was derived from an earlier version of the GNU C++ standard
* library, which itself was derived from the SGI STL implementation.
*/
#ifndef GC_ALLOCATOR_H
#define GC_ALLOCATOR_H
#include "gc.h"
#if defined(__GNUC__)
# define GC_ATTR_UNUSED __attribute__((unused))
#else
# define GC_ATTR_UNUSED
#endif
/* First some helpers to allow us to dispatch on whether or not a type
* is known to be pointerfree.
* These are private, except that the client may invoke the
* GC_DECLARE_PTRFREE macro.
*/
struct GC_true_type {};
struct GC_false_type {};
template <class GC_tp>
struct GC_type_traits {
GC_false_type GC_is_ptr_free;
};
# define GC_DECLARE_PTRFREE(T) \
template<> struct GC_type_traits<T> { GC_true_type GC_is_ptr_free; }
GC_DECLARE_PTRFREE(signed char);
GC_DECLARE_PTRFREE(unsigned char);
GC_DECLARE_PTRFREE(signed short);
GC_DECLARE_PTRFREE(unsigned short);
GC_DECLARE_PTRFREE(signed int);
GC_DECLARE_PTRFREE(unsigned int);
GC_DECLARE_PTRFREE(signed long);
GC_DECLARE_PTRFREE(unsigned long);
GC_DECLARE_PTRFREE(float);
GC_DECLARE_PTRFREE(double);
/* The client may want to add others. */
// In the following GC_Tp is GC_true_type iff we are allocating a
// pointerfree object.
template <class GC_Tp>
inline void * GC_selective_alloc(size_t n, GC_Tp) {
return GC_MALLOC(n);
}
template <>
inline void * GC_selective_alloc<GC_true_type>(size_t n, GC_true_type) {
return GC_MALLOC_ATOMIC(n);
}
/* Now the public gc_allocator<T> class:
*/
template <class GC_Tp>
class gc_allocator {
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef GC_Tp* pointer;
typedef const GC_Tp* const_pointer;
typedef GC_Tp& reference;
typedef const GC_Tp& const_reference;
typedef GC_Tp value_type;
template <class GC_Tp1> struct rebind {
typedef gc_allocator<GC_Tp1> other;
};
gc_allocator() {}
# ifndef _MSC_VER
// I'm not sure why this is needed here in addition to the following.
// The standard specifies it for the standard allocator, but VC++ rejects
// it. -HB
gc_allocator(const gc_allocator&) throw() {}
# endif
template <class GC_Tp1> gc_allocator(const gc_allocator<GC_Tp1>&) throw() {}
~gc_allocator() throw() {}
pointer address(reference GC_x) const { return &GC_x; }
const_pointer address(const_reference GC_x) const { return &GC_x; }
// GC_n is permitted to be 0. The C++ standard says nothing about what
// the return value is when GC_n == 0.
GC_Tp* allocate(size_type GC_n, const void* = 0) {
GC_type_traits<GC_Tp> traits;
return static_cast<GC_Tp *>
(GC_selective_alloc(GC_n * sizeof(GC_Tp),
traits.GC_is_ptr_free));
}
// __p is not permitted to be a null pointer.
void deallocate(pointer __p, size_type GC_ATTR_UNUSED GC_n)
{ GC_FREE(__p); }
size_type max_size() const throw()
{ return size_t(-1) / sizeof(GC_Tp); }
void construct(pointer __p, const GC_Tp& __val) { new(__p) GC_Tp(__val); }
void destroy(pointer __p) { __p->~GC_Tp(); }
};
template<>
class gc_allocator<void> {
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
template <class GC_Tp1> struct rebind {
typedef gc_allocator<GC_Tp1> other;
};
};
template <class GC_T1, class GC_T2>
inline bool operator==(const gc_allocator<GC_T1>&, const gc_allocator<GC_T2>&)
{
return true;
}
template <class GC_T1, class GC_T2>
inline bool operator!=(const gc_allocator<GC_T1>&, const gc_allocator<GC_T2>&)
{
return false;
}
/*
* And the public traceable_allocator class.
*/
// Note that we currently don't specialize the pointer-free case, since a
// pointer-free traceable container doesn't make that much sense,
// though it could become an issue due to abstraction boundaries.
template <class GC_Tp>
class traceable_allocator {
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef GC_Tp* pointer;
typedef const GC_Tp* const_pointer;
typedef GC_Tp& reference;
typedef const GC_Tp& const_reference;
typedef GC_Tp value_type;
template <class GC_Tp1> struct rebind {
typedef traceable_allocator<GC_Tp1> other;
};
traceable_allocator() throw() {}
# ifndef _MSC_VER
traceable_allocator(const traceable_allocator&) throw() {}
# endif
template <class GC_Tp1> traceable_allocator
(const traceable_allocator<GC_Tp1>&) throw() {}
~traceable_allocator() throw() {}
pointer address(reference GC_x) const { return &GC_x; }
const_pointer address(const_reference GC_x) const { return &GC_x; }
// GC_n is permitted to be 0. The C++ standard says nothing about what
// the return value is when GC_n == 0.
GC_Tp* allocate(size_type GC_n, const void* = 0) {
return static_cast<GC_Tp*>(GC_MALLOC_UNCOLLECTABLE(GC_n * sizeof(GC_Tp)));
}
// __p is not permitted to be a null pointer.
void deallocate(pointer __p, size_type GC_ATTR_UNUSED GC_n)
{ GC_FREE(__p); }
size_type max_size() const throw()
{ return size_t(-1) / sizeof(GC_Tp); }
void construct(pointer __p, const GC_Tp& __val) { new(__p) GC_Tp(__val); }
void destroy(pointer __p) { __p->~GC_Tp(); }
};
template<>
class traceable_allocator<void> {
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
template <class GC_Tp1> struct rebind {
typedef traceable_allocator<GC_Tp1> other;
};
};
template <class GC_T1, class GC_T2>
inline bool operator==(const traceable_allocator<GC_T1>&, const traceable_allocator<GC_T2>&)
{
return true;
}
template <class GC_T1, class GC_T2>
inline bool operator!=(const traceable_allocator<GC_T1>&, const traceable_allocator<GC_T2>&)
{
return false;
}
#endif /* GC_ALLOCATOR_H */
-480
View File
@@ -1,480 +0,0 @@
/*
* Copyright (c) 1996-1998 by Silicon Graphics. All rights reserved.
*
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
* OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
*
* Permission is hereby granted to use or copy this program
* for any purpose, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*/
//
// This is a revision of gc_alloc.h for SGI STL versions > 3.0
// Unlike earlier versions, it supplements the standard "alloc.h"
// instead of replacing it.
//
// This is sloppy about variable names used in header files.
// It also doesn't yet understand the new header file names or
// namespaces.
//
// This assumes the collector has been compiled with -DATOMIC_UNCOLLECTABLE.
// The user should also consider -DREDIRECT_MALLOC=GC_uncollectable_malloc,
// to ensure that object allocated through malloc are traced.
//
// Some of this could be faster in the explicit deallocation case.
// In particular, we spend too much time clearing objects on the
// free lists. That could be avoided.
//
// This uses template classes with static members, and hence does not work
// with g++ 2.7.2 and earlier.
//
// Unlike its predecessor, this one simply defines
// gc_alloc
// single_client_gc_alloc
// traceable_alloc
// single_client_traceable_alloc
//
// It does not redefine alloc. Nor does it change the default allocator,
// though the user may wish to do so. (The argument against changing
// the default allocator is that it may introduce subtle link compatibility
// problems. The argument for changing it is that the usual default
// allocator is usually a very bad choice for a garbage collected environment.)
//
// This code assumes that the collector itself has been compiled with a
// compiler that defines __STDC__ .
//
#ifndef GC_ALLOC_H
#include "gc.h"
#if (__GNUC__ < 3)
# include <stack> // A more portable way to get stl_alloc.h .
#else
# include <bits/stl_alloc.h>
# ifndef __STL_BEGIN_NAMESPACE
# define __STL_BEGIN_NAMESPACE namespace std {
# define __STL_END_NAMESPACE };
# endif
#ifndef __STL_USE_STD_ALLOCATORS
#define __STL_USE_STD_ALLOCATORS
#endif
#endif
/* A hack to deal with gcc 3.1. If you are using gcc3.1 and later, */
/* you should probably really use gc_allocator.h instead. */
#if defined (__GNUC__) && \
(__GNUC > 3 || (__GNUC__ == 3 && (__GNUC_MINOR__ >= 1)))
# define simple_alloc __simple_alloc
#endif
#define GC_ALLOC_H
#include <stddef.h>
#include <string.h>
// The following need to match collector data structures.
// We can't include gc_priv.h, since that pulls in way too much stuff.
// This should eventually be factored out into another include file.
extern "C" {
extern void ** const GC_objfreelist_ptr;
extern void ** const GC_aobjfreelist_ptr;
extern void ** const GC_uobjfreelist_ptr;
extern void ** const GC_auobjfreelist_ptr;
extern void GC_incr_words_allocd(size_t words);
extern void GC_incr_mem_freed(size_t words);
extern char * GC_generic_malloc_words_small(size_t word, int kind);
}
// Object kinds; must match PTRFREE, NORMAL, UNCOLLECTABLE, and
// AUNCOLLECTABLE in gc_priv.h.
enum { GC_PTRFREE = 0, GC_NORMAL = 1, GC_UNCOLLECTABLE = 2,
GC_AUNCOLLECTABLE = 3 };
enum { GC_max_fast_bytes = 255 };
enum { GC_bytes_per_word = sizeof(char *) };
enum { GC_byte_alignment = 8 };
enum { GC_word_alignment = GC_byte_alignment/GC_bytes_per_word };
inline void * &GC_obj_link(void * p)
{ return *reinterpret_cast<void **>(p); }
// Compute a number of words >= n+1 bytes.
// The +1 allows for pointers one past the end.
inline size_t GC_round_up(size_t n)
{
return ((n + GC_byte_alignment)/GC_byte_alignment)*GC_word_alignment;
}
// The same but don't allow for extra byte.
inline size_t GC_round_up_uncollectable(size_t n)
{
return ((n + GC_byte_alignment - 1)/GC_byte_alignment)*GC_word_alignment;
}
template <int dummy>
class GC_aux_template {
public:
// File local count of allocated words. Occasionally this is
// added into the global count. A separate count is necessary since the
// real one must be updated with a procedure call.
static size_t GC_words_recently_allocd;
// Same for uncollectable mmory. Not yet reflected in either
// GC_words_recently_allocd or GC_non_gc_bytes.
static size_t GC_uncollectable_words_recently_allocd;
// Similar counter for explicitly deallocated memory.
static size_t GC_mem_recently_freed;
// Again for uncollectable memory.
static size_t GC_uncollectable_mem_recently_freed;
static void * GC_out_of_line_malloc(size_t nwords, int kind);
};
template <int dummy>
size_t GC_aux_template<dummy>::GC_words_recently_allocd = 0;
template <int dummy>
size_t GC_aux_template<dummy>::GC_uncollectable_words_recently_allocd = 0;
template <int dummy>
size_t GC_aux_template<dummy>::GC_mem_recently_freed = 0;
template <int dummy>
size_t GC_aux_template<dummy>::GC_uncollectable_mem_recently_freed = 0;
template <int dummy>
void * GC_aux_template<dummy>::GC_out_of_line_malloc(size_t nwords, int kind)
{
GC_words_recently_allocd += GC_uncollectable_words_recently_allocd;
GC_non_gc_bytes +=
GC_bytes_per_word * GC_uncollectable_words_recently_allocd;
GC_uncollectable_words_recently_allocd = 0;
GC_mem_recently_freed += GC_uncollectable_mem_recently_freed;
GC_non_gc_bytes -=
GC_bytes_per_word * GC_uncollectable_mem_recently_freed;
GC_uncollectable_mem_recently_freed = 0;
GC_incr_words_allocd(GC_words_recently_allocd);
GC_words_recently_allocd = 0;
GC_incr_mem_freed(GC_mem_recently_freed);
GC_mem_recently_freed = 0;
return GC_generic_malloc_words_small(nwords, kind);
}
typedef GC_aux_template<0> GC_aux;
// A fast, single-threaded, garbage-collected allocator
// We assume the first word will be immediately overwritten.
// In this version, deallocation is not a noop, and explicit
// deallocation is likely to help performance.
template <int dummy>
class single_client_gc_alloc_template {
public:
static void * allocate(size_t n)
{
size_t nwords = GC_round_up(n);
void ** flh;
void * op;
if (n > GC_max_fast_bytes) return GC_malloc(n);
flh = GC_objfreelist_ptr + nwords;
if (0 == (op = *flh)) {
return GC_aux::GC_out_of_line_malloc(nwords, GC_NORMAL);
}
*flh = GC_obj_link(op);
GC_aux::GC_words_recently_allocd += nwords;
return op;
}
static void * ptr_free_allocate(size_t n)
{
size_t nwords = GC_round_up(n);
void ** flh;
void * op;
if (n > GC_max_fast_bytes) return GC_malloc_atomic(n);
flh = GC_aobjfreelist_ptr + nwords;
if (0 == (op = *flh)) {
return GC_aux::GC_out_of_line_malloc(nwords, GC_PTRFREE);
}
*flh = GC_obj_link(op);
GC_aux::GC_words_recently_allocd += nwords;
return op;
}
static void deallocate(void *p, size_t n)
{
size_t nwords = GC_round_up(n);
void ** flh;
if (n > GC_max_fast_bytes) {
GC_free(p);
} else {
flh = GC_objfreelist_ptr + nwords;
GC_obj_link(p) = *flh;
memset(reinterpret_cast<char *>(p) + GC_bytes_per_word, 0,
GC_bytes_per_word * (nwords - 1));
*flh = p;
GC_aux::GC_mem_recently_freed += nwords;
}
}
static void ptr_free_deallocate(void *p, size_t n)
{
size_t nwords = GC_round_up(n);
void ** flh;
if (n > GC_max_fast_bytes) {
GC_free(p);
} else {
flh = GC_aobjfreelist_ptr + nwords;
GC_obj_link(p) = *flh;
*flh = p;
GC_aux::GC_mem_recently_freed += nwords;
}
}
};
typedef single_client_gc_alloc_template<0> single_client_gc_alloc;
// Once more, for uncollectable objects.
template <int dummy>
class single_client_traceable_alloc_template {
public:
static void * allocate(size_t n)
{
size_t nwords = GC_round_up_uncollectable(n);
void ** flh;
void * op;
if (n > GC_max_fast_bytes) return GC_malloc_uncollectable(n);
flh = GC_uobjfreelist_ptr + nwords;
if (0 == (op = *flh)) {
return GC_aux::GC_out_of_line_malloc(nwords, GC_UNCOLLECTABLE);
}
*flh = GC_obj_link(op);
GC_aux::GC_uncollectable_words_recently_allocd += nwords;
return op;
}
static void * ptr_free_allocate(size_t n)
{
size_t nwords = GC_round_up_uncollectable(n);
void ** flh;
void * op;
if (n > GC_max_fast_bytes) return GC_malloc_atomic_uncollectable(n);
flh = GC_auobjfreelist_ptr + nwords;
if (0 == (op = *flh)) {
return GC_aux::GC_out_of_line_malloc(nwords, GC_AUNCOLLECTABLE);
}
*flh = GC_obj_link(op);
GC_aux::GC_uncollectable_words_recently_allocd += nwords;
return op;
}
static void deallocate(void *p, size_t n)
{
size_t nwords = GC_round_up_uncollectable(n);
void ** flh;
if (n > GC_max_fast_bytes) {
GC_free(p);
} else {
flh = GC_uobjfreelist_ptr + nwords;
GC_obj_link(p) = *flh;
*flh = p;
GC_aux::GC_uncollectable_mem_recently_freed += nwords;
}
}
static void ptr_free_deallocate(void *p, size_t n)
{
size_t nwords = GC_round_up_uncollectable(n);
void ** flh;
if (n > GC_max_fast_bytes) {
GC_free(p);
} else {
flh = GC_auobjfreelist_ptr + nwords;
GC_obj_link(p) = *flh;
*flh = p;
GC_aux::GC_uncollectable_mem_recently_freed += nwords;
}
}
};
typedef single_client_traceable_alloc_template<0> single_client_traceable_alloc;
template < int dummy >
class gc_alloc_template {
public:
static void * allocate(size_t n) { return GC_malloc(n); }
static void * ptr_free_allocate(size_t n)
{ return GC_malloc_atomic(n); }
static void deallocate(void *, size_t) { }
static void ptr_free_deallocate(void *, size_t) { }
};
typedef gc_alloc_template < 0 > gc_alloc;
template < int dummy >
class traceable_alloc_template {
public:
static void * allocate(size_t n) { return GC_malloc_uncollectable(n); }
static void * ptr_free_allocate(size_t n)
{ return GC_malloc_atomic_uncollectable(n); }
static void deallocate(void *p, size_t) { GC_free(p); }
static void ptr_free_deallocate(void *p, size_t) { GC_free(p); }
};
typedef traceable_alloc_template < 0 > traceable_alloc;
// We want to specialize simple_alloc so that it does the right thing
// for all pointerfree types. At the moment there is no portable way to
// even approximate that. The following approximation should work for
// SGI compilers, and recent versions of g++.
# define __GC_SPECIALIZE(T,alloc) \
class simple_alloc<T, alloc> { \
public: \
static T *allocate(size_t n) \
{ return 0 == n? 0 : \
reinterpret_cast<T*>(alloc::ptr_free_allocate(n * sizeof (T))); } \
static T *allocate(void) \
{ return reinterpret_cast<T*>(alloc::ptr_free_allocate(sizeof (T))); } \
static void deallocate(T *p, size_t n) \
{ if (0 != n) alloc::ptr_free_deallocate(p, n * sizeof (T)); } \
static void deallocate(T *p) \
{ alloc::ptr_free_deallocate(p, sizeof (T)); } \
};
__STL_BEGIN_NAMESPACE
__GC_SPECIALIZE(char, gc_alloc)
__GC_SPECIALIZE(int, gc_alloc)
__GC_SPECIALIZE(unsigned, gc_alloc)
__GC_SPECIALIZE(float, gc_alloc)
__GC_SPECIALIZE(double, gc_alloc)
__GC_SPECIALIZE(char, traceable_alloc)
__GC_SPECIALIZE(int, traceable_alloc)
__GC_SPECIALIZE(unsigned, traceable_alloc)
__GC_SPECIALIZE(float, traceable_alloc)
__GC_SPECIALIZE(double, traceable_alloc)
__GC_SPECIALIZE(char, single_client_gc_alloc)
__GC_SPECIALIZE(int, single_client_gc_alloc)
__GC_SPECIALIZE(unsigned, single_client_gc_alloc)
__GC_SPECIALIZE(float, single_client_gc_alloc)
__GC_SPECIALIZE(double, single_client_gc_alloc)
__GC_SPECIALIZE(char, single_client_traceable_alloc)
__GC_SPECIALIZE(int, single_client_traceable_alloc)
__GC_SPECIALIZE(unsigned, single_client_traceable_alloc)
__GC_SPECIALIZE(float, single_client_traceable_alloc)
__GC_SPECIALIZE(double, single_client_traceable_alloc)
__STL_END_NAMESPACE
#ifdef __STL_USE_STD_ALLOCATORS
__STL_BEGIN_NAMESPACE
template <class _Tp>
struct _Alloc_traits<_Tp, gc_alloc >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, gc_alloc > _Alloc_type;
typedef __allocator<_Tp, gc_alloc > allocator_type;
};
inline bool operator==(const gc_alloc&,
const gc_alloc&)
{
return true;
}
inline bool operator!=(const gc_alloc&,
const gc_alloc&)
{
return false;
}
template <class _Tp>
struct _Alloc_traits<_Tp, single_client_gc_alloc >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, single_client_gc_alloc > _Alloc_type;
typedef __allocator<_Tp, single_client_gc_alloc > allocator_type;
};
inline bool operator==(const single_client_gc_alloc&,
const single_client_gc_alloc&)
{
return true;
}
inline bool operator!=(const single_client_gc_alloc&,
const single_client_gc_alloc&)
{
return false;
}
template <class _Tp>
struct _Alloc_traits<_Tp, traceable_alloc >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, traceable_alloc > _Alloc_type;
typedef __allocator<_Tp, traceable_alloc > allocator_type;
};
inline bool operator==(const traceable_alloc&,
const traceable_alloc&)
{
return true;
}
inline bool operator!=(const traceable_alloc&,
const traceable_alloc&)
{
return false;
}
template <class _Tp>
struct _Alloc_traits<_Tp, single_client_traceable_alloc >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, single_client_traceable_alloc > _Alloc_type;
typedef __allocator<_Tp, single_client_traceable_alloc > allocator_type;
};
inline bool operator==(const single_client_traceable_alloc&,
const single_client_traceable_alloc&)
{
return true;
}
inline bool operator!=(const single_client_traceable_alloc&,
const single_client_traceable_alloc&)
{
return false;
}
__STL_END_NAMESPACE
#endif /* __STL_USE_STD_ALLOCATORS */
#endif /* GC_ALLOC_H */
+1 -1
View File
@@ -1884,7 +1884,7 @@ word bytes;
return(result);
}
void GC_win32_free_heap ()
void GC_win32_free_heap (void)
{
if (GC_no_win32_dlls) {
while (GC_n_heap_bases > 0) {
+1 -1
View File
@@ -12,7 +12,7 @@ endif
if HAVE_STATIC_ZLIB
llvm_extra_libs = $(STATIC_ZLIB_PATH)
else
if HAVE_ZLIB
if HAVE_SYS_ZLIB
llvm_extra_libs=-lz
else
llvm_extra_libs=
+75
View File
@@ -0,0 +1,75 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
#
# DESCRIPTION
#
# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
# added in between.
#
# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
# FLAG.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <[email protected]>
# Copyright (c) 2011 Maarten Bosmans <[email protected]>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 7
m4_ifndef([AS_VAR_APPEND],
[m4_define([AS_VAR_APPEND],
[$1=$$1$2])])
AC_DEFUN([AX_APPEND_FLAG],
[dnl
AC_PREREQ(2.63)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
AS_VAR_SET_IF(FLAGS,[
AS_CASE([" AS_VAR_GET(FLAGS) "],
[*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
[
AS_VAR_APPEND(FLAGS,[" $1"])
AC_RUN_LOG([: FLAGS="$FLAGS"])
])
],
[
AS_VAR_SET(FLAGS,[$1])
AC_RUN_LOG([: FLAGS="$FLAGS"])
])
AS_VAR_POPDEF([FLAGS])dnl
])dnl AX_APPEND_FLAG
+65
View File
@@ -0,0 +1,65 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# For every FLAG1, FLAG2 it is checked whether the linker works with the
# flag. If it does, the flag is added FLAGS-VARIABLE
#
# If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is
# used. During the check the flag is always added to the linker's flags.
#
# If EXTRA-FLAGS is defined, it is added to the linker's default flags
# when the check is done. The check is thus made with the flags: "LDFLAGS
# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
# issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG.
# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS.
#
# LICENSE
#
# Copyright (c) 2011 Maarten Bosmans <[email protected]>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 6
AC_DEFUN([AX_APPEND_LINK_FLAGS],
[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
for flag in $1; do
AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4])
done
])dnl AX_APPEND_LINK_FLAGS
+74
View File
@@ -0,0 +1,74 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the linker or gives an error.
# (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the linker's default flags
# when the check is done. The check is thus made with the flags: "LDFLAGS
# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
# issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_LINK_IFELSE.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <[email protected]>
# Copyright (c) 2011 Maarten Bosmans <[email protected]>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 5
AC_DEFUN([AX_CHECK_LINK_FLAG],
[AC_PREREQ(2.63)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
ax_check_save_flags=$LDFLAGS
LDFLAGS="$LDFLAGS $4 $1"
AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
LDFLAGS=$ax_check_save_flags])
AS_VAR_IF(CACHEVAR,yes,
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_LINK_FLAGS
+37
View File
@@ -0,0 +1,37 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_REQUIRE_DEFINED(MACRO)
#
# DESCRIPTION
#
# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
# been defined and thus are available for use. This avoids random issues
# where a macro isn't expanded. Instead the configure script emits a
# non-fatal:
#
# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
#
# It's like AC_REQUIRE except it doesn't expand the required macro.
#
# Here's an example:
#
# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
#
# LICENSE
#
# Copyright (c) 2014 Mike Frysinger <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 2
AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
])dnl AX_REQUIRE_DEFINED
+1
View File
@@ -1,5 +1,6 @@
man_MANS = \
al.1 \
aprofutil.1 \
cert2spc.1 \
certmgr.1 \
cert-sync.1 \
+91
View File
@@ -0,0 +1,91 @@
.TH aprofutil 1
.SH NAME
aprofutil \- Mono's AOT profile tool
.SH SYNOPSIS
.B aprofutil
\fR[\fIoptions\fR] <\fIyour-aot-profile.aotprofile\fR>
.SH DESCRIPTION
AOT profile tool is a tool to inspect AOT profiler files.
.PP
It can be used to show, filter and write the profiler file content in readable text form.
.SH OPTIONS
.nf
.RS
-h, --help, -? Show this message and exit
-a, --all Show modules, types and methods in the profile
-d, --modules Show modules in the profile
--filter-method=VALUE Filter by method with regex VALUE
--filter-module=VALUE Filter by module with regex VALUE
--filter-type=VALUE Filter by type with regex VALUE
-m, --methods Show methods in the profile
-o, --output=VALUE Write profile to OUTPUT file
-s, --summary Show summary of the profile
-t, --types Show types in the profile
-v, --verbose Output information about progress during the run
of the tool
.RE
.fi
.SH EXAMPLES
Display modules and summary of XA startup profile
.PP
.nf
.RS
mono aprofutil.exe -sd startup.aotprofile
.fi
.RE
.PP
Output:
.PP
.nf
.RS
Modules:
41C38B0A-2032-45CE-8638-0299CED65330 mscorlib
0326DF03-2158-4F7A-9A2B-B7A9419F021D Mono.Android
8FB63BB4-1195-4173-A9ED-0EC341B07C32 System
74C06E06-C1C7-4A4C-B64E-EAC7DBB08BBC Java.Interop
11E2319F-6A26-461C-9C46-C972248BEE4B System.Core
7999CC4B-D566-4ECA-8A72-469344172CA3 Xamarin.Forms.Platform.Android
C5089213-328B-451D-BA87-D6585C120780 Xamarin.Forms.Performance.Integration.Droid
D754F8AE-503C-41C8-B16F-647FC662507A Xamarin.Android.Support.v7.AppCompat
929ECB6D-1171-4C66-8470-DD32AC608969 Xamarin.Android.Support.Fragment
F841E23B-59A8-4AE2-9A84-D2FC1D891B4A Xamarin.Forms.Core
945CCBF8-C2DB-468B-B3BD-D7ACA37B69AD Xamarin.Forms.Performance.Integration
AF20FA19-F07E-4BD4-B5ED-104706EA660E Xamarin.Forms.Xaml
629C84F8-0988-42EF-8BC5-872173A0A71F FormsViewGroup
60398815-8E62-487E-A553-781F56A0849D Xamarin.Android.Support.Design
F0C550D7-665A-40B5-A307-8E9B49976D87 Xamarin.Android.Support.Core.UI
23A34485-DE75-440E-BA9D-E235F664E990 Xamarin.Android.Support.Compat
Summary:
Modules: 16
Types: 907
Methods: 4,230
.fi
.RE
.PP
Filter Java.Interop.Runtime type in XA startup profile
.PP
.nf
.RS
mono aprofutil.exe --filter-type Java.Interop.Runtime -sa startup.aotprofile
.fi
.RE
.PP
Output:
.PP
.nf
.RS
Modules:
0326DF03-2158-4F7A-9A2B-B7A9419F021D Mono.Android
Types:
Java.Interop.Runtime
Methods:
bool Java.Interop.Runtime:IsGCUserPeer (Android.Runtime.IJavaObject)
bool Java.Interop.Runtime:IsGCUserPeer (intptr)
Summary:
Modules: 1 (of 16)
Types: 1 (of 907)
Methods: 2 (of 4230)
.fi
.RE
.SH SEE ALSO
\fBmono-profilers\fR(1)
+3 -5
View File
@@ -1446,11 +1446,9 @@ Checks that mark bits in the major heap are consistent at the end of
each major collection. Consistent mark bits mean that if an object is
marked, all objects that it had references to must also be marked.
.TP
\fBcheck-nursery-pinned\fR
After nursery collections, and before starting concurrent collections,
check whether all nursery objects are pinned, or not pinned -
depending on context. Does nothing when the split nursery collector
is used.
\fBcheck-nursery-untag\fR
After garbage collections, check whether all vtable pointers are no
longer tagged.
.TP
\fBxdomain-checks\fR
Performs a check to make sure that no references are left to an
+2
View File
@@ -24,6 +24,7 @@ xammac_net_4_5_SUBDIRS := build class
xbuild_12_SUBDIRS := build class tools/xbuild
xbuild_14_SUBDIRS := build class tools/xbuild
winaot_SUBDIRS := build class
testing_winaot_interp_SUBDIRS := build class
orbis_SUBDIRS := build class
unreal_SUBDIRS := build class
wasm_SUBDIRS := build class
@@ -85,6 +86,7 @@ $(_boot_:%=profile-do--testing_aot_full_interp--%): profile-do--testing_a
$(_boot_:%=profile-do--testing_aot_hybrid--%): profile-do--testing_aot_hybrid--%: profile-do--build--%
$(_boot_:%=profile-do--testing_aot_full--%): profile-do--testing_aot_full--%: profile-do--build--%
$(_boot_:%=profile-do--winaot--%): profile-do--winaot--%: profile-do--build--%
$(_boot_:%=profile-do--testing_winaot_interp--%): profile-do--testing_winaot_interp--%: profile-do--build--%
$(_boot_:%=profile-do--orbis--%): profile-do--orbis--%: profile-do--build--%
$(_boot_:%=profile-do--unreal--%): profile-do--unreal--%: profile-do--build--%
$(_boot_:%=profile-do--wasm--%): profile-do--wasm--%: profile-do--build--%
+1
View File
@@ -49,6 +49,7 @@ DISTFILES = \
library.make \
rules.make \
tests.make \
start-compiler-server.sh \
$(COMMON_SRCS:%=common/%) \
$(PLATFORMS:%=platforms/%.make) $(PROFILES:%=profiles/%.make)
+2 -2
View File
@@ -41,9 +41,9 @@ class X
Version min_mono_version;
#if __MonoCS__
min_mono_version = new Version (6, 2);
min_mono_version = new Version (6, 5);
#else
min_mono_version = new Version (6, 2);
min_mono_version = new Version (6, 5);
#endif
if (version < min_mono_version)
+1
View File
@@ -38,5 +38,6 @@ NO_CONSOLE = yes
ifdef PLATFORM_WIN32
PROFILE_MCS_FLAGS += -d:MOBILE_DESKTOP_HOST -d:WIN_PLATFORM
endif
ENABLE_GSS=1
PROFILE_TEST_HARNESS_EXCLUDES = MobileNotWorking PKITS InetAccess AndroidNotWorking
+1 -1
View File
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
TARGET_NET_REFERENCE = v4.6
TARGET_NET_REFERENCE = v4.7
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = -d:NET_4_6 -d:MONO -d:MONODROID_TOOLS -d:WIN_PLATFORM -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS)
+4
View File
@@ -25,3 +25,7 @@ ifdef PLATFORM_MACOS
MONO_FEATURE_APPLETLS=1
ENABLE_GSS=1
endif
ifeq ($(HOST_PLATFORM),linux)
ENABLE_GSS=1
endif
@@ -0,0 +1,13 @@
#! -*- makefile -*-
include $(topdir)/build/profiles/winaot_common.make
PROFILE_MCS_FLAGS += \
-d:FULL_AOT_INTERP \
-d:DISABLE_SECURITY \
-d:DISABLE_REMOTING
DISABLE_REMOTING = yes
NO_MULTIPLE_APPDOMAINS = yes
PROFILE_TEST_HARNESS_EXCLUDES := MobileNotWorking PKITS
+4 -34
View File
@@ -1,43 +1,13 @@
#! -*- makefile -*-
BOOTSTRAP_PROFILE = build
include $(topdir)/build/profiles/winaot_common.make
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_CSC)
MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
-d:NET_2_1 \
-d:NET_3_5 \
-d:NET_4_0 \
-d:NET_4_5 \
-d:MONO \
-d:MOBILE,MOBILE_LEGACY \
PROFILE_MCS_FLAGS += \
-d:FULL_AOT_DESKTOP \
-d:FULL_AOT_RUNTIME \
-d:DISABLE_COM \
-d:WIN_PLATFORM \
-d:WINAOT \
-nowarn:1699 \
-nostdlib \
$(PLATFORM_DEBUG_FLAGS)
-d:FULL_AOT_RUNTIME
API_BIN_PROFILE = build/monotouch
FRAMEWORK_VERSION = 2.1
# the tuner takes care of the install
NO_INSTALL = yes
AOT_FRIENDLY_PROFILE = yes
ALWAYS_AOT_BCL = yes
ALWAYS_AOT_TESTS = yes
MOBILE_PROFILE = yes
NO_VTS_TEST = yes
NO_SRE = yes
PROFILE_TEST_HARNESS_EXCLUDES = MobileNotWorking PKITS SRE NotWorkingLinqInterpreter
PROFILE_TEST_HARNESS_EXCLUDES = MobileNotWorking PKITS SRE NotWorkingLinqInterpreter
+35
View File
@@ -0,0 +1,35 @@
#! -*- makefile -*-
BOOTSTRAP_PROFILE = build
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_CSC)
MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = \
-d:NET_1_1 \
-d:NET_2_0 \
-d:NET_2_1 \
-d:NET_3_5 \
-d:NET_4_0 \
-d:NET_4_5 \
-d:MONO \
-d:MOBILE,MOBILE_LEGACY \
-d:DISABLE_COM \
-d:WIN_PLATFORM \
-d:WINAOT \
-nowarn:1699 \
-nostdlib \
$(PLATFORM_DEBUG_FLAGS)
API_BIN_PROFILE = build/monotouch
FRAMEWORK_VERSION = 2.1
NO_INSTALL = yes
AOT_FRIENDLY_PROFILE = yes
ALWAYS_AOT_BCL = yes
MOBILE_PROFILE = yes
+1 -1
View File
@@ -45,7 +45,7 @@ USE_MCS_FLAGS = $(COMPILER_SERVER_ARGS) /codepage:$(CODEPAGE) /nologo /noconfig
USE_MBAS_FLAGS = $(COMPILER_SERVER_ARGS) /codepage:$(CODEPAGE) $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS)
USE_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS) $(CPPFLAGS)
CSCOMPILE = $(Q_MCS) $(MCS) $(USE_MCS_FLAGS)
CSC_RUNTIME_FLAGS = --aot-path=$(abspath $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)) --gc-params=nursery-size=64m
CSC_RUNTIME_FLAGS = --aot-path=$(abspath $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)) --gc-params=nursery-size=64m --clr-memory-model
BASCOMPILE = $(MBAS) $(USE_MBAS_FLAGS)
CCOMPILE = $(CC) $(USE_CFLAGS)
BOOT_COMPILE = $(Q_MCS) $(BOOTSTRAP_MCS) $(USE_MCS_FLAGS)
+1 -1
View File
@@ -6,7 +6,7 @@ set -u
set -e
if [ -s "$VBCS_LOCATION" ]; then
CMD="RoslynCommandLineLogFile=$2 $VBCS_RUNTIME --gc-params=nursery-size=64m \"$VBCS_LOCATION\" -pipename:$3 &"
CMD="RoslynCommandLineLogFile=$2 $VBCS_RUNTIME --clr-memory-model --gc-params=nursery-size=64m \"$VBCS_LOCATION\" -pipename:$3 &"
echo "Log location set to $2"
touch "$2"
echo "cd $1; bash -c \"$CMD\""
@@ -69,7 +69,12 @@
<PropertyGroup Condition=" '$(Platform)' == 'winaot' ">
<OutputPath>./../../../class/lib/winaot/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_COM;WIN_PLATFORM;WINAOT</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_COM;WIN_PLATFORM;WINAOT;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'testing_winaot_interp' ">
<OutputPath>./../../../class/lib/testing_winaot_interp/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_COM;WIN_PLATFORM;WINAOT;FULL_AOT_INTERP;DISABLE_SECURITY;DISABLE_REMOTING</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../../class/lib/xammac/Facades</OutputPath>
@@ -139,6 +144,12 @@
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'testing_winaot_interp' ">
<Reference Include="nunitlite">
<HintPath>..\lib\testing_winaot_interp\nunitlite.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<!-- @ALL_REFERENCES@ -->
<!-- @ALL_RESOURCES@ -->
<PropertyGroup>
@@ -69,7 +69,12 @@
<PropertyGroup Condition=" '$(Platform)' == 'winaot' ">
<OutputPath>./../../../class/lib/winaot/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_COM;WIN_PLATFORM;WINAOT</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_COM;WIN_PLATFORM;WINAOT;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'testing_winaot_interp' ">
<OutputPath>./../../../class/lib/testing_winaot_interp/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_COM;WIN_PLATFORM;WINAOT;FULL_AOT_INTERP;DISABLE_SECURITY;DISABLE_REMOTING</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../../class/lib/xammac/Facades</OutputPath>
@@ -140,6 +145,12 @@
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'testing_winaot_interp' ">
<Reference Include="nunitlite">
<HintPath>..\lib\testing_winaot_interp\nunitlite.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<!-- @ALL_REFERENCES@ -->
<!-- @ALL_RESOURCES@ -->
<PropertyGroup>
@@ -69,7 +69,12 @@
<PropertyGroup Condition=" '$(Platform)' == 'winaot' ">
<OutputPath>./../../../class/lib/winaot/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_COM;WIN_PLATFORM;WINAOT</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_COM;WIN_PLATFORM;WINAOT;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'testing_winaot_interp' ">
<OutputPath>./../../../class/lib/testing_winaot_interp/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_COM;WIN_PLATFORM;WINAOT;FULL_AOT_INTERP;DISABLE_SECURITY;DISABLE_REMOTING</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../../class/lib/xammac/Facades</OutputPath>
@@ -139,6 +144,12 @@
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'testing_winaot_interp' ">
<Reference Include="nunitlite">
<HintPath>..\lib\testing_winaot_interp\nunitlite.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<!-- @ALL_REFERENCES@ -->
<!-- @ALL_RESOURCES@ -->
<PropertyGroup>
@@ -69,7 +69,12 @@
<PropertyGroup Condition=" '$(Platform)' == 'winaot' ">
<OutputPath>./../../../class/lib/winaot/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_COM;WIN_PLATFORM;WINAOT</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_COM;WIN_PLATFORM;WINAOT;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'testing_winaot_interp' ">
<OutputPath>./../../../class/lib/testing_winaot_interp/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_COM;WIN_PLATFORM;WINAOT;FULL_AOT_INTERP;DISABLE_SECURITY;DISABLE_REMOTING</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../../class/lib/xammac/Facades</OutputPath>
@@ -139,6 +144,12 @@
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'testing_winaot_interp' ">
<Reference Include="nunitlite">
<HintPath>..\lib\testing_winaot_interp\nunitlite.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<!-- @ALL_REFERENCES@ -->
<!-- @ALL_RESOURCES@ -->
<PropertyGroup>
@@ -64,7 +64,12 @@
<PropertyGroup Condition=" '$(Platform)' == 'winaot' ">
<OutputPath>./../../../class/lib/winaot/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_COM;WIN_PLATFORM;WINAOT</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_COM;WIN_PLATFORM;WINAOT;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'testing_winaot_interp' ">
<OutputPath>./../../../class/lib/testing_winaot_interp/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_COM;WIN_PLATFORM;WINAOT;FULL_AOT_INTERP;DISABLE_SECURITY;DISABLE_REMOTING</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../../class/lib/xammac/Facades</OutputPath>
@@ -128,6 +133,12 @@
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'testing_winaot_interp' ">
<Reference Include="nunitlite">
<HintPath>..\lib\testing_winaot_interp\nunitlite.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<!-- @ALL_REFERENCES@ -->
<!-- @ALL_RESOURCES@ -->
<PropertyGroup>
@@ -69,7 +69,12 @@
<PropertyGroup Condition=" '$(Platform)' == 'winaot' ">
<OutputPath>./../../../class/lib/winaot/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_COM;WIN_PLATFORM;WINAOT</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_COM;WIN_PLATFORM;WINAOT;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'testing_winaot_interp' ">
<OutputPath>./../../../class/lib/testing_winaot_interp/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;DISABLE_COM;WIN_PLATFORM;WINAOT;FULL_AOT_INTERP;DISABLE_SECURITY;DISABLE_REMOTING</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../../class/lib/xammac/Facades</OutputPath>
@@ -139,6 +144,12 @@
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'testing_winaot_interp' ">
<Reference Include="nunitlite">
<HintPath>..\lib\testing_winaot_interp\nunitlite.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<!-- @ALL_REFERENCES@ -->
<!-- @ALL_RESOURCES@ -->
<PropertyGroup>
Loaded 100 of 1456 files, more files were not shown because too many files have changed in this diff. Show more