Compare commits

..
131 Commits
Author SHA1 Message Date
Bernhard Urban-Forster 80b1e103cb [debugger] skip suspend for unattached threads (#18105)
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
2019-12-10 12:16:05 +01:00
Aleksey Kliger (λgeek) 7704bd1b92 [mini] Fix delegate trampoline virtual call via delgate Invoke (#18073)
* [mini] Fix delegate trampoline virtual call via delgate Invoke

If we need to jit the Invoke method of a delegate, we get tramp_info with a
NULL method.

Background: normally when we create a delegate around a virtual method,
handle_delegate_ctor will just create a virtual invoke trampoline with
mono_arch_get_delegate_virtual_invoke_impl which doesn't get here.  But if
we're asked to compile the delegate's Invoke method, then compile_special ()
will create a tramp_info with a null method, and return a delegate trampoline.

That's the case here - we had
  var del = SomeDelegate(obj.VirtualMethod);
  var invoke_method = del.GetType().GetMethod ("Invoke");
  invoke_method.Invoke (del, args);
or
  var del = SomeDelegate(obj.VirtualMethod);
  var another_del = OtherDelegate (del.Invoke);
  another_del (args);

in both cases, we end up in mono_delegate_trampoline with tramp_info->method ==
NULL.

in the second case the IL is like this:
   newobj instance void Derived::'.ctor'
   ldvirtftn instance void class Base::VirtualMethod()
   newobj instance void class SomeDelegate::'.ctor'(object, native int)

So delegate->target is a derived instance but delegate->method is some base
class method.

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

* [tests] Add tests for compiling delegate's Invoke method

Where the delegate calls a virtual method
2019-12-10 12:12:50 +01:00
Bernhard Urban-Forster fd44435a84 [debugger] remove unused thread suspend count (#18102) 2019-12-10 08:25:31 +01:00
Nikolay Sivov d1fc2ffa84 [support] Remove some dead code (#16674)
Both 'ptv' and 'tv' are unused since select() was replaced with poll() in 57b521e.
2019-12-10 00:21:00 +01:00
Steve Pfister 4cefdcb7ce Bump to mono/corefx@f3815a9 (#18090)
Picks up https://github.com/mono/corefx/pull/376
2019-12-09 21:29:40 +01:00
Jay Krell 5cbb1f4be8 [cxx] Fix mono-boehm to compile as C++. (#18086)
https://jenkins.mono-project.com/job/test-mono-pull-request-i386/32263/consoleText

```
      ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
boehm-gc.c: In function 'void mono_gc_base_init()':
boehm-gc.c:202:42: error: invalid conversion from
'void (*)(size_t) {aka void (*)(unsigned int)}' to
GC_on_heap_resize_proc {aka void (*)(long unsigned int)}' [-fpermissive]
  GC_set_on_heap_resize (on_gc_heap_resize);
                                          ^
In file included from ../../mono/utils/gc_wrapper.h:44:0,
                 from ../../mono/metadata/gc-internals.h:16,
                 from boehm-gc.c:16:
../../external/bdwgc/include/gc.h:132:21: note:
 initializing argument 1 of 'void GC_set_on_heap_resize(GC_on_heap_resize_proc)'
 GC_API void GC_CALL GC_set_on_heap_resize(GC_on_heap_resize_proc);
```
2019-12-09 18:59:10 +01:00
abrevet-dev 3d83c7429e [WinForms] No event should be triggered when calling ComboBox.Items.RemoteAt() (#18069)
* [WinForms] Fix wrong behavior when calling ComboBox.Items.RemoteAt() with index equals to SelectedIndex

* [WinForms] Fix #10643 No event should be triggered when calling ComboBox.Items.RemoteAt()

Fixes #10643
2019-12-09 15:51:28 +01:00
dotnet-maestro[bot] 612f2a8e88 Update dependencies from https://github.com/dotnet/arcade build 20191208.1 (#18089)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19608.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19608.1
2019-12-09 15:26:16 +01:00
Maxim Lipnin 17bba9e7dd [wasm] Clean up rsp-file (#18087) 2019-12-09 07:57:00 -06:00
Egor Bogatov 2befdcfa52 [netcore] Enable more tests for interpreter and llvm on CI (#17957)
* Enable more tests

* fix build?

* forward XUNIT_MONO_ENV_OPTIONS

* increase timeout

* ignore some tests for interpreter

* ignore more tests

* move interp specific issues to a separate rsp

* fix CI

* fix CI

* undo build.sh chmod

* revert chmod for xunit-summary-py

* improve xunit summary

* Ignore the whole System.Net.Tests namespace

* Ignore System.Text.Json

* disable the whole BinaryFormatterTests

* Disable System.Net.Http.Functional.Tests
2019-12-09 14:55:44 +01:00
Kenneth Pouncey 1462208991 [wasm][bcl][websockets] Add WebSocket support. (#18062)
Add the ability to initialize a `WebAssembly.Net.WebSockets::ClientWebSocket` from `System.Net.WebSockets.ClientWebSocket`.

`System.Net.WebSockets.ClientWebSocket` will delegate all calls to the WebAssembly ClientWebSocket.  

- Add support for marshaling `Uri` class correctly.  This was a cause of failures.
- Add bindings tests for `Uri` marhaling.
2019-12-09 13:32:17 +01:00
Jay Krell ed6b8024b0 fix warning: threadpool-worker-default.c: In function 'worker_try_create': 'now' may be used uninitialized (#18056)
https://jenkins.mono-project.com/job/build-source-tarball-mono-pullrequest/854/console
2019-12-09 08:17:54 +01:00
Jay Krell a6c4eafee8 Add some missing barriers when dealing with global caches (#18032)
* Add some missing barriers when dealing with global caches
accessed from multiple threads without locks.

This is based on earlier PR https://github.com/mono/mono/pull/17849.

Read-side barriers are removed.
  More analysis is needed to determine if they are needed (which pointer
  read vs. written).
Write-side barriers are compiler barrier + store-release instead of full barrier.

Note all candidates are converted to new form yet.

Cases that do motivate read-wide barriers are skipped.
e.g.
`mono_arch_start_dyn_call`
`get_agent_domain_info`
`init_jit_info_dbg_attrs`

* PR: Remove 'Try one more time..'
2019-12-08 15:30:48 +01:00
Sam Patel 74567a0a34 Update glib-remap.h to include g_module_address (#18076) 2019-12-07 07:11:59 +01:00
abrevet-dev 4be2a9a207 [WinForms] Handle menu for wheel button click (close the contextmenu) (#18049)
Fixes #18019
2019-12-06 18:41:47 +01:00
Ankit Jain d1db937e78 Bump msbuild to track xplat-master (#18050)
.. to get changes from https://github.com/mono/msbuild/pull/162 .

And bump roslyn to 3.4.0-beta4-19569-03 to match msbuild.
2019-12-06 16:55:44 +01:00
Aleksey Kliger (λgeek) 3dabeddfc6 [threads] Add back mono_threads_attach_tools_thread as a public API (#18048)
* [utils] Add back mono_threads_attach_tools_thread

In https://github.com/mono/mono/commit/a5da7b21f4b6dbc5eaa09c2addee91b84dc1dbd5
we got rid of "tools" threads internally to the runtime.

However since the API was previously marked with MONO_API it was an internal
API that some embedders depended on.

This PR adds back an (external-only) limited form of tools thread.

The runtime is aware of the Tools thread in that FOREACH_THREAD_* macros will
iterate over them, and the thread has a coop thread state machine. (That is,
mono_thread_info_current() and GC Safe and GC Unsafe transitions all work.)

However the thread is:
1. Not stopped by the GC
2. Is not interrupted by profiler sampling.
3. Does not have a "current domain"
4. (As a consequence of the above) cannot call managed methods or touch managed
objects.

Such threads are useful for low-level interaction with the runtime such as
querying metadata, the JIT state and other coordination.

mono_threads_attach_tools_thread should be called no more than once.  It should
not be called on a thread that is already attached with mono_thread_atach, and
vice versa.

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

* [threads] Make mono_threads_attach_tools_thread into a public API
2019-12-06 10:50:34 -05:00
Bernhard Urban-Forster 121928d29a [ppc32] delete leftover code from pre-monoctx area (#18072)
Also update assert which doesn't make sense since we have moved over to MonoContext

Some context: e7011c780f

Fixes: https://github.com/mono/mono/issues/18064
2019-12-06 11:35:11 +01:00
Jay Krell 12bc4717fd [cxx] Remove use of register keyword. (#18057)
[cxx] Remove use of register keyword.

https://jenkins.mono-project.com/job/test-mono-pull-request-wasm/19408/parsed_console/log_content.html

```
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/utils/mono-md5.c:259:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register guint32 a, b, c, d;
        ^~~~~~~~~
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/utils/mono-md5.c:259:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register guint32 a, b, c, d;
        ^~~~~~~~~
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/utils/mono-md5.c:259:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register guint32 a, b, c, d;
        ^~~~~~~~~
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/utils/mono-md5.c:259:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register guint32 a, b, c, d;
        ^~~~~~~~~
4 warnings generated.
```
2019-12-06 03:55:56 +01:00
Jay Krell a131e9bbb0 [cxx][netcore] Fix goto around init. (#18058)
https://jenkins.mono-project.com/job/test-mono-pull-request-wasm/19408/parsed_console/log_content.html
```
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/metadata/icall.c:882:1: error: jump to label 'exit' [-fpermissive]
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/metadata/icall.c:882:1: error: jump to label 'exit' [-fpermissive]
/mnt/jenkins/workspace/test-mono-pull-request-wasm/mono/metadata/icall.c:882:1: error: jump to label 'exit' [-fpermissive]
```
2019-12-05 15:41:09 -06:00
Egor Bogatov 63f155ac46 Let user overwrite opt -Ox level (#18012) 2019-12-05 13:44:05 -06:00
Jay Krell b99ea70e43 Remove handles/MonoError from two socket icalls. (#17977)
Remove handles/MonoError from two socket icalls.

Ongoing removal of handles() icalls.
This is small, to pause and remove `mono_class_get_field_from_name_full` from w32socket.c.
2019-12-05 19:36:11 +01:00
Egor Bogatov 84839ab297 Merge pull request #18053 from EgorBo/fix-fneg-llvm
LLVM: use fneg instead of fsub for `-x`
2019-12-05 21:13:11 +03:00
Jay Krell ae9192f96f [netcore] Remove approx. 10 icalls. (#18018)
* [netcore] Remove ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni and _len icalls.
They are implemented in C#.
The C# is equivalent to the C, and could be used for classic runtime, except for the treatment of large/negative lengths.

* Remove a few more icalls.
Instead of ifdef and leaving them uncompiled when compiling netcore,
declare them and put asserts in them.
2019-12-05 13:10:29 -05:00
Alexander Köplinger 269d509e42 Remove DNS lookups of the local hostname in tests (#18059)
This allows us to workaround issues we currently have in the macOS bot network where DNS lookup of the hostname fails.
2019-12-05 18:08:26 +01:00
Zoltan Varga e67673fac8 [llvm] Avoid decomposing OP_STOREV_MEMBASE early for types which contains no references. (#18041) 2019-12-05 16:02:43 +01:00
Martin Baulig cc720b83aa [System.Net.Http]: Add workaround for mono/mono#17897. (#17992)
Use `(UriKind)300` (which is the same as setting `MONO_URI_DOTNETRELATIVEORABSOLUTE=true`)
when parsing Uri headers.
2019-12-05 14:36:07 +01:00
Jay Krell 5a5e092a53 Fix ifndef include guard in icall-decl.h. (#18055)
There was no clash so ok either way, but this is more like intended.
2019-12-05 10:19:24 +01:00
Egor Bogatov a3fbb64493 Convert to 0/1 in OP_XEQUAL (#18038) 2019-12-05 02:38:34 +01:00
abrevet-dev 186f9cd8c4 [WinForms] Fix wrong behavior of RadioButton auto-check (#18044)
Fixes #18020
2019-12-05 00:41:49 +01:00
Alexander Köplinger 4590bf6cac Bump bockbuild to get https://github.com/mono/bockbuild/pull/136 (#18043) 2019-12-05 00:33:08 +01:00
Alexander Köplinger f965e5d3e8 Fix formatting of README.netcore.md 2019-12-05 00:11:14 +01:00
EgorBo 55a3c10e72 remove some items from rsp 2019-12-05 02:09:11 +03:00
EgorBo 92047c453f use fneg instead of fsub 2019-12-05 02:03:24 +03:00
Bernhard Urban-Forster 9d58bc1d12 [amd64] align application stack pointer in signal handler (#18021)
* [amd64] align application stack pointer in signal handler

16byte stack pointer alignment is only required in certain places by the ABI, so the assumption that it holds all the time is wrong (though, it passed CI 😅). We have to setup the frame properly, i.e. we have to ensure the stack pointer is properly aligned. That's what we have done previously too.

Regression of https://github.com/mono/mono/pull/17922
Fixes https://github.com/mono/mono/issues/18006

* add ALIGN_DOWN_TO macro

* remove unnecessary ifndefs
2019-12-04 15:23:19 -06:00
Alexander Köplinger 59554712cc Update submodules before running external/bdwgc/autogen.sh (#18042)
Otherwise we'll run into issues because in configure.ac we update submodules _after_ we try to call external/bdwgc/configure (which won't be there if autogen.sh didn't run).
This would manifest itself as `*** No rule to make target 'all'.` in external/bdwgc when you build as there's no Makefile.
2019-12-04 22:16:21 +01:00
Jonathan Peppers 8511ae20f0 [corlib] add InternalsVisibleTo for Mono.Android (#18040)
* [corlib] add InternalsVisibleTo for Mono.Android

Context: https://github.com/xamarin/xamarin-android/pull/3991

In Xamarin.Android, we have a bit of System.Reflection usage on
startup:

https://github.com/xamarin/xamarin-android/blob/bbbe2ed36e6eeb7cce0905dcbfdaeaa30754070f/src/Mono.Android/Android.Runtime/UncaughtExceptionHandler.cs#L47-L67

These methods are in `mscorlib.dll` and `internal`. If we had
`[assembly: InternalsVisibleTo ("Mono.Android")]` we could avoid the
System.Reflection.

This is already done for `Xamarin.iOS`, `Xamarin.Mac`, etc. so
hopefully it's OK to add one more?

We could then, just call these methods directly:

* `System.Diagnostics.Debugger.Mono_UnhandledException`
* `AppDomain.CurrentDomain.DoUnhandledException`

The results are possibly a 100-250ms improvement to startup:

    Before:
    12-03 14:27:51.450  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s727ms
    12-03 14:27:57.310  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s723ms
    12-03 14:28:03.216  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s703ms
    12-03 14:28:09.054  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s679ms
    12-03 14:28:14.953  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s711ms
    After:
    12-04 09:13:18.248  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s608ms
    12-04 09:13:24.087  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s570ms
    12-04 09:13:29.997  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s566ms
    12-04 09:13:35.805  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s498ms
    12-04 09:13:41.670  1876  1898 I ActivityManager: Displayed Xamarin.Forms_Performance_Integration/xamarin.forms.performance.integration.MainActivity: +3s475ms

This was the Xamarin.Forms integration project in xamarin-android.
Running a `Debug` build on a HAXM x86 emulator on Windows.

https://github.com/xamarin/xamarin-android/tree/master/tests/Xamarin.Forms-Performance-Integration

* Bump API snapshot submodule
2019-12-04 21:01:20 +01:00
Kenneth Pouncey 83cac0306c [wasm][build] Modify to use -s USE_ZLIB=1 instead of zlib support headers (#18031)
* [wasm] Modify to use -s USE_ZLIB=1 instead of zlib support headers

- This will remove the dependency on the mono zlib header files.
- Moves the zlibtest.cs to tests/src directory to help clean up the main directory.

* [wasm][packager] Remove the zlib headers from the zlib build

- use `-s USE_ZLIB=1` instead when building.
2019-12-04 20:11:43 +01:00
Alexander Köplinger 4e8ead7caf Remove mk/ folder (#18039)
The plan to put additional helpers into this directory didn't materialize and we can just inline the one thing we have in common.mk where needed.
2019-12-04 19:55:22 +01:00
Kenneth Pouncey 42c5ccc298 [wasm][reference] Update binary references to include wasm websocket assemblies. (#18029) 2019-12-04 11:52:19 +01:00
Jonathan Peppers b816189b94 [android] don't probe directories for .config files (#18024)
* [android] don't probe directories for .config files

In Xamarin.Android, on startup we see logging like this for every .NET
assembly:

    12-03 14:27:42.104 26842 26842 D Mono    : Prepared to set up assembly 'FormsViewGroup' (/storage/emulated/0/Android/data/Xamarin.Forms_Performance_Integration/files/.__override__/FormsViewGroup.dll)
    12-03 14:27:42.104 26842 26842 D Mono    : Assembly FormsViewGroup[0xebcee9c0] added to domain RootDomain, ref_count=1
    12-03 14:27:42.104 26842 26842 D Mono    : Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/Xamarin.Forms_Performance_Integration/files/.__override__/FormsViewGroup.dll'.
    12-03 14:27:42.104 26842 26842 D Mono    : Config attempting to parse: '/storage/emulated/0/Android/data/Xamarin.Forms_Performance_Integration/files/.__override__/FormsViewGroup.dll.config'.
    12-03 14:27:42.104 26842 26842 D Mono    : Config attempting to parse: '/Users/builder/jenkins/workspace/archive-mono/2019-10/android/release/sdks/out/android-x86-release/etc/mono/assemblies/FormsViewGroup/FormsViewGroup.config'.

In most cases, no `.dll.config` file exists and so it probes this
macOS-looking path:

    /Users/builder/jenkins/workspace/archive-mono/2019-10/android/release/sdks/out/android-x86-release/etc/mono/assemblies/FormsViewGroup/FormsViewGroup.config

It looks like this is happening because nothing in Xamarin.Android
calls `mono_set_dirs` or `mono_set_config_dir` and so it falls back to
using `MONO_CFG_DIR`. `MONO_CFG_DIR` is set to a path on the build
machine.

Even if Xamarin.Android *did* call `mono_set_config_dir`, the code
appends `mono/assemblies`:

    cfg = g_build_filename (cfg_dir, "mono", "assemblies", aname, cfg_name, (const char*)NULL);

So it doesn't seem useful to use this fallback at all, there would
never be a file found.

I wrapped the appropriate code in `#ifndef TARGET_ANDROID` blocks.

I was able to see a minor *maybe* ~20ms performance improvement on
startup:

    Before:
    12-03 14:27:48.494 26903 26903 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:601::443900
    12-03 14:27:54.356 26963 26963 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:587::495400
    12-03 14:28:00.263 27021 27021 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:586::147100
    12-03 14:28:06.135 27074 27074 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:593::639100
    12-03 14:28:11.988 27129 27129 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:571::194900
    After:
    12-03 14:46:50.590 27737 27737 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:503::918700
    12-03 14:46:56.517 27794 27794 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:570::533600
    12-03 14:47:02.368 27850 27850 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:537::435000
    12-03 14:47:08.289 27904 27904 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:587::830900
    12-03 14:47:14.130 27965 27965 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:555::593400

This was the Xamarin.Forms integration project in xamarin-android.
Running a `Debug` build on a HAXM x86 emulator on Windows.

https://github.com/xamarin/xamarin-android/tree/master/tests/Xamarin.Forms-Performance-Integration

* Add --enable-minimal=cfgdir_config

* This also defines `DISABLE_CFGDIR_CONFIG`
* Used this setting for android
2019-12-04 11:50:59 +01:00
abrevet-dev a79c4d11a4 [WinForms] Editing the DialogResult of the form in the button click event was ignored. (#18025)
Fixes #12022
2019-12-04 11:49:43 +01:00
Jérôme Laban 91d3d63858 Update to emscripten 1.39.4 (#18016)
Fixes for i64 returning values with dynamic runtime configuration.

See https://github.com/emscripten-core/emscripten/issues/9850
2019-12-04 09:11:22 +01:00
monojenkins 37ba834ee1 [bcl] Update BCL Linked Size 2019-12-04 08:29:56 +01:00
Aleksey Kliger (λgeek) 467d46f8ab [configure.ac] Build on FreeBSD/PowerPC64 (#18015)
Community contribution from https://github.com/mono/mono/issues/18009
from @igorzigorz
2019-12-03 19:56:30 -05:00
Egor Bogatov 85826e5c27 Merge pull request #18013 from EgorBo/intrin-string-memcpy
[netcore] Improve jitdiff tool
2019-12-04 02:19:32 +03:00
Maxim Lipnin e7ef2f3d5f [Wasm] Enable system nunit tests on ci (#17716)
* [wasm][nunit tests] Enable nunit tests for System on CI

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.Mail.SmtpClientTest tests

* Fix test suit name

* [wasm][nunit tests] Exclude MonoTests.System.Net.HttpListenerPrefixCollectionTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.HttpListenerTest nunit tests

* [wasm][nunit tests] Exclude MonoTests.System.Net.NetworkInformation.NetworkInterfaceTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.Sockets.UdpClientTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.ComponentModel.PropertyDescriptorCollectionTests nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Collections.Specialized.NameValueCollectionTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Collections.Concurrent.ConcurrentBagTests nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.ComponentModel.BackgroundWorkerTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.NetworkInformation.IPInterfacePropertiesTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.ComponentModel.EventDescriptorCollectionTests nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.ComponentModel.AsyncOperationManagerTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.HttpListenerRequestTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.ServicePointTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.Sockets.TcpListenerTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.WebClientTestAsync nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.WebProxyTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.WebRequestTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Security.Cryptography.X509Certificates.X509Certificate2CollectionTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Timers.TimerTest nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.HttpListenerTest.PropertiesWhenClosedSet3 test

* [wasm][nunit tests] Increase timeout for System nunit tests

* [wasm][nunit tests] Exclude failing MonoTests.System.Security.Cryptography.X509Certificates.X509Certificate2CollectionTest.Find_FindByIssuerName test

* [wasm][nunit tests] Remove PNSE expectation in MonoTests.System.Net.Mail.SmtpClientTest tests

* [wasm][nunit tests] Remove PNSE expectation in MonoTests.System.Net.HttpListenerPrefixCollectionTest nunit tests

* [wasm][nunit tests] Remove PNSE expectation in MonoTests.System.Net.HttpListenerTest nunit tests

* Increase CI timeout for System.Core nunit tests

* [wasm][nunit tests] Remove PNSE expectation in MonoTests.System.Net.Sockets.UdpClientTest nunit tests

* [wasm][nunit tests] Update NetworkInterface class to throw PNSE

* [wasm][nunit tests] Ignore failing MonoTests.System.ComponentModel.PropertyDescriptorCollectionTests nunit tests

* [wasm][nunit tests] Ignore failing MonoTests.System.Collections.Specialized.NameValueCollectionTest nunit tests

* [wasm][nunit tests] Adjust the use of Ignore attribute

* [wasm][nunit tests] Categorize failing MonoTests.System.Collections.Concurrent.ConcurrentBagTests nunit tests

* [wasm][nunit tests] Categorize failing MonoTests.System.ComponentModel.BackgroundWorkerTest nunit tests

* [wasm][nunit tests] Categorize failing MonoTests.System.Net.NetworkInformation.IPInterfacePropertiesTest nunit tests

* [wasm][nunit tests] Ignore failing MonoTests.System.Net.NetworkInformation.IPInterfacePropertiesTest nunit tests

* [wasm][nunit tests] Remove the category for passing MonoTests.System.Net.HttpListenerRequestTest nunit tests

* [wasm][nunit tests] Exclude failing part of MonoTests.System.Net.ServicePointTest.DnsRefreshTimeout test

* [wasm][nunit tests] Remove PNSE expectation in failing MonoTests.System.Net.Sockets.TcpListenerTest nunit tests.

* [wasm][nunit tests] Exclude failing MonoTests.System.Net.WebProxyTest nunit tests due to libc issue

* [wasm][nunit tests] Remove PNSE expectation in MonoTests.System.Net.WebRequestTest.DefaultWebProxy test

* [wasm][nunit tests] Exclude failing MonoTests.System.Security.Cryptography.X509Certificates.X509Certificate2CollectionTest nunit tests due to compare info issue
2019-12-03 22:40:09 +01:00
abrevet-dev 174f2f6a70 [WinForms] SetRowSpan and SetColumnSpan does not trigger the good exception. (#18002)
According to .Net documentation:

Exceptions
ArgumentOutOfRangeException

value is less than 1.
2019-12-03 21:38:38 +01:00
EgorBo 5f58bb0959 Improve TryParseFunctionName in jitdiff 2019-12-03 18:13:48 +03:00
EgorBo ea0824cb22 Remove dead docs 2019-12-03 18:11:42 +03:00
Egor Bogatov 8150a38dae Don't throw NRE when len == 0 in Buffer.Memmove (#18004) 2019-12-03 15:21:41 +01:00
Steve Pfister a3c25e7b4f Added Obsolete to AppDomain.CreateDomain for monodroid. (#18000)
* Added Obsolete to AppDomain.CreateDomain for monodroid.  The intent is to be helpful for when .NET 5 comes along

* Changed AssemblyLoadContext link to a better doc

* Bump API snapshot submodule
2019-12-03 14:23:49 +01:00
Jo Shields a2f9fb77a3 Bump version to 6.11 (#17990) 2019-12-02 15:58:38 -05:00
Di Wu 0370372ce3 Fix raw security descriptor parsing (#17482)
Fix security identifier parsing error with the following SDDL:

```
O:S-1-5-21-1356517589-3987021482-2501375073-1001G:S-1-5-21-1356517589-3987021482-2501375073-513D:(A;;FA;;;SY)(A;;FA;;;BA)(A;;FA;;;S-1-5-21-1356517589-3987021482-2501375073-1001)
```
2019-12-02 20:03:49 +01:00
Jay Krell 72aa81e901 Remove handles/MonoError from Mono.RuntimeClassHandle. (#17805) 2019-12-02 19:18:03 +01:00
Bernhard Urban-Forster a9a0a1e5b9 [profiler] disable inlining when coverage profiler is used and fix allocation sizes (#17986)
* [profiler] let compiler decide about the size of an entry

* [profiler] disable inlining when coverage profiler is used
2019-12-02 19:04:13 +01:00
Vlad Brezae 640ffa7a62 [sgen] Don't trigger collections during allocation of thread objects (#17970)
Allocation of thread objects usese the mono_object_new_mature API. These objects are allocated before the thread is finished attaching to the runtime. This means that a collection can happen on an unattached thread as well as all its callbacks, which is a counter-intuitive behavior.

On android this is problematic because at the end of the SGen collection we need to call the java collection, which needs to have the thread attached. This could probably be fixed instead from the Xamarin.Android side, but this approach seems simpler and saner.

Fixes https://github.com/mono/mono/issues/17878
2019-12-02 12:54:21 -05:00
Jay Krell d7f5a5fdfe Remove handles/MonoError from Mono.Security.Cryptography.KeyPairPersistence icalls. (#17967) 2019-12-02 12:51:16 -05:00
dotnet-maestro[bot] 9bd1b2e065 Update dependencies from https://github.com/dotnet/arcade build 20191201.1 (#17985)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19601.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19601.1
2019-12-02 18:03:11 +01:00
abrevet-dev 1454b010ae [WinForms] the Text property was not set for every cell in the column when UseColumnTextForLinkValue is true (#17981)
* [WinForms] Fix #17980 Prevent from crashing when DataGridView  is null.

Reproducer:

DataGridViewLinkColumn links = new DataGridViewLinkColumn();
links.UseColumnTextForLinkValue = true;

* [WinForms] Fix #17980 The field useColumnTextForLinkValue of DataGridViewLinkCell was not cloned.

* [WinForms] Fix #17980 the Text property was not set for every cell in the column when UseColumnTextForLinkValue is true

Fixes #17980
2019-12-02 17:39:43 +01:00
abrevet-dev 865e955840 [WinForms] Fix #9726 imageLayout of DataGridViewImageCell was not cloned. (#17974)
Fixes #9726
2019-12-02 17:38:08 +01:00
Thays Grazia 3834be3d22 [DIM] Fix behavior when there is an override of a method in a generic interface. (#17963)
* Fix behavior when there is an override of a method in a generic interface.
Fixes #17869
2019-12-02 13:20:00 -03:00
Jay Krell 7356aedc77 Refactor Monitor to eliminate near identical duplicated code. (#17964)
The only difference in the copies, was that one had an infinite timeout
so implied TRUE result unless interrupted.

Where the other copy had a timeout and could return FALSE as a result.

They both used the same underlying, with timeout, so it wasn't really an optimization,
just duplicated code.

Also there is subtelty around having a return value or an out parameter.
That is carefully preserved.

Also, coop is fixed, by creating a frame only in a slow path.
Presumably creating a thread is quick and stateless enough such that this
is not too late.
2019-12-02 11:06:11 -05:00
Calvin Buckley 369806e3e6 Disable ConnectFailAsync test on AIX (#17975)
Hangs runtime; prevents CI from completing run. (Another test can
also hang the runtime, but is hard to reproduce and inconsistent
about that.)

This should be fixed eventually, but...
2019-12-02 10:34:07 +01:00
Zoltan Varga f13e6ba91a [wasm] Add beginnings of SIMD support in AOT mode. (#17971)
* [jit] Implement beginnings of SIMD support for WASM.

* [wasm] Add a DISABLE_WASM_NO_NETCORE Make.local conditional to disable non-netcore builds during development.

* [wasm] Add a --simd argument to the packager.

* Remove some duplicate defines.

* Fix an windows assertion.
2019-12-02 07:21:17 +01:00
campersau b0f0b14023 [wasm][bcl][http] Fix descriptive message for the PlatformNotSupportedException (#17919)
* Fix descriptive message for the `PlatformNotSupportedException`

* Add more descriptive message to the `Properties` `PlatformNotSupportedException`
2019-12-02 05:20:15 +01:00
EgorBo d33ce1c3ec enable only for netcore 2019-12-01 17:38:33 -06:00
EgorBo 376d3acb29 fix failing tests 2019-12-01 17:38:33 -06:00
EgorBo b77f757679 fix build 2019-12-01 17:38:33 -06:00
EgorBo 1b7c7e6075 Address feedback and fix C++ warnings 2019-12-01 17:38:33 -06:00
EgorBo e2241969f5 Optimize box(X) == null to false 2019-12-01 17:38:33 -06:00
Jay Krell fffeb23239 sockets: Remove piecemeal ifndef ENABLE_NETCORE since the file has it broadly. 2019-12-01 17:33:24 -06:00
Zoltan Varga ae4b678b94 [wasm] Avoid rebuilding corelib in build-wasm-bcl-netcore. (#17969) 2019-11-30 03:18:42 +01:00
Bernhard Urban-Forster 4d0feffa42 [interp] track valuetype stack for CEE_RET too (#17968)
[interp] track valuetype stack for CEE_RET too

Usually the stack depth is determined via basic block predecessors, but  that only works for forward branches.

Fixes https://github.com/mono/mono/issues/17924
2019-11-30 00:06:05 +01:00
Zoltan Varga 6c0bfdc3f3 [wasm] Add more netcore test suites. (#17965)
* [wasm] Handle more exceptions in the xunit runner.

* [wasm] Add more corefx test suites.

* Add more icall signatures.

* Add support for running the System.Compression test suites.
2019-11-29 18:17:40 +01:00
Zoltan Varga d1735a8356 Interpreter fixes. (#17966)
Interpreter fixes.
2019-11-29 16:26:05 +01:00
Ankit Jain c92a96ccb5 Bump msbuild to track xplat-master (#17950)
* Bump msbuild to track xplat-master

* Bump nuget.exe to 5.4.0
2019-11-29 12:01:06 +01:00
Egor Bogatov 9a18b6fd6f [netcore] Improve Jitdiff tool (#17960)
use `objdump` arguments to reduce verbosity (no raw bytes, etc) and make the dasm more diff-friendly.
On Linux all functions have a random prefix (address) - replace it with `0xD1FFAB1E` constant). On macOS it's fine by default.

Also, allow to generate diffs for a single assembly via `dump-asm-lib` rule.
2019-11-29 11:54:01 +01:00
Kenneth Pouncey 608c93643e [wasm][http] Fix race condition as a result of using TaskCompletionSource: RangeError: Maximum call stack size on Safari (#17946)
There is a race condition on Safari as a result of using TaskCompletionSource that causes a stack exceeded error being thrown during Blazor startup.

Safari throws the following error:

```
[Error] Unhandled Promise Rejection: RangeError: Maximum call stack size exceeded.
    step (blazor.webassembly.js:2530)
    fulfilled (blazor.webassembly.js:2500)
    promiseReactionJob

```

- Modify `WebAssemblyHttpMessageHandler.cs` to create the TaskCompletionSource to run continuations asynchronously.
   - `TaskCompletionSource<HttpResponseMessage>(TaskCreationOptions.RunContinuationsAsynchronously);`

- There is a second part to this on AspNetCore in `Renderer.cs` to process it's pending startup tasks to run continuations asynchronously to compliment the TaskCompetionSource of the Http response message.

The following link discusses the potential stack/race problem that can occur when using TaskCompletionSource:  https://devblogs.microsoft.com/premier-developer/the-danger-of-taskcompletionsourcet-class/
2019-11-29 07:14:19 +01:00
Zoltan Varga 59a9af6d7c Revert "Use range metadata (#17956)" (#17958)
This reverts commit fde058518d.
2019-11-28 21:52:01 +01:00
Egor Bogatov fde058518d Use range metadata (#17956) 2019-11-28 14:26:35 +01:00
Kenneth Pouncey d6dea097ca [wasm] Marshal null string correctly. (#17955) 2019-11-28 07:31:59 +01:00
Zoltan Varga 79db9b2a87 [interp] Make calli non recursive as well. (#17953) 2019-11-28 06:26:36 +01:00
EgorBo 6360ccbfe3 Add quick diff 2019-11-27 19:15:56 -06:00
EgorBo e333f13710 Add jit-diff tools 2019-11-27 19:15:56 -06:00
Ryan Lucia 9c1cae02ca Change signature, add cast 2019-11-27 19:13:30 -06:00
Ryan Lucia 0c3036abc7 [mini] Move bundled native library loading into the runtime 2019-11-27 19:13:30 -06:00
Jay Krell b2817e6404 [cxx] MonoJitICallId same between C and C++.
This is optional.
The real problem was -enable-cxx not actually compiling some files as C++.
This is still reasonable, to ward off the danger of that occuring again.
2019-11-27 19:12:32 -06:00
Jay Krell c3da0ad518 Update netcore. 2019-11-27 19:11:35 -06:00
Jay Krell 4a15e73429 Remove handles/MonoError from Mono.RuntimeMarshal and Mono.SafeStringMarshal. 2019-11-27 19:11:35 -06:00
Nikita Voronchev 7db2389846 [WinForms][UIA] Add to the PropertyGrid new internal event to track grid items expanded state update (#17731)
This PR is needed for the https://github.com/mono/uia2atk/pull/6 one.
2019-11-27 23:59:04 +01:00
abrevet-dev f135312b44 [WinForms] DrawToBitmap() did not draw children controls (#17676)
Fixes #13777
2019-11-27 23:38:04 +01:00
Sergey Podobry abc75476d7 [Mono.Security] Do not decode data beyond detected length in ASN1 parser (#17751)
If `byte[] data` has additional data at the end `Decode` will try to parse it and will generate incorrect tags or throw an exception. This fix makes `Decode` to use only `nLength` bytes from `byte[] data`.
2019-11-27 23:37:20 +01:00
Aleksey Kliger (λgeek) b6a351c330 [threadpool] Decrement max_working when worker times out (#17927)
[threadpool] Decrement max_working when worker times out

The corresponding code in CoreCLR:
https://github.com/dotnet/runtime/blob/bf88f146412d1e2d41779422337184a802f186c9/src/coreclr/src/vm/win32threadpool.cpp#L2156-L2164

The issue is that counter._.max_working is only ever changed by:
1. the monitor_thread when it detects starvation (increment by 1).
2. the hill climbing algorithm (increment or decrement).

Creating a periodic load of creating many workers at once followed by a minute
or more of quiescence increases the variable worker.counters._.max_working in
monitor_thread(). Once that counter matches worker.limit_worker_max,
monitor_thread() keeps looping without unparking or creating a thread, even
though the actual number of threads/workers is small. If the existing threads
are all waiting on work that needs a new thread, then a deadlock occurs.

With this change, when a parked worker times out, it will lower max_working to
the number of active (working + parked + starting) threads minus itself (but no
less than limit_worker_min). As a result, monitor_thread will only increment
max_working as long as none of the already running workers are timing out.

Attempt to address https://github.com/mono/mono/issues/17833

---

Also allow monitor_thread to start workers if there aren't enough active, even if the max worker limit has been reached.

Work around a pathological condition where the work_item_count is non-zero, and
the max_working limit has been reached, but the number of active threads is
still below the max.  In that case, unpark some workers and start some new
threads.

May address http://work.azdo.io/827206
2019-11-27 22:06:17 +01:00
Jay Krell 3e369ba8c9 Cleanup initialize_object_slots, remove unused GetHashCode (ghc) handling. (#17834)
Fix possible race conditions involving multiple writes to globals, by
removing one of the two globals involved in finalize.
2019-11-27 14:25:14 -05:00
abrevet-dev 6145a397d6 [WinForms] Refactor selected indexes in TabControl.Remove (#17608)
Fixes #12337
2019-11-27 19:55:00 +01:00
abrevet-dev 5944e72d72 [WinForms] Returns real installed input languages on Windows (#17653)
The method InstalledInputLanguages() always returned InvariantCulture. Now, installed input languages are detected properly on Windows.

Reproducer:

`Console.WriteLine(InputLanguage.CurrentInputLanguage.Culture.TwoLetterISOLanguageName.ToUpper());`

Related issue: #13552
2019-11-27 19:46:04 +01:00
abrevet-dev 41ba5846b3 [WinForms] DefaultCellStyle was not cloned deeply in DataGridViewRow.Clone() (#17755)
Fixes #16557
2019-11-27 19:41:15 +01:00
HebaruSan d62eed676e [WinForms] Fix X11 theming (#17888)
## Background

In Mono 5 and earlier, the active GTK or KDE theme would be sourced for system colors, allowing dark themes to be obeyed:

![image](https://user-images.githubusercontent.com/1559108/69486043-f3bf0500-0e0c-11ea-9b29-1654ba4e6d9a.png)

This allowed WinForms apps to blend in and look more like native apps.

## Problem

In Mono 6, this capability was lost (as noted in passing in #14325). WinForms apps now only look like this, regardless of the system color settings:

![image](https://user-images.githubusercontent.com/1559108/69486114-dccce280-0e0d-11ea-8107-fe1653b2d816.png)

This looks somewhat jarring and worse than previous Mono releases, for users with a dark system theme.

## Cause

During load of the system settings (in the static constructor of `X11DesktopColors`), `Theme.SetSystemColors` passes system color data to `System.Drawing.KnownColors.Update`, which populates them into `System.Drawing.KnownColors.ArgbValues`. In Mono 5 and earlier, this flowed through to the visible UI.

It seems that as of Mono 6, this table no longer affects the visible WinForms UI (although it is still being updated!). Instead, a same-but-different table in `System.Drawing.KnownColorTable` drives the system colors now. I was not able to identify the commit in which this change was made.

## Changes

Now `Theme.SetSystemColors` accesses `System.Drawing.KnownColorTable.s_colorTable` instead, and WinForms apps once again obey GTK and KDE themes:

![image](https://user-images.githubusercontent.com/1559108/69486043-f3bf0500-0e0c-11ea-9b29-1654ba4e6d9a.png)

Fixes KSP-CKAN/CKAN#2881.
2019-11-27 19:13:11 +01:00
RizvanKuliev a73e7b8af2 [WinForms] Fix Recalculate in ScrollableControl (#17163) 2019-11-27 19:09:19 +01:00
Alexander Köplinger 9954579c2a [sdks] Call mono_gc_init_finalizer_thread() on iOS device runtimes
These runtimes are configured with `--with-lazy-gc-thread-creation=yes` so they don't start a GC finalizer threads by themselves.
XI does this because they want to delay creating that thread for some time after startup.

We can just do it immediately, the important part is that it _does_ exist.
2019-11-27 18:36:02 +01:00
Alexander Köplinger c66c7814d0 [sdks] Add option to enable debug server for iOS test app
Include .pdb files in iOS test app if the DEBUG variable is set and wait for managed debugger to attach.
2019-11-27 18:36:02 +01:00
Alexander Köplinger 18ddc2e45d [sdks] Fix loading of assemblies in assembly_preload_hook()
We need to check whether the assembly name passed to us already contains .exe/.dll and append it otherwise.
Fixes loading of assemblies via the hook, we were falling back to the usual path resolving logic (which doesn't work in netcore mode).
2019-11-27 18:36:02 +01:00
Alexander Köplinger a0d79a4886 [sdks] Add netcore option for iOS SDK 2019-11-27 18:36:02 +01:00
Alexis Christoforides 167913524f [merp] Use timeline (and generate timeline breadcrumbs) for SendExceptionToTelemetry() (#17913)
Fixes https://github.com/mono/mono/issues/17790
2019-11-27 11:56:12 -05:00
Bernhard Urban-Forster 4c595069e7 [arm] if mtriple is provided, do not set -march (#17937)
[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-11-27 17:36:03 +01:00
monojenkins 9dfeb545d5 [bcl] Update BCL Linked Size (#17322) 2019-11-27 13:43:31 +01:00
Bernhard Urban-Forster 690af29ad9 [amd64] do not stack allocate on the application stack for the transtion from alstack handling (#17922)
### Backstory
This test is failing in the interpreter (ONLY on Debian9/amd64. Not Ubuntu/amd64. Not macOS/amd64):
https://github.com/mono/mono/blob/0fed03ed63ed4ea742c4511d8edc3bc1c6f4044f/mcs/class/Mono.Debugger.Soft/Test/dtest.cs#L2484-L2499
Where the debuggee is just some unsafe code that tries to read from unmapped memory, thus causing a segfault.

So the test expects the runtime to send a CRASH event via the managed debugger interface. This happens very late in the crash handling machinery:
https://github.com/mono/mono/blob/0fed03ed63ed4ea742c4511d8edc3bc1c6f4044f/mono/mini/mini-posix.c#L1105

However, the runtime would never reach that, because it silently crashes when calling `backtrace`:
https://github.com/mono/mono/blob/0fed03ed63ed4ea742c4511d8edc3bc1c6f4044f/mono/mini/mini-posix.c#L939

At the point where the SIGSEGV happens, the native stack trace looks like this:
```
Thread 1 "mono-sgen" received signal SIGSEGV, Segmentation fault.
interp_exec_method_full (frame=0x555555c51f18, context=0x555555c38350, clause_args=clause_args@entry=0x0, error=0x555555c53f18, error@entry=0x7fffffffd8b0) at interp/interp.c:4463
4463                            sp[-1].data.i = *(gint32*)sp[-1].data.p;
(gdb) bt
%0  interp_exec_method_full (frame=0x555555c51f18, context=0x555555c38350, clause_args=clause_args@entry=0x0, error=0x555555c53f18, error@entry=0x7fffffffd8b0) at interp/interp.c:4463
%1  0x000055555569237a in interp_runtime_invoke (method=<optimized out>, obj=<optimized out>, params=<optimized out>, exc=0x0, error=0x7fffffffd8b0) at interp/interp.c:1900
%2  0x0000555555590745 in mono_jit_runtime_invoke (method=0x555555bfdc38, obj=<optimized out>, params=0x7fffffffd858, exc=0x0, error=0x7fffffffd8b0) at mini-runtime.c:3001
%3  0x0000555555778c4c in do_runtime_invoke (method=0x555555bfdc38, obj=<optimized out>, params=<optimized out>, exc=<optimized out>, error=0x7fffffffd8b0) at object.c:3052
%4  0x000055555577b7d0 in do_exec_main_checked (method=0x555555bfdc38, args=<optimized out>, error=0x7fffffffd8b0) at object.c:5184
%5  0x000055555559a2aa in mono_jit_exec_internal (argv=0x7fffffffdcb8, argc=1, assembly=0x0, domain=0x555555bf9d40) at driver.c:1320
%6  mono_jit_exec (domain=domain@entry=0x555555bf9d40, assembly=assembly@entry=0x555555c66ae0, argc=argc@entry=1, argv=argv@entry=0x7fffffffdcb8) at driver.c:1265
%7  0x000055555559b8e2 in main_thread_handler (user_data=<synthetic pointer>) at driver.c:1402
%8  mono_main (argc=<optimized out>, argv=<optimized out>) at driver.c:2622
%9  0x000055555558b757 in mono_main_with_options (argv=<optimized out>, argc=<optimized out>) at main.c:52
%10 main (argc=<optimized out>, argv=<optimized out>) at main.c:434
```
Stepping into the crash handling machinery, the picture looks a bit different:
```
Thread 1 "mono-sgen" hit Breakpoint 1, altstack_handle_and_restore (ctx=0x7fffffffd2d0, obj=0x0, flags=0) at exceptions-amd64.c:871
871     {
(gdb) bt
%0  altstack_handle_and_restore (ctx=0x7fffffffd2d0, obj=0x0, flags=0) at exceptions-amd64.c:871
%1  0x00005555556957de in interp_exec_method_full (frame=0x555555c53f08, context=0x555555c38350, clause_args=0x0, error=0x555555c53f18) at interp/interp.c:4461
%2  0x0000000000000000 in ?? ()
```
So it looks like we messed up in the transition from altstack back to the program stack.

 ### The fix

The problem is that `backtrace` consults the unwind information emitted at the point where SIGSEGV happens in `interp_exec_method_full ()`. However at that given program code, there is no function call that allocates space to pass arguments on the stack. Still, we massage the stack to do that in the signal handler, which does not add up with the emitted unwind information by the C compiler.

Note that without the fix, crashing in `backtrace` is the worst case. In other cases we might (1) get still a correct stack trace, or (2) we get a wrong stack trace, and `backtrace` will not crash. So this PR might improve the crash experience overall.

This also reverts commit cff400f3fae9775ac734f8a691339e59a272872c.
2019-11-27 12:20:47 +01:00
Zoltan Varga c4136ebd94 [interp] Non-recursive interpreter (#16461)
* Aling alloca_size to 8.

* Prevent some false pinning in the monitor-resurrection.cs test when using the non-recursive interpreter.

* [runtime] Add a mono_compiler_barrier () function.

* Add a MONO_GET_SP opcode to pass to enter/exit_gc_safe_region, ldloca might not return a native stack address with the interpreter.

* Add an interpreter/gc callback to mark the interpreter stack.

* Copy only an integer in ENDFILTER.

* Add a native_stack_addr field to InterpFrame so the EH code has something to compare against native stack addresses.

* Add a FrameStack structure to allow allocation of InterpFrame structures and stack data outside the native stack.

* Allocate InterpFrames/stack data from a frame stack instead of the native stack.

* Make some calls non-recursive.

* Remove an assert.

* Use non-recursive calls in CALLVIRT_FAST as well.

* Fix stack size allocation for vararg calls.

* Add some micro optimizations to the calling code.

* Add more micro optimizations.

* [dtest] disable Crash test on interpreter

* Add some implicit conversions to STSFLD to fix a corefx test failure.

* Disable the new test.
2019-11-26 04:31:32 +01:00
Zoltan Varga 5b4cd5ce50 WASM + Netcore. (#17915)
* [runtime] Throw an exception from Thread::StartInternal () if threads are disabled.

* Add more test suites and a corefx exclusions file.
2019-11-26 02:59:31 +01:00
Larry Ewing e917c95053 Add the reference assembly path for the Http implementation (#17908) 2019-11-25 19:21:38 -06:00
dotnet-maestro[bot] cd190481bd Update dependencies from https://github.com/dotnet/arcade build 20191124.1 (#17899)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19574.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19574.1
2019-11-25 21:22:41 +01:00
Alexander Köplinger e437330808 Remove mkinstalldirs invocation from two places (#17910)
These can be easily replaced so we don't need to mirror over the mkinstalldirs file to the new repo
2019-11-25 21:10:26 +01:00
Alexander Köplinger 8aa1cdfe17 [configure.ac] Don't run compiler server check in netcore mode (#17911)
We don't need it there.
2019-11-25 21:10:08 +01:00
Calvin Buckley 836f453906 Fix BinaryReader on BE (#17893)
Fix BinaryReader on BE

The ints passed into the int array ctor needed to be endian swapped.
Interestingly, the BinaryWriter implementation currently being used
(not refsrc AFAIK) does this on write just fine.

Fixes ReadDecimal test on AIX, and adds another test to ensure that
Write(decimal) can be read back by ReadDecimal in case.
2019-11-25 19:15:55 +01:00
Alexander Köplinger bdf4790fa0 Fix boehm on Windows i386 builds (#17901)
After https://github.com/mono/mono/pull/16832 was merged the run-msbuild.bat
script has an additional required parameter for specifying the GC.

However the script only passed the MONO_TARGET_GC property to msbuild
if the script had no additional parameters which doesn't make sense.

Always pass the parameter, this should fix the boehm build on Windows i386.
2019-11-25 18:58:42 +01:00
Larry Ewing b42845c567 Fix issue in debugger variable inspection (#17900) 2019-11-25 11:55:21 -06:00
Marek Habersack 10795da1c0 [WIP] Make debugger agent startup faster (#17898)
Mono SDB's debugger agent takes a `host:port` parameter to specify the host and
port on which to listen for debugger connection. `host` is passed, via
`mono_get_address_info`, to the `getaddrinfo(3)` standard library call which
does the job of translating the name to the IP address. However, there's no
special treatment for situations when `host` is already an IP address. In this
case `getaddrinfo` takes a lot of time to perform at least two DNS lookups (if
there's just a single DNS server configured) which will time out as the IP
address in `host` will not be resolved by any of the servers.

`getaddrinfo` takes a "hints" parameter where caller can specify some
information about the `host:port` pair to make the lookup faster/easier.
However, Mono doesn't specify the address family in the `hints` parameter, thus
forcing the slow path of DNS lookups on `getaddrinfo`.

This commit adds a new hint named `MONO_HINT_NUMERIC_HOST` (which maps to
`AI_NUMERICHOST` for `getaddrinfo`) which will allow, if set, `getaddrinfo` to
take a faster route in address discovery. Debugger agent will, in most cases,
get an IP address to instead of host name so we call `mono_get_address_info` up
to 3 times (IPv4, IPv6 and unspecified) in order to make the lookup faster.
2019-11-25 17:52:58 +01:00
Calvin Buckley f47b7bbf4f Fix flawed BufferTest on big-endian (#17894)
Fix flawed BufferTest on big-endian

Test ignored byte order when considering integer comparison. This
tests different cases for each endian, and explains why the byte
order is different.
2019-11-25 16:25:55 +01:00
Kenneth Pouncey 5d981c2679 [wasm] [bindings] Method invoke signature argument validation. (#17853)
* Implement validation for signature and argument count consistency.

- throw error `Parameter count mismatch.` when arguments and signature counts are not consistent.

* Fix tests that have Parameter count mismatch.

* Add browser binding tests for `Parameter count mismatch
2019-11-25 08:24:33 -06:00
Kenneth Pouncey e8d70c333f Add tests for Promise library.
- Right now only Bluebird promise library is tested right now.
- If more are needed later then we can add them.
2019-11-25 08:23:45 -06:00
Kenneth Pouncey 2f1e2f8132 Add a more reliable way of identifying a Promise to be marshaled.
- This is left as generic as possible for now.
2019-11-25 08:23:45 -06:00
Kenneth Pouncey 64e2864fef Add a more descriptive error in case of fetch response not returning back what it should.
- An example of this is when a Promise library is being used and the Promise can not be identified correctly.  Thus the internal error.
2019-11-25 08:23:45 -06:00
Vlad Brezae 1ef7a29836 [interp] Resolve tokens also from wrappers during optimization (#17880)
[interp] Resolve tokens also from wrappers during optimization

Remove some duplicated code.
2019-11-25 14:45:56 +01:00
Calvin Buckley 004fd06b96 [eglib] In AIX/generic POSIX, handle null addresses better (#17892)
Fixes crash in tests on AIX.

Matches b0d966bd7a
2019-11-25 02:52:54 -05:00
Calvin Buckley a3f4def8b6 Allow runtime to be built with C++ on AIX (#17672)
* Allow runtime to be built with C++ on AIX

Many AIX/PPC/BE specific codepaths didn't do casting properly,
since C++ is much stricter than C about pointer typing.

Also specify the C99 format macros early as possible, since
inttypes may get included before eglib gets a chance to set the
macros.

Also explicitly use -pthread, since not using it is the cause of
many libstdc++ crashes on AIX.

* Oops, should have been that define instead

* Suggested changes from Jay on style

* Remove unneeded cast
2019-11-24 17:08:19 -05:00
Alexander Köplinger 280e9d2423 Fix warnings in runtime build (#17887)
This makes at least the netcore-mono build in dotnet/runtime warning-free.
2019-11-24 00:16:20 +01:00
Alexander Köplinger 165e28ae97 [netcore] Disable libmonoruntime-support.la build on netcore (#17885)
It's used for the zlib compression helpers used by System.IO.Compression in the old Mono BCL.
On corefx this is handled differently so we don't need it there.

To avoid automake complaining about missing files we include the .c files directly instead of in the Makefile.
2019-11-23 10:06:40 +01:00
Alexander Köplinger 2ccd6122bd [netcore] Disable a test which fails on the interpreter
The test is wrong, will be fixed upstream.
2019-11-22 23:00:28 +01:00
Alexander Köplinger 81e305421d Fix run-msbuild.bat invocation in pipeline-netcore-runtime.yml 2019-11-22 22:48:53 +01:00
Alexander Köplinger 0d80372173 Make configure.ac and Makefile.am work without certain directories (#17871)
Those folders won't be present in the dotnet/runtime repository.

We need to factor out AC_OUTPUT into a separate file so we can continue
to share configure.ac but not the list of files in AC_OUTPUT since
autotools doesn't support variables there.
2019-11-22 22:48:11 +01:00
310 changed files with 6350 additions and 2950 deletions

No files matched your search

+1
View File
@@ -10,6 +10,7 @@ mkinstalldirs crlf=input
*.sources crlf=input
.gitattributes crlf=input
*akefile* crlf=input
m4/mono-output.m4 crlf=input
# ensure native line endings on checkout
*.c crlf
+5 -51
View File
@@ -2,33 +2,10 @@ ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = $(WERROR_CFLAGS)
MONOTOUCH_SUBDIRS = $(libgc_dir) mono
SUBDIRS = @MONO_SUBDIRS@
DIST_SUBDIRS = $(SUBDIRS) m4 netcore netcore/corerun
# Some tools might not build when cross-compiling
if CROSS_COMPILING
tools_dir =
else
tools_dir = tools
endif
if ENABLE_MSVC
build_with_msvc = msvc
build_without_msvc =
else
build_with_msvc =
build_without_msvc = msvc
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
# 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 netcore/corerun
if !ENABLE_NETCORE
all: $(update_submodules)
@@ -116,31 +93,6 @@ mcs-do-compiler-tests:
bootstrap-world: compiler-tests
$(MAKE) install
if INSTALL_MONOTOUCH
monotouch-do-build: config.h
@list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
case "x$$subdir" in \
xmono ) target="monotouch-do-build";; \
* ) target="all";; \
esac; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
done;
(cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-build)
monotouch-do-clean:
@list='$(MONOTOUCH_SUBDIRS)'; for subdir in $$list; do \
case "x$$subdir" in \
xmono ) target="monotouch-do-clean";; \
* ) target="clean";; \
esac; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
done;
(cd runtime && $(MAKE) $(AM_MAKEFLAGS) monotouch-do-clean)
endif
update-csproj:
-rm msvc/scripts/order
-rm msvc/scripts/order.xml
@@ -183,3 +135,5 @@ update-solution-files:
update-solution-files-with-tests:
$(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files
endif
+14 -5
View File
@@ -104,12 +104,10 @@ if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
fi
fi
#
# Plug in the extension module
#
# Parse parameters
has_ext_mod=false
ext_mod_args=''
has_disable_boehm=false
for PARAM; do
if [[ $PARAM =~ "--enable-extension-module" ]] ; then
has_ext_mod=true
@@ -117,8 +115,14 @@ for PARAM; do
ext_mod_args=`echo $PARAM | cut -d= -f2`
fi
fi
if [[ $PARAM =~ "--disable-boehm" ]] ; then
has_disable_boehm=true
fi
done
#
# Plug in the extension module
#
if test x$has_ext_mod = xtrue; then
pushd $top_srcdir../mono-extensions/scripts
sh ./prepare-repo.sh $ext_mod_args || exit 1
@@ -150,7 +154,12 @@ automake $am_opt ||
echo "Running autoconf ..."
autoconf || { echo "**Error**: autoconf failed."; exit 1; }
if test -d $srcdir/external/bdwgc; then
# Update all submodules recursively to ensure everything is checked out
if test -e $srcdir/scripts/update_submodules.sh; then
(cd $srcdir && scripts/update_submodules.sh)
fi
if test x$has_disable_boehm = xfalse -a -d $srcdir/external/bdwgc; then
echo Running external/bdwgc/autogen.sh ...
(cd $srcdir/external/bdwgc ; NOCONFIGURE=1 ./autogen.sh "$@")
echo Done running external/bdwgc/autogen.sh ...
+229 -297
View File
@@ -4,10 +4,10 @@
# 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.9.0],
AC_INIT(mono, [6.11.0],
[https://github.com/mono/mono/issues/new])
AC_CONFIG_SRCDIR([README.md])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_SYSTEM
@@ -63,7 +63,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=423e7794-9279-49a3-a477-f1cb2432e9f4
MONO_CORLIB_VERSION=97b07b51-46d8-4084-b48e-77aa5c192654
#
# Put a quoted #define in config.h.
@@ -358,6 +358,10 @@ case "$host" in
# https://bugzilla.novell.com/show_bug.cgi?id=504411
disable_munmap=yes
;;
powerpc*-*-freebsd*)
# https://bugzilla.novell.com/show_bug.cgi?id=504411
disable_munmap=yes
;;
riscv*)
support_boehm=no
with_gc=sgen
@@ -510,8 +514,8 @@ case "$host" in
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"
libmono_cflags="-D_THREAD_SAFE -D_REENTRANT"
CPPFLAGS="$CPPFLAGS -maix64 -DGC_AIX_THREADS -D_ALL_SOURCE -pthread -D_THREAD_SAFE -D_LARGE_FILES -D_REENTRANT"
libmono_cflags="-pthread -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. (OBJECT_MODE is finicky with cmake.)
@@ -1206,8 +1210,10 @@ AC_ARG_ENABLE(cxx, [ --enable-cxx compile some code as C++])
# mono/corefx/native has a lot of invalid C++98 in its headers
# dotnet/corefx/native looks a lot better, i.e. 44e5bdafb8d989a220c9cf1b94f31a64a6e4f052
# use these C99 print macros in the command line, since glib may not win first inttypes include
#CXXFLAGS_COMMON=' -std=gnu++98 -fno-exceptions -fno-rtti '
CXXFLAGS_COMMON=' -std=gnu++0x -fno-exceptions -fno-rtti '
CXXFLAGS_COMMON="$CXXFLAGS_COMMON -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS"
# "c++0x" instead of C++11, for compat with Centos6/gcc4.4
# -stdlib=libc++ is needed by clang for iOS 6.0 (-miphoneos-version-min=6.0)
@@ -1749,7 +1755,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, dllmap,
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, gac, threads.],
security, lldb, mdb, assert_messages, cfgdir_config, cleanup, sgen_marksweep_conc, sgen_split_nursery, sgen_gc_bridge, sgen_debug_helpers, sockets, gac, threads.],
[
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
eval "mono_feature_disable_$feature='yes'"
@@ -1925,6 +1931,11 @@ if test "x$mono_feature_disable_assert_messages" = "xyes"; then
AC_MSG_NOTICE([Disabled assertion messages.])
fi
if test "x$mono_feature_disable_cfgdir_config" = "xyes"; then
AC_DEFINE(DISABLE_CFGDIR_CONFIG, 1, [Disable config directories.])
AC_MSG_NOTICE([Disabled config directories.])
fi
if test "x$mono_feature_disable_cleanup" = "xyes"; then
AC_DEFINE(DISABLE_CLEANUP, 1, [Disable runtime cleanup.])
AC_MSG_NOTICE([Disabled runtime cleanup.])
@@ -2031,13 +2042,8 @@ if test "x$support_boehm" = "xyes"; then
LIBGC_CPPFLAGS=
LIBGC_LIBS=
LIBGC_STATIC_LIBS=
libgc_dir=
case "x$libgc" in
xincluded)
if test "x$support_boehm" = "xyes"; then
libgc_dir=external/bdwgc
fi
LIBGC_CPPFLAGS='-I$(top_srcdir)/external/bdwgc/include -I$(top_srcdir)/external/bdwgc/libatomic_ops/src'
LIBGC_LIBS='$(top_builddir)/external/bdwgc/libgc.la'
LIBGC_STATIC_LIBS='$(top_builddir)/external/bdwgc/libgc-static.la'
@@ -2085,7 +2091,6 @@ if test "x$support_boehm" = "xyes"; then
AC_SUBST(LIBGC_CPPFLAGS)
AC_SUBST(LIBGC_LIBS)
AC_SUBST(LIBGC_STATIC_LIBS)
AC_SUBST(libgc_dir)
AC_SUBST(BOEHM_DEFINES)
fi
@@ -2216,14 +2221,10 @@ if test x$host_win32 = xno; then
dnl ******************************************************************
AC_ARG_WITH(ikvm-native, [ --with-ikvm-native=yes,no build the IKVM JNI interface library (defaults to yes)],[with_ikvm_native=$withval],[with_ikvm_native=$ikvm_native])
ikvm_native_dir=
if test x$with_ikvm_native = xyes; then
ikvm_native_dir=ikvm-native
jdk_headers_found="IKVM Native"
fi
AC_SUBST(ikvm_native_dir)
AC_CHECK_HEADERS(execinfo.h)
AC_CHECK_HEADERS(sys/auxv.h sys/resource.h)
@@ -4466,7 +4467,7 @@ case "$host" in
;;
macppc-*-openbsd* | powerpc*-*-linux* | powerpc-*-openbsd* | \
powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* | \
powerpc-*-freebsd* | powerpc*-*-aix* | powerpc*-*-os400* )
powerpc*-*-freebsd* | powerpc*-*-aix* | powerpc*-*-os400* )
if test "x$ac_cv_sizeof_void_p" = "x8"; then
TARGET=POWERPC64;
CPPFLAGS="$CPPFLAGS -D__mono_ppc__ -D__mono_ppc64__"
@@ -5964,13 +5965,6 @@ fi
AM_CONDITIONAL(BTLS_ANDROID, test x$btls_android = xyes)
if test x$DISABLE_MCS_DOCS = xyes; then
docs_dir=""
else
docs_dir=docs
fi
AC_SUBST(docs_dir)
## Maybe should also disable if mcsdir is invalid. Let's punt the issue for now.
AM_CONDITIONAL(BUILD_MCS, [test x$cross_compiling = xno && test x$enable_mcs_build != xno])
AM_CONDITIONAL(BUILD_SUPPORT, [test x$enable_support_build != xno])
@@ -6067,8 +6061,8 @@ fi
AC_SUBST(mono_runtime)
AC_SUBST(mono_runtime_wrapper)
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.0/csc.exe
VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.0/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
@@ -6100,166 +6094,192 @@ AC_SUBST(mono_cfg_dir)
AC_SUBST(CSC)
AC_CONFIG_FILES([po/mcs/Makefile.in])
if test "x$with_core" != "xonly"; then
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=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/1.0
cd runtime/etc/mono/1.0
rm -f machine.config
$LN_S $reldir/data/net_1_1/machine.config machine.config
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/1.0/machine.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/1.0
cd runtime/etc/mono/1.0
rm -f machine.config
$LN_S $reldir/data/net_1_1/machine.config machine.config
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/machine.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/2.0
cd runtime/etc/mono/2.0
rm -f machine.config
$LN_S $reldir/data/net_2_0/machine.config machine.config
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/machine.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/2.0
cd runtime/etc/mono/2.0
rm -f machine.config
$LN_S $reldir/data/net_2_0/machine.config machine.config
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/web.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/2.0
cd runtime/etc/mono/2.0
rm -f web.config
$LN_S $reldir/data/net_2_0/web.config web.config
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/web.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/2.0
cd runtime/etc/mono/2.0
rm -f web.config
$LN_S $reldir/data/net_2_0/web.config web.config
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/browscap.ini],
[ depth=../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/
cd runtime/etc/mono/
rm -f browscap.ini
$LN_S $reldir/data/browscap.ini browscap.ini
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/browscap.ini],
[ depth=../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/
cd runtime/etc/mono/
rm -f browscap.ini
$LN_S $reldir/data/browscap.ini browscap.ini
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/Browsers/Compat.browser],
[ depth=../../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/2.0/Browsers/
cd runtime/etc/mono/2.0/Browsers
rm -f Compat.browser
$LN_S $reldir/data/Browsers/Compat.browser Compat.browser
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/Browsers/Compat.browser],
[ depth=../../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/2.0/Browsers/
cd runtime/etc/mono/2.0/Browsers
rm -f Compat.browser
$LN_S $reldir/data/Browsers/Compat.browser Compat.browser
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/Browsers/Compat.browser],
[ depth=../../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/4.0/Browsers/
cd runtime/etc/mono/4.0/Browsers
rm -f Compat.browser
$LN_S $reldir/data/Browsers/Compat.browser Compat.browser
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/Browsers/Compat.browser],
[ depth=../../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/4.0/Browsers/
cd runtime/etc/mono/4.0/Browsers
rm -f Compat.browser
$LN_S $reldir/data/Browsers/Compat.browser Compat.browser
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/Browsers/Compat.browser],
[ depth=../../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/4.5/Browsers/
cd runtime/etc/mono/4.5/Browsers
rm -f Compat.browser
$LN_S $reldir/data/Browsers/Compat.browser Compat.browser
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/Browsers/Compat.browser],
[ depth=../../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/4.5/Browsers/
cd runtime/etc/mono/4.5/Browsers
rm -f Compat.browser
$LN_S $reldir/data/Browsers/Compat.browser Compat.browser
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/machine.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/4.0
cd runtime/etc/mono/4.0
rm -f machine.config
$LN_S $reldir/data/net_4_0/machine.config machine.config
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/machine.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/4.0
cd runtime/etc/mono/4.0
rm -f machine.config
$LN_S $reldir/data/net_4_0/machine.config machine.config
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/web.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/4.0
cd runtime/etc/mono/4.0
rm -f web.config
$LN_S $reldir/data/net_4_0/web.config web.config
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/web.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/4.0
cd runtime/etc/mono/4.0
rm -f web.config
$LN_S $reldir/data/net_4_0/web.config web.config
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/machine.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/4.5
cd runtime/etc/mono/4.5
rm -f machine.config
$LN_S $reldir/data/net_4_5/machine.config machine.config
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/machine.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/4.5
cd runtime/etc/mono/4.5
rm -f machine.config
$LN_S $reldir/data/net_4_5/machine.config machine.config
cd $depth
],[LN_S='$LN_S'])
AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/web.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/4.5
cd runtime/etc/mono/4.5
rm -f web.config
$LN_S $reldir/data/net_4_5/web.config web.config
cd $depth
],[LN_S='$LN_S'])
fi
AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/web.config],
[ depth=../../../..
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
.) reldir=$depth ;;
*) reldir=$depth/$srcdir ;;
esac
$ac_aux_dir/install-sh -d runtime/etc/mono/4.5
cd runtime/etc/mono/4.5
rm -f web.config
$LN_S $reldir/data/net_4_5/web.config web.config
cd $depth
],[LN_S='$LN_S'])
# Top level Makefile.am subdirs
if test "x$with_core" = "xonly"; then
MONO_SUBDIRS="llvm mono"
else
if test "x$support_boehm" = "xyes" -a "x$libgc" = "xincluded"; then
mono_subdirs_libgc=external/bdwgc
fi
if test x$enable_support_build != xno; then
mono_subdirs_support=support
fi
if test x$cross_compiling = xno; then
# Some tools might not build when cross-compiling
mono_subdirs_tools=tools
fi
if test x$DISABLE_MCS_DOCS != xyes; then
mono_subdirs_docs=docs
fi
if test x$with_ikvm_native = xyes; then
mono_subdirs_ikvm_native=ikvm-native
fi
MONO_SUBDIRS="po $mono_subdirs_libgc llvm mono $mono_subdirs_ikvm_native $mono_subdirs_support data runtime scripts man samples $mono_subdirs_tools $mono_subdirs_docs msvc acceptance-tests"
fi
AC_SUBST(MONO_SUBDIRS)
AC_CONFIG_COMMANDS([quiet-libtool], [sed -e 's/echo "copying selected/# "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool; sed -e 's/$ECHO "copying selected/# "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
AC_CONFIG_COMMANDS([nolock-libtool], [sed -e 's/lock_old_archive_extraction=yes/lock_old_archive_extraction=no/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
@@ -6699,95 +6719,7 @@ if test "x$with_core" != "xonly"; then
(cd $srcdir && scripts/update_submodules.sh)
fi
AC_OUTPUT([
Makefile
mono-uninstalled.pc
acceptance-tests/Makefile
llvm/Makefile
scripts/mono-find-provides
scripts/mono-find-requires
mk/Makefile
mono/Makefile
mono/btls/Makefile
mono/native/Makefile
mono/utils/Makefile
mono/utils/jemalloc/Makefile
mono/metadata/Makefile
mono/zlib/Makefile
mono/dis/Makefile
mono/cil/Makefile
mono/arch/Makefile
mono/arch/x86/Makefile
mono/arch/amd64/Makefile
mono/arch/ppc/Makefile
mono/arch/sparc/Makefile
mono/arch/s390x/Makefile
mono/arch/arm/Makefile
mono/arch/arm64/Makefile
mono/arch/mips/Makefile
mono/arch/riscv/Makefile
mono/sgen/Makefile
mono/native/platform-type.c
mono/native/platform-type-compat.c
mono/native/platform-type-unified.c
mono/tests/Makefile
mono/tests/assembly-load-reference/Makefile
mono/tests/tests-config
mono/tests/gc-descriptors/Makefile
mono/tests/testing_gac/Makefile
mono/tests/fullaot-mixed/Makefile
mono/tests/llvmonly-mixed/Makefile
mono/unit-tests/Makefile
mono/benchmark/Makefile
mono/mini/Makefile
mono/profiler/Makefile
mono/eglib/Makefile
mono/eglib/eglib-config.h
mono/eglib/test/Makefile
m4/Makefile
ikvm-native/Makefile
scripts/Makefile
man/Makefile
docs/Makefile
data/Makefile
data/net_2_0/Makefile
data/net_4_0/Makefile
data/net_4_5/Makefile
data/net_2_0/Browsers/Makefile
data/net_4_0/Browsers/Makefile
data/net_4_5/Browsers/Makefile
data/mint.pc
data/mono-2.pc
data/monosgen-2.pc
data/mono.pc
data/mono-cairo.pc
data/mono-options.pc
data/mono-lineeditor.pc
data/monodoc.pc
data/dotnet.pc
data/dotnet35.pc
data/wcf.pc
data/cecil.pc
data/system.web.extensions_1.0.pc
data/system.web.extensions.design_1.0.pc
data/system.web.mvc.pc
data/system.web.mvc2.pc
data/system.web.mvc3.pc
data/aspnetwebstack.pc
data/reactive.pc
samples/Makefile
support/Makefile
data/config
tools/Makefile
tools/locale-builder/Makefile
tools/sgen/Makefile
tools/pedump/Makefile
tools/mono-hang-watchdog/Makefile
runtime/Makefile
msvc/Makefile
po/Makefile
netcore/corerun/Makefile
])
AC_MONO_OUTPUT()
if test x$host_win32 = xyes; then
# Get rid of 'cyg' prefixes in library names
@@ -6803,40 +6735,6 @@ 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,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=yes;
else
AC_MSG_ERROR([You must supply one of "yes", "no", "default" or "force" to the --with-compiler-server option])
fi
],[enable_compiler_server=yes])
AC_MSG_RESULT($enable_compiler_server)
if test x$enable_compiler_server = xyes; 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 || test x$host_win32 = xyes; then
AC_MSG_WARN([compiler server temporarily disabled on darwin and win32])
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
fi
(
case $prefix in
NONE) prefix=$ac_default_prefix ;;
@@ -6966,6 +6864,40 @@ fi
echo "MONO_NATIVE_USING_COMPAT=false" >> $srcdir/$mcsdir/build/config.make
fi
force_enable_compiler_server=no;
AC_MSG_CHECKING([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=yes;
else
AC_MSG_ERROR([You must supply one of "yes", "no", "default" or "force" to the --with-compiler-server option])
fi
],[enable_compiler_server=yes])
AC_MSG_RESULT($enable_compiler_server)
if test x$enable_compiler_server = xyes; 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 || test x$host_win32 = xyes; then
AC_MSG_WARN([compiler server temporarily disabled on darwin and win32])
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
fi
echo "MONO_NATIVE_PLATFORM_TYPE=$MONO_NATIVE_PLATFORM_TYPE" >> $srcdir/$mcsdir/build/config.make
echo "MONO_NATIVE_PLATFORM=$MONO_NATIVE_PLATFORM" >> $srcdir/$mcsdir/build/config.make
if test x$enable_compiler_server = xyes; then
+4 -4
View File
@@ -15,13 +15,13 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.19567.2">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.19608.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>928efaa081ffd17b37f6c662fee44775f2d0b90f</Sha>
<Sha>71ce4c736b882e6112b395a0e92313be5dcb4328</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.19567.2">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.19608.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>928efaa081ffd17b37f6c662fee44775f2d0b90f</Sha>
<Sha>71ce4c736b882e6112b395a0e92313be5dcb4328</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
+27 -26
View File
@@ -5,11 +5,12 @@ param(
)
Add-Type -AssemblyName System.IO.Compression.FileSystem
. $PSScriptRoot\pipeline-logging-functions.ps1
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] $TargetServerParameter, # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols
[string] $SymbolsPath
)
@@ -21,36 +22,36 @@ function FirstMatchingSymbolDescriptionOrDefault {
# checking and which type of file was uploaded.
# The file itself is returned
$SymbolPath = $SymbolsPath + "\" + $FileName
$SymbolPath = $SymbolsPath + '\' + $FileName
# PDB file for the module
$PdbPath = $SymbolPath.Replace($Extension, ".pdb")
$PdbPath = $SymbolPath.Replace($Extension, '.pdb')
# PDB file for R2R module (created by crossgen)
$NGenPdb = $SymbolPath.Replace($Extension, ".ni.pdb")
$NGenPdb = $SymbolPath.Replace($Extension, '.ni.pdb')
# DBG file for a .so library
$SODbg = $SymbolPath.Replace($Extension, ".so.dbg")
$SODbg = $SymbolPath.Replace($Extension, '.so.dbg')
# DWARF file for a .dylib
$DylibDwarf = $SymbolPath.Replace($Extension, ".dylib.dwarf")
$DylibDwarf = $SymbolPath.Replace($Extension, '.dylib.dwarf')
.\dotnet-symbol.exe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath | Out-Null
.\dotnet-symbol.exe --symbols --modules --windows-pdbs $TargetServerParameter $FullPath -o $SymbolsPath | Out-Null
if (Test-Path $PdbPath) {
return "PDB"
return 'PDB'
}
elseif (Test-Path $NGenPdb) {
return "NGen PDB"
return 'NGen PDB'
}
elseif (Test-Path $SODbg) {
return "DBG for SO"
return 'DBG for SO'
}
elseif (Test-Path $DylibDwarf) {
return "Dwarf for Dylib"
return 'Dwarf for Dylib'
}
elseif (Test-Path $SymbolPath) {
return "Module"
return 'Module'
}
else {
return $null
@@ -68,7 +69,7 @@ function CountMissingSymbols {
}
# Extensions for which we'll look for symbols
$RelevantExtensions = @(".dll", ".exe", ".so", ".dylib")
$RelevantExtensions = @('.dll', '.exe', '.so', '.dylib')
# How many files are missing symbol information
$MissingSymbols = 0
@@ -76,7 +77,7 @@ function CountMissingSymbols {
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$PackageGuid = New-Guid
$ExtractPath = Join-Path -Path $ExtractPath -ChildPath $PackageGuid
$SymbolsPath = Join-Path -Path $ExtractPath -ChildPath "Symbols"
$SymbolsPath = Join-Path -Path $ExtractPath -ChildPath 'Symbols'
[System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath)
@@ -86,31 +87,31 @@ function CountMissingSymbols {
Get-ChildItem -Recurse $ExtractPath |
Where-Object {$RelevantExtensions -contains $_.Extension} |
ForEach-Object {
if ($_.FullName -Match "\\ref\\") {
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
$SymbolsOnMSDL = FirstMatchingSymbolDescriptionOrDefault -FullPath $_.FullName -TargetServerParameter '--microsoft-symbol-server' -SymbolsPath $SymbolsPath
$SymbolsOnSymWeb = FirstMatchingSymbolDescriptionOrDefault -FullPath $_.FullName -TargetServerParameter '--internal-server' -SymbolsPath $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 ")"
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!"
Write-Host 'No symbols found on MSDL or SymWeb!'
}
else {
if ($SymbolsOnMSDL -eq $null) {
Write-Host "No symbols found on MSDL!"
Write-Host 'No symbols found on MSDL!'
}
else {
Write-Host "No symbols found on SymWeb!"
Write-Host 'No symbols found on SymWeb!'
}
}
}
@@ -129,26 +130,26 @@ function CheckSymbolsAvailable {
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\.") {
if ($FileName -Match 'Microsoft\.DotNet\.Darc\.') {
Write-Host "Ignoring Arcade-services file: $FileName"
Write-Host
return
}
elseif ($FileName -Match "Microsoft\.DotNet\.Maestro\.Tasks\.") {
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-Error "Missing symbols for $Status modules in the package $FileName"
Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Missing symbols for $Status modules in the package $FileName"
}
Write-Host
+18 -4
View File
@@ -16,7 +16,7 @@
# condition: eq(variables['Agent.OS'], 'Windows_NT')
# inputs:
# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
# arguments: -ConfigFile ${Env:BUILD_SOURCESDIRECTORY}/NuGet.config -Password $Env:Token
# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
# env:
# Token: $(dn-bot-dnceng-artifact-feeds-rw)
@@ -95,10 +95,15 @@ function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Password) {
}
if (!(Test-Path $ConfigFile -PathType Leaf)) {
Write-Host "Couldn't find the file NuGet config file: $ConfigFile"
Write-PipelineTelemetryError -Category 'Build' -Message "Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile"
ExitWithExitCode 1
}
if (!$Password) {
Write-PipelineTelemetryError -Category 'Build' -Message 'Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Please supply a valid PAT'
ExitWithExitCode 1
}
# Load NuGet.config
$doc = New-Object System.Xml.XmlDocument
$filename = (Get-Item $ConfigFile).FullName
@@ -121,7 +126,16 @@ if ($creds -eq $null) {
# Insert credential nodes for Maestro's private feeds
InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Password $Password
AddPackageSource -Sources $sources -SourceName "dotnet3-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
AddPackageSource -Sources $sources -SourceName "dotnet3-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-transport/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
$dotnet3Source = $sources.SelectSingleNode("add[@key='dotnet3']")
if ($dotnet3Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet3-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
AddPackageSource -Sources $sources -SourceName "dotnet3-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-transport/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
}
$dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']")
if ($dotnet31Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username "dn-bot" -Password $Password
}
$doc.Save($filename)
+55 -23
View File
@@ -17,7 +17,7 @@
# displayName: Setup Private Feeds Credentials
# inputs:
# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
# arguments: $BUILD_SOURCESDIRECTORY/NuGet.config $Token
# arguments: $(Build.SourcesDirectory)/NuGet.config $Token
# condition: ne(variables['Agent.OS'], 'Windows_NT')
# env:
# Token: $(dn-bot-dnceng-artifact-feeds-rw)
@@ -42,7 +42,12 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. "$scriptroot/tools.sh"
if [ ! -f "$ConfigFile" ]; then
echo "Couldn't find the file NuGet config file: $ConfigFile"
Write-PipelineTelemetryError -Category 'Build' "Error: Eng/common/SetupNugetSources.sh returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile"
ExitWithExitCode 1
fi
if [ -z "$CredToken" ]; then
Write-PipelineTelemetryError -category 'Build' "Error: Eng/common/SetupNugetSources.sh returned a non-zero exit code. Please supply a valid PAT"
ExitWithExitCode 1
fi
@@ -52,7 +57,7 @@ if [[ `uname -s` == "Darwin" ]]; then
fi
# Ensure there is a <packageSources>...</packageSources> section.
grep -i "<packageSources>" $ConfigFile
grep -i "<packageSources>" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding <packageSources>...</packageSources> section."
ConfigNodeHeader="<configuration>"
@@ -62,7 +67,7 @@ if [ "$?" != "0" ]; then
fi
# Ensure there is a <packageSourceCredentials>...</packageSourceCredentials> section.
grep -i "<packageSourceCredentials>" $ConfigFile
grep -i "<packageSourceCredentials>" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding <packageSourceCredentials>...</packageSourceCredentials> section."
@@ -72,37 +77,64 @@ if [ "$?" != "0" ]; then
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourcesNodeFooter${NL}$PackageSourceCredentialsTemplate|" NuGet.config
fi
# Ensure dotnet3-internal and dotnet3-internal-transport is in the packageSources
grep -i "<add key=\"dotnet3-internal\">" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3-internal to the packageSources."
PackageSources=()
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3-internal\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal/nuget/v2\" />"
# Ensure dotnet3-internal and dotnet3-internal-transport are in the packageSources if the public dotnet3 feeds are present
grep -i "<add key=\"dotnet3\"" $ConfigFile
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" NuGet.config
if [ "$?" == "0" ]; then
grep -i "<add key=\"dotnet3-internal\">" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3-internal to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3-internal\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal/nuget/v2\" />"
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet3-internal')
grep -i "<add key=\"dotnet3-internal-transport\"" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3-internal-transport to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3-internal-transport\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-transport/nuget/v2\" />"
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet3-internal-transport')
fi
# Ensure dotnet3-internal and dotnet3-internal-transport is in the packageSources
grep -i "<add key=\"dotnet3-internal-transport\">" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3-internal-transport to the packageSources."
# Ensure dotnet3.1-internal and dotnet3.1-internal-transport are in the packageSources if the public dotnet3.1 feeds are present
grep -i "<add key=\"dotnet3.1\"" $ConfigFile
if [ "$?" == "0" ]; then
grep -i "<add key=\"dotnet3.1-internal\"" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3.1-internal to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3.1-internal\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2\" />"
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3-internal-transport\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-transport/nuget/v2\" />"
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet3.1-internal')
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" NuGet.config
grep -i "<add key=\"dotnet3.1-internal-transport\">" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding dotnet3.1-internal-transport to the packageSources."
PackageSourcesNodeFooter="</packageSources>"
PackageSourceTemplate="${TB}<add key=\"dotnet3.1-internal-transport\" value=\"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2\" />"
sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile
fi
PackageSources+=('dotnet3.1-internal-transport')
fi
# I want things split line by line
PrevIFS=$IFS
IFS=$'\n'
PackageSources=$(grep -oh '"darc-int-[^"]*"' $ConfigFile | tr -d '"')
PackageSources+="$IFS"
PackageSources+=$(grep -oh '"darc-int-[^"]*"' $ConfigFile | tr -d '"')
IFS=$PrevIFS
PackageSources+=('dotnet3-internal')
PackageSources+=('dotnet3-internal-transport')
for FeedName in ${PackageSources[@]} ; do
# Check if there is no existing credential for this FeedName
grep -i "<$FeedName>" $ConfigFile
@@ -112,6 +144,6 @@ for FeedName in ${PackageSources[@]} ; do
PackageSourceCredentialsNodeFooter="</packageSourceCredentials>"
NewCredential="${TB}${TB}<$FeedName>${NL}<add key=\"Username\" value=\"dn-bot\" />${NL}<add key=\"ClearTextPassword\" value=\"$CredToken\" />${NL}</$FeedName>"
sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" NuGet.config
sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" $ConfigFile
fi
done
+140 -129
View File
@@ -6,140 +6,15 @@ param(
[Parameter(Mandatory=$true)][string] $GHCommit # GitHub commit SHA used to build the packages
)
# 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
)
# Ensure input file exist
if (!(Test-Path $PackagePath)) {
throw "Input file does not exist: $PackagePath"
}
# 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);
$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
)
# Makes easier to reference `sourcelink cli`
Push-Location $using:SourceLinkToolPath
$SourceLinkInfos = .\sourcelink.exe 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 = -Join("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") {
$Status = (Invoke-WebRequest -Uri $Link -UseBasicParsing -Method HEAD -TimeoutSec 5).StatusCode
}
else {
$Status = 0
}
}
catch {
$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
}
}
Pop-Location
}
&$ValidateFile $TargetFile $FileName ([ref]$FailedFiles)
}
$zip.Dispose()
if ($FailedFiles -eq 0) {
Write-Host "Passed."
}
}
function ValidateSourceLinkLinks {
if (!($GHRepoName -Match "^[^\s\/]+/[^\s\/]+$")) {
Write-Host "GHRepoName should be in the format <org>/<repo>"
Write-PipelineTelemetryError -Category "Build" -Message "GHRepoName should be in the format <org>/<repo>"
$global:LASTEXITCODE = 1
return
}
if (!($GHCommit -Match "^[0-9a-fA-F]{40}$")) {
Write-Host "GHCommit should be a 40 chars hexadecimal string"
Write-PipelineTelemetryError -Category "Build" -Message "GHCommit should be a 40 chars hexadecimal string"
$global:LASTEXITCODE = 1
return
}
@@ -160,7 +35,7 @@ function ValidateSourceLinkLinks {
}
}
catch {
Write-Host "Problems downloading the list of files from the repo. Url used: $RepoTreeURL"
Write-PipelineTelemetryError -Category "Build" -Message "Problems downloading the list of files from the repo. Url used: $RepoTreeURL"
$global:LASTEXITCODE = 1
return
}
@@ -181,4 +56,140 @@ function ValidateSourceLinkLinks {
}
}
Measure-Command { ValidateSourceLinkLinks }
try {
. $PSScriptRoot\pipeline-logging-functions.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
)
# Ensure input file exist
if (!(Test-Path $PackagePath)) {
throw "Input file does not exist: $PackagePath"
}
# 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);
$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
)
# Makes easier to reference `sourcelink cli`
Push-Location $using:SourceLinkToolPath
$SourceLinkInfos = .\sourcelink.exe 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 = -Join("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") {
$Status = (Invoke-WebRequest -Uri $Link -UseBasicParsing -Method HEAD -TimeoutSec 5).StatusCode
}
else {
$Status = 0
}
}
catch {
$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
}
}
Pop-Location
}
&$ValidateFile $TargetFile $FileName ([ref]$FailedFiles)
}
$zip.Dispose()
if ($FailedFiles -eq 0) {
Write-Host "Passed."
}
}
Measure-Command { ValidateSourceLinkLinks }
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'SourceLink' -Message $_
ExitWithExitCode 1
}
+45 -45
View File
@@ -26,50 +26,50 @@ Param(
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)
. $PSScriptRoot\tools.ps1
function Print-Usage() {
Write-Host "Common settings:"
Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
Write-Host " -platform <value> Platform configuration: 'x86', 'x64' or any valid Platform value to pass to msbuild"
Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
Write-Host " -binaryLog Output binary log (short: -bl)"
Write-Host " -help Print help and exit"
Write-Host ""
Write-Host "Common settings:"
Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
Write-Host " -platform <value> Platform configuration: 'x86', 'x64' or any valid Platform value to pass to msbuild"
Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
Write-Host " -binaryLog Output binary log (short: -bl)"
Write-Host " -help Print help and exit"
Write-Host ""
Write-Host "Actions:"
Write-Host " -restore Restore dependencies (short: -r)"
Write-Host " -build Build solution (short: -b)"
Write-Host " -rebuild Rebuild solution"
Write-Host " -deploy Deploy built VSIXes"
Write-Host " -deployDeps Deploy dependencies (e.g. VSIXes for integration tests)"
Write-Host " -test Run all unit tests in the solution (short: -t)"
Write-Host " -integrationTest Run all integration tests in the solution"
Write-Host " -performanceTest Run all performance tests in the solution"
Write-Host " -pack Package build outputs into NuGet packages and Willow components"
Write-Host " -sign Sign build outputs"
Write-Host " -publish Publish artifacts (e.g. symbols)"
Write-Host " -clean Clean the solution"
Write-Host ""
Write-Host "Actions:"
Write-Host " -restore Restore dependencies (short: -r)"
Write-Host " -build Build solution (short: -b)"
Write-Host " -rebuild Rebuild solution"
Write-Host " -deploy Deploy built VSIXes"
Write-Host " -deployDeps Deploy dependencies (e.g. VSIXes for integration tests)"
Write-Host " -test Run all unit tests in the solution (short: -t)"
Write-Host " -integrationTest Run all integration tests in the solution"
Write-Host " -performanceTest Run all performance tests in the solution"
Write-Host " -pack Package build outputs into NuGet packages and Willow components"
Write-Host " -sign Sign build outputs"
Write-Host " -publish Publish artifacts (e.g. symbols)"
Write-Host " -clean Clean the solution"
Write-Host ""
Write-Host "Advanced settings:"
Write-Host " -projects <value> Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)"
Write-Host " -ci Set when running on CI server"
Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build"
Write-Host " -warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
Write-Host ""
Write-Host "Advanced settings:"
Write-Host " -projects <value> Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)"
Write-Host " -ci Set when running on CI server"
Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build"
Write-Host " -warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
Write-Host ""
Write-Host "Command line arguments not listed above are passed thru to msbuild."
Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)."
Write-Host "Command line arguments not listed above are passed thru to msbuild."
Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)."
}
. $PSScriptRoot\tools.ps1
function InitializeCustomToolset {
if (-not $restore) {
return
}
$script = Join-Path $EngRoot "restore-toolset.ps1"
$script = Join-Path $EngRoot 'restore-toolset.ps1'
if (Test-Path $script) {
. $script
@@ -80,8 +80,8 @@ function Build {
$toolsetBuildProj = InitializeToolset
InitializeCustomToolset
$bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" }
$platformArg = if ($platform) { "/p:Platform=$platform" } else { "" }
$bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'Build.binlog') } else { '' }
$platformArg = if ($platform) { "/p:Platform=$platform" } else { '' }
if ($projects) {
# Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons.
@@ -114,16 +114,16 @@ function Build {
@properties
}
if ($clean) {
if(Test-Path $ArtifactsDir) {
Remove-Item -Recurse -Force $ArtifactsDir
Write-Host "Artifacts directory deleted."
}
exit 0
}
try {
if ($help -or (($null -ne $properties) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) {
if ($clean) {
if (Test-Path $ArtifactsDir) {
Remove-Item -Recurse -Force $ArtifactsDir
Write-Host 'Artifacts directory deleted.'
}
exit 0
}
if ($help -or (($null -ne $properties) -and ($properties.Contains('/help') -or $properties.Contains('/?')))) {
Print-Usage
exit 0
}
@@ -141,7 +141,7 @@ try {
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category "InitializeToolset" -Message $_
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
ExitWithExitCode 1
}
+1 -1
View File
@@ -193,7 +193,7 @@ fi
if [[ "$__LinuxCodeName" == "alpine" ]]; then
__ApkToolsVersion=2.9.1
__AlpineVersion=3.7
__AlpineVersion=3.9
__ApkToolsDir=$(mktemp -d)
wget https://github.com/alpinelinux/apk-tools/releases/download/v$__ApkToolsVersion/apk-tools-$__ApkToolsVersion-x86_64-linux.tar.gz -P $__ApkToolsDir
tar -xf $__ApkToolsDir/apk-tools-$__ApkToolsVersion-x86_64-linux.tar.gz -C $__ApkToolsDir
+13 -6
View File
@@ -1,14 +1,14 @@
param (
$darcVersion = $null,
$versionEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16",
$verbosity = "m",
$versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16',
$verbosity = 'minimal',
$toolpath = $null
)
. $PSScriptRoot\tools.ps1
function InstallDarcCli ($darcVersion) {
$darcCliPackageName = "microsoft.dotnet.darc"
$darcCliPackageName = 'microsoft.dotnet.darc'
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
@@ -27,12 +27,19 @@ function InstallDarcCli ($darcVersion) {
$arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/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."
Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.'
if (-not $toolpath) {
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g
}else {
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath"
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath"
}
}
InstallDarcCli $darcVersion
try {
InstallDarcCli $darcVersion
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Darc' -Message $_
ExitWithExitCode 1
}
+2 -2
View File
@@ -2,8 +2,8 @@
source="${BASH_SOURCE[0]}"
darcVersion=''
versionEndpoint="https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16"
verbosity=m
versionEndpoint='https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16'
verbosity='minimal'
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
+12 -13
View File
@@ -1,28 +1,27 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $verbosity = "minimal",
[string] $architecture = "",
[string] $version = "Latest",
[string] $runtime = "dotnet",
[string] $RuntimeSourceFeed = "",
[string] $RuntimeSourceFeedKey = ""
[string] $verbosity = 'minimal',
[string] $architecture = '',
[string] $version = 'Latest',
[string] $runtime = 'dotnet',
[string] $RuntimeSourceFeed = '',
[string] $RuntimeSourceFeedKey = ''
)
. $PSScriptRoot\tools.ps1
$dotnetRoot = Join-Path $RepoRoot ".dotnet"
$dotnetRoot = Join-Path $RepoRoot '.dotnet'
$installdir = $dotnetRoot
try {
if ($architecture -and $architecture.Trim() -eq "x86") {
$installdir = Join-Path $installdir "x86"
if ($architecture -and $architecture.Trim() -eq 'x86') {
$installdir = Join-Path $installdir 'x86'
}
InstallDotNet $installdir $version $architecture $runtime $true -RuntimeSourceFeed $RuntimeSourceFeed -RuntimeSourceFeedKey $RuntimeSourceFeedKey
}
InstallDotNet $installdir $version $architecture $runtime $true -RuntimeSourceFeed $RuntimeSourceFeed -RuntimeSourceFeedKey $RuntimeSourceFeedKey
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
ExitWithExitCode 1
}
+4 -3
View File
@@ -11,6 +11,8 @@ while [[ -h "$source" ]]; do
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. "$scriptroot/tools.sh"
version='Latest'
architecture=''
runtime='dotnet'
@@ -40,7 +42,7 @@ while [[ $# > 0 ]]; do
runtimeSourceFeedKey="$1"
;;
*)
echo "Invalid argument: $1"
Write-PipelineTelemetryError -Category 'Build' -Message "Invalid argument: $1"
exit 1
;;
esac
@@ -73,7 +75,6 @@ case $cpuname in
;;
esac
. "$scriptroot/tools.sh"
dotnetRoot="$repo_root/.dotnet"
if [[ $architecture != "" ]] && [[ $architecture != $buildarch ]]; then
dotnetRoot="$dotnetRoot/$architecture"
@@ -81,7 +82,7 @@ fi
InstallDotNet $dotnetRoot $version "$architecture" $runtime true $runtimeSourceFeed $runtimeSourceFeedKey || {
local exit_code=$?
echo "dotnet-install.sh failed (exit code '$exit_code')." >&2
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2
ExitWithExitCode $exit_code
}
+4 -2
View File
@@ -2,5 +2,7 @@ param(
[string] $token
)
Write-Host "##vso[task.setvariable variable=VSS_NUGET_ACCESSTOKEN]$token"
Write-Host "##vso[task.setvariable variable=VSS_NUGET_URI_PREFIXES]https://dnceng.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/dnceng/;https://devdiv.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/devdiv/"
. $PSScriptRoot\pipeline-logging-functions.ps1
Write-PipelineSetVariable -Name 'VSS_NUGET_ACCESSTOKEN' -Value $token
Write-PipelineSetVariable -Name 'VSS_NUGET_URI_PREFIXES' -Value 'https://dnceng.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/dnceng/;https://devdiv.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/devdiv/'
+24 -25
View File
@@ -9,33 +9,33 @@ Param(
# toolset dependencies see https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#toolset-vs-product-dependencies
)
$ErrorActionPreference = "Stop"
. $PSScriptRoot\tools.ps1
Import-Module -Name (Join-Path $PSScriptRoot "native\CommonLibrary.psm1")
function CheckExitCode ([string]$stage)
{
$exitCode = $LASTEXITCODE
if ($exitCode -ne 0) {
Write-Host "Something failed in stage: '$stage'. Check for errors above. Exiting now..."
Write-PipelineTelemetryError -Category 'Arcade' -Message "Something failed in stage: '$stage'. Check for errors above. Exiting now..."
ExitWithExitCode $exitCode
}
}
try {
$ErrorActionPreference = 'Stop'
. $PSScriptRoot\tools.ps1
Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1')
Push-Location $PSScriptRoot
Write-Host "Installing darc..."
Write-Host 'Installing darc...'
. .\darc-init.ps1 -darcVersion $darcVersion
CheckExitCode "Running darc-init"
CheckExitCode 'Running darc-init'
$engCommonBaseDir = Join-Path $PSScriptRoot "native\"
$engCommonBaseDir = Join-Path $PSScriptRoot 'native\'
$graphvizInstallDir = CommonLibrary\Get-NativeInstallDirectory
$nativeToolBaseUri = "https://netcorenativeassets.blob.core.windows.net/resource-packages/external"
$installBin = Join-Path $graphvizInstallDir "bin"
$nativeToolBaseUri = 'https://netcorenativeassets.blob.core.windows.net/resource-packages/external'
$installBin = Join-Path $graphvizInstallDir 'bin'
Write-Host "Installing dot..."
Write-Host 'Installing dot...'
.\native\install-tool.ps1 -ToolName graphviz -InstallPath $installBin -BaseUri $nativeToolBaseUri -CommonLibraryDirectory $engCommonBaseDir -Version $graphvizVersion -Verbose
$darcExe = "$env:USERPROFILE\.dotnet\tools"
@@ -51,37 +51,36 @@ try {
$graphVizImageFilePath = "$outputFolder\graph.png"
$normalGraphFilePath = "$outputFolder\graph-full.txt"
$flatGraphFilePath = "$outputFolder\graph-flat.txt"
$baseOptions = @( "--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" )
Write-Host 'Toolsets will be included in the graph...'
$baseOptions += @( '--include-toolset' )
}
Write-Host "Generating standard dependency graph..."
Write-Host 'Generating standard dependency graph...'
& "$darcExe" get-dependency-graph @baseOptions --output-file $normalGraphFilePath
CheckExitCode "Generating normal dependency graph"
CheckExitCode 'Generating normal dependency graph'
Write-Host "Generating flat dependency graph and graphviz file..."
Write-Host 'Generating flat dependency graph and graphviz file...'
& "$darcExe" get-dependency-graph @baseOptions --flat --coherency --graphviz $graphVizFilePath --output-file $flatGraphFilePath
CheckExitCode "Generating flat and graphviz dependency graph"
CheckExitCode 'Generating flat and graphviz dependency graph'
Write-Host "Generating graph image $graphVizFilePath"
$dotFilePath = Join-Path $installBin "graphviz\$graphvizVersion\release\bin\dot.exe"
& "$dotFilePath" -Tpng -o"$graphVizImageFilePath" "$graphVizFilePath"
CheckExitCode "Generating graphviz image"
CheckExitCode 'Generating graphviz image'
Write-Host "'$graphVizFilePath', '$flatGraphFilePath', '$normalGraphFilePath' and '$graphVizImageFilePath' created!"
}
catch {
if (!$includeToolset) {
Write-Host "This might be a toolset repo which includes only toolset dependencies. " -NoNewline -ForegroundColor Yellow
Write-Host "Since -includeToolset is not set there is no graph to create. Include -includeToolset and try again..." -ForegroundColor Yellow
Write-Host 'This might be a toolset repo which includes only toolset dependencies. ' -NoNewline -ForegroundColor Yellow
Write-Host 'Since -includeToolset is not set there is no graph to create. Include -includeToolset and try again...' -ForegroundColor Yellow
}
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Arcade' -Message $_
ExitWithExitCode 1
} finally {
Pop-Location
Pop-Location
}
+20 -16
View File
@@ -35,7 +35,7 @@ File path to global.json file
#>
[CmdletBinding(PositionalBinding=$false)]
Param (
[string] $BaseUri = "https://netcorenativeassets.blob.core.windows.net/resource-packages/external",
[string] $BaseUri = 'https://netcorenativeassets.blob.core.windows.net/resource-packages/external',
[string] $InstallDirectory,
[switch] $Clean = $False,
[switch] $Force = $False,
@@ -45,26 +45,27 @@ Param (
)
if (!$GlobalJsonFile) {
$GlobalJsonFile = Join-Path (Get-Item $PSScriptRoot).Parent.Parent.FullName "global.json"
$GlobalJsonFile = Join-Path (Get-Item $PSScriptRoot).Parent.Parent.FullName 'global.json'
}
Set-StrictMode -version 2.0
$ErrorActionPreference="Stop"
$ErrorActionPreference='Stop'
Import-Module -Name (Join-Path $PSScriptRoot "native\CommonLibrary.psm1")
. $PSScriptRoot\pipeline-logging-functions.ps1
Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1')
try {
# Define verbose switch if undefined
$Verbose = $VerbosePreference -Eq "Continue"
$Verbose = $VerbosePreference -Eq 'Continue'
$EngCommonBaseDir = Join-Path $PSScriptRoot "native\"
$EngCommonBaseDir = Join-Path $PSScriptRoot 'native\'
$NativeBaseDir = $InstallDirectory
if (!$NativeBaseDir) {
$NativeBaseDir = CommonLibrary\Get-NativeInstallDirectory
}
$Env:CommonLibrary_NativeInstallDir = $NativeBaseDir
$InstallBin = Join-Path $NativeBaseDir "bin"
$InstallerPath = Join-Path $EngCommonBaseDir "install-tool.ps1"
$InstallBin = Join-Path $NativeBaseDir 'bin'
$InstallerPath = Join-Path $EngCommonBaseDir 'install-tool.ps1'
# Process tools list
Write-Host "Processing $GlobalJsonFile"
@@ -74,7 +75,7 @@ try {
}
$NativeTools = Get-Content($GlobalJsonFile) -Raw |
ConvertFrom-Json |
Select-Object -Expand "native-tools" -ErrorAction SilentlyContinue
Select-Object -Expand 'native-tools' -ErrorAction SilentlyContinue
if ($NativeTools) {
$NativeTools.PSObject.Properties | ForEach-Object {
$ToolName = $_.Name
@@ -112,18 +113,21 @@ try {
}
$toolInstallationFailure = $true
} else {
Write-Error $errMsg
# We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482
Write-Host $errMsg
exit 1
}
}
}
if ((Get-Variable 'toolInstallationFailure' -ErrorAction 'SilentlyContinue') -and $toolInstallationFailure) {
# We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482
Write-Host 'Native tools bootstrap failed'
exit 1
}
}
else {
Write-Host "No native tools defined in global.json"
Write-Host 'No native tools defined in global.json'
exit 0
}
@@ -131,18 +135,18 @@ try {
exit 0
}
if (Test-Path $InstallBin) {
Write-Host "Native tools are available from" (Convert-Path -Path $InstallBin)
Write-Host 'Native tools are available from ' (Convert-Path -Path $InstallBin)
Write-Host "##vso[task.prependpath]$(Convert-Path -Path $InstallBin)"
return $InstallBin
}
else {
Write-Error "Native tools install directory does not exist, installation failed"
Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message 'Native tools install directory does not exist, installation failed'
exit 1
}
exit 0
}
catch {
Write-Host $_
Write-Host $_.Exception
exit 1
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message $_
ExitWithExitCode 1
}
+3 -2
View File
@@ -12,6 +12,7 @@ retry_wait_time_seconds=30
global_json_file="$(dirname "$(dirname "${scriptroot}")")/global.json"
declare -A native_assets
. $scriptroot/pipeline-logging-functions.sh
. $scriptroot/native/common-library.sh
while (($# > 0)); do
@@ -120,7 +121,7 @@ else
$installer_command
if [[ $? != 0 ]]; then
echo "Execution Failed" >&2
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed"
exit 1
fi
done
@@ -134,7 +135,7 @@ if [[ -d $install_bin ]]; then
echo "Native tools are available from $install_bin"
echo "##vso[task.prependpath]$install_bin"
else
echo "Native tools install directory does not exist, installation failed" >&2
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Native tools install directory does not exist, installation failed"
exit 1
fi
+13 -15
View File
@@ -6,9 +6,8 @@ param(
[switch] $IsFeedPrivate
)
$ErrorActionPreference = "Stop"
$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
@@ -21,7 +20,7 @@ function SetupCredProvider {
)
# Install the Cred Provider NuGet plugin
Write-Host "Setting up Cred Provider NuGet plugin in the agent..."
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'
@@ -29,18 +28,18 @@ function SetupCredProvider {
Write-Host "Writing the contents of 'installcredprovider.ps1' locally..."
Invoke-WebRequest $url -OutFile installcredprovider.ps1
Write-Host "Installing plugin..."
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!"
Write-PipelineTelemetryError -Category 'Arcade' -Message 'CredProvider plugin was not installed correctly!'
ExitWithExitCode 1
}
else {
Write-Host "CredProvider plugin was installed correctly!"
Write-Host 'CredProvider plugin was installed correctly!'
}
# Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable
@@ -49,7 +48,7 @@ function SetupCredProvider {
$nugetConfigPath = "$RepoRoot\NuGet.config"
if (-Not (Test-Path -Path $nugetConfigPath)) {
Write-Host "NuGet.config file not found in repo's root!"
Write-PipelineTelemetryError -Category 'Build' -Message 'NuGet.config file not found in repo root!'
ExitWithExitCode 1
}
@@ -81,7 +80,7 @@ function SetupCredProvider {
}
else
{
Write-Host "No internal endpoints found in NuGet.config"
Write-Host 'No internal endpoints found in NuGet.config'
}
}
@@ -99,7 +98,7 @@ function InstallDotNetSdkAndRestoreArcade {
& $dotnet restore $restoreProjPath
Write-Host "Arcade SDK restored!"
Write-Host 'Arcade SDK restored!'
if (Test-Path -Path $restoreProjPath) {
Remove-Item $restoreProjPath
@@ -113,23 +112,22 @@ function InstallDotNetSdkAndRestoreArcade {
try {
Push-Location $PSScriptRoot
if ($Operation -like "setup") {
if ($Operation -like 'setup') {
SetupCredProvider $AuthToken
}
elseif ($Operation -like "install-restore") {
elseif ($Operation -like 'install-restore') {
InstallDotNetSdkAndRestoreArcade
}
else {
Write-Host "Unknown operation '$Operation'!"
Write-PipelineTelemetryError -Category 'Arcade' -Message "Unknown operation '$Operation'!"
ExitWithExitCode 1
}
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Arcade' -Message $_
ExitWithExitCode 1
}
finally {
Pop-Location
Pop-Location
}
+2 -2
View File
@@ -30,7 +30,7 @@ function SetupCredProvider {
rm installcredprovider.sh
if [ ! -d "$HOME/.nuget/plugins" ]; then
echo "CredProvider plugin was not installed correctly!"
Write-PipelineTelemetryError -category 'Build' 'CredProvider plugin was not installed correctly!'
ExitWithExitCode 1
else
echo "CredProvider plugin was installed correctly!"
@@ -42,7 +42,7 @@ function SetupCredProvider {
local nugetConfigPath="$repo_root/NuGet.config"
if [ ! "$nugetConfigPath" ]; then
echo "NuGet.config file not found in repo's root!"
Write-PipelineTelemetryError -category 'Build' "NuGet.config file not found in repo's root!"
ExitWithExitCode 1
fi
+2 -3
View File
@@ -1,6 +1,6 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $verbosity = "minimal",
[string] $verbosity = 'minimal',
[bool] $warnAsError = $true,
[bool] $nodeReuse = $true,
[switch] $ci,
@@ -18,9 +18,8 @@ try {
MSBuild @extraArgs
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Build' -Message $_
ExitWithExitCode 1
}
+5 -5
View File
@@ -34,7 +34,7 @@ function ExpandZip {
echo "'Force flag enabled, but '$output_directory' exists. Removing directory"
rm -rf $output_directory
if [[ $? != 0 ]]; then
echo Unable to remove '$output_directory'>&2
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Unable to remove '$output_directory'"
return 1
fi
fi
@@ -45,7 +45,7 @@ function ExpandZip {
echo "Extracting archive"
tar -xf $zip_path -C $output_directory
if [[ $? != 0 ]]; then
echo "Unable to extract '$zip_path'" >&2
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Unable to extract '$zip_path'"
return 1
fi
@@ -117,7 +117,7 @@ function DownloadAndExtract {
# Download file
GetFile "$uri" "$temp_tool_path" $force $download_retries $retry_wait_time_seconds
if [[ $? != 0 ]]; then
echo "Failed to download '$uri' to '$temp_tool_path'." >&2
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Failed to download '$uri' to '$temp_tool_path'."
return 1
fi
@@ -125,7 +125,7 @@ function DownloadAndExtract {
echo "extracting from $temp_tool_path to $installDir"
ExpandZip "$temp_tool_path" "$installDir" $force $download_retries $retry_wait_time_seconds
if [[ $? != 0 ]]; then
echo "Failed to extract '$temp_tool_path' to '$installDir'." >&2
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Failed to extract '$temp_tool_path' to '$installDir'."
return 1
fi
@@ -148,7 +148,7 @@ function NewScriptShim {
fi
if [[ ! -f $tool_file_path ]]; then
echo "Specified tool file path:'$tool_file_path' does not exist" >&2
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Specified tool file path:'$tool_file_path' does not exist"
return 1
fi
+2 -2
View File
@@ -101,7 +101,7 @@ fi
DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds
if [[ $? != 0 ]]; then
echo "Installation failed" >&2
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Installation failed'
exit 1
fi
@@ -110,7 +110,7 @@ fi
NewScriptShim $shim_path $tool_file_path true
if [[ $? != 0 ]]; then
echo "Shim generation failed" >&2
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Shim generation failed'
exit 1
fi
+2 -2
View File
@@ -101,7 +101,7 @@ fi
DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds
if [[ $? != 0 ]]; then
echo "Installation failed" >&2
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Installation failed'
exit 1
fi
@@ -110,7 +110,7 @@ fi
NewScriptShim $shim_path $tool_file_path true
if [[ $? != 0 ]]; then
echo "Shim generation failed" >&2
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Shim generation failed'
exit 1
fi
+7 -5
View File
@@ -46,6 +46,8 @@ Param (
[int] $RetryWaitTimeInSeconds = 30
)
. $PSScriptRoot\..\pipeline-logging-functions.ps1
# Import common library modules
Import-Module -Name (Join-Path $CommonLibraryDirectory "CommonLibrary.psm1")
@@ -93,7 +95,7 @@ try {
-Verbose:$Verbose
if ($InstallStatus -Eq $False) {
Write-Error "Installation failed"
Write-PipelineTelemetryError "Installation failed" -Category "NativeToolsetBootstrapping"
exit 1
}
}
@@ -103,7 +105,7 @@ try {
Write-Error "There are multiple copies of $ToolName in $($ToolInstallDirectory): `n$(@($ToolFilePath | out-string))"
exit 1
} elseif (@($ToolFilePath).Length -Lt 1) {
Write-Error "$ToolName was not found in $ToolFilePath."
Write-Host "$ToolName was not found in $ToolFilePath."
exit 1
}
@@ -117,14 +119,14 @@ try {
-Verbose:$Verbose
if ($GenerateShimStatus -Eq $False) {
Write-Error "Generate shim failed"
Write-PipelineTelemetryError "Generate shim failed" -Category "NativeToolsetBootstrapping"
return 1
}
exit 0
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category "NativeToolsetBootstrapping" -Message $_
exit 1
}
+39 -33
View File
@@ -12,6 +12,7 @@ $script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"
# TODO: BUG: Escape % ???
# TODO: Add test to verify don't need to escape "=".
# Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set
function Write-PipelineTelemetryError {
[CmdletBinding()]
param(
@@ -25,49 +26,53 @@ function Write-PipelineTelemetryError {
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput)
[switch]$AsOutput,
[switch]$Force)
$PSBoundParameters.Remove("Category") | Out-Null
$PSBoundParameters.Remove('Category') | Out-Null
$Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message"
$PSBoundParameters.Remove("Message") | Out-Null
$PSBoundParameters.Add("Message", $Message)
$PSBoundParameters.Remove('Message') | Out-Null
$PSBoundParameters.Add('Message', $Message)
Write-PipelineTaskError @PSBoundParameters
}
# Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set
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) {
[Parameter(Mandatory = $true)]
[string]$Message,
[Parameter(Mandatory = $false)]
[string]$Type = 'error',
[string]$ErrCode,
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput,
[switch]$Force
)
if(!$Force -And (-Not (Test-Path variable:ci) -Or !$ci)) {
if($Type -eq 'error') {
Write-Host $Message -ForegroundColor Red
return
Write-Host $Message -ForegroundColor Red
return
}
elseif ($Type -eq 'warning') {
Write-Host $Message -ForegroundColor Yellow
return
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
}
if(($Type -ne 'error') -and ($Type -ne 'warning')) {
Write-Host $Message
return
}
$PSBoundParameters.Remove('Force') | Out-Null
if(-not $PSBoundParameters.ContainsKey('Type')) {
$PSBoundParameters.Add('Type', 'error')
}
Write-LogIssue @PSBoundParameters
}
function Write-PipelineSetVariable {
@@ -80,7 +85,7 @@ function Write-PipelineTaskError {
[switch]$AsOutput,
[bool]$IsMultiJobVariable=$true)
if($ci) {
if((Test-Path variable:ci) -And $ci) {
Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{
'variable' = $Name
'isSecret' = $Secret
@@ -95,7 +100,8 @@ function Write-PipelineTaskError {
[Parameter(Mandatory=$true)]
[string]$Path,
[switch]$AsOutput)
if($ci) {
if((Test-Path variable:ci) -And $ci) {
Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput
}
}
@@ -231,4 +237,4 @@ function Write-LogIssue {
}
Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor
}
}
+9 -2
View File
@@ -2,6 +2,7 @@
function Write-PipelineTelemetryError {
local telemetry_category=''
local force=false
local function_args=()
local message=''
while [[ $# -gt 0 ]]; do
@@ -11,6 +12,9 @@ function Write-PipelineTelemetryError {
telemetry_category=$2
shift
;;
-force|-f)
force=true
;;
-*)
function_args+=("$1 $2")
shift
@@ -22,19 +26,22 @@ function Write-PipelineTelemetryError {
shift
done
if [[ "$ci" != true ]]; then
if [[ $force != true ]] && [[ "$ci" != true ]]; then
echo "$message" >&2
return
fi
message="(NETCORE_ENGINEERING_TELEMETRY=$telemetry_category) $message"
function_args+=("$message")
if [[ $force == true ]]; then
function_args+=("-force")
fi
Write-PipelineTaskError $function_args
}
function Write-PipelineTaskError {
if [[ "$ci" != true ]]; then
if [[ $force != true ]] && [[ "$ci" != true ]]; then
echo "$@" >&2
return
fi
+7 -8
View File
@@ -2,20 +2,20 @@ 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
[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\post-build-utils.ps1
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..."
Write-PipelineTelemetryError -Category "Darc" -Message "Something failed while running 'darc-init.ps1'. Check for errors above. Exiting now..."
ExitWithExitCode $exitCode
}
@@ -38,8 +38,7 @@ try {
--latest-location
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category "Darc" -Message $_
ExitWithExitCode 1
}
+5 -6
View File
@@ -6,20 +6,19 @@ param(
[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"
. $PSScriptRoot\post-build-utils.ps1
New-Item -ItemType "directory" -Path ${ToolDestinationPath} -Force
$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
Write-PipelineTelemetryError -Category 'NuGetValidation' -Message $_
ExitWithExitCode 1
}
+16 -16
View File
@@ -1,17 +1,17 @@
# Most of the functions in this file require the variables `MaestroApiEndPoint`,
# `MaestroApiVersion` and `MaestroApiAccessToken` to be globally available.
$ErrorActionPreference = "Stop"
$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
$disableConfigureToolsetImport = "true"
$disableConfigureToolsetImport = $true
. $PSScriptRoot\..\tools.ps1
function Create-MaestroApiRequestHeaders([string]$ContentType = "application/json") {
function Create-MaestroApiRequestHeaders([string]$ContentType = 'application/json') {
Validate-MaestroVars
$headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]'
@@ -51,14 +51,6 @@ function Get-MaestroSubscriptions([string]$SourceRepository, [int]$ChannelId) {
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
@@ -67,24 +59,32 @@ function Assign-BuildToChannel([int]$BuildId, [int]$ChannelId) {
Invoke-WebRequest -Method Post -Uri $apiEndpoint -Headers $apiHeaders | Out-Null
}
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 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'"
if (!($MaestroApiEndPoint -Match '^http[s]?://maestro-(int|prod).westus2.cloudapp.azure.com$')) {
Write-PipelineTelemetryError -Category 'MaestroVars' -Message "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'"
if (!($MaestroApiVersion -Match '^[0-9]{4}-[0-9]{2}-[0-9]{2}$')) {
Write-PipelineTelemetryError -Category 'MaestroVars' -Message "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-PipelineTelemetryError -Category 'MaestroVars' -Message 'Error: Variables `MaestroApiEndPoint`, `MaestroApiVersion` and `MaestroApiAccessToken` are required while using this script.'
Write-Host $_
ExitWithExitCode 1
}
+9 -9
View File
@@ -2,18 +2,18 @@ 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"
[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 {
. $PSScriptRoot\post-build-utils.ps1
# 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!"
Write-PipelineTelemetryCategory -Category 'PromoteBuild' -Message "Channel with BAR ID $ChannelId was not found in BAR!"
ExitWithExitCode 1
}
@@ -21,7 +21,7 @@ try {
$buildInfo = Get-MaestroBuild -BuildId $BuildId
if (!$buildInfo) {
Write-Host "Build with BAR ID $BuildId was not found in BAR!"
Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "Build with BAR ID $BuildId was not found in BAR!"
ExitWithExitCode 1
}
@@ -39,10 +39,10 @@ try {
Assign-BuildToChannel -BuildId $BuildId -ChannelId $ChannelId
Write-Host "done."
Write-Host 'done.'
}
catch {
Write-Host "There was an error while trying to promote build '$BuildId' to channel '$ChannelId'"
Write-Host $_
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "There was an error while trying to promote build '$BuildId' to channel '$ChannelId'"
ExitWithExitCode 1
}
+21 -21
View File
@@ -34,9 +34,9 @@ $ValidatePackage = {
# Extensions for which we'll look for SourceLink information
# For now we'll only care about Portable & Embedded PDBs
$RelevantExtensions = @(".dll", ".exe", ".pdb")
$RelevantExtensions = @('.dll', '.exe', '.pdb')
Write-Host -NoNewLine "Validating" ([System.IO.Path]::GetFileName($PackagePath)) "... "
Write-Host -NoNewLine 'Validating ' ([System.IO.Path]::GetFileName($PackagePath)) '...'
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId
@@ -58,7 +58,7 @@ $ValidatePackage = {
$TargetFile = Join-Path -Path $ExtractPath -ChildPath $FakeName
# We ignore resource DLLs
if ($FileName.EndsWith(".resources.dll")) {
if ($FileName.EndsWith('.resources.dll')) {
return
}
@@ -96,7 +96,7 @@ $ValidatePackage = {
$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")) {
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 {
@@ -143,19 +143,19 @@ $ValidatePackage = {
}
if ($FailedFiles -eq 0) {
Write-Host "Passed."
Write-Host 'Passed.'
return 0
}
else {
Write-Host "$PackagePath has broken SourceLink links."
Write-PipelineTelemetryError -Category 'SourceLink' -Message "$PackagePath has broken SourceLink links."
return 1
}
}
function ValidateSourceLinkLinks {
if ($GHRepoName -ne "" -and !($GHRepoName -Match "^[^\s\/]+/[^\s\/]+$")) {
if (!($GHRepoName -Match "^[^\s-]+-[^\s]+$")) {
Write-PipelineTaskError "GHRepoName should be in the format <org>/<repo> or <org>-<repo>. '$GHRepoName'"
if ($GHRepoName -ne '' -and !($GHRepoName -Match '^[^\s\/]+/[^\s\/]+$')) {
if (!($GHRepoName -Match '^[^\s-]+-[^\s]+$')) {
Write-PipelineTelemetryError -Category 'SourceLink' -Message "GHRepoName should be in the format <org>/<repo> or <org>-<repo>. '$GHRepoName'"
ExitWithExitCode 1
}
else {
@@ -163,14 +163,14 @@ function ValidateSourceLinkLinks {
}
}
if ($GHCommit -ne "" -and !($GHCommit -Match "^[0-9a-fA-F]{40}$")) {
Write-PipelineTaskError "GHCommit should be a 40 chars hexadecimal string. '$GHCommit'"
if ($GHCommit -ne '' -and !($GHCommit -Match '^[0-9a-fA-F]{40}$')) {
Write-PipelineTelemetryError -Category 'SourceLink' -Message "GHCommit should be a 40 chars hexadecimal string. '$GHCommit'"
ExitWithExitCode 1
}
if ($GHRepoName -ne "" -and $GHCommit -ne "") {
$RepoTreeURL = -Join("http://api.github.com/repos/", $GHRepoName, "/git/trees/", $GHCommit, "?recursive=1")
$CodeExtensions = @(".cs", ".vb", ".fs", ".fsi", ".fsx", ".fsscript")
if ($GHRepoName -ne '' -and $GHCommit -ne '') {
$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
@@ -188,8 +188,8 @@ function ValidateSourceLinkLinks {
Write-Host "Problems downloading the list of files from the repo. Url used: $RepoTreeURL . Execution will proceed without caching."
}
}
elseif ($GHRepoName -ne "" -or $GHCommit -ne "") {
Write-Host "For using the http caching mechanism both GHRepoName and GHCommit should be informed."
elseif ($GHRepoName -ne '' -or $GHCommit -ne '') {
Write-Host 'For using the http caching mechanism both GHRepoName and GHCommit should be informed.'
}
if (Test-Path $ExtractPath) {
@@ -217,18 +217,18 @@ function ValidateSourceLinkLinks {
$ValidationFailures = 0
foreach ($Job in @(Get-Job)) {
$jobResult = Wait-Job -Id $Job.Id | Receive-Job
if ($jobResult -ne "0") {
if ($jobResult -ne '0') {
$ValidationFailures++
}
}
if ($ValidationFailures -gt 0) {
Write-PipelineTaskError " $ValidationFailures package(s) failed validation."
Write-PipelineTelemetryError -Category 'SourceLink' -Message "$ValidationFailures package(s) failed validation."
ExitWithExitCode 1
}
}
function InstallSourcelinkCli {
$sourcelinkCliPackageName = "sourcelink"
$sourcelinkCliPackageName = 'sourcelink'
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
@@ -239,7 +239,7 @@ function InstallSourcelinkCli {
}
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."
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
}
}
@@ -250,8 +250,8 @@ try {
ValidateSourceLinkLinks
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'SourceLink' -Message $_
ExitWithExitCode 1
}
+35 -36
View File
@@ -4,10 +4,6 @@ param(
[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
@@ -23,19 +19,19 @@ function FirstMatchingSymbolDescriptionOrDefault {
# checking and which type of file was uploaded.
# The file itself is returned
$SymbolPath = $SymbolsPath + "\" + $FileName
$SymbolPath = $SymbolsPath + '\' + $FileName
# PDB file for the module
$PdbPath = $SymbolPath.Replace($Extension, ".pdb")
$PdbPath = $SymbolPath.Replace($Extension, '.pdb')
# PDB file for R2R module (created by crossgen)
$NGenPdb = $SymbolPath.Replace($Extension, ".ni.pdb")
$NGenPdb = $SymbolPath.Replace($Extension, '.ni.pdb')
# DBG file for a .so library
$SODbg = $SymbolPath.Replace($Extension, ".so.dbg")
$SODbg = $SymbolPath.Replace($Extension, '.so.dbg')
# DWARF file for a .dylib
$DylibDwarf = $SymbolPath.Replace($Extension, ".dylib.dwarf")
$DylibDwarf = $SymbolPath.Replace($Extension, '.dylib.dwarf')
$dotnetSymbolExe = "$env:USERPROFILE\.dotnet\tools"
$dotnetSymbolExe = Resolve-Path "$dotnetSymbolExe\dotnet-symbol.exe"
@@ -43,19 +39,19 @@ function FirstMatchingSymbolDescriptionOrDefault {
& $dotnetSymbolExe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath | Out-Null
if (Test-Path $PdbPath) {
return "PDB"
return 'PDB'
}
elseif (Test-Path $NGenPdb) {
return "NGen PDB"
return 'NGen PDB'
}
elseif (Test-Path $SODbg) {
return "DBG for SO"
return 'DBG for SO'
}
elseif (Test-Path $DylibDwarf) {
return "Dwarf for Dylib"
return 'Dwarf for Dylib'
}
elseif (Test-Path $SymbolPath) {
return "Module"
return 'Module'
}
else {
return $null
@@ -74,7 +70,7 @@ function CountMissingSymbols {
}
# Extensions for which we'll look for symbols
$RelevantExtensions = @(".dll", ".exe", ".so", ".dylib")
$RelevantExtensions = @('.dll', '.exe', '.so', '.dylib')
# How many files are missing symbol information
$MissingSymbols = 0
@@ -82,38 +78,38 @@ function CountMissingSymbols {
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$PackageGuid = New-Guid
$ExtractPath = Join-Path -Path $ExtractPath -ChildPath $PackageGuid
$SymbolsPath = Join-Path -Path $ExtractPath -ChildPath "Symbols"
$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
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
$SymbolsOnMSDL = FirstMatchingSymbolDescriptionOrDefault $_.FullName '--microsoft-symbol-server' $SymbolsPath
$SymbolsOnSymWeb = FirstMatchingSymbolDescriptionOrDefault $_.FullName '--internal-server' $SymbolsPath
Write-Host -NoNewLine "`t Checking file" $_.FullName "... "
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 ")"
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!"
Write-Host 'No symbols found on MSDL or SymWeb!'
}
else {
if ($SymbolsOnMSDL -eq $null) {
Write-Host "No symbols found on MSDL!"
Write-Host 'No symbols found on MSDL!'
}
else {
Write-Host "No symbols found on SymWeb!"
Write-Host 'No symbols found on SymWeb!'
}
}
}
@@ -132,27 +128,27 @@ function CheckSymbolsAvailable {
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\.") {
if ($FileName -Match 'Microsoft\.DotNet\.Darc\.') {
Write-Host "Ignoring Arcade-services file: $FileName"
Write-Host
return
}
elseif ($FileName -Match "Microsoft\.DotNet\.Maestro\.Tasks\.") {
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-PipelineTelemetryError -Category 'CheckSymbols' -Message "Missing symbols for $Status modules in the package $FileName"
ExitWithExitCode $exitCode
}
Write-Host
@@ -160,7 +156,7 @@ function CheckSymbolsAvailable {
}
function InstallDotnetSymbol {
$dotnetSymbolPackageName = "dotnet-symbol"
$dotnetSymbolPackageName = 'dotnet-symbol'
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
@@ -171,19 +167,22 @@ function InstallDotnetSymbol {
}
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."
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 {
. $PSScriptRoot\post-build-utils.ps1
Add-Type -AssemblyName System.IO.Compression.FileSystem
InstallDotnetSymbol
CheckSymbolsAvailable
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'CheckSymbols' -Message $_
ExitWithExitCode 1
}
+50 -43
View File
@@ -2,56 +2,63 @@ 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"
[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 {
. $PSScriptRoot\post-build-utils.ps1
# Get all the $SourceRepo subscriptions
$normalizedSourceRepo = $SourceRepo.Replace('dnceng@', '')
$subscriptions = Get-MaestroSubscriptions -SourceRepository $normalizedSourceRepo -ChannelId $ChannelId
# 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
}
if (!$subscriptions) {
Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message "No subscriptions found for source repo '$normalizedSourceRepo' in channel '$ChannelId'"
ExitWithExitCode 0
}
$subscriptionsToTrigger = New-Object System.Collections.Generic.List[string]
$failedTriggeredSubscription = $false
$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)
# 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-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message 'At least one subscription failed to be triggered...'
ExitWithExitCode 1
}
else {
Write-Host 'All subscriptions were triggered successfully!'
}
}
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..."
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message $_
ExitWithExitCode 1
}
else {
Write-Host "All subscriptions were triggered successfully!"
}
+9 -10
View File
@@ -1,8 +1,8 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $configuration = "Debug",
[string] $configuration = 'Debug',
[string] $task,
[string] $verbosity = "minimal",
[string] $verbosity = 'minimal',
[string] $msbuildEngine = $null,
[switch] $restore,
[switch] $prepareMachine,
@@ -32,7 +32,7 @@ function Print-Usage() {
}
function Build([string]$target) {
$logSuffix = if ($target -eq "Execute") { "" } else { ".$target" }
$logSuffix = if ($target -eq 'Execute') { '' } else { ".$target" }
$log = Join-Path $LogDir "$task$logSuffix.binlog"
$outputPath = Join-Path $ToolsetDir "$task\\"
@@ -46,33 +46,32 @@ function Build([string]$target) {
}
try {
if ($help -or (($null -ne $properties) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) {
if ($help -or (($null -ne $properties) -and ($properties.Contains('/help') -or $properties.Contains('/?')))) {
Print-Usage
exit 0
}
if ($task -eq "") {
Write-Host "Missing required parameter '-task <value>'" -ForegroundColor Red
Write-PipelineTelemetryError -Category 'Build' -Message "Missing required parameter '-task <value>'" -ForegroundColor Red
Print-Usage
ExitWithExitCode 1
}
$taskProject = GetSdkTaskProject $task
if (!(Test-Path $taskProject)) {
Write-Host "Unknown task: $task" -ForegroundColor Red
Write-PipelineTelemetryError -Category 'Build' -Message "Unknown task: $task" -ForegroundColor Red
ExitWithExitCode 1
}
if ($restore) {
Build "Restore"
Build 'Restore'
}
Build "Execute"
Build 'Execute'
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Build' -Message $_
ExitWithExitCode 1
}
+79 -69
View File
@@ -5,7 +5,7 @@ Param(
[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_ARTIFACTSTAGINGDIRECTORY ("artifacts")), # Required: the directory where build artifacts are located
[string] $ArtifactsDirectory = (Join-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY ('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
@@ -22,79 +22,89 @@ Param(
[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] $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
try {
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 2.0
$disableConfigureToolsetImport = $true
$LASTEXITCODE = 0
#Replace repo names to the format of org/repo
if (!($Repository.contains('/'))) {
$RepoName = $Repository -replace '(.*?)-(.*)', '$1/$2';
. $PSScriptRoot\..\tools.ps1
#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
}
$workingDirectory = (Split-Path $SourceDirectory -Parent)
$ValidPath = Test-Path $guardianCliLocation
if ($ValidPath -eq $False)
{
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message 'Invalid Guardian CLI Location.'
ExitWithExitCode 1
}
& $(Join-Path $PSScriptRoot 'init-sdl.ps1') -GuardianCliLocation $guardianCliLocation -Repository $RepoName -BranchName $BranchName -WorkingDirectory $workingDirectory -AzureDevOpsAccessToken $AzureDevOpsAccessToken -GuardianLoggerLevel $GuardianLoggerLevel
$gdnFolder = Join-Path $workingDirectory '.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 $workingDirectory --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 $workingDirectory --logger-level $GuardianLoggerLevel
if ($LASTEXITCODE -ne 0) {
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Guardian tsa-onboard failed with exit code $LASTEXITCODE."
ExitWithExitCode $LASTEXITCODE
}
} else {
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message 'Could not onboard to TSA -- not all required values ($TsaCodebaseName, $TsaNotificationEmail, $TsaCodebaseAdmin, $TsaBugAreaPath) were specified.'
ExitWithExitCode 1
}
}
if ($ArtifactToolsList -and $ArtifactToolsList.Count -gt 0) {
& $(Join-Path $PSScriptRoot 'run-sdl.ps1') -GuardianCliLocation $guardianCliLocation -WorkingDirectory $workingDirectory -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 $workingDirectory -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 $workingDirectory --logger-level $GuardianLoggerLevel"
& $guardianCliLocation tsa-publish --all-tools --repository-name "$TsaRepositoryName" --branch-name "$TsaBranchName" --build-number "$BuildNumber" --onboard $True --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $workingDirectory --logger-level $GuardianLoggerLevel
if ($LASTEXITCODE -ne 0) {
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Guardian tsa-publish failed with exit code $LASTEXITCODE."
ExitWithExitCode $LASTEXITCODE
}
} else {
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message 'Could not publish to TSA -- not all required values ($TsaBranchName, $BuildNumber) were specified.'
ExitWithExitCode 1
}
}
}
else{
$RepoName = $Repository;
}
if ($GuardianPackageName) {
$guardianCliLocation = Join-Path $NugetPackageDirectory (Join-Path $GuardianPackageName (Join-Path "tools" "guardian.cmd"))
} else {
$guardianCliLocation = $GuardianCliLocation
}
$workingDirectory = (Split-Path $SourceDirectory -Parent)
$ValidPath = Test-Path $guardianCliLocation
if ($ValidPath -eq $False)
{
Write-Host "Invalid Guardian CLI Location."
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_
exit 1
}
& $(Join-Path $PSScriptRoot "init-sdl.ps1") -GuardianCliLocation $guardianCliLocation -Repository $RepoName -BranchName $BranchName -WorkingDirectory $workingDirectory -AzureDevOpsAccessToken $AzureDevOpsAccessToken -GuardianLoggerLevel $GuardianLoggerLevel
$gdnFolder = Join-Path $workingDirectory ".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 $workingDirectory --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 $workingDirectory --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 $workingDirectory -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 $workingDirectory -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 $workingDirectory --logger-level $GuardianLoggerLevel"
& $guardianCliLocation tsa-publish --all-tools --repository-name "$TsaRepositoryName" --branch-name "$TsaBranchName" --build-number "$BuildNumber" --onboard $True --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $workingDirectory --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
}
}
+46 -44
View File
@@ -3,55 +3,16 @@ param(
[Parameter(Mandatory=$true)][string] $ExtractPath # Full path to directory where the packages will be extracted
)
$ErrorActionPreference = "Stop"
$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
$disableConfigureToolsetImport = "true"
. $PSScriptRoot\..\tools.ps1
$disableConfigureToolsetImport = $true
$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 {
function ExtractArtifacts {
if (!(Test-Path $InputPath)) {
Write-Host "Input Path does not exist: $InputPath"
ExitWithExitCode 0
@@ -68,11 +29,52 @@ $ExtractPackage = {
}
try {
. $PSScriptRoot\..\tools.ps1
$ExtractPackage = {
param(
[string] $PackagePath # Full path to a NuGet package
)
if (!(Test-Path $PackagePath)) {
Write-PipelineTelemetryError -Category 'Build' -Message "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 {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_
ExitWithExitCode 1
}
finally {
$zip.Dispose()
}
}
Measure-Command { ExtractArtifacts }
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_
ExitWithExitCode 1
}
+25 -13
View File
@@ -1,16 +1,19 @@
Param(
[string] $GuardianCliLocation,
[string] $Repository,
[string] $BranchName="master",
[string] $BranchName='master',
[string] $WorkingDirectory,
[string] $AzureDevOpsAccessToken,
[string] $GuardianLoggerLevel="Standard"
[string] $GuardianLoggerLevel='Standard'
)
$ErrorActionPreference = "Stop"
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 2.0
$disableConfigureToolsetImport = $true
$LASTEXITCODE = 0
. $PSScriptRoot\..\tools.ps1
# Don't display the console progress UI - it's a huge perf hit
$ProgressPreference = 'SilentlyContinue'
@@ -21,11 +24,10 @@ $uri = "https://dev.azure.com/dnceng/internal/_apis/git/repositories/sdl-tool-cf
$zipFile = "$WorkingDirectory/gdn.zip"
Add-Type -AssemblyName System.IO.Compression.FileSystem
$gdnFolder = (Join-Path $WorkingDirectory ".gdn")
Try
{
$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..."
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)
@@ -33,19 +35,29 @@ Try
}
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipFile, $WorkingDirectory)
Write-Host $gdnFolder
} Catch [System.Net.WebException] {
ExitWithExitCode 0
} catch [System.Net.WebException] { } # Catch and ignore webexception
try {
# 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 '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."
Write-PipelineTelemetryError -Force -Category 'Build' -Message "Guardian init failed with exit code $LASTEXITCODE."
ExitWithExitCode $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."
Write-PipelineTelemetryError -Force -Category 'Build' -Message "Guardian baseline failed with exit code $LASTEXITCODE."
ExitWithExitCode $LASTEXITCODE
}
& $(Join-Path $PSScriptRoot "push-gdn.ps1") -Repository $Repository -BranchName $BranchName -GdnFolder $gdnFolder -AzureDevOpsAccessToken $AzureDevOpsAccessToken -PushReason "Initialize gdn folder"
}
& $(Join-Path $PSScriptRoot 'push-gdn.ps1') -Repository $Repository -BranchName $BranchName -GdnFolder $gdnFolder -AzureDevOpsAccessToken $AzureDevOpsAccessToken -PushReason 'Initialize gdn folder'
ExitWithExitCode 0
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Sdl' -Message $_
ExitWithExitCode 1
}
+53 -39
View File
@@ -1,51 +1,65 @@
Param(
[string] $Repository,
[string] $BranchName="master",
[string] $BranchName='master',
[string] $GdnFolder,
[string] $AzureDevOpsAccessToken,
[string] $PushReason
)
$ErrorActionPreference = "Stop"
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 2.0
$disableConfigureToolsetImport = $true
$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
}
try {
. $PSScriptRoot\..\tools.ps1
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."
}
# 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
}
# Return to the original directory
Pop-Location
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-PipelineTelemetryError -Force -Category 'Sdl' -Message "Git clone failed with exit code $LASTEXITCODE."
ExitWithExitCode $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-PipelineTelemetryError -Force -Category 'Sdl' -Message "Git add failed with exit code $LASTEXITCODE."
ExitWithExitCode $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-PipelineTelemetryError -Force -Category 'Sdl' -Message "Git commit failed with exit code $LASTEXITCODE."
ExitWithExitCode $LASTEXITCODE
}
Write-Host 'git push'
git push
if ($LASTEXITCODE -ne 0) {
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Git push failed with exit code $LASTEXITCODE."
ExitWithExitCode $LASTEXITCODE
}
# Return to the original directory
Pop-Location
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Sdl' -Message $_
ExitWithExitCode 1
}
+49 -39
View File
@@ -5,55 +5,65 @@ Param(
[string] $GdnFolder,
[string[]] $ToolsList,
[string] $UpdateBaseline,
[string] $GuardianLoggerLevel="Standard",
[string] $GuardianLoggerLevel='Standard',
[string[]] $CrScanAdditionalRunConfigParams,
[string[]] $PoliCheckAdditionalRunConfigParams
)
$ErrorActionPreference = "Stop"
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 2.0
$disableConfigureToolsetImport = $true
$LASTEXITCODE = 0
# We store config files in the r directory of .gdn
Write-Host $ToolsList
$gdnConfigPath = Join-Path $GdnFolder "r"
$ValidPath = Test-Path $GuardianCliLocation
try {
. $PSScriptRoot\..\tools.ps1
if ($ValidPath -eq $False)
{
Write-Host "Invalid Guardian CLI Location."
exit 1
}
# We store config files in the r directory of .gdn
Write-Host $ToolsList
$gdnConfigPath = Join-Path $GdnFolder 'r'
$ValidPath = Test-Path $GuardianCliLocation
$configParam = @("--config")
foreach ($tool in $ToolsList) {
$gdnConfigFile = Join-Path $gdnConfigPath "$tool-configure.gdnconfig"
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 `" `" OutputType < pre `" $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams})"
& $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " TargetDirectory < $TargetDirectory " "OutputType < pre" $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams})
if ($LASTEXITCODE -ne 0) {
Write-Host "Guardian configure for $tool failed with exit code $LASTEXITCODE."
exit $LASTEXITCODE
}
}
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
}
if ($ValidPath -eq $False)
{
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location."
ExitWithExitCode 1
}
$configParam+=$gdnConfigFile
}
$configParam = @('--config')
Write-Host "$GuardianCliLocation run --working-directory $WorkingDirectory --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel $configParam"
& $GuardianCliLocation run --working-directory $WorkingDirectory --tool $tool --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel $configParam
if ($LASTEXITCODE -ne 0) {
Write-Host "Guardian run for $ToolsList using $configParam failed with exit code $LASTEXITCODE."
exit $LASTEXITCODE
foreach ($tool in $ToolsList) {
$gdnConfigFile = Join-Path $gdnConfigPath "$tool-configure.gdnconfig"
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 `" `" OutputType < pre `" $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams})"
& $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " TargetDirectory < $TargetDirectory " "OutputType < pre" $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams})
if ($LASTEXITCODE -ne 0) {
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Guardian configure for $tool failed with exit code $LASTEXITCODE."
ExitWithExitCode $LASTEXITCODE
}
}
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-PipelineTelemetryError -Force -Category 'Sdl' -Message "Guardian configure for $tool failed with exit code $LASTEXITCODE."
ExitWithExitCode $LASTEXITCODE
}
}
$configParam+=$gdnConfigFile
}
Write-Host "$GuardianCliLocation run --working-directory $WorkingDirectory --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel $configParam"
& $GuardianCliLocation run --working-directory $WorkingDirectory --tool $tool --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel $configParam
if ($LASTEXITCODE -ne 0) {
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Guardian run for $ToolsList using $configParam failed with exit code $LASTEXITCODE."
ExitWithExitCode $LASTEXITCODE
}
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'Sdl' -Message $_
ExitWithExitCode 1
}
@@ -97,7 +97,6 @@ stages:
buildType: current
artifactName: BlobArtifacts
continueOnError: true
- task: DownloadBuildArtifacts@0
displayName: Download Asset Manifests
inputs:
@@ -71,7 +71,6 @@ stages:
StageLabel: '${{ parameters.stageName }}'
JobLabel: 'SymbolPublishing'
- job: publish_assets
displayName: Publish Assets
dependsOn: setupMaestroVars
@@ -4,7 +4,7 @@ variables:
- group: DotNet-DotNetCli-Storage
- group: DotNet-MSRC-Storage
- group: Publish-Build-Assets
# .NET Core 3.1 Dev
- name: PublicDevRelease_31_Channel_Id
value: 128
@@ -13,19 +13,19 @@ variables:
- name: NetCore_5_Dev_Channel_Id
value: 131
# .NET Tools - Validation
- name: NetCore_Tools_Validation_Channel_Id
# .NET Eng - Validation
- name: Net_Eng_Validation_Channel_Id
value: 9
# .NET Tools - Latest
- name: NetCore_Tools_Latest_Channel_Id
# .NET Eng - Latest
- name: Net_Eng_Latest_Channel_Id
value: 2
# .NET 3 Tools - Validation
- name: NETCore_3_Tools_Validation_Channel_Id
# .NET 3 Eng - Validation
- name: NET_3_Eng_Validation_Channel_Id
value: 390
# .NET 3 Tools - Latest
# .NET 3 Eng
- name: NetCore_3_Tools_Channel_Id
value: 344
@@ -49,6 +49,10 @@ variables:
- name: NetCore_31_Blazor_Features_Channel_Id
value: 531
# .NET Core Experimental
- name: NetCore_Experimental_Channel_Id
value: 562
# Whether the build is internal or not
- name: IsInternalBuild
value: ${{ and(ne(variables['System.TeamProject'], 'public'), contains(variables['Build.SourceBranch'], 'internal')) }}
+30 -95
View File
@@ -137,21 +137,8 @@ stages:
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NetCore_Dev31_Publish'
channelName: '.NET Core 3.1 Dev'
channelId: 128
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NetCore_Tools_Latest_Publish'
channelName: '.NET Tools - Latest'
stageName: 'Net_Eng_Latest_Publish'
channelName: '.NET Eng - Latest'
channelId: 2
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
@@ -163,91 +150,13 @@ stages:
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'PVR_Publish'
channelName: '.NET Tools - Validation'
stageName: 'Net_Eng_Validation_Publish'
channelName: '.NET Eng - Validation'
channelId: 9
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NetCore_3_Tools_Validation_Publish'
channelName: '.NET 3 Tools - Validation'
channelId: 390
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NetCore_3_Tools_Publish'
channelName: '.NET 3 Tools'
channelId: 344
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NetCore_Release30_Publish'
channelName: '.NET Core 3.0 Release'
channelId: 19
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NetCore_Release31_Publish'
channelName: '.NET Core 3.1 Release'
channelId: 129
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NetCore_Blazor31_Features_Publish'
channelName: '.NET Core 3.1 Blazor Features'
channelId: 531
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-blazor/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-blazor/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-blazor-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-internal-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NetCore_30_Internal_Servicing_Publishing'
channelName: '.NET Core 3.0 Internal Servicing'
channelId: 184
transportFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
@@ -286,3 +195,29 @@ stages:
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-internal-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NET_Internal_Tooling_Publishing'
channelName: '.NET Internal Tooling'
channelId: 551
transportFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NETCore_Experimental_Publishing'
channelName: '.NET Core Experimental'
channelId: 562
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental-symbols/nuget/v3/index.json'
+77 -71
View File
@@ -5,7 +5,7 @@
[bool]$ci = if (Test-Path variable:ci) { $ci } else { $false }
# Build configuration. Common values include 'Debug' and 'Release', but the repository may use other names.
[string]$configuration = if (Test-Path variable:configuration) { $configuration } else { "Debug" }
[string]$configuration = if (Test-Path variable:configuration) { $configuration } else { 'Debug' }
# Set to true to output binary log from msbuild. Note that emitting binary log slows down the build.
# Binary log must be enabled on CI.
@@ -24,7 +24,7 @@
[bool]$restore = if (Test-Path variable:restore) { $restore } else { $true }
# Adjusts msbuild verbosity level.
[string]$verbosity = if (Test-Path variable:verbosity) { $verbosity } else { "minimal" }
[string]$verbosity = if (Test-Path variable:verbosity) { $verbosity } else { 'minimal' }
# Set to true to reuse msbuild nodes. Recommended to not reuse on CI.
[bool]$nodeReuse = if (Test-Path variable:nodeReuse) { $nodeReuse } else { !$ci }
@@ -41,23 +41,23 @@
# Enable repos to use a particular version of the on-line dotnet-install scripts.
# default URL: https://dot.net/v1/dotnet-install.ps1
[string]$dotnetInstallScriptVersion = if (Test-Path variable:dotnetInstallScriptVersion) { $dotnetInstallScriptVersion } else { "v1" }
[string]$dotnetInstallScriptVersion = if (Test-Path variable:dotnetInstallScriptVersion) { $dotnetInstallScriptVersion } else { 'v1' }
# True to use global NuGet cache instead of restoring packages to repository-local directory.
[bool]$useGlobalNuGetCache = if (Test-Path variable:useGlobalNuGetCache) { $useGlobalNuGetCache } else { !$ci }
# An array of names of processes to stop on script exit if prepareMachine is true.
$processesToStopOnExit = if (Test-Path variable:processesToStopOnExit) { $processesToStopOnExit } else { @("msbuild", "dotnet", "vbcscompiler") }
$processesToStopOnExit = if (Test-Path variable:processesToStopOnExit) { $processesToStopOnExit } else { @('msbuild', 'dotnet', 'vbcscompiler') }
$disableConfigureToolsetImport = if (Test-Path variable:disableConfigureToolsetImport) { $disableConfigureToolsetImport } else { $null }
set-strictmode -version 2.0
$ErrorActionPreference = "Stop"
$ErrorActionPreference = 'Stop'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
function Create-Directory([string[]] $path) {
if (!(Test-Path $path)) {
New-Item -path $path -force -itemType "Directory" | Out-Null
New-Item -path $path -force -itemType 'Directory' | Out-Null
}
}
@@ -121,7 +121,7 @@ function InitializeDotNetCli([bool]$install) {
# Find the first path on %PATH% that contains the dotnet.exe
if ($useInstalledDotNetCli -and (-not $globalJsonHasRuntimes) -and ($env:DOTNET_INSTALL_DIR -eq $null)) {
$dotnetCmd = Get-Command "dotnet.exe" -ErrorAction SilentlyContinue
$dotnetCmd = Get-Command 'dotnet.exe' -ErrorAction SilentlyContinue
if ($dotnetCmd -ne $null) {
$env:DOTNET_INSTALL_DIR = Split-Path $dotnetCmd.Path -Parent
}
@@ -134,13 +134,13 @@ function InitializeDotNetCli([bool]$install) {
if ((-not $globalJsonHasRuntimes) -and ($env:DOTNET_INSTALL_DIR -ne $null) -and (Test-Path(Join-Path $env:DOTNET_INSTALL_DIR "sdk\$dotnetSdkVersion"))) {
$dotnetRoot = $env:DOTNET_INSTALL_DIR
} else {
$dotnetRoot = Join-Path $RepoRoot ".dotnet"
$dotnetRoot = Join-Path $RepoRoot '.dotnet'
if (-not (Test-Path(Join-Path $dotnetRoot "sdk\$dotnetSdkVersion"))) {
if ($install) {
InstallDotNetSdk $dotnetRoot $dotnetSdkVersion
} else {
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Unable to find dotnet with SDK version '$dotnetSdkVersion'"
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Unable to find dotnet with SDK version '$dotnetSdkVersion'"
ExitWithExitCode 1
}
}
@@ -163,7 +163,7 @@ function InitializeDotNetCli([bool]$install) {
}
function GetDotNetInstallScript([string] $dotnetRoot) {
$installScript = Join-Path $dotnetRoot "dotnet-install.ps1"
$installScript = Join-Path $dotnetRoot 'dotnet-install.ps1'
if (!(Test-Path $installScript)) {
Create-Directory $dotnetRoot
$ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit
@@ -173,17 +173,17 @@ function GetDotNetInstallScript([string] $dotnetRoot) {
return $installScript
}
function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $architecture = "") {
function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $architecture = '') {
InstallDotNet $dotnetRoot $version $architecture
}
function InstallDotNet([string] $dotnetRoot,
[string] $version,
[string] $architecture = "",
[string] $runtime = "",
[string] $architecture = '',
[string] $runtime = '',
[bool] $skipNonVersionedFiles = $false,
[string] $runtimeSourceFeed = "",
[string] $runtimeSourceFeedKey = "") {
[string] $runtimeSourceFeed = '',
[string] $runtimeSourceFeedKey = '') {
$installScript = GetDotNetInstallScript $dotnetRoot
$installParameters = @{
@@ -199,7 +199,7 @@ function InstallDotNet([string] $dotnetRoot,
& $installScript @installParameters
}
catch {
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Failed to install dotnet runtime '$runtime' from public location."
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Failed to install dotnet runtime '$runtime' from public location."
# Only the runtime can be installed from a custom [private] location.
if ($runtime -and ($runtimeSourceFeed -or $runtimeSourceFeedKey)) {
@@ -215,7 +215,7 @@ function InstallDotNet([string] $dotnetRoot,
& $installScript @installParameters
}
catch {
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Failed to install dotnet runtime '$runtime' from custom location '$runtimeSourceFeed'."
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Failed to install dotnet runtime '$runtime' from custom location '$runtimeSourceFeed'."
}
}
}
@@ -238,16 +238,16 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
}
if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs }
$vsMinVersionStr = if ($vsRequirements.version) { $vsRequirements.version } else { "15.9" }
$vsMinVersionStr = if ($vsRequirements.version) { $vsRequirements.version } else { '15.9' }
$vsMinVersion = [Version]::new($vsMinVersionStr)
# Try msbuild command available in the environment.
if ($env:VSINSTALLDIR -ne $null) {
$msbuildCmd = Get-Command "msbuild.exe" -ErrorAction SilentlyContinue
$msbuildCmd = Get-Command 'msbuild.exe' -ErrorAction SilentlyContinue
if ($msbuildCmd -ne $null) {
# Workaround for https://github.com/dotnet/roslyn/issues/35793
# Due to this issue $msbuildCmd.Version returns 0.0.0.0 for msbuild.exe 16.2+
$msbuildVersion = [Version]::new((Get-Item $msbuildCmd.Path).VersionInfo.ProductVersion.Split(@('-', '+'))[0])
$msbuildVersion = [Version]::new((Get-Item $msbuildCmd.Path).VersionInfo.ProductVersion.Split([char[]]@('-', '+'))[0])
if ($msbuildVersion -ge $vsMinVersion) {
return $global:_MSBuildExe = $msbuildCmd.Path
@@ -267,7 +267,7 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
InitializeVisualStudioEnvironmentVariables $vsInstallDir $vsMajorVersion
} else {
if (Get-Member -InputObject $GlobalJson.tools -Name "xcopy-msbuild") {
if (Get-Member -InputObject $GlobalJson.tools -Name 'xcopy-msbuild') {
$xcopyMSBuildVersion = $GlobalJson.tools.'xcopy-msbuild'
$vsMajorVersion = $xcopyMSBuildVersion.Split('.')[0]
} else {
@@ -277,7 +277,7 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
$vsInstallDir = InitializeXCopyMSBuild $xcopyMSBuildVersion $install
if ($vsInstallDir -eq $null) {
throw "Unable to find Visual Studio that has required version and components installed"
throw 'Unable to find Visual Studio that has required version and components installed'
}
}
@@ -301,7 +301,7 @@ function InstallXCopyMSBuild([string]$packageVersion) {
}
function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) {
$packageName = "RoslynTools.MSBuild"
$packageName = 'RoslynTools.MSBuild'
$packageDir = Join-Path $ToolsDir "msbuild\$packageVersion"
$packagePath = Join-Path $packageDir "$packageName.$packageVersion.nupkg"
@@ -317,7 +317,7 @@ function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) {
Unzip $packagePath $packageDir
}
return Join-Path $packageDir "tools"
return Join-Path $packageDir 'tools'
}
#
@@ -334,32 +334,32 @@ function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) {
# or $null if no instance meeting the requirements is found on the machine.
#
function LocateVisualStudio([object]$vsRequirements = $null){
if (Get-Member -InputObject $GlobalJson.tools -Name "vswhere") {
if (Get-Member -InputObject $GlobalJson.tools -Name 'vswhere') {
$vswhereVersion = $GlobalJson.tools.vswhere
} else {
$vswhereVersion = "2.5.2"
$vswhereVersion = '2.5.2'
}
$vsWhereDir = Join-Path $ToolsDir "vswhere\$vswhereVersion"
$vsWhereExe = Join-Path $vsWhereDir "vswhere.exe"
$vsWhereExe = Join-Path $vsWhereDir 'vswhere.exe'
if (!(Test-Path $vsWhereExe)) {
Create-Directory $vsWhereDir
Write-Host "Downloading vswhere"
Write-Host 'Downloading vswhere'
Invoke-WebRequest "https://github.com/Microsoft/vswhere/releases/download/$vswhereVersion/vswhere.exe" -OutFile $vswhereExe
}
if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs }
$args = @("-latest", "-prerelease", "-format", "json", "-requires", "Microsoft.Component.MSBuild", "-products", "*")
$args = @('-latest', '-prerelease', '-format', 'json', '-requires', 'Microsoft.Component.MSBuild', '-products', '*')
if (Get-Member -InputObject $vsRequirements -Name "version") {
$args += "-version"
if (Get-Member -InputObject $vsRequirements -Name 'version') {
$args += '-version'
$args += $vsRequirements.version
}
if (Get-Member -InputObject $vsRequirements -Name "components") {
if (Get-Member -InputObject $vsRequirements -Name 'components') {
foreach ($component in $vsRequirements.components) {
$args += "-requires"
$args += '-requires'
$args += $component
}
}
@@ -385,27 +385,27 @@ function InitializeBuildTool() {
# Initialize dotnet cli if listed in 'tools'
$dotnetRoot = $null
if (Get-Member -InputObject $GlobalJson.tools -Name "dotnet") {
if (Get-Member -InputObject $GlobalJson.tools -Name 'dotnet') {
$dotnetRoot = InitializeDotNetCli -install:$restore
}
if ($msbuildEngine -eq "dotnet") {
if ($msbuildEngine -eq 'dotnet') {
if (!$dotnetRoot) {
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "/global.json must specify 'tools.dotnet'."
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "/global.json must specify 'tools.dotnet'."
ExitWithExitCode 1
}
$buildTool = @{ Path = Join-Path $dotnetRoot "dotnet.exe"; Command = "msbuild"; Tool = "dotnet"; Framework = "netcoreapp2.1" }
$buildTool = @{ Path = Join-Path $dotnetRoot 'dotnet.exe'; Command = 'msbuild'; Tool = 'dotnet'; Framework = 'netcoreapp2.1' }
} elseif ($msbuildEngine -eq "vs") {
try {
$msbuildPath = InitializeVisualStudioMSBuild -install:$restore
} catch {
Write-PipelineTelemetryError -Category "InitializeToolset" -Message $_
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
ExitWithExitCode 1
}
$buildTool = @{ Path = $msbuildPath; Command = ""; Tool = "vs"; Framework = "net472" }
} else {
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Unexpected value of -msbuildEngine: '$msbuildEngine'."
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Unexpected value of -msbuildEngine: '$msbuildEngine'."
ExitWithExitCode 1
}
@@ -414,15 +414,15 @@ function InitializeBuildTool() {
function GetDefaultMSBuildEngine() {
# Presence of tools.vs indicates the repo needs to build using VS msbuild on Windows.
if (Get-Member -InputObject $GlobalJson.tools -Name "vs") {
return "vs"
if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') {
return 'vs'
}
if (Get-Member -InputObject $GlobalJson.tools -Name "dotnet") {
return "dotnet"
if (Get-Member -InputObject $GlobalJson.tools -Name 'dotnet') {
return 'dotnet'
}
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'."
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'."
ExitWithExitCode 1
}
@@ -431,9 +431,9 @@ function GetNuGetPackageCachePath() {
# Use local cache on CI to ensure deterministic build,
# use global cache in dev builds to avoid cost of downloading packages.
if ($useGlobalNuGetCache) {
$env:NUGET_PACKAGES = Join-Path $env:UserProfile ".nuget\packages"
$env:NUGET_PACKAGES = Join-Path $env:UserProfile '.nuget\packages'
} else {
$env:NUGET_PACKAGES = Join-Path $RepoRoot ".packages"
$env:NUGET_PACKAGES = Join-Path $RepoRoot '.packages'
}
}
@@ -475,14 +475,14 @@ function InitializeToolset() {
}
if (-not $restore) {
Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Toolset version $toolsetVersion has not been restored."
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Toolset version $toolsetVersion has not been restored."
ExitWithExitCode 1
}
$buildTool = InitializeBuildTool
$proj = Join-Path $ToolsetDir "restore.proj"
$bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "ToolsetRestore.binlog") } else { "" }
$proj = Join-Path $ToolsetDir 'restore.proj'
$bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'ToolsetRestore.binlog') } else { '' }
'<Project Sdk="Microsoft.DotNet.Arcade.Sdk"/>' | Set-Content $proj
@@ -504,7 +504,7 @@ function ExitWithExitCode([int] $exitCode) {
}
function Stop-Processes() {
Write-Host "Killing running build processes..."
Write-Host 'Killing running build processes...'
foreach ($processName in $processesToStopOnExit) {
Get-Process -Name $processName -ErrorAction SilentlyContinue | Stop-Process
}
@@ -521,7 +521,7 @@ function MSBuild() {
# Work around issues with Azure Artifacts credential provider
# https://github.com/dotnet/arcade/issues/3932
if ($ci -and $buildTool.Tool -eq "dotnet") {
if ($ci -and $buildTool.Tool -eq 'dotnet') {
dotnet nuget locals http-cache -c
$env:NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS = 20
@@ -532,7 +532,7 @@ function MSBuild() {
$toolsetBuildProject = InitializeToolset
$path = Split-Path -parent $toolsetBuildProject
$path = Join-Path $path (Join-Path $buildTool.Framework "Microsoft.DotNet.Arcade.Sdk.dll")
$path = Join-Path $path (Join-Path $buildTool.Framework 'Microsoft.DotNet.Arcade.Sdk.dll')
$args += "/logger:$path"
}
@@ -547,12 +547,12 @@ function MSBuild() {
function MSBuild-Core() {
if ($ci) {
if (!$binaryLog) {
Write-PipelineTaskError -Message "Binary log must be enabled in CI build."
Write-PipelineTelemetryError -Category 'Build' -Message 'Binary log must be enabled in CI build.'
ExitWithExitCode 1
}
if ($nodeReuse) {
Write-PipelineTaskError -Message "Node reuse must be disabled in CI build."
Write-PipelineTelemetryError -Category 'Build' -Message 'Node reuse must be disabled in CI build.'
ExitWithExitCode 1
}
}
@@ -562,10 +562,10 @@ function MSBuild-Core() {
$cmdArgs = "$($buildTool.Command) /m /nologo /clp:Summary /v:$verbosity /nr:$nodeReuse /p:ContinuousIntegrationBuild=$ci"
if ($warnAsError) {
$cmdArgs += " /warnaserror /p:TreatWarningsAsErrors=true"
$cmdArgs += ' /warnaserror /p:TreatWarningsAsErrors=true'
}
else {
$cmdArgs += " /p:TreatWarningsAsErrors=false"
$cmdArgs += ' /p:TreatWarningsAsErrors=false'
}
foreach ($arg in $args) {
@@ -577,7 +577,7 @@ function MSBuild-Core() {
$exitCode = Exec-Process $buildTool.Path $cmdArgs
if ($exitCode -ne 0) {
Write-PipelineTaskError -Message "Build failed."
Write-PipelineTelemetryError Category 'Build' -Message 'Build failed.'
$buildLog = GetMSBuildBinaryLogCommandLineArgument $args
if ($buildLog -ne $null) {
@@ -592,12 +592,12 @@ 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('/bl:', "OrdinalIgnoreCase")) {
return $arg.Substring('/bl:'.Length)
}
if ($arg.StartsWith("/binaryLogger:", "OrdinalIgnoreCase")) {
return $arg.Substring("/binaryLogger:".Length)
if ($arg.StartsWith('/binaryLogger:', 'OrdinalIgnoreCase')) {
return $arg.Substring('/binaryLogger:'.Length)
}
}
}
@@ -607,14 +607,14 @@ function GetMSBuildBinaryLogCommandLineArgument($arguments) {
. $PSScriptRoot\pipeline-logging-functions.ps1
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..\..")
$EngRoot = Resolve-Path (Join-Path $PSScriptRoot "..")
$ArtifactsDir = Join-Path $RepoRoot "artifacts"
$ToolsetDir = Join-Path $ArtifactsDir "toolset"
$ToolsDir = Join-Path $RepoRoot ".tools"
$LogDir = Join-Path (Join-Path $ArtifactsDir "log") $configuration
$TempDir = Join-Path (Join-Path $ArtifactsDir "tmp") $configuration
$GlobalJson = Get-Content -Raw -Path (Join-Path $RepoRoot "global.json") | ConvertFrom-Json
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..')
$EngRoot = Resolve-Path (Join-Path $PSScriptRoot '..')
$ArtifactsDir = Join-Path $RepoRoot 'artifacts'
$ToolsetDir = Join-Path $ArtifactsDir 'toolset'
$ToolsDir = Join-Path $RepoRoot '.tools'
$LogDir = Join-Path (Join-Path $ArtifactsDir 'log') $configuration
$TempDir = Join-Path (Join-Path $ArtifactsDir 'tmp') $configuration
$GlobalJson = Get-Content -Raw -Path (Join-Path $RepoRoot 'global.json') | ConvertFrom-Json
# true if global.json contains a "runtimes" section
$globalJsonHasRuntimes = if ($GlobalJson.tools.PSObject.Properties.Name -Match 'runtimes') { $true } else { $false }
@@ -631,8 +631,14 @@ Write-PipelineSetVariable -Name 'TMP' -Value $TempDir
# Import custom tools configuration, if present in the repo.
# Note: Import in global scope so that the script set top-level variables without qualification.
if (!$disableConfigureToolsetImport) {
$configureToolsetScript = Join-Path $EngRoot "configure-toolset.ps1"
$configureToolsetScript = Join-Path $EngRoot 'configure-toolset.ps1'
if (Test-Path $configureToolsetScript) {
. $configureToolsetScript
. $configureToolsetScript
if ((Test-Path variable:failOnConfigureToolsetError) -And $failOnConfigureToolsetError) {
if ((Test-Path variable:LastExitCode) -And ($LastExitCode -ne 0)) {
Write-PipelineTelemetryError -Category 'Build' -Message 'configure-toolset.ps1 returned a non-zero exit code'
ExitWithExitCode $LastExitCode
}
}
}
}
+6 -7
View File
@@ -4,7 +4,6 @@
# CI mode - set to true on CI server for PR validation build or official build.
ci=${ci:-false}
disable_configure_toolset_import=${disable_configure_toolset_import:-}
# Set to true to use the pipelines logger which will enable Azure logging output.
# https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md
@@ -82,7 +81,7 @@ function ReadGlobalVersion {
local pattern="\"$key\" *: *\"(.*)\""
if [[ ! $line =~ $pattern ]]; then
Write-PipelineTelemetryError -category 'InitializeToolset' "Error: Cannot find \"$key\" in $global_json_file"
Write-PipelineTelemetryError -category 'Build' "Error: Cannot find \"$key\" in $global_json_file"
ExitWithExitCode 1
fi
@@ -325,7 +324,7 @@ function InitializeToolset {
local toolset_build_proj=`cat "$toolset_location_file"`
if [[ ! -a "$toolset_build_proj" ]]; then
Write-PipelineTelemetryError -category 'InitializeToolset' "Invalid toolset path: $toolset_build_proj"
Write-PipelineTelemetryError -category 'Build' "Invalid toolset path: $toolset_build_proj"
ExitWithExitCode 3
fi
@@ -375,12 +374,12 @@ function MSBuild {
function MSBuild-Core {
if [[ "$ci" == true ]]; then
if [[ "$binary_log" != true ]]; then
Write-PipelineTaskError "Binary log must be enabled in CI build."
Write-PipelineTelemetryError -category 'Build' "Binary log must be enabled in CI build."
ExitWithExitCode 1
fi
if [[ "$node_reuse" == true ]]; then
Write-PipelineTaskError "Node reuse must be disabled in CI build."
Write-PipelineTelemetryError -category 'Build' "Node reuse must be disabled in CI build."
ExitWithExitCode 1
fi
fi
@@ -394,7 +393,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=$?
Write-PipelineTaskError "Build failed (exit code '$exit_code')."
Write-PipelineTelemetryError -category 'Build' "Build failed (exit code '$exit_code')."
ExitWithExitCode $exit_code
}
}
@@ -437,7 +436,7 @@ Write-PipelineSetVariable -name "Temp" -value "$temp_dir"
Write-PipelineSetVariable -name "TMP" -value "$temp_dir"
# Import custom tools configuration, if present in the repo.
if [[ -z "$disable_configure_toolset_import" ]]; then
if [ -z "${disable_configure_toolset_import:-}" ]; then
configure_toolset_script="$eng_root/configure-toolset.sh"
if [[ -a "$configure_toolset_script" ]]; then
. "$configure_toolset_script"
+1 -1
+1 -1
+2 -2
View File
@@ -3,7 +3,7 @@
"dotnet": "5.0.100-alpha1-014854"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.19567.2",
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.19567.2"
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.19608.1",
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.19608.1"
}
}
+102
View File
@@ -0,0 +1,102 @@
# Usage:
# AC_MONO_OUTPUT()
#
# Generates the output files used by Mono.
#
AC_DEFUN([AC_MONO_OUTPUT], [
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_OUTPUT([
Makefile
llvm/Makefile
mono/Makefile
mono/btls/Makefile
mono/native/Makefile
mono/utils/Makefile
mono/metadata/Makefile
mono/zlib/Makefile
mono/dis/Makefile
mono/cil/Makefile
mono/arch/Makefile
mono/arch/x86/Makefile
mono/arch/amd64/Makefile
mono/arch/ppc/Makefile
mono/arch/sparc/Makefile
mono/arch/s390x/Makefile
mono/arch/arm/Makefile
mono/arch/arm64/Makefile
mono/arch/mips/Makefile
mono/arch/riscv/Makefile
mono/sgen/Makefile
mono/native/platform-type.c
mono/native/platform-type-compat.c
mono/native/platform-type-unified.c
mono/tests/Makefile
mono/tests/assembly-load-reference/Makefile
mono/tests/tests-config
mono/tests/gc-descriptors/Makefile
mono/tests/testing_gac/Makefile
mono/tests/fullaot-mixed/Makefile
mono/tests/llvmonly-mixed/Makefile
mono/unit-tests/Makefile
mono/benchmark/Makefile
mono/mini/Makefile
mono/profiler/Makefile
mono/eglib/Makefile
mono/eglib/eglib-config.h
mono/eglib/test/Makefile
m4/Makefile
msvc/Makefile
mono/utils/jemalloc/Makefile
mono-uninstalled.pc
acceptance-tests/Makefile
scripts/mono-find-provides
scripts/mono-find-requires
ikvm-native/Makefile
scripts/Makefile
man/Makefile
docs/Makefile
data/Makefile
data/net_2_0/Makefile
data/net_4_0/Makefile
data/net_4_5/Makefile
data/net_2_0/Browsers/Makefile
data/net_4_0/Browsers/Makefile
data/net_4_5/Browsers/Makefile
data/mint.pc
data/mono-2.pc
data/monosgen-2.pc
data/mono.pc
data/mono-cairo.pc
data/mono-options.pc
data/mono-lineeditor.pc
data/monodoc.pc
data/dotnet.pc
data/dotnet35.pc
data/wcf.pc
data/cecil.pc
data/system.web.extensions_1.0.pc
data/system.web.extensions.design_1.0.pc
data/system.web.mvc.pc
data/system.web.mvc2.pc
data/system.web.mvc3.pc
data/aspnetwebstack.pc
data/reactive.pc
samples/Makefile
support/Makefile
data/config
tools/Makefile
tools/locale-builder/Makefile
tools/sgen/Makefile
tools/pedump/Makefile
tools/mono-hang-watchdog/Makefile
runtime/Makefile
po/Makefile
netcore/corerun/Makefile
])
])
@@ -43,33 +43,16 @@ namespace Mono.Messaging.RabbitMQ {
public class RabbitMQMessagingProvider : IMessagingProvider {
private int txCounter = 0;
private readonly uint localIp;
private readonly Guid localId;
private readonly MessagingContextPool contextPool;
public RabbitMQMessagingProvider ()
{
localIp = GetLocalIP ();
localId = Guid.NewGuid ();
contextPool = new MessagingContextPool (new MessageFactory (this),
CreateConnection);
}
private static uint GetLocalIP ()
{
String strHostName = Dns.GetHostName ();
IPHostEntry ipEntry = Dns.GetHostByName (strHostName);
foreach (IPAddress ip in ipEntry.AddressList) {
if (AddressFamily.InterNetwork == ip.AddressFamily) {
byte[] addr = ip.GetAddressBytes ();
uint localIP = 0;
for (int i = 0; i < 4 && i < addr.Length; i++) {
localIP += (uint) (addr[i] << 8 * (3 - i));
}
return localIP;
}
}
return 0;
}
public IMessage CreateMessage ()
{
return new MessageBase ();
@@ -78,7 +61,7 @@ namespace Mono.Messaging.RabbitMQ {
public IMessageQueueTransaction CreateMessageQueueTransaction ()
{
Interlocked.Increment (ref txCounter);
string txId = localIp.ToString () + txCounter.ToString ();
string txId = localId.ToString () + "_" + txCounter.ToString ();
return new RabbitMQMessageQueueTransaction (txId, contextPool);
}
@@ -86,8 +86,8 @@ namespace Mono.Security {
Buffer.BlockCopy (data, (2 + nLenLength), m_aValue, 0, nLength);
if ((m_nTag & 0x20) == 0x20) {
int nStart = (2 + nLenLength);
Decode (data, ref nStart, data.Length);
int nStart = 0;
Decode (m_aValue, ref nStart, m_aValue.Length);
}
}
@@ -312,7 +312,7 @@ namespace Mono.Security {
public override string ToString()
{
StringBuilder hexLine = new StringBuilder ();
// Add tag
hexLine.AppendFormat ("Tag: {0} {1}", m_nTag.ToString ("X2"), Environment.NewLine);
@@ -78,8 +78,8 @@ namespace System.Net.Http
}
public bool UseProxy {
get => throw new PlatformNotSupportedException ("Property AutomaticDecompression is not supported.");
set => throw new PlatformNotSupportedException ("Property AutomaticDecompression is not supported.");
get => throw new PlatformNotSupportedException ("Property UseProxy is not supported.");
set => throw new PlatformNotSupportedException ("Property UseProxy is not supported.");
}
public IWebProxy Proxy {
@@ -132,7 +132,7 @@ namespace System.Net.Http
set => throw new PlatformNotSupportedException ("Property MaxRequestContentBufferSize is not supported.");
}
public IDictionary<string, object> Properties => throw new PlatformNotSupportedException ();
public IDictionary<string, object> Properties => throw new PlatformNotSupportedException ("Property Properties is not supported.");
public static Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> DangerousAcceptAnyServerCertificateValidator { get; } = delegate { return true; };
@@ -30,7 +30,10 @@ namespace MonoTests.Remoting
{
try
{
tcp = new TcpChannel (0);
Hashtable tcpOptions = new Hashtable ();
tcpOptions ["port"] = 0;
tcpOptions ["bindTo"] = "127.0.0.1";
tcp = new TcpChannel (tcpOptions, null, null);
Hashtable options = new Hashtable ();
options ["timeout"] = 10000; // 10s
@@ -42,8 +45,8 @@ namespace MonoTests.Remoting
AppDomain domain = BaseCallTest.CreateDomain ("testdomain_activation");
server = (ActivationServer) domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName,"MonoTests.Remoting.ActivationServer");
var tcpUrlPrefix = $"tcp://localhost:{server.TcpPort}";
var httpUrlPrefix = $"http://localhost:{server.HttpPort}";
var tcpUrlPrefix = $"tcp://127.0.0.1:{server.TcpPort}";
var httpUrlPrefix = $"http://127.0.0.1:{server.HttpPort}";
RemotingConfiguration.RegisterActivatedClientType (typeof(CaObject1), tcpUrlPrefix);
RemotingConfiguration.RegisterActivatedClientType (typeof(CaObject2), httpUrlPrefix);
RemotingConfiguration.RegisterWellKnownClientType (typeof(WkObjectSinglecall1), tcpUrlPrefix + "/wkoSingleCall1");
@@ -169,8 +172,14 @@ namespace MonoTests.Remoting
{
TcpPort = NetworkHelpers.FindFreePort ();
HttpPort = NetworkHelpers.FindFreePort ();
tcp = new TcpChannel (TcpPort);
http = new HttpChannel (HttpPort);
IDictionary tcpProps = new Hashtable ();
IDictionary httpProps = new Hashtable ();
tcpProps ["port"] = TcpPort;
tcpProps ["bindTo"] = "127.0.0.1";
httpProps ["port"] = HttpPort;
httpProps ["bindTo"] = "127.0.0.1";
tcp = new TcpChannel (tcpProps, null, null);
http = new HttpChannel (httpProps, null, null);
ChannelServices.RegisterChannel (tcp);
ChannelServices.RegisterChannel (http);
@@ -172,6 +172,7 @@ namespace MonoTests.Remoting
IDictionary props = new Hashtable ();
props ["name"] = Guid.NewGuid ().ToString("N");
props ["port"] = port;
props ["bindTo"] = "127.0.0.1";
TcpChannel chan = new TcpChannel (props, null, null);
ChannelServices.RegisterChannel (chan);
@@ -20,11 +20,15 @@ namespace MonoTests.Remoting.Http
[Ignore ("This test somehow keeps http channel registered and then blocks any further http tests working. This also happens under .NET, so this test itself is wrong with nunit 2.4.8.")]
public void Test ()
{
new HttpChannel (8086);
var port = NetworkHelpers.FindFreePort ();
Hashtable props = new Hashtable ();
props["port"] = port;
props["bindTo"] = "127.0.0.1";
new HttpChannel (props, null, null);
RemotingServices.Marshal (new Service (), "test");
Service remObj = (Service) RemotingServices.Connect (
typeof (Service), "http://localhost:8086/test");
typeof (Service), $"http://127.0.0.1:{port}/test");
ArrayList list;
remObj.Test (out list);
@@ -70,13 +74,16 @@ namespace MonoTests.Remoting.Http
public void Main ()
{
var port = NetworkHelpers.FindFreePort ();
channel = new HttpChannel (port);
Hashtable props = new Hashtable ();
props["port"] = port;
props["bindTo"] = "127.0.0.1";
channel = new HttpChannel (props, null, null);
ChannelServices.RegisterChannel (channel);
RemotingConfiguration.RegisterWellKnownServiceType
(typeof (Bug321420),"Server.soap", WellKnownObjectMode.Singleton);
Bug321420 s = (Bug321420) Activator.GetObject (typeof
(Bug321420), $"http://localhost:{port}/Server.soap");
(Bug321420), $"http://127.0.0.1:{port}/Server.soap");
// this works: s.Method ("a", "b");
s.Method ("a", "a");
@@ -101,7 +108,7 @@ namespace MonoTests.Remoting.Http
public void Main ()
{
Foo foo = (Foo) Activator.GetObject (typeof (Foo),
$"http://localhost:{server.HttpPort}/Test");
$"http://127.0.0.1:{server.HttpPort}/Test");
Bar bar = foo.Login ();
if (bar != null)
@@ -146,7 +153,10 @@ namespace MonoTests.Remoting.Http
public void Start ()
{
HttpPort = NetworkHelpers.FindFreePort ();
c = new HttpChannel (HttpPort);
Hashtable props = new Hashtable ();
props["port"] = HttpPort;
props["bindTo"] = "127.0.0.1";
c = new HttpChannel (props, null, null);
ChannelServices.RegisterChannel (c);
Type t = typeof(Foo);
@@ -174,11 +184,14 @@ namespace MonoTests.Remoting.Http
[Test]
public void Main ()
{
channel = new HttpChannel (0);
Hashtable props = new Hashtable ();
props["port"] = 0;
props["bindTo"] = "127.0.0.1";
channel = new HttpChannel (props, null, null);
ChannelServices.RegisterChannel (channel);
MarshalByRefObject obj = (MarshalByRefObject) RemotingServices.Connect (
typeof (IFactorial),
$"http://localhost:{server.HttpPort}/MyEndPoint");
$"http://127.0.0.1:{server.HttpPort}/MyEndPoint");
IFactorial cal = (IFactorial) obj;
Assert.AreEqual (cal.CalculateFactorial (4), 24);
}
@@ -216,7 +229,10 @@ namespace MonoTests.Remoting.Http
public void Start ()
{
HttpPort = NetworkHelpers.FindFreePort ();
c = new HttpChannel (HttpPort);
Hashtable props = new Hashtable ();
props["port"] = HttpPort;
props["bindTo"] = "127.0.0.1";
c = new HttpChannel (props, null, null);
ChannelServices.RegisterChannel (c);
Type t = typeof(Calculator);
@@ -294,6 +294,7 @@ namespace MonoTests.Remoting
IDictionary props = new Hashtable ();
props ["name"] = objMarshal.Uri;
props ["port"] = port;
props ["bindTo"] = "127.0.0.1";
TcpChannel chn = new TcpChannel (props, null, null);
ChannelServices.RegisterChannel (chn);
@@ -317,6 +318,7 @@ namespace MonoTests.Remoting
IDictionary props = new Hashtable ();
props ["name"] = objMarshal.Uri;
props ["port"] = port;
props ["bindTo"] = "127.0.0.1";
TcpChannel chn = new TcpChannel (props, null, null);
ChannelServices.RegisterChannel (chn);
@@ -346,7 +348,10 @@ namespace MonoTests.Remoting
public void ExecuteMessage ()
{
var port = NetworkHelpers.FindFreePort ();
TcpChannel chn = new TcpChannel (port);
IDictionary props = new Hashtable ();
props ["port"] = port;
props ["bindTo"] = "127.0.0.1";
TcpChannel chn = new TcpChannel (props, null, null);
ChannelServices.RegisterChannel (chn);
try {
MarshalObject objMarshal = NewMarshalObject ();
@@ -379,7 +384,10 @@ namespace MonoTests.Remoting
public void IsOneWay ()
{
var port = NetworkHelpers.FindFreePort ();
TcpChannel chn = new TcpChannel (port);
IDictionary props = new Hashtable ();
props ["port"] = port;
props ["bindTo"] = "127.0.0.1";
TcpChannel chn = new TcpChannel (props, null, null);
ChannelServices.RegisterChannel (chn);
try {
RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "MarshalObject.rem", WellKnownObjectMode.Singleton);
@@ -403,7 +411,10 @@ namespace MonoTests.Remoting
public void GetObjRefForProxy ()
{
var port = NetworkHelpers.FindFreePort ();
TcpChannel chn = new TcpChannel (port);
IDictionary props = new Hashtable ();
props ["port"] = port;
props ["bindTo"] = "127.0.0.1";
TcpChannel chn = new TcpChannel (props, null, null);
ChannelServices.RegisterChannel (chn);
try {
// Register le factory as a SAO
@@ -427,7 +438,10 @@ namespace MonoTests.Remoting
public void GetRealProxy ()
{
var port = NetworkHelpers.FindFreePort ();
TcpChannel chn = new TcpChannel (port);
IDictionary props = new Hashtable ();
props ["port"] = port;
props ["bindTo"] = "127.0.0.1";
TcpChannel chn = new TcpChannel (props, null, null);
ChannelServices.RegisterChannel (chn);
try {
RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "MonoTests.System.Runtime.Remoting.RemotingServicesTest.MarshalObject.soap", WellKnownObjectMode.Singleton);
@@ -449,7 +463,10 @@ namespace MonoTests.Remoting
public void SetObjectUriForMarshal ()
{
var port = NetworkHelpers.FindFreePort ();
TcpChannel chn = new TcpChannel (port);
IDictionary props = new Hashtable ();
props ["port"] = port;
props ["bindTo"] = "127.0.0.1";
TcpChannel chn = new TcpChannel (props, null, null);
ChannelServices.RegisterChannel (chn);
try {
MarshalObject objRem = NewMarshalObject ();
@@ -469,7 +486,10 @@ namespace MonoTests.Remoting
public void GetServeurTypeForUri ()
{
var port = NetworkHelpers.FindFreePort ();
TcpChannel chn = new TcpChannel (port);
IDictionary props = new Hashtable ();
props ["port"] = port;
props ["bindTo"] = "127.0.0.1";
TcpChannel chn = new TcpChannel (props, null, null);
Type type = typeof (MarshalObject);
ChannelServices.RegisterChannel (chn);
try {
@@ -491,7 +511,10 @@ namespace MonoTests.Remoting
public void IsObjectOutOf ()
{
var port = NetworkHelpers.FindFreePort ();
TcpChannel chn = new TcpChannel (port);
IDictionary props = new Hashtable ();
props ["port"] = port;
props ["bindTo"] = "127.0.0.1";
TcpChannel chn = new TcpChannel (props, null, null);
ChannelServices.RegisterChannel (chn);
try {
RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "MarshalObject2.rem", WellKnownObjectMode.Singleton);
@@ -514,7 +537,10 @@ namespace MonoTests.Remoting
{
var port = NetworkHelpers.FindFreePort ();
RemotingConfiguration.ApplicationName = "app";
TcpChannel chn = new TcpChannel (port);
IDictionary props = new Hashtable ();
props ["port"] = port;
props ["bindTo"] = "127.0.0.1";
TcpChannel chn = new TcpChannel (props, null, null);
ChannelServices.RegisterChannel (chn);
try {
RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "obj3.rem", WellKnownObjectMode.Singleton);
@@ -541,7 +567,10 @@ namespace MonoTests.Remoting
public void GetObjectWithChannelDataTest ()
{
var port = NetworkHelpers.FindFreePort ();
TcpChannel chn = new TcpChannel (port);
IDictionary props = new Hashtable ();
props ["port"] = port;
props ["bindTo"] = "127.0.0.1";
TcpChannel chn = new TcpChannel (props, null, null);
ChannelServices.RegisterChannel (chn);
try {
RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "getobjectwithchanneldata.rem", WellKnownObjectMode.Singleton);
@@ -7,6 +7,7 @@
//
using System;
using System.Collections;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
@@ -55,12 +56,18 @@ namespace MonoTests.Remoting
{
public override IChannelSender CreateClientChannel ()
{
return new TcpChannel (0);
Hashtable props = new Hashtable ();
props["port"] = 0;
props["bindTo"] = "127.0.0.1";
return new TcpChannel (props, null, null);
}
public override IChannelReceiver CreateServerChannel ()
{
return new TcpChannel (0);
Hashtable props = new Hashtable ();
props["port"] = 0;
props["bindTo"] = "127.0.0.1";
return new TcpChannel (props, null, null);
}
}
}
@@ -92,14 +92,16 @@ namespace System.Windows.Forms {
#region Protected Methods
protected override void OnClick (EventArgs e)
{
if (dialog_result != DialogResult.None) {
Form p = FindForm ();
if (p != null)
Form p = FindForm ();
if (p != null) {
p.dialog_result_changed = false; // manages the case where the DialogResult of the form is overriden in the button click event.
base.OnClick (e);
if (dialog_result != DialogResult.None && !p.dialog_result_changed) {
p.DialogResult = dialog_result;
}
} else {
base.OnClick (e);
}
base.OnClick (e);
}
protected override void OnFontChanged (EventArgs e)
@@ -1695,7 +1695,7 @@ namespace System.Windows.Forms
}
}
void SetSelectedIndex (int value, bool supressAutoScroll)
void SetSelectedIndex (int value, bool supressAutoScroll, bool triggerEvents = true)
{
if (selected_index == value)
return;
@@ -1718,9 +1718,11 @@ namespace System.Windows.Forms
if (listbox_ctrl != null)
listbox_ctrl.HighlightedIndex = value;
OnSelectedValueChanged (EventArgs.Empty);
OnSelectedIndexChanged (EventArgs.Empty);
OnSelectedItemChanged (EventArgs.Empty);
if (triggerEvents) {
OnSelectedValueChanged (EventArgs.Empty);
OnSelectedIndexChanged (EventArgs.Empty);
OnSelectedItemChanged (EventArgs.Empty);
}
}
// If no item is currently selected, and an item is found matching the text
@@ -2134,9 +2136,7 @@ namespace System.Windows.Forms
throw new ArgumentOutOfRangeException ("index");
if (index < owner.SelectedIndex)
--owner.SelectedIndex;
else if (index == owner.SelectedIndex)
owner.SelectedIndex = -1;
owner.SetSelectedIndex (owner.SelectedIndex - 1, false, false);
object removed = object_items [index];
@@ -2589,6 +2589,16 @@ namespace System.Windows.Forms
if (!pea.Handled)
OnPaint (pea);
}
// Call DrawToBitmap for all children of the control
for (int i=0; i < child_controls.Count; i++) {
Rectangle childRect = child_controls[i].ClientRectangle;
Bitmap childBitmap = new Bitmap (childRect.Width, childRect.Height);
child_controls[i].DrawToBitmap (childBitmap, childRect);
g.DrawImage (childBitmap, new Rectangle (child_controls[i].Location, child_controls[i].Size));
}
}
}
@@ -5367,6 +5377,12 @@ namespace System.Windows.Forms
}
private void WmMButtonUp (ref Message m) {
// Menu handle.
if (XplatUI.IsEnabled (Handle) && active_tracker != null) {
ProcessActiveTracker (ref m);
return;
}
MouseEventArgs me;
me = new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()) | MouseButtons.Middle,
@@ -5385,6 +5401,12 @@ namespace System.Windows.Forms
}
private void WmMButtonDown (ref Message m) {
// Menu handle.
if (XplatUI.IsEnabled (Handle) && active_tracker != null) {
ProcessActiveTracker (ref m);
return;
}
InternalCapture = true;
OnMouseDown (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()),
mouse_clicks, LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()),
@@ -108,6 +108,7 @@ namespace System.Windows.Forms {
cell.defaultNewRowValue = this.defaultNewRowValue;
cell.description = this.description;
cell.valueIsIcon = this.valueIsIcon;
cell.imageLayout = this.imageLayout;
return cell;
}
@@ -56,6 +56,7 @@ namespace System.Windows.Forms
clone.linkBehavior = this.linkBehavior;
clone.visited_link_color = this.visited_link_color;
clone.trackVisitedState = this.trackVisitedState;
clone.useColumnTextForLinkValue = this.useColumnTextForLinkValue;
return clone;
}
@@ -77,7 +77,8 @@ namespace System.Windows.Forms
throw new InvalidOperationException ("CellTemplate is null when getting this property.");
template.ActiveLinkColor = value;
if (DataGridView == null)
return;
foreach (DataGridViewRow row in DataGridView.Rows) {
DataGridViewLinkCell cell = row.Cells[Index] as DataGridViewLinkCell;
if (cell != null)
@@ -113,6 +114,8 @@ namespace System.Windows.Forms
throw new InvalidOperationException ("CellTemplate is null when getting this property.");
template.LinkBehavior = value;
if (DataGridView == null)
return;
foreach (DataGridViewRow row in DataGridView.Rows)
{
DataGridViewLinkCell cell = row.Cells[Index] as DataGridViewLinkCell;
@@ -137,6 +140,8 @@ namespace System.Windows.Forms
if (template == null)
throw new InvalidOperationException ("CellTemplate is null when getting this property.");
template.LinkColor = value;
if (DataGridView == null)
return;
foreach (DataGridViewRow row in DataGridView.Rows)
{
DataGridViewLinkCell cell = row.Cells[Index] as DataGridViewLinkCell;
@@ -150,20 +155,20 @@ namespace System.Windows.Forms
[DefaultValue ((string) null)]
public string Text {
get {
DataGridViewLinkCell template = CellTemplate as DataGridViewLinkCell;
if (template == null)
throw new InvalidOperationException ("CellTemplate is null when getting this property.");
return text;
}
set {
if (this.Text == value)
return;
DataGridViewLinkCell template = CellTemplate as DataGridViewLinkCell;
if (template == null)
throw new InvalidOperationException ("CellTemplate is null when getting this property.");
//TODO : sets the Text property of every cell in the column
//TODO only if UseColumnTextForLinkValue is true
text = value;
if (DataGridView == null)
return;
foreach (DataGridViewRow row in DataGridView.Rows)
{
DataGridViewLinkCell cell = row.Cells[Index] as DataGridViewLinkCell;
if (cell != null && cell.UseColumnTextForLinkValue)
cell.Value = value;
}
DataGridView.InvalidateColumn (Index);
}
}
@@ -184,6 +189,8 @@ namespace System.Windows.Forms
if (template == null)
throw new InvalidOperationException ("CellTemplate is null when getting this property.");
template.TrackVisitedState = value;
if (DataGridView == null)
return;
foreach (DataGridViewRow row in DataGridView.Rows)
{
DataGridViewLinkCell cell = row.Cells[Index] as DataGridViewLinkCell;
@@ -210,6 +217,8 @@ namespace System.Windows.Forms
if (template == null)
throw new InvalidOperationException ("CellTemplate is null when getting this property.");
template.UseColumnTextForLinkValue = value;
if (DataGridView == null)
return;
foreach (DataGridViewRow row in DataGridView.Rows)
{
DataGridViewLinkCell cell = row.Cells[Index] as DataGridViewLinkCell;
@@ -235,6 +244,8 @@ namespace System.Windows.Forms
if (template == null)
throw new InvalidOperationException ("CellTemplate is null when getting this property.");
template.VisitedLinkColor = value;
if (DataGridView == null)
return;
foreach (DataGridViewRow row in DataGridView.Rows)
{
DataGridViewLinkCell cell = row.Cells[Index] as DataGridViewLinkCell;
@@ -356,6 +356,7 @@ namespace System.Windows.Forms
{
DataGridViewRow row = (DataGridViewRow)MemberwiseClone ();
row.DefaultCellStyle = (DataGridViewCellStyle)DefaultCellStyle.Clone ();
row.HeaderCell = (DataGridViewRowHeaderCell)HeaderCell.Clone ();
row.SetIndex (-1);
@@ -102,6 +102,7 @@ namespace System.Windows.Forms {
private bool autoscale_base_size_set;
internal ArrayList disabled_by_showdialog = new ArrayList();
internal static ArrayList modal_dialogs = new ArrayList();
internal bool dialog_result_changed;
#endregion // Local Variables
#region Private & Internal Methods
@@ -637,6 +638,7 @@ namespace System.Windows.Forms {
typeof (DialogResult));
dialog_result = value;
dialog_result_changed = true;
if (dialog_result != DialogResult.None && is_modal)
RaiseCloseEvents (false, false); // .Net doesn't send WM_CLOSE here.
}
@@ -26,7 +26,9 @@
// NOT COMPLETE
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.InteropServices;
namespace System.Windows.Forms {
public sealed class InputLanguage {
@@ -37,6 +39,15 @@ namespace System.Windows.Forms {
private static InputLanguage current_input;
private static InputLanguage default_input;
#region user32.dll functions
[DllImport("user32", CharSet = CharSet.Auto)]
private static extern IntPtr GetKeyboardLayout(UInt32 idThread);
[DllImport("user32", CharSet = CharSet.Auto)]
private static extern Int32 GetKeyboardLayoutList(Int32 nBuff, IntPtr[] lpList);
#endregion // user32.dll functions
#region Private Constructor
[MonoInternalNote ("Pull Microsofts InputLanguages and enter them here")]
internal InputLanguage()
@@ -75,9 +86,23 @@ namespace System.Windows.Forms {
public static InputLanguageCollection InstalledInputLanguages {
get {
if (all == null)
all = new InputLanguageCollection (new InputLanguage[] { new InputLanguage (IntPtr.Zero, new CultureInfo(string.Empty), "US") });
if (all == null) {
List<InputLanguage> inputLanguageList = new List<InputLanguage>();
if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
var keyboardLayoutCount = GetKeyboardLayoutList (0, null);
var keyboardLayoutIds = new IntPtr[keyboardLayoutCount];
GetKeyboardLayoutList (keyboardLayoutCount, keyboardLayoutIds);
foreach (var keyboardLayoutId in keyboardLayoutIds) {
var languageId = (Int32)keyboardLayoutId & 0xFFFF;
CultureInfo cultureInfo = CultureInfo.GetCultureInfo (languageId);
inputLanguageList.Add (new InputLanguage (IntPtr.Zero, cultureInfo, cultureInfo.Name));
}
}
if (inputLanguageList.Count == 0)
inputLanguageList.Add (new InputLanguage (IntPtr.Zero, new CultureInfo(string.Empty), "US"));
all = new InputLanguageCollection (inputLanguageList.ToArray());
}
return all;
}
}
@@ -566,11 +566,13 @@ namespace System.Windows.Forms
internal void OnExpandItem (GridEntry item)
{
property_grid_view.ExpandItem (item);
OnExpandedItemChanged (EventArgs.Empty);
}
internal void OnCollapseItem (GridEntry item)
{
property_grid_view.CollapseItem (item);
OnExpandedItemChanged (EventArgs.Empty);
}
internal DialogResult ShowError (string text)
@@ -1081,7 +1083,7 @@ namespace System.Windows.Forms
if (eh != null)
eh (this, e);
}
protected virtual void OnPropertyTabChanged (PropertyTabChangedEventArgs e)
{
PropertyTabChangedEventHandler eh = (PropertyTabChangedEventHandler)(Events [PropertyTabChangedEvent]);
@@ -1119,6 +1121,13 @@ namespace System.Windows.Forms
base.OnVisibleChanged (e);
}
protected void OnExpandedItemChanged (EventArgs e)
{
EventHandler eh = (EventHandler)(Events [ExpandedItemChangedEvent]);
if (eh != null)
eh (this, e);
}
protected override bool ProcessDialogKey (Keys keyData) {
return base.ProcessDialogKey (keyData);
}
@@ -1140,6 +1149,7 @@ namespace System.Windows.Forms
static object PropertyValueChangedEvent = new object ();
static object SelectedGridItemChangedEvent = new object ();
static object SelectedObjectsChangedEvent = new object ();
static object ExpandedItemChangedEvent = new object ();
public event EventHandler PropertySortChanged {
add { Events.AddHandler (PropertySortChangedEvent, value); }
@@ -1165,6 +1175,12 @@ namespace System.Windows.Forms
add { Events.AddHandler (SelectedObjectsChangedEvent, value); }
remove { Events.RemoveHandler (SelectedObjectsChangedEvent, value); }
}
// UIA Framework Note: Used to track changes of expanded state of grid items
internal event EventHandler ExpandedItemChanged {
add { Events.AddHandler (ExpandedItemChangedEvent, value); }
remove { Events.RemoveHandler (ExpandedItemChangedEvent, value); }
}
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
@@ -326,8 +326,6 @@ namespace System.Windows.Forms {
if (!Checked) {
Checked = true;
}
} else {
Checked = !Checked;
}
base.OnClick (e);
@@ -837,10 +837,10 @@ namespace System.Windows.Forms {
*/
if (!vscrollbar.Visible) {
vscrollbar.Value = 0;
vscrollbar.Value = vscrollbar.Minimum;
}
if (!hscrollbar.Visible) {
hscrollbar.Value = 0;
hscrollbar.Value = hscrollbar.Minimum;
}
/* Manually setting the size of the thumb should be done before
@@ -1715,31 +1715,32 @@ namespace System.Windows.Forms {
public override void Remove (Control value)
{
bool change_index = false;
bool invalid_selected_index = false;
TabPage page = value as TabPage;
int next_selected_index = -1;
if (page != null && owner.Controls.Contains (page)) {
int index = owner.IndexForTabPage (page);
if (index < owner.SelectedIndex || owner.SelectedIndex == Count - 1)
change_index = true;
if (owner.SelectedIndex < index || owner.SelectedIndex == 0)
next_selected_index = owner.SelectedIndex;
else
next_selected_index = owner.SelectedIndex - 1;
owner.selected_index = -1; // Invalidate internal selected Index
invalid_selected_index = true;
}
base.Remove (value);
// We don't want to raise SelectedIndexChanged until after we
// have removed from the collection, so TabCount will be
// correct for the user.
if (change_index && Count > 0) {
// Clear the selected index internally, to avoid trying to access the previous
// selected tab when setting the new one - this is what .net seems to do
int prev_selected_index = owner.SelectedIndex;
owner.selected_index = -1;
owner.SelectedIndex = --prev_selected_index;
owner.Invalidate ();
} else if (change_index) {
owner.selected_index = -1;
owner.OnSelectedIndexChanged (EventArgs.Empty);
if (invalid_selected_index) {
if (Count > 0)
owner.SelectedIndex = next_selected_index;
else // Count == 0
owner.OnSelectedIndexChanged (EventArgs.Empty);
owner.Invalidate ();
} else
owner.Redraw ();
@@ -284,8 +284,8 @@ namespace System.Windows.Forms
{
if (control == null)
throw new ArgumentNullException ();
if (value < -1)
throw new ArgumentException ();
if (value < 1)
throw new ArgumentOutOfRangeException ();
column_spans[control] = value;
@@ -310,8 +310,8 @@ namespace System.Windows.Forms
{
if (control == null)
throw new ArgumentNullException ();
if (value < -1)
throw new ArgumentException ();
if (value < 1)
throw new ArgumentOutOfRangeException ();
row_spans[control] = value;
@@ -191,7 +191,7 @@ namespace System.Windows.Forms
protected Color defaultWindowBackColor;
protected Color defaultWindowForeColor;
internal SystemResPool ResPool = new SystemResPool ();
private MethodInfo update;
private int[] knownColorTable;
protected Theme ()
{
@@ -199,13 +199,23 @@ namespace System.Windows.Forms
private void SetSystemColors (KnownColor kc, Color value)
{
if (update == null) {
Type known_colors = Type.GetType ("System.Drawing.KnownColors, " + Consts.AssemblySystem_Drawing);
if (known_colors != null)
update = known_colors.GetMethod ("Update", BindingFlags.Static | BindingFlags.Public);
if (knownColorTable == null) {
Type knownColorTableClass = Type.GetType ("System.Drawing.KnownColorTable, " + Consts.AssemblySystem_Drawing);
if (knownColorTableClass != null)
{
MethodInfo ensureMethod = knownColorTableClass.GetMethod ("EnsureColorTable", BindingFlags.Static | BindingFlags.NonPublic);
if (ensureMethod != null) {
ensureMethod.Invoke(null, new object[]{});
FieldInfo colorTableField = knownColorTableClass.GetField ("s_colorTable", BindingFlags.Static | BindingFlags.NonPublic);
if (colorTableField != null) {
knownColorTable = colorTableField.GetValue (null) as int[];
}
}
}
}
if (knownColorTable != null) {
knownColorTable[(int)kc] = value.ToArgb();
}
if (update != null)
update.Invoke (null, new object [2] { (int)kc, value.ToArgb () });
}
/* OS Feature support */
@@ -732,6 +732,22 @@ namespace MonoTests.System.Windows.Forms
Assert.IsTrue (cmbbox.ItemHeight > 0, "#21");
}
[Test]
public void RemoveAt_SelectedIndex ()
{
ComboBox cmbbox = new ComboBox ();
cmbbox.Items.AddRange (new object[] {"1", "2", "3"});
cmbbox.SelectedIndex = 0;
cmbbox.Items.RemoveAt (0);
Assert.AreEqual (0, cmbbox.SelectedIndex, "#A1");
cmbbox.Items.Clear ();
cmbbox.Items.AddRange (new object[] {"1", "2", "3"});
cmbbox.SelectedIndex = 2;
cmbbox.Items.RemoveAt (0);
Assert.AreEqual (1, cmbbox.SelectedIndex, "#A2");
}
//
// Exceptions
//
@@ -90,6 +90,10 @@ using System.Runtime.InteropServices;
[assembly: InternalsVisibleTo ("Mono.Android, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
#endif
#if WASM
[assembly: InternalsVisibleTo ("WebAssembly.Net.WebSockets, PublicKey=00240000048000009400000006020000002400005253413100040000010001004b86c4cb78549b34bab61a3b1800e23bfeb5b3ec390074041536a7e3cbd97f5f04cf0f857155a8928eaa29ebfd11cfbbad3ba70efea7bda3226c6a8d370a4cd303f714486b6ebc225985a638471e6ef571cc92a4613c00b8fa65d61ccee0cbe5f36330c9a01f4183559f1bef24cc2917c6d913e3a541333a1d05d9bed22b38cb")]
#endif
[assembly: TypeForwardedTo (typeof (System.Collections.Generic.Stack<>))]
[assembly: TypeForwardedTo (typeof (System.Collections.Generic.Queue<>))]
[assembly: TypeForwardedTo (typeof (System.IO.Enumeration.FileSystemName))]
+4
View File
@@ -116,6 +116,10 @@ API_BIN_REFS += System.Configuration
LIB_MCS_FLAGS += -d:CONFIGURATION_DEP
endif
ifeq (wasm,$(PROFILE))
API_BIN_REFS += WebAssembly.Net.WebSockets
endif
EXTRA_DISTFILES = \
Test/test-config-file \
Test/System.Security.Cryptography.X509Certificates/pkits/Makefile \
@@ -0,0 +1,108 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net.Security;
using System.Net.Sockets;
using System.Runtime.ExceptionServices;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net.WebSockets
{
internal sealed class WebSocketHandle
{
private WebSocketState _state = WebSocketState.Connecting;
private WebAssembly.Net.WebSockets.ClientWebSocket _webSocket;
public static WebSocketHandle Create() => new WebSocketHandle();
public static bool IsValid(WebSocketHandle handle) => handle != null;
public WebSocketCloseStatus? CloseStatus => _webSocket?.CloseStatus;
public string CloseStatusDescription => _webSocket?.CloseStatusDescription;
public WebSocketState State => _webSocket?.State ?? _state;
public string SubProtocol => _webSocket?.SubProtocol;
public static void CheckPlatformSupport() { /* nop */ }
public void Dispose()
{
_state = WebSocketState.Closed;
_webSocket?.Dispose();
}
public void Abort()
{
_webSocket?.Abort();
}
public Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) =>
_webSocket.SendAsync(buffer, messageType, endOfMessage, cancellationToken);
public ValueTask SendAsync(ReadOnlyMemory<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) =>
_webSocket.SendAsync(buffer, messageType, endOfMessage, cancellationToken);
public Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byte> buffer, CancellationToken cancellationToken) =>
_webSocket.ReceiveAsync(buffer, cancellationToken);
public ValueTask<ValueWebSocketReceiveResult> ReceiveAsync(Memory<byte> buffer, CancellationToken cancellationToken) =>
_webSocket.ReceiveAsync(buffer, cancellationToken);
public Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) =>
_webSocket.CloseAsync(closeStatus, statusDescription, cancellationToken);
public Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) =>
_webSocket.CloseOutputAsync(closeStatus, statusDescription, cancellationToken);
public async Task ConnectAsyncCore(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options)
{
// TODO #14480 : Not currently implemented, or explicitly ignored:
// - ClientWebSocketOptions.UseDefaultCredentials
// - ClientWebSocketOptions.Credentials
// - ClientWebSocketOptions.Proxy
// - ClientWebSocketOptions._sendBufferSize
// throw new PlatformNotSupportedException ();
// Establish connection to the server
CancellationTokenRegistration registration = cancellationToken.Register(s => ((WebSocketHandle)s).Abort(), this);
try
{
_webSocket = new WebAssembly.Net.WebSockets.ClientWebSocket ();//(options);
foreach (var t in options.RequestedSubProtocols) {
_webSocket.Options.AddSubProtocol (t);
}
await _webSocket.ConnectAsync (uri, cancellationToken);
}
catch (Exception exc)
{
if (_state < WebSocketState.Closed)
{
_state = WebSocketState.Closed;
}
Abort();
if (exc is WebSocketException)
{
throw;
}
throw new WebSocketException(SR.net_webstatus_ConnectFailure, exc);
}
finally
{
registration.Dispose();
}
}
}
}
+21 -1
View File
@@ -461,7 +461,6 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.WebClient\src\System\Net\WebClient.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\ClientWebSocket.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\ClientWebSocketOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.WebSocketProtocol\src\System\Net\WebSockets\ManagedWebSocket.netstandard.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets\src\System\Net\WebSockets\ValueWebSocketReceiveResult.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets\src\System\Net\WebSockets\WebSocket.cs" />
@@ -1059,6 +1058,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunner.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunnerFactory.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCompiler.cs" />
@@ -1218,6 +1218,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPClient.cs" />
<Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPListener.cs" />
<Compile Include="..\referencesource\System\net\System\Net\Sockets\UDPClient.cs" />
@@ -1363,6 +1364,7 @@
<Compile Include="System.Net.NetworkInformation\UnixTcpStatistics.cs" />
<Compile Include="System.Net.NetworkInformation\UnixUdpStatistics.cs" />
<Compile Include="System.Net.Security\SslStream.cs" />
<Compile Include="System.Net.WebSockets\WebSocketHandle.wasm.cs" />
<Compile Include="System.Net\AuthenticationManager.cs" />
<Compile Include="System.Net\BufferedReadStream.cs" />
<Compile Include="System.Net\ChunkedInputStream.cs" />
@@ -1439,6 +1441,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunner.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunnerFactory.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCompiler.cs" />
@@ -1568,6 +1571,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPClient.cs" />
<Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPListener.cs" />
<Compile Include="..\referencesource\System\net\System\Net\Sockets\UDPClient.cs" />
@@ -1834,6 +1838,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Encoding\src\Internal\Cryptography\OidLookup.Windows.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunner.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunnerFactory.cs" />
@@ -2307,6 +2312,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunner.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunnerFactory.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCompiler.cs" />
@@ -2805,6 +2811,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunner.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunnerFactory.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCompiler.cs" />
@@ -3321,6 +3328,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunner.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunnerFactory.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCompiler.cs" />
@@ -3682,6 +3690,7 @@
<Compile Include="..\..\..\external\corefx\src\Common\src\System\Net\Security\Unix\SafeFreeNegoCredentials.cs" />
<Compile Include="..\..\..\external\corefx\src\System.IO.FileSystem.Watcher\src\System\IO\FileSystemWatcher.UnknownUnix.cs" />
<Compile Include="..\..\..\external\corefx\src\System.IO.FileSystem.Watcher\src\System\IO\FileSystemWatcher.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\Mono.Security\Mono.Security.Cryptography\PKCS8.cs" />
<Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\AuthorityKeyIdentifierExtension.cs" />
<Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\BasicConstraintsExtension.cs" />
@@ -3801,6 +3810,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPClient.cs" />
<Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPListener.cs" />
<Compile Include="..\referencesource\System\net\System\Net\Sockets\UDPClient.cs" />
@@ -3939,6 +3949,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPClient.cs" />
<Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPListener.cs" />
<Compile Include="..\referencesource\System\net\System\Net\Sockets\UDPClient.cs" />
@@ -4104,6 +4115,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Encoding\src\Internal\Cryptography\OidLookup.Windows.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunner.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunnerFactory.cs" />
@@ -4224,6 +4236,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunner.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunnerFactory.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCompiler.cs" />
@@ -4366,6 +4379,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunner.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunnerFactory.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCompiler.cs" />
@@ -4508,6 +4522,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Security\src\System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WebSocketHandle.Managed.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunner.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\CompiledRegexRunnerFactory.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCompiler.cs" />
@@ -5078,6 +5093,11 @@
<HintPath>./../../../external/binary-reference-assemblies/build/monowasm/System.Numerics.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="./../../../external/binary-reference-assemblies/build/monowasm/WebAssembly.Net.WebSockets.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>./../../../external/binary-reference-assemblies/build/monowasm/WebAssembly.Net.WebSockets.dll</HintPath>
<Private>False</Private>
</Reference>
<ProjectReference Include="../Mono.Security/Mono.Security.csproj">
<Aliases>MonoSecurity</Aliases>
</ProjectReference>
@@ -197,6 +197,9 @@ namespace MonoTests.System.Collections.Concurrent
}
[Test]
#if WASM
[Category ("MultiThreaded")]
#endif
public void BasicRemoveEmptyTest ()
{
int result;
@@ -205,6 +208,9 @@ namespace MonoTests.System.Collections.Concurrent
}
[Test]
#if WASM
[Category ("MultiThreaded")]
#endif
public void BasicRemoveTwiceTest()
{
bag.Add (1);
@@ -254,6 +254,9 @@ namespace MonoTests.System.Collections.Specialized {
}
[Test]
#if WASM
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
#endif
public void CaseInsensitive ()
{
// default constructor is case insensitive
@@ -347,6 +350,9 @@ namespace MonoTests.System.Collections.Specialized {
}
[Test]
#if WASM
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
#endif
public void Remove ()
{
string[] items = { "mono", "MoNo", "mOnO", "MONO" };
@@ -414,6 +420,9 @@ namespace MonoTests.System.Collections.Specialized {
}
[Test]
#if WASM
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
#endif
public void Constructor_IEqualityComparer_Null ()
{
NameValueCollection c1 = new NameValueCollection ((IEqualityComparer)null);
@@ -423,6 +432,9 @@ namespace MonoTests.System.Collections.Specialized {
}
[Test]
#if WASM
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
#endif
public void Constructor_NameValueCollection ()
{
NameValueCollection c1 = new NameValueCollection (StringComparer.InvariantCultureIgnoreCase);
@@ -18,6 +18,7 @@ using NUnit.Framework;
namespace MonoTests.System.ComponentModel
{
[TestFixture]
[NUnit.Framework.CategoryAttribute ("NotWasm")]
public class AsyncOperationManagerTest
{
[Test]
@@ -81,6 +81,9 @@ namespace MonoTests.System.ComponentModel
}
[Test]
#if WASM
[NUnit.Framework.CategoryAttribute ("MultiThreaded")]
#endif
public void CancelBackgroundWorker ()
{
BackgroundWorker bw = new BackgroundWorker ();
@@ -117,6 +120,9 @@ namespace MonoTests.System.ComponentModel
}
[Test]
#if WASM
[NUnit.Framework.CategoryAttribute ("MultiThreaded")]
#endif
public void ExceptionBackgroundWorker ()
{
BackgroundWorker bw = new BackgroundWorker ();
@@ -154,6 +160,9 @@ namespace MonoTests.System.ComponentModel
}
[Test]
#if WASM
[NUnit.Framework.CategoryAttribute ("MultiThreaded")]
#endif
public void CompleteBackgroundWorker ()
{
BackgroundWorker bw = new BackgroundWorker ();
@@ -151,6 +151,9 @@ namespace MonoTests.System.ComponentModel
}
[Test] // Sort ()
#if WASM
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
#endif
public void Sort1 ()
{
EventDescriptorCollection descriptors;
@@ -192,6 +195,9 @@ namespace MonoTests.System.ComponentModel
}
[Test] // Sort (String [])
#if WASM
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
#endif
public void Sort2 ()
{
EventDescriptorCollection descriptors;
@@ -249,6 +255,9 @@ namespace MonoTests.System.ComponentModel
}
[Test] // Sort (IComparer)
#if WASM
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
#endif
public void Sort3 ()
{
EventDescriptorCollection descriptors;
@@ -306,6 +315,9 @@ namespace MonoTests.System.ComponentModel
}
[Test] // Sort (String [], IComparer)
#if WASM
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
#endif
public void Sort4 ()
{
EventDescriptorCollection descriptors;
@@ -247,6 +247,9 @@ namespace MonoTests.System.ComponentModel
}
[Test] // Sort ()
#if WASM
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
#endif
public void Sort1 ()
{
PropertyDescriptorCollection descriptors;
@@ -288,6 +291,9 @@ namespace MonoTests.System.ComponentModel
}
[Test] // Sort (String [])
#if WASM
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
#endif
public void Sort2 ()
{
PropertyDescriptorCollection descriptors;
@@ -345,6 +351,9 @@ namespace MonoTests.System.ComponentModel
}
[Test] // Sort (IComparer)
#if WASM
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
#endif
public void Sort3 ()
{
PropertyDescriptorCollection descriptors;
@@ -402,6 +411,9 @@ namespace MonoTests.System.ComponentModel
}
[Test] // Sort (String [], IComparer)
#if WASM
[Ignore ("WASM CompareInfo - https://github.com/mono/mono/issues/17837")]
#endif
public void Sort4 ()
{
PropertyDescriptorCollection descriptors;
@@ -40,7 +40,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Credentials_Default ()
@@ -49,7 +49,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void DeliveryMethod ()
@@ -67,7 +67,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void EnableSsl ()
@@ -80,7 +80,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Host ()
@@ -99,7 +99,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Host_Value_Null ()
@@ -116,7 +116,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Host_Value_Empty ()
@@ -134,7 +134,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void PickupDirectoryLocation ()
@@ -153,7 +153,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Port ()
@@ -166,7 +166,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Port_Value_Invalid ()
@@ -195,7 +195,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Send_Message_Null ()
@@ -212,7 +212,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Send_Network_Host_Null ()
@@ -230,7 +230,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Send_Network_Host_Whitespace ()
@@ -249,7 +249,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Send_SpecifiedPickupDirectory ()
@@ -265,7 +265,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_DirectoryNotFound ()
@@ -295,7 +295,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_Empty ()
@@ -317,7 +317,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_IllegalChars ()
@@ -345,7 +345,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_NotAbsolute ()
@@ -367,7 +367,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Send_SpecifiedPickupDirectory_PickupDirectoryLocation_Null ()
@@ -388,7 +388,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Timeout ()
@@ -401,7 +401,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ArgumentOutOfRangeException))]
@@ -412,7 +412,7 @@ namespace MonoTests.System.Net.Mail
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void UseDefaultCredentials_Default ()
@@ -19,6 +19,9 @@ namespace MonoTests.System.Net.NetworkInformation
public class IPInterfacePropertiesTest
{
[Test]
#if WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void AtLeastOneUnicastAddress ()
{
int numUnicastAddresses = 0;
@@ -112,10 +115,13 @@ namespace MonoTests.System.Net.NetworkInformation
}
[Test]
#if WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void DnsEnabled ()
{
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
Assert.Ignore ("IsDnsEnabled is not nessasarily enabled for all interfaces on windows.");
Assert.Ignore ("IsDnsEnabled is not necessarily enabled for all interfaces on windows.");
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
foreach (NetworkInterface adapter in adapters)
@@ -126,6 +132,9 @@ namespace MonoTests.System.Net.NetworkInformation
}
[Test]
#if WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
// The code works as expected when part of a regular app. It fails when executed from within an NUnit test
// Might be a problem with the test suite. To investigate.
[Category("AndroidNotWorking")]
@@ -19,18 +19,27 @@ namespace MonoTests.System.Net.NetworkInformation
public class NetworkInterfaceTest
{
[Test]
#if WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void IsNetworkAvailable ()
{
Assert.IsTrue (NetworkInterface.GetIsNetworkAvailable ());
}
[Test]
#if WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void LoopbackInterfaceIndex ()
{
Assert.IsTrue (NetworkInterface.LoopbackInterfaceIndex > 0);
}
[Test]
#if WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void AtLeastOneInterface ()
{
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
@@ -38,6 +47,9 @@ namespace MonoTests.System.Net.NetworkInformation
}
[Test]
#if WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void FirstInterfaceId ()
{
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
@@ -45,6 +57,9 @@ namespace MonoTests.System.Net.NetworkInformation
}
[Test]
#if WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void FirstInterfaceName ()
{
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
@@ -52,6 +67,9 @@ namespace MonoTests.System.Net.NetworkInformation
}
[Test]
#if WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void FirstInterfaceType ()
{
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
@@ -59,6 +77,9 @@ namespace MonoTests.System.Net.NetworkInformation
}
[Test]
#if WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void FirstInterfaceOperationalStatus ()
{
var adapter = NetworkInterface.GetAllNetworkInterfaces ()[0];
@@ -68,6 +89,9 @@ namespace MonoTests.System.Net.NetworkInformation
}
[Test]
#if WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void FirstInterfaceSpeed ()
{
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
@@ -75,6 +99,9 @@ namespace MonoTests.System.Net.NetworkInformation
}
[Test]
#if WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void IPv4Mask ()
{
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
@@ -20,7 +20,7 @@ using System.Net;
using System.Net.Sockets;
using NUnit.Framework;
using System.IO;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using MonoTests.Helpers;
@@ -215,6 +215,10 @@ namespace MonoTests.System.Net.Sockets
#endif
public void ConnectFailAsync ()
{
// XXX: Hangs on AIX
if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("AIX")))
Assert.Ignore ("Skipping on AIX/i");
Socket sock = new Socket (AddressFamily.InterNetwork,
SocketType.Stream,
ProtocolType.Tcp);
@@ -93,7 +93,7 @@ namespace MonoTests.System.Net.Sockets
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ArgumentNullException))]
@@ -104,7 +104,7 @@ namespace MonoTests.System.Net.Sockets
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ArgumentNullException))]
@@ -115,7 +115,7 @@ namespace MonoTests.System.Net.Sockets
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ArgumentOutOfRangeException))]
@@ -95,7 +95,7 @@ namespace MonoTests.System.Net.Sockets {
}
[Test] // .ctor (AddressFamily)
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Constructor2_Family_Invalid ()
@@ -176,7 +176,7 @@ namespace MonoTests.System.Net.Sockets {
}
[Test] // .ctor (Int32)
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Constructor3_Port_OutOfRange ()
@@ -240,7 +240,7 @@ namespace MonoTests.System.Net.Sockets {
}
[Test] // .ctor (IPEndPoint)
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Constructor4_LocalEP_Null ()
@@ -313,7 +313,7 @@ namespace MonoTests.System.Net.Sockets {
}
[Test] // .ctor (Int32, AddressFamily)
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Constructor5_Family_Invalid ()
@@ -346,7 +346,7 @@ namespace MonoTests.System.Net.Sockets {
}
[Test] // .ctor (Int32, AddressFamily)
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Constructor5_Port_OutOfRange ()
@@ -426,7 +426,7 @@ namespace MonoTests.System.Net.Sockets {
}
[Test] // .ctor (String, Int32)
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Constructor6_HostName_Null ()
@@ -443,7 +443,7 @@ namespace MonoTests.System.Net.Sockets {
}
[Test] // .ctor (String, Int32)
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Constructor6_Port_OutOfRange ()
@@ -38,7 +38,7 @@ namespace MonoTests.System.Net {
public class HttpListenerPrefixCollectionTest {
// NL -> Not listening -> tests when listener.IsListening == false
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void NL_DefaultProperties ()
@@ -51,7 +51,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void DefaultProperties ()
@@ -100,7 +100,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void EndsWithSlash ()
@@ -110,7 +110,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void DifferentPath ()
@@ -122,7 +122,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void NL_Clear ()
@@ -133,7 +133,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void NL_Remove ()
@@ -144,7 +144,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void NL_RemoveBadUri ()
@@ -155,7 +155,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ArgumentException))]
@@ -168,7 +168,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ArgumentException))]
@@ -180,7 +180,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void MultipleSlashes ()
@@ -196,7 +196,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void PercentSign ()
@@ -212,7 +212,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Disposed1 ()
@@ -226,7 +226,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ObjectDisposedException))]
@@ -240,7 +240,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ObjectDisposedException))]
@@ -254,7 +254,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ObjectDisposedException))]
@@ -268,7 +268,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ObjectDisposedException))]
@@ -283,7 +283,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Disposed6 ()
@@ -299,7 +299,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Disposed7 ()
@@ -39,7 +39,7 @@ namespace MonoTests.System.Net {
[TestFixture]
public class HttpListenerTest {
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void DefaultProperties ()
@@ -55,7 +55,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Start1 ()
@@ -65,7 +65,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Stop1 ()
@@ -75,7 +75,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (InvalidOperationException))]
@@ -88,7 +88,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (InvalidOperationException))]
@@ -102,7 +102,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (InvalidOperationException))]
@@ -115,7 +115,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void BeginGetContext2 ()
@@ -227,7 +227,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void CloseBeforeStart ()
@@ -271,7 +271,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void AbortBeforeStart ()
@@ -292,7 +292,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void PropertiesWhenClosed1 ()
@@ -308,7 +308,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ObjectDisposedException))]
@@ -321,7 +321,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ObjectDisposedException))]
@@ -334,7 +334,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ObjectDisposedException))]
@@ -347,7 +347,8 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
[Category ("NotWasm")]
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ObjectDisposedException))]
@@ -360,7 +361,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ObjectDisposedException))]
@@ -373,7 +374,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#else
[ExpectedException (typeof (ObjectDisposedException))]
@@ -386,7 +387,7 @@ namespace MonoTests.System.Net {
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
#if FEATURE_NO_BSD_SOCKETS && !WASM
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void PropertiesWhenClosed3 ()
@@ -209,11 +209,13 @@ public class ServicePointTest
Assert.AreSame (host0, host1, "HostEntry should result in the same IPHostEntry object.");
#if !WASM
Thread.Sleep (dnsRefreshTimeout * 2);
host2 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;
Assert.AreNotSame(host0, host2, "HostEntry should result in a new IPHostEntry " +
"object when DnsRefreshTimeout is reached.");
#endif
}
// Debug code not used now, but could be useful later
@@ -41,6 +41,7 @@ namespace MonoTests.System.Net
public class WebClientTestAsync
{
[Test]
[Category("NotWasm")]
[Category("Async")]
[Category("AndroidNotWorking")] // Attempts to access the test dll which won't work on Android
[Category("BitcodeNotSupported")]
@@ -66,6 +66,9 @@ namespace MonoTests.System.Net
}
[Test]
#if WASM
[Ignore ("WASM - libc issue")]
#endif
public void BypassArrayList ()
{
Uri proxy1 = new Uri ("http://proxy.contoso.com");
@@ -124,6 +127,9 @@ namespace MonoTests.System.Net
}
[Test]
#if WASM
[Ignore ("WASM - libc issue")]
#endif
public void IsByPassed ()
{
WebProxy p = new WebProxy ("http://proxy.contoso.com", true);
Loaded 100 of 310 files, more files were not shown because too many files have changed in this diff. Show more