Compare commits

..
175 Commits
Author SHA1 Message Date
Alexander Köplinger 77769615db Fix Cairo issue on macOS Big Sur
Bumps bockbuild to get the changes from mono/bockbuild#162

BigSur's CoreGraphics seems to need a copy of the data to stick around longer than the surface,
so we provide it a copy of the data instead.

Backport of https://github.com/mono/mono/pull/20154 to 2019-12
2020-07-24 13:53:25 +02:00
Alexander Köplinger df7816daf4 Bump bockbuild to get https://github.com/mono/bockbuild/pull/159 2020-05-15 14:33:53 +02:00
Ankit Jain 5d03a6fe11 [2019-12] Bump msbuild to track mono-2019-12 (#19662)
* [2019-12] Bump msbuild to track mono-2019-12

* [2019-12] Bump msbuild to track mono-2019-12

* [2019-12] Bump msbuild to track mono-2019-12
2020-04-29 19:47:23 -04:00
Ankit Jain 4a2a26ce69 [2019-12] Bump msbuild to track mono-2019-12 (#19622)
* [2019-12] Bump msbuild to track mono-2019-12

* Bump nuget.exe to 5.6.0-preview2

* Bump roslyn to 3.6.0-4.20222.3 to match msbuild
2020-04-24 12:42:07 -04:00
monojenkins c8cfa8f284 [System.Runtime.Serialization] Work around specified cast is not valid error (#19641)
Backport of #19620.
2020-04-24 10:56:14 +02:00
Mitchell HwangandMitchell Hwang 6f0bf73005 [mono-2019-12] Bump corefx to get https://github.com/mono/corefx/pull/396 (#19428)
Co-authored-by: Mitchell Hwang <[email protected]>
2020-04-03 14:59:29 -04:00
monojenkins fdbba4a34e [2019-12] [amd64] align application stack pointer in signal handler (#19368)
[2019-12] [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


Backport of #18021.

/cc @lewurm
2020-04-03 06:36:06 -04:00
Alexander Köplinger 1278c2f35e Bump bockbuild to get PATH fix 2020-04-03 11:36:20 +02:00
8199a27e28 [2019-12] Force Python 3.x from env in shebang lines (#19423)
* Force Python 3.x from env in shebang lines

* Fix byte/string incompatiblity in Python 3

* Fix locating Python interpreter when it isn't "python" (#18197)

Fix locating Python interpreter when it isn't "python"

The "python" interpreter is specified by PEP-394. In it, an OS
can decide not to ship a "python" executable, and instead only
ship python2/3, providing some ambiguity for scripts that are
version-neutral, like the one Mono uses.

This uses an automake macro to locate a suitable Python, and
changes the makefile to use the located Python, whatever it may be.

(cherry picked from commit 84221f04b5)

* More disambiguation of Python in makefiles (#18284)

(cherry picked from commit b3ce5bfa88)

* [build] Check for Python 3 in configure.ac (#18625)

I fear this causing packaging problems, but as-is we require Python 3 for most of our Python files but don't actually check for that in configure. We should be consistent about this. Some projects (notably wasm) also use the Python version detected here, so bumping this will also bump the version used in those cases (a good thing, since there are some known bugs when using the scripts with Python 2).

(cherry picked from commit 0f47ea5d80)

Co-authored-by: Calvin Buckley <[email protected]>
Co-authored-by: Ryan Lucia <[email protected]>
2020-04-03 10:38:34 +02:00
Alexander Köplinger 9b3e6f4700 Fix Windows .msi build using newer xar and recent cygwin updates
The old version didn't compile anymore with OpenSSL 1.1

Cygwin now ships libssl 1.1 which removed OpenSSL_add_all_ciphers so the xar configure fails.
Replace the configure check with another existing function to fix it.

(cherry picked from commit 9485a66d20)
(cherry picked from commit e10990125d)
2020-04-03 10:37:58 +02:00
monojenkinsandAlexis Christoforides 8487188883 [2019-12] [merp] Add breadcrumb for StackHash (#19243)
* [merp] Add breadcrumb for StackHash

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

Co-authored-by: Alexis Christoforides <[email protected]>
2020-03-17 11:59:07 -04:00
monojenkinsandAleksey Kliger f2379f2d66 [2019-12] [corlib] Capture the ExceptionDispatchInfo when rethrowing from TaskContinuation (#19208)
* [corlib] Capture the ExceptionDispatchInfo when rethrowing from TaskContinuation

In `task.GetAwaiter().OnCompleted(action)` if `action` throws, the
`TaskContinuation.RunOrScheduleAction method will catch the exception and then
call `RuntimeAugments.ReportUnhandledException`.  We must not simply throw the
exception again - in that case we will lose all the frames leading up to the
`catch` in `RunOrScheduleAction`.  Instead use ExceptionDispatchInfo to
caputure the original throw.

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

* [test] Add regression test

For annoying reasons we can't run this as a simple NUnit test because the
exception is unhandled on some arbitrary threadpool worker thread, and those
don't show up within an NUnit setup.

Additionally because the unhandled exception in the root domain would normally
terminate the application, we need to run this in a new appdomain.

Co-authored-by: Aleksey Kliger <[email protected]>
2020-03-13 10:03:05 -04:00
Ankit Jain db04a05e04 [2019-12] Bump msbuild to track mono-2019-12 (#19205) 2020-03-12 23:39:03 +01:00
monojenkinsandAlexis Christoforides d06686c425 [merp] Create a 'reason' breadcrumb for the crash dump process (#19119)
For example, the system name of a signal ('segv') or 'MANAGED_EXCEPTION' are typical arguments.

Co-authored-by: Alexis Christoforides <[email protected]>
2020-03-11 09:35:31 -04:00
Ankit Jain 2ff898859b [2019-12] Bump msbuild to track mono-2019-12 (#19078) 2020-03-02 20:49:30 +01:00
Alexander Köplinger b27b2d7f61 Update mono-extensions 2020-02-28 19:58:45 +01:00
Alexander Köplinger 13fc6948f3 Update mono-extensions 2020-02-28 19:06:21 +01:00
Alexander Köplinger 2517534847 Bump mono-extensions 2020-02-28 15:22:33 +01:00
Alexis Christoforides c6890f410c [2019-12][runtime] Improve handling crashing signals (#19018)
* [runtime] Improve handling crashing signals

The default handlers for SIGTRAP, SIGSYS on macOS and Linux crash the process, so we now have Mono report this.

This patch also changes how the name of the signal is acquired for passing on to the crash reporting functions, allowing code reuse on crashing signals.

* [mono] Remove SIGTRAP handler, as it interferes with debugging

See https://github.com/mono/mono/pull/18243#issuecomment-586013427

* Fix lack of cleanup for SIGSYS
2020-02-28 02:27:41 -05:00
monojenkinsandThays Grazia b33fa1d00e Backport 2020-02 enable embedded ppdb. (#19050)
Co-authored-by: Thays Grazia <[email protected]>
2020-02-26 20:10:15 -05:00
Alexander Köplinger 8a687a4044 Bump bockbuild for Pango nil check fix
Pango nil check fix: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1069059/

Brings in https://github.com/mono/bockbuild/pull/153

Backport of https://github.com/mono/mono/pull/18936
2020-02-24 19:48:37 +01:00
monojenkinsandAlexis Christoforides 44703b3ecc [merp] Produce hashes for unmanaged thread stacks also (#18964)
Before, this was only done for managed stacks.

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

Co-authored-by: Alexis Christoforides <[email protected]>
2020-02-24 13:01:47 -05:00
monojenkinsandAlexis Christoforides 0ac7105edd [merp] Increase buffer size for state dump (#18839)
Addresses https://github.com/mono/mono/issues/18796

Co-authored-by: Alexis Christoforides <[email protected]>
2020-02-24 10:21:43 -05:00
Ankit Jain 147ecc0ac3 [2019-12] Bump msbuild to track mono-2019-10 (#18986) 2020-02-24 15:51:06 +01:00
monojenkinsandNathan Ricci e7b4669bc9 Added some parenthesis and a cast to control order of operations. (#18984)
This fixes https://github.com/mono/mono/issues/17140; intermittent incorrect results from GetTotalBytesAllocated for current thread. uint64_t and a pointer difference are not the same type/width on all architectures, so incorrect results can happen with out the parenthesis.

Co-authored-by: Nathan Ricci <[email protected]>
2020-02-24 12:08:03 +01:00
monojenkinsandVlad Brezae fc145be98c [sgen] Disable managed allocator when using nursery-canaries (#18946)
The managed allocator included in a full aot image does not support canaries, leading to inconsistent object layout.

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

Co-authored-by: Vlad Brezae <[email protected]>
2020-02-20 14:01:06 +02:00
monojenkinsandEgor Bogatov adebac056a Remove TestEnvVarSwitchForInnerHttpHandler test as it should be in XA/LinkerTests.cs instead (#18956)
Co-authored-by: Egor Bogatov <[email protected]>
2020-02-20 11:11:33 +01:00
monojenkinsandAleksey Kliger f7f561703a [2019-12] [merp] Capture Environment.FailFast message in crash report (#18921)
* [merp] Capture Environment.FailFast message in crash report

* [test] merp-crash-test refactor crasher data; add optional validator

Switch from a Tuple<T1,T2> to a struct for the crash items.  Add a third
optional validator field which is an action to run on the json blob that we get
back.

Not updating existing tests to do any json validation, yet.

* [test] Add new MERP crash test for Environment.FailFast

Check that the resulting json blob includes the failfast message.

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
2020-02-19 20:16:29 +01:00
monojenkins b5b50eefe7 [2019-12] [bcl] Default XmlSerializer stream serialize to UTF8 Encoding (#18908)
* [mcs] Default XmlSerializer stream serialize to UTF8 Encoding

* [bcl] Add XmlSerialize Test to preserve UTF chars in stream
2020-02-19 14:06:28 -05:00
Marius Ungureanu cec38fcfc8 Bump bockbuild to bring in Gtk# regression fix (#18911)
Backport of https://github.com/mono/mono/pull/18909
2020-02-18 19:45:45 +01:00
monojenkinsandEgor Bogatov 0761b0ee55 [2019-12] Make MonoWebRequestHandler linker friendly (#18833)
* Make MonoWebRequestHandler linker friendly

* Make MonoWebRequestHandler's ctor public (to be able to use in Activator.CreateInstance without binding flags)

* Remove Console.WriteLine from system.net.http

Co-authored-by: Egor Bogatov <[email protected]>
2020-02-18 15:55:00 +03:00
monojenkinsandEgor Bogatov 0c45a74a96 Move HttpClientHandlerTests.Android.cs to nunit (#18889)
Co-authored-by: Egor Bogatov <[email protected]>
2020-02-18 15:54:41 +03:00
Ankit Jain d5f5f3762f [2019-12] Bump msbuild to track mono-2019-10 (#18862)
- Changes roslyn to 3.5.0-beta2-20074-05
2020-02-17 12:39:58 +01:00
monojenkinsandAlexander Köplinger f1bdf8a93d Move offsets-tool into mono/tools (#18830)
Backporting this since we see errors during `pip install` on the Android Mono SDKs build on Linux and with this we're removing the call to pip (it wasn't needed).

Backport of #18783.

Co-authored-by: Alexander Köplinger <[email protected]>
2020-02-13 14:16:59 +01:00
Ankit Jain 3fdc3c84b2 [2019-12] Bump msbuild to track mono-2019-10 (#18792)
* [2019-12] Bump msbuild to track mono-2019-10

* Bump roslyn to 3.5.0-beta3-20111-03 .

* Update nuget.exe to match xbuild

- the closest version available right now, to `5.5.0-rtm.6422` is
`5.5.0-preview2`, so using that for now.
2020-02-12 17:11:04 +01:00
monojenkins 846a5d41ee [2019-12] Allow users to switch to MonoWebRequestHandler on Android via UI (#18786)
* Bring back old HttpHandler for Android
Co-authored-by: Egor Bogatov <[email protected]>
2020-02-12 16:24:10 +03:00
Alexander Köplinger c8b96661d3 Bump bockbuild to get GTK NSPasteboardType change.
Backport from https://github.com/mono/mono/pull/18080
2020-02-10 16:22:27 +01:00
monojenkinsandAlex Soto db584480ff [iOS] Replace removed dsymutil -t switch with -num-threads (#18744)
Apple removed `-t` switch from dsymutil in favor of `-num-threads`

Co-authored-by: Alex Soto <[email protected]>
2020-02-07 11:14:01 +01:00
Alexander Köplinger 0686e1435b Skip WebAssembly build in sdks archive build on non-master branches
WebAssembly doesn't use our usual release branches yet.

(cherry picked from commit a40e1ae681)
2020-02-06 22:39:13 +01:00
monojenkinsandAlexis Christoforides 5ef6ad0ef7 [merp] Add an exception type for managed exceptions (#18723)
Addresses https://github.com/mono/mono/issues/18681

Co-authored-by: Alexis Christoforides <[email protected]>
2020-02-06 16:31:17 -05:00
monojenkinsandManuel de la Pena 36073a0c74 [NUnitLite] Bump nunitlite submodule. (#18733)
Update the nunitlite submodule to pick up some fixes in the NUnit v3
outputwriter that are needed by xamarin-macios.

Co-authored-by: Manuel de la Pena <[email protected]>
2020-02-06 15:57:58 +01:00
Matt Sylvia e65846bfd3 Update deprecated query parameter to header (#18705)
Use of `access_token` is now deprecated, switching to HTTP header

```
Please use the Authorization HTTP header instead, as using the `access_token` query parameter is deprecated.
```

(cherry picked from commit 2f74ab393f)
2020-02-04 22:58:48 +01:00
monojenkinsandZoltan Varga 0011444f0b [aot] Avoid inflating gparams with byreflike types during generic sharing. (#18682)
Fixes https://github.com/mono/mono/issues/18676.

Co-authored-by: Zoltan Varga <[email protected]>
2020-02-04 16:41:04 +01:00
monojenkinsandAleksey Kliger 4c93e382f5 [2019-12] [merp] MONO_DEBUG=no-gdb-stacktrace shouldn't disable MERP (#18611)
* [merp] MONO_DEBUG=no-gdb-stacktrace shouldn't disable MERP

Only prevent `gdb` or `lldb` from being invoked.

MERP is controlled by separate mechanisms --- configure flags for crash
reporting and an explicit opt-in icall.

The existing code collects crashed process data in-process, but it writes the
data out (using mono_merp_invoke) in the forked child process.  This is a bit
surprising, but in the interest of not disturbing the code too much, this PR
doesn't change that.  We should revisit `dump_native_stacktrace` again in the
future and rationalize these decisions.

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

* Fix indentation

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
2020-01-31 19:24:43 +01:00
monojenkinsandAlexander Köplinger 8b72dbb708 [corlib] Split corlib xunit tests even more for iOS (#18620)
Follow-up to https://github.com/mono/mono/pull/18228 since two parts wasn't enough to fix the size issue on 32bits devices.
We now use three parts.

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

Co-authored-by: Alexander Köplinger <[email protected]>
2020-01-29 21:27:54 +01:00
Alexander Köplinger 1e2d68b92c Bump bockbuild for Pango patch
Fixes bug #1048838, correct SF font not loading in VSMac

Backport of https://github.com/mono/mono/pull/18566
2020-01-28 13:16:07 +01:00
monojenkinsandAlexander Köplinger e55302cb08 configure.ac: remove AC_SEARCH_LIBS for libintl (#18595)
This causes an additional dependency of mono on libintl which we didn't have before.
Reported by a user on gitter, it's problematic on macOS since it makes the mono binary depend on the libintl we ship in the Mono .pkg.

It was introduced in Mono 6.6 by https://github.com/mono/mono/commit/18e0ebfe89be0a175d2f904b9bb1ec6816daa318

Co-authored-by: Alexander Köplinger <[email protected]>
2020-01-27 17:02:44 +01:00
monojenkins ef8188a08d [runtime] Disable lldb backtrace display on osx, it hangs on attaching in lldb. (#18591)
Backport of #18590.
Co-authored-by: Zoltan Varga <[email protected]>
2020-01-27 10:59:17 +01:00
Ankit Jain 01be275ad7 [2019-12] Bump msbuild to track mono-2019-10 (#18577) 2020-01-27 10:55:09 +01:00
monojenkinsandZoltan Varga f9e5a6d2b2 [jit] Compute has_references correctly for gshared types whose constraint is a generic valuetype. Also emit write barriers correctly for these types. (#18562)
Co-authored-by: Zoltan Varga <[email protected]>
2020-01-25 13:02:39 -05:00
monojenkinsandThays Grazia a979811c63 [2019-12] [debugger] Native thread not executing managed code considered as terminated (#18504)
* If a thread was suspended and doesn't have any managed stack, it was considered as terminated, but it wasn't really terminated because it can execute managed code again, and stop in a breakpoint so if the execution arrives in debugger_agent_breakpoint_from_context we reset the flag terminated to FALSE.

* Adding terminated = FALSE in single_step_from_context.

Co-authored-by: Thays Grazia <[email protected]>
2020-01-23 13:15:06 -03:00
monojenkinsandBernhard Urban-Forster 455cf7d3b1 [interp] context can be uninitialized for get_resume_state callback (#18535)
`jit_tls->interp_context` gets initialized lazily, that is, upon the first interpreter execution on a specific thread (e.g. via interp_runtime_invoke). However, with mixed mode the execution can purely happen in AOT code upon the first interaction with the managed debugger.

Stack trace:

```
  thread #1, name = 'tid_407', queue = 'com.apple.main-thread'
    frame #0: 0x0000000190aedc94 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000190a0f094 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 672
    frame #2: 0x000000010431318c reloadcontext.iOS`mono_os_cond_wait(cond=0x0000000104b9ba78, mutex=0x0000000104b9ba30) at mono-os-mutex.h:219:8
    frame #3: 0x0000000104312a68 reloadcontext.iOS`mono_coop_cond_wait(cond=0x0000000104b9ba78, mutex=0x0000000104b9ba30) at mono-coop-mutex.h:91:2
    frame #4: 0x0000000104312858 reloadcontext.iOS`suspend_current at debugger-agent.c:3021:4
    frame #5: 0x000000010431be18 reloadcontext.iOS`process_event(event=EVENT_KIND_BREAKPOINT, arg=0x0000000145d09ae8, il_offset=0, ctx=0x0000000149015c20, events=0x0000000000000000, suspend_policy=2) at debugger-agent.c:4058:3
    frame #6: 0x0000000104310cf4 reloadcontext.iOS`process_breakpoint_events(_evts=0x000000028351a680, method=0x0000000145d09ae8, ctx=0x0000000149015c20, il_offset=0) at debugger-agent.c:4722:3
    frame #7: 0x000000010432f1c8 reloadcontext.iOS`mono_de_process_breakpoint(void_tls=0x0000000149014e00, from_signal=0) at debugger-engine.c:1141:2
    frame #8: 0x000000010430f238 reloadcontext.iOS`debugger_agent_breakpoint_from_context(ctx=0x000000016f656790) at debugger-agent.c:4938:2
    frame #9: 0x00000001011b73a4 reloadcontext.iOS`sdb_breakpoint_trampoline + 148
    frame #10: 0x00000001008511b4 reloadcontext.iOS`reloadcontext_iOS_Application_Main_string__(args=0x000000010703a030) at Main.cs:14
    frame #11: 0x00000001010f9730 reloadcontext.iOS`wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 272
    frame #12: 0x00000001042fd8b8 reloadcontext.iOS`mono_jit_runtime_invoke(method=0x0000000145d09ae8, obj=0x0000000000000000, params=0x000000016f656f20, exc=0x0000000000000000, error=0x000000016f656ff8) at mini-runtime.c:3162:3
    frame #13: 0x0000000104411950 reloadcontext.iOS`do_runtime_invoke(method=0x0000000145d09ae8, obj=0x0000000000000000, params=0x000000016f656f20, exc=0x0000000000000000, error=0x000000016f656ff8) at object.c:3052:11
    frame #14: 0x000000010440c4dc reloadcontext.iOS`mono_runtime_invoke_checked(method=0x0000000145d09ae8, obj=0x0000000000000000, params=0x000000016f656f20, error=0x000000016f656ff8) at object.c:3220:9
    frame #15: 0x0000000104415ae0 reloadcontext.iOS`do_exec_main_checked(method=0x0000000145d09ae8, args=0x000000010703a030, error=0x000000016f656ff8) at object.c:5184:3
    frame #16: 0x00000001044144ac reloadcontext.iOS`mono_runtime_exec_main_checked(method=0x0000000145d09ae8, args=0x000000010703a030, error=0x000000016f656ff8) at object.c:5281:9
    frame #17: 0x0000000104414500 reloadcontext.iOS`mono_runtime_run_main_checked(method=0x0000000145d09ae8, argc=1, argv=0x000000016f6570d0, error=0x000000016f656ff8) at object.c:4734:9
    frame #18: 0x00000001042d3b54 reloadcontext.iOS`mono_jit_exec_internal(domain=0x0000000145f00130, assembly=0x0000000281ba2900, argc=1, argv=0x000000016f6570d0) at driver.c:1320:13
    frame #19: 0x00000001042d39a4 reloadcontext.iOS`mono_jit_exec(domain=0x0000000145f00130, assembly=0x0000000281ba2900, argc=1, argv=0x000000016f6570d0) at driver.c:1265:7
    frame #20: 0x0000000104597994 reloadcontext.iOS`::xamarin_main(argc=5, argv=0x000000016f657a80, launch_mode=XamarinLaunchModeApp) at monotouch-main.m:483:8
    frame #21: 0x00000001008510dc reloadcontext.iOS`main(argc=5, argv=0x000000016f657a80) at main.m:104:11
    frame #22: 0x0000000190af8360 libdyld.dylib`start + 4
[...]
* thread #5, name = 'Debugger agent', stop reason = signal SIGABRT
  * frame #0: 0x0000000190aedec4 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x0000000190a0d724 libsystem_pthread.dylib`pthread_kill$VARIANT$armv81 + 216
    frame #2: 0x000000019095d844 libsystem_c.dylib`abort + 100
    frame #3: 0x00000001045871b4 reloadcontext.iOS`log_callback(log_domain=0x0000000000000000, log_level="error", message="* Assertion at ../../../../../mono/mini/interp/interp.c:7176, condition `context' not met\n", fatal=4, user_data=0x0000000000000000) at runtime.m:1213:3
    frame #4: 0x0000000104544fc8 reloadcontext.iOS`eglib_log_adapter(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, message="* Assertion at ../../../../../mono/mini/interp/interp.c:7176, condition `context' not met\n", user_data=0x0000000000000000) at mono-logger.c:405:2
    frame #5: 0x000000010456093c reloadcontext.iOS`monoeg_g_logstr(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, msg="* Assertion at ../../../../../mono/mini/interp/interp.c:7176, condition `context' not met\n") at goutput.c:134:2
    frame #6: 0x0000000104560598 reloadcontext.iOS`monoeg_g_logv_nofree(log_domain=0x0000000000000000, log_level=G_LOG_LEVEL_ERROR, format="* Assertion at %s:%d, condition `%s' not met\n", args="e\x12z\x04\x01") at goutput.c:149:2
    frame #7: 0x000000010456061c reloadcontext.iOS`monoeg_assertion_message(format="* Assertion at %s:%d, condition `%s' not met\n") at goutput.c:184:22
    frame #8: 0x0000000104560674 reloadcontext.iOS`mono_assertion_message(file="../../../../../mono/mini/interp/interp.c", line=7176, condition="context") at goutput.c:203:2
    frame #9: 0x000000010459b570 reloadcontext.iOS`interp_get_resume_state(jit_tls=0x000000014900d000, has_resume_state=0x000000016fc7a9f4, interp_frame=0x000000016fc7a9e8, handler_ip=0x000000016fc7a9e0) at interp.c:7176:2
    frame #10: 0x0000000104319420 reloadcontext.iOS`compute_frame_info(thread=0x0000000104fe4130, tls=0x0000000149014e00, force_update=1) at debugger-agent.c:3422:3
    frame #11: 0x0000000104320d40 reloadcontext.iOS`thread_commands(command=1, p="", end="", buf=0x000000016fc7acf8) at debugger-agent.c:9048:3
    frame #12: 0x000000010431cca0 reloadcontext.iOS`debugger_thread(arg=0x0000000000000000) at debugger-agent.c:10132:10
    frame #13: 0x000000010447eb04 reloadcontext.iOS`start_wrapper_internal(start_info=0x0000000000000000, stack_ptr=0x000000016fc7b000) at threads.c:1232:3
    frame #14: 0x000000010447e788 reloadcontext.iOS`start_wrapper(data=0x000000028203ef40) at threads.c:1305:8
    frame #15: 0x0000000190a11d8c libsystem_pthread.dylib`_pthread_start + 15
[...]
```

Thanks to @drasticactions for helping me to reproduce.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1050615

Co-authored-by: Bernhard Urban-Forster <[email protected]>
2020-01-23 13:50:12 +01:00
2edccc52a7 [2019-12] [jit] Compute the instance size/alignment correctly for gshared types whose constraint is a generic valuetype. (#18529)
* [jit] Compute the instance size/alignment correctly for gshared types whose constraint is a generic valuetype.

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

* [jit] Simplify code

Fix some line damage

Co-authored-by: Zoltan Varga <[email protected]>
Co-authored-by: Vlad Brezae <[email protected]>
2020-01-21 15:05:07 -08:00
monojenkinsandAlexander Köplinger 2b0e9bfe7a Bump xsp to fix issues with removed Mono.Security APIs (#18487)
See https://github.com/mono/xsp/pull/88

Co-authored-by: Alexander Köplinger <[email protected]>
2020-01-16 21:51:57 +01:00
monojenkinsandJo Shields d56ea8a520 [2019-12] Don't run make install in boehm submodule (#18476)
* Don't run `make install` in boehm submodule

* Simplify logic

Co-authored-by: Jo Shields <[email protected]>
2020-01-16 10:35:01 -05:00
monojenkins 4e15267c70 [wasm] Improve virtualenv installation script (#18470)
[2019-12] [wasm] Improve virtualenv installation script



Backport of #18190.

/cc @lewurm @marek-safar
2020-01-16 12:36:02 +01:00
monojenkinsandBernhard Urban-Forster fe455fcb34 [2019-12] [arm] account for signed bit when calculating offset to PLT entry (#18460)
* [arm] account for signed bit when calculating offset to PLT entry

* mask only will do the job

Co-authored-by: Bernhard Urban-Forster <[email protected]>
2020-01-16 10:47:32 +01:00
monojenkinsandAleksey Kliger 64bfc6c000 [2019-12] [loader] ReflectionOnlyLoad(byte[]) should not apply binding redirects (#18458)
* [loader] ReflectionOnlyLoad(byte[]) should not apply binding redirects

Match .NET Framework behavior.

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

* [tests] ReflectionOnlyLoad(byte[]) should not apply binding redirects

Regression test for https://github.com/mono/mono/issues/18388

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
2020-01-15 10:47:39 +01:00
monojenkinsandVlad Brezae 0fd24828b1 [2019-12] [sgen] Fixes for max-heap-size option (#18456)
* [sgen] Don't subtract twice the nursery size from max_heap_size

We were subtracting the nursery size when initializing max_heap_size as well as adding it to the allocated_heap when allocating the nursery (alloc_nursery).

* [sgen] Trigger collection if failing to allocate los section

If the memory governor says we are exceeding the max_heap_size by allocating a los section (1MB) for a new los object, attempt to clear some space by triggering a major collection, before completely bailing out.

Co-authored-by: Vlad Brezae <[email protected]>
2020-01-15 10:45:09 +01:00
Ankit Jain 03e8e8e56f [2019-12] Bump msbuild to track mono-2019-10 (#18433) 2020-01-12 10:55:59 +01:00
Ankit Jain db8ee7ad92 [2019-12] Bump msbuild to track mono-2019-10 (#18413) 2020-01-10 12:43:06 +01:00
monojenkins a83bdec08e [memory barrier] use pagesize determined by helper (#18396)
[2019-12] [memory barrier] use pagesize determined by helper

`limits.h` doesn't always define `PAGESIZE` properly (e.g. iOS), so it would fall back to `0x1000` (4096) but it's really `0x4000` (16384) on iOS. We already have a helper in the runtime to determine the pagesize, so let's use that instead.


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

Backport of #18383.

/cc @lewurm
2020-01-10 01:55:45 +01:00
Martin BauligandAlexander Köplinger f323b29968 Bump corefx to latest 2019-12. (#18405)
Co-authored-by: Alexander Köplinger <[email protected]>
2020-01-09 23:48:02 +01:00
Alexis Christoforides 360e64d261 [FileSystemWatcher] Fix wrong behaviour when move multiple files out of watched folder on mac (#41963) (#18225)
Backport of https://github.com/dotnet/corefx/pull/41963

Fixes https://github.com/mono/mono/issues/16778
2020-01-09 16:24:33 -05:00
Ankit Jain a1351981f6 [2019-12] Bump msbuild to track mono-2019-10 (#18392) 2020-01-09 22:18:30 +01:00
monojenkinsandRyan Lucia 2cc08cae73 [reflection] Fix check for Type.FullName to match CoreCLR (#18390)
Updated test to follow in dotnet/runtime

Co-authored-by: Ryan Lucia <[email protected]>
2020-01-09 11:12:27 -05:00
Ankit Jain 0a51d89c42 [2019-12] Bump msbuild to track mono-2019-10 (#18375) 2020-01-08 15:00:40 +01:00
monojenkins f7df632ff0 [2019-12] [jit] Avoid passing a vtable argument to DIM methods when making calls out of gsharedvt methods. (#18365)
* [jit] Avoid passing a vtable argument to DIM methods when making calls out of gsharedvt methods.

Fixes https://github.com/mono/mono/issues/18276.
2020-01-07 17:28:27 -05:00
Ankit Jain 694c3ef470 [2019-12] Bump msbuild to track mono-2019-10 (#18304) 2020-01-07 18:10:27 +01:00
monojenkins 00cb738f63 [2019-12] Add SignedCms to the TypeForwards in the System.Security.Cryptography.Pkcs facade (#18362)
* Add SignedCms to the typeforwards in the System.Security.Cryptography.Pkcs facade

* Added additional missing types from System.Security.Cryptography.Pkcs.

* It would be nice if the files I added had namespaces ;-)

* [csproj] Update project files

* Bump API snapshot submodule
2020-01-07 18:05:54 +01:00
monojenkins 1ff24a77be [2019-12] [metadata] Size 0 Blob heap is ok when resolving assembly refs (#18337)
* [metadata] Size 0 Blob heap is ok when resolving assembly refs

Sometimes ILasm can produce images with a Blob heap of size 0.  In cases where
we're loading assembly references from such an image, the hash (which is
optional) can be at index = 0 and the Blob heap size is also 0.

Also: add the hash value to the output of `monodis --assemblyref`

* [metadata] Add a separate assertion for the index == size == 0 case

And a comment explaining how it is likely to be triggered.  If the assembly is
reasonable the caller of mono_metadata_blob_heap should be updated to use
mono_metadata_blob_heap_null_ok instead

* [bcl] Allow Mono's ILASM to produce a size 0 Blob heap

ECMA 335 II.24.2.4 says that the user string and blob heaps should have an
entry at index 0 consisting of the single byte 0.  However .NET Framework (and
.NET Core) ilasm will entirely omit the Blob heap (that is, create a blob heap
entry of size 0) if it is not needed.  This PR changes Mono's ILASM to emit the
initial byte on demand only if one of the MetaDataStream.Add() methods is
called. Otherwise we will also emit a stream of size 0.

This is needed to compile some test cases.

* [tests] Add regression test for loading assemblies with size 0 Blob heap

Depends on ILASM that can emit a size 0 Blob heap
2020-01-06 16:02:33 -05:00
monojenkins 5f80ec8d77 [2019-12] Set inited flag _after_ TermInfoDriver initialisation completes (#18329)
[2019-12] Set inited flag _after_ TermInfoDriver initialisation completes

This flag was causing issues when accessing console properties on concurrent threads during TermInfoDriver initialisation.

Fixes #18317

Backport of #18318.

/cc @steveisok @nagytech
2020-01-03 20:36:17 +01:00
Steve Pfister 1ae385b59e [2019-12] Pull in DirectoryInfo Invalidate After Create Fix (#18327)
* Bump to mono/corefx@b7e7440

Backport of https://github.com/mono/mono/pull/18310

* Forgot the test tweak
2020-01-03 12:27:42 -05:00
monojenkinsandThays Grazia b61db514ab The behaviour expected of filter exceptions is: -> throw in a async task with a try catch in the caller -> don't stop -> throw in a new thread with a try catch in the caller -> stop -> throw in the main thread without any try catch -> stop (#18333)
Including a new test to test the fix of #17601.

Fixing #16588, create a while 1 to stops the program execution when an exception is thrown and no try catch is found and MONO_DEBUG=suspend-on-unhandled.

Fixes #17601
Fixes #16588

Co-authored-by: Thays Grazia <[email protected]>
2020-01-03 10:21:35 -03:00
monojenkins 68a4b43536 Use byte-aligned LLVM loads and stores for unaligned mini IR loads and stores. (#18301)
[2019-12] Use byte-aligned LLVM loads and stores for unaligned mini IR loads and stores.

Should fix https://github.com/mono/mono/issues/18221.

Backport of #18296.

/cc @lambdageek @imhameed
2020-01-02 22:16:13 +01:00
monojenkinsandMartin Baulig a36cb75039 Socket.BeginMConnect() should not attempt connections on unsupported address families. (#18322)
Fixes #16513.

Co-authored-by: Martin Baulig <[email protected]>
2020-01-01 17:31:23 -05:00
monojenkinsandAleksey Kliger c721d4ce2a [eglib] Don't define _FORTIFY_SOURCE on Cygwin builds (#18311)
See https://github.com/msys2/MINGW-packages/issues/5803

Without -lssp (or -fstack-protector), -D_FORTIFY_SOURCE=2 leads to linker
errors.

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
2019-12-30 09:54:18 -05:00
Ankit Jain 2c3a70016b [2019-12] Bump msbuild to track mono-2019-10 (#18258)
* Bump msbuild to track mono-2019-10

- and update nuget.exe to 5.5.0-preview1 to match

* [2019-12] Bump msbuild to track mono-2019-10
2019-12-24 18:36:25 -05:00
monojenkins cafdade424 [domain] Don't add NULL runtime to runtimes list (#18266)
Also when iterating over the runtimes, actually look at the current element,
not the first element.

Also mention the unsupported runtime version in the warning message when it is
passed to mono_init_internal.

Fixes https://github.com/mono/mono/issues/17916
2019-12-23 08:42:29 -05:00
Alexander Köplinger 43cfe8ecfe Bump corefx to get test fix 2019-12-20 00:37:02 +01:00
Alexander Köplinger bcee9454e9 [System] Add additional hardening against race in MonoTlsStream (#18250)
See https://github.com/mono/mono/issues/15805#issuecomment-567131297

(cherry picked from commit c8e19bec68)
2019-12-19 11:57:43 +01:00
Alexander Köplinger e283c45cc0 [bcl] Split corlib and System.Core xunit test assemblies for monotouch profiles (#18228)
They cannot deal with large test assemblies so we need to split them.

We're doing this by introducing a new `#skip <PROFILE>` directive in the .sources format which defines where to split the assembly.
The logic is very simple: files up until the first `#skip` are common files which get included in each part, subsequent files are only in the respective part assembly.

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

(cherry picked from commit 3891fe97d2)
(cherry picked from commit a74416d950)
2019-12-18 22:23:03 +01:00
Ankit Jain 828af02bdf Bump msbuild to track mono-2019-10 (#18193)
.. to get changes from https://github.com/mono/msbuild/pull/184 .
2019-12-18 16:48:30 +01:00
monojenkins ff68a657fa [metadata] Check for GTDs in setup_generic_array_ifaces (#18216)
Judging by https://github.com/mono/mono/blob/4cefdcb7ce2d939ee78fb45d1b4913eb3bc064fd/mono/metadata/metadata.c#L3515 the cached_class is sometimes intentionally a GTD, which can get passed all the way down to setup_generic_array_ifaces and cause a crash.
2019-12-17 14:14:03 -05:00
monojenkins eb6a6bae1e [2019-12] [cominterop] Attach to runtime from IUnknown and IDispatch methods (#18185)
* [cominterop][test] Calling QueryInterface from an unattached thread asserts

If we pass a managed COM object to native code and the native code calls one of
the IUnknown methods, we assert because the thread is not attached but we want
to enter GC Unsafe mode.

* [cominterop] Attach to runtime from IUnkown and IDispatch methods

If the COM objects for a managed object is passed to a thread that hasn't
interacted with Mono before, we need to attach before doing GC thread state
transitions.

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

* [test] Call managed method through COM wrapper from unattached thread

This works, but I don't think we had a test previously.  Call a managed method
via a COM interface from a thread that is not attached to the runtime, to
ensure that it is attached.
2019-12-16 11:08:09 -05:00
monojenkins e8046e3848 [2019-12] Relax faultcode parsing for Soap11 message errors. (#18187)
* Relax faultcode parsing for Soap11 message errors.

The mono implementation was reading the faultcode content as an XmlQualifiedName, which applied the rule where you could not
start a name with a number. This caused interoperability problems with the .net framework because their parsing just looks
for <namespace>:<name>, where name can be any string.

Example:

<faultcode>s:1</faultcode>

On mono, a soap response that contains a fault code name of 1 will throw an error.  If you run the same code on the .net framework, it will not.

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

* [csproj] Update project files
2019-12-14 00:32:18 +01:00
Alexander Köplinger ade2f9239a [sdks] Use Xcode 11.3 stable version for iOS/Mac SDKs
As requested by the xamarin-macios team.

(cherry picked from commit 7e65a73d4d)
2019-12-13 18:15:41 +01:00
Ankit Jain ac8a9a9eab [2019-12] Bump msbuild to track mono-2019-10 (#18131)
* Bump msbuild to track mono-2019-10

- msbuild doesn't have a separate branch for mono-2019-12 right now

* [2019-12] Bump msbuild to track mono-2019-10

* [2019-12] Bump msbuild to track mono-2019-10
2019-12-12 20:57:10 -05:00
monojenkins 12c92be908 [corlib] Rename internal LogLevel enum to avoid conflict with Android LogLevel (#18125)
After https://github.com/mono/mono/pull/18040 we now have InternalsVisibleTo for the Mono.Android assembly.
This exposed the internal LogLevel enum in BCLDebug which causes an issue when consumed in XA:

```
Java.Lang/Object.cs(119,18): error CS0104: 'LogLevel' is an ambiguous reference between 'Android.Runtime.LogLevel' and 'System.LogLevel'
```

To fix this we rename the internal enum in corlib since it's not really used.
2019-12-11 11:34:23 +02:00
monojenkins b951ebb775 [debugger] skip suspend for unattached threads (#18110)
[2019-12] [debugger] skip suspend for unattached threads

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

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

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

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

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



<!--
Thank you for your Pull Request!

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

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


Backport of #18105.

/cc @lewurm
2019-12-10 18:15:09 +01:00
monojenkins 47262ff08a [2019-12] [mini] Fix delegate trampoline virtual call via delgate Invoke (#18109)
* [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 17:43:04 +01:00
Ankit Jain 17a925ca25 Bump msbuild+roslyn to track mono-2019-10 (#18092)
* Bump msbuild+roslyn to track mono-2019-10

- bumps roslyn to 3.5.0-beta1-19606-04

* roslyn: Delete reference to the now removed Microsoft.Managed.EditorConfig.targets
2019-12-10 12:39:51 +01:00
monojenkins a2bb316900 Bump to mono/corefx@f3815a9 (#18099)
Picks up https://github.com/mono/corefx/pull/376
2019-12-10 12:35:56 +01:00
monojenkins cbc3a80a27 [2019-12] [threads] Add back mono_threads_attach_tools_thread as a public API (#18074)
* [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-09 10:06:43 +01:00
monojenkins 2538b65b30 Update glib-remap.h to include g_module_address (#18077) 2019-12-09 10:06:17 +01:00
monojenkins 5d83bf4c65 [2019-12] Added Obsolete to AppDomain.CreateDomain for monodroid. (#18026)
* 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-06 18:45:36 +01:00
monojenkins 37c475126d [llvm] Avoid decomposing OP_STOREV_MEMBASE early for types which contains no references. (#18065) 2019-12-06 12:24:16 +01:00
Alexander Köplinger 50d4fc360c 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.

(cherry picked from commit 269d509e42)
2019-12-05 23:21:13 +01:00
monojenkins 159160da7b [System.Net.Http]Add workaround for mono/mono#17897. (#18010)
Use `(UriKind)300` (which is the same as setting `MONO_URI_DOTNETRELATIVEORABSOLUTE=true`)
when parsing Uri headers.
2019-12-05 14:40:49 +01:00
monojenkins 25b7c45431 [2019-12] [corlib] add InternalsVisibleTo for Mono.Android (#18047)
* [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-05 00:44:10 +01:00
Alexander Köplinger 3e0d18cb7b Bump bockbuild to get https://github.com/mono/bockbuild/pull/136 2019-12-05 00:35:14 +01:00
Ankit Jain 8228edb9a2 [2019-12] Bump msbuild to track mono-2019-10 (#18046)
.. to get changes from https://github.com/mono/msbuild/pull/163 .

And bump roslyn to 3.4.0-beta4-19569-03 to match msbuild.
2019-12-04 18:10:51 -05:00
Thays Grazia c823f329f1 Fix side effect. 2019-12-04 14:57:40 -06:00
Thays Grazia bb4cd21233 Fix DIM in a generic interface. Fixes #17869 2019-12-04 14:57:40 -06:00
monojenkins 7327c13535 [2019-12] [profiler] disable inlining when coverage profiler is used and fix allocation sizes (#17999)
* [profiler] let compiler decide about the size of an entry

* [profiler] disable inlining when coverage profiler is used
2019-12-03 16:47:09 +01:00
monojenkins 7eb7a82f09 [sgen] Don't trigger collections during allocation of thread objects (#17996)
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-03 10:10:25 +02:00
Jo Shields 94ad23218f Bump version to 6.10 (#17989) 2019-12-02 15:58:36 -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
345 changed files with 8237 additions and 3130 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
+2 -1
View File
@@ -116,6 +116,8 @@
/mono/sgen @BrzVlad @lambdageek
/mono/tools/offsets-tool @lewurm @rolfbjarne
/mono/utils @vargaz @lewurm @lambdageek
/mono/utils/atomic* @lewurm @vargaz
/mono/utils/mono-hwcap* @lewurm @vargaz
@@ -156,6 +158,5 @@
/tools @lambdageek @vargaz
/tools/locale-builder @marek-safar @egorbo
/tools/nuget-hash-extractor @marek-safar @radical @akoeplinger
/tools/offsets-tool @lewurm @rolfbjarne
/tools/pedump @lambdageek @lewurm
/tools/sgen @brzvlad @vargaz @naricc
-2
View File
@@ -139,8 +139,6 @@ llvm/usr/
sdks/builds/llvm-*/
sdks/builds/android-*/
mcs/build/compiler-server.log
tools/offsets-tool-py/offtool/
tools/offsets-tool-py/clang/__pycache__
##############################################################################
# Arcade output directories
+10 -50
View File
@@ -2,33 +2,11 @@ ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = $(WERROR_CFLAGS)
MONOTOUCH_SUBDIRS = $(libgc_dir) mono
SUBDIRS = @MONO_SUBDIRS@
noinst_SUBDIRS = @MONO_NOINST_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,30 +94,10 @@ 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
install:
for mydir in $(filter-out $(noinst_SUBDIRS),$(SUBDIRS)); do \
(cd $${mydir} && ${MAKE} install) \
done
update-csproj:
-rm msvc/scripts/order
@@ -183,3 +141,5 @@ update-solution-files:
update-solution-files-with-tests:
$(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files
endif
+238 -302
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.10.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.
@@ -510,8 +510,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.)
@@ -605,6 +605,7 @@ AC_CHECK_TOOL(CC, gcc, gcc)
AC_PROG_CC
AC_CHECK_TOOL(CXX, g++, g++)
AC_PROG_CXX
AM_PATH_PYTHON([3.2])
AM_PROG_AS
AC_PROG_INSTALL
AC_PROG_AWK
@@ -1206,8 +1207,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)
@@ -2031,13 +2034,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 +2083,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 +2213,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)
@@ -2934,6 +2927,23 @@ if test x$host_win32 = xno; then
])
fi
dnl ********************************
dnl *** Checks for sys_signame ***
dnl ********************************
AC_MSG_CHECKING(for sys_signame)
AC_TRY_LINK([
#include <signal.h>
], [
const char *signame = sys_signame[0];
], [
# Yes, we have it...
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SYSSIGNAME, 1, [Have sys_signame])
], [
AC_MSG_RESULT(no)
])
dnl ********************************
dnl *** Checks for semaphore lib ***
dnl ********************************
@@ -2945,13 +2955,6 @@ if test x$host_win32 = xno; then
AC_SEARCH_LIBS(shm_open, pthread rt posix4)
AC_CHECK_FUNCS(shm_open)
dnl ********************************
dnl *** Checks for gettext lib ***
dnl ********************************
# This is needed for some hackery for AIX;
# Mono itself doesn't use it, but DllMap includes it
AC_SEARCH_LIBS([gettext], [intl])
dnl ********************************
dnl *** Checks for timezone stuff **
dnl ********************************
@@ -5964,13 +5967,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 +6063,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.6.0/csc.exe
VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.6.0/VBCSCompiler.exe
if test $csc_compiler = mcs; then
CSC=$mcs_topdir/class/lib/build/mcs.exe
@@ -6100,166 +6096,194 @@ 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="mk 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="mk 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"
MONO_NOINST_SUBDIRS="$mono_subdirs_libgc"
fi
AC_SUBST(MONO_SUBDIRS)
AC_SUBST(MONO_NOINST_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 +6723,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 +6739,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 +6868,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.19574.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>928efaa081ffd17b37f6c662fee44775f2d0b90f</Sha>
<Sha>87b59e17420bf0c3341edacbd8a6721e619afbac</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.19574.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>928efaa081ffd17b37f6c662fee44775f2d0b90f</Sha>
<Sha>87b59e17420bf0c3341edacbd8a6721e619afbac</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
+36 -29
View File
@@ -94,34 +94,41 @@ function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Password) {
}
}
if (!(Test-Path $ConfigFile -PathType Leaf)) {
Write-Host "Couldn't find the file NuGet config file: $ConfigFile"
ExitWithExitCode 1
try {
if (!(Test-Path $ConfigFile -PathType Leaf)) {
Write-PipelineTelemetryError -Category 'Build' -Message "Couldn't find the file NuGet config file: $ConfigFile"
ExitWithExitCode 1
}
# Load NuGet.config
$doc = New-Object System.Xml.XmlDocument
$filename = (Get-Item $ConfigFile).FullName
$doc.Load($filename)
# Get reference to <PackageSources> or create one if none exist already
$sources = $doc.DocumentElement.SelectSingleNode("packageSources")
if ($sources -eq $null) {
$sources = $doc.CreateElement("packageSources")
$doc.DocumentElement.AppendChild($sources) | Out-Null
}
# Looks for a <PackageSourceCredentials> node. Create it if none is found.
$creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
if ($creds -eq $null) {
$creds = $doc.CreateElement("packageSourceCredentials")
$doc.DocumentElement.AppendChild($creds) | Out-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
$doc.Save($filename)
}
# Load NuGet.config
$doc = New-Object System.Xml.XmlDocument
$filename = (Get-Item $ConfigFile).FullName
$doc.Load($filename)
# Get reference to <PackageSources> or create one if none exist already
$sources = $doc.DocumentElement.SelectSingleNode("packageSources")
if ($sources -eq $null) {
$sources = $doc.CreateElement("packageSources")
$doc.DocumentElement.AppendChild($sources) | Out-Null
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
ExitWithExitCode 1
}
# Looks for a <PackageSourceCredentials> node. Create it if none is found.
$creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
if ($creds -eq $null) {
$creds = $doc.CreateElement("packageSourceCredentials")
$doc.DocumentElement.AppendChild($creds) | Out-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
$doc.Save($filename)
+1 -1
View File
@@ -42,7 +42,7 @@ 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' -Message "Couldn't find the file NuGet config file: $ConfigFile"
ExitWithExitCode 1
fi
+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
}
+42 -38
View File
@@ -26,42 +26,40 @@ 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.)."
}
function InitializeCustomToolset {
@@ -69,7 +67,7 @@ function InitializeCustomToolset {
return
}
$script = Join-Path $EngRoot "restore-toolset.ps1"
$script = Join-Path $EngRoot 'restore-toolset.ps1'
if (Test-Path $script) {
. $script
@@ -80,8 +78,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.
@@ -117,13 +115,19 @@ function Build {
if ($clean) {
if(Test-Path $ArtifactsDir) {
Remove-Item -Recurse -Force $ArtifactsDir
Write-Host "Artifacts directory deleted."
Write-Host 'Artifacts directory deleted.'
}
exit 0
}
try {
if ($help -or (($null -ne $properties) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) {
. $PSScriptRoot\tools.ps1
If ((Test-Path variable:LastExitCode) -And ($LastExitCode -ne 0)) {
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message 'Eng/common/tools.ps1 returned a non-zero exit code.'
ExitWithExitCode $LastExitCode
}
if ($help -or (($null -ne $properties) -and ($properties.Contains('/help') -or $properties.Contains('/?')))) {
Print-Usage
exit 0
}
@@ -141,7 +145,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
}
+18 -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,19 @@ try {
}
$toolInstallationFailure = $true
} else {
Write-Error $errMsg
Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message $errMsg
exit 1
}
}
}
if ((Get-Variable 'toolInstallationFailure' -ErrorAction 'SilentlyContinue') -and $toolInstallationFailure) {
Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message '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 +133,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
+6 -4
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
}
}
@@ -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
}
+38 -32
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(-Not (Test-Path variable:ci) -Or !$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(-Not (Test-Path variable:ci) -Or !$ci) {
Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput
}
}
+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
+17 -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,16 @@ 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'
+76 -70
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,12 +238,12 @@ 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+
@@ -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.19574.1",
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.19574.1"
}
}
+103
View File
@@ -0,0 +1,103 @@
# 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
mk/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
])
])
+7 -1
View File
@@ -1496,6 +1496,9 @@ scanning is available.
\fBno-managed-allocator\fR
Disables the managed allocator.
.TP
\fBmanaged-allocator\fR
Enables the managed allocator.
.TP
\fBcheck-scan-starts\fR
If set, does a plausibility check on the scan_starts before and after each collection
.TP
@@ -1521,7 +1524,10 @@ sgen-gc.c. You can then use this command to explore the output
\fBnursery-canaries\fR
If set, objects allocated in the nursery are suffixed with a canary (guard)
word, which is checked on each minor collection. Can be used to detect/debug
heap corruption issues.
heap corruption issues. This disables the usage of the managed allocator,
because allocation from full aot code is inconsistent with this option. If
the application is guaranteed not to use aot code, the managed allocator can
be enabled back with managed-allocator option.
.TP
\fBdo-not-finalize(=\fIclasses\fB)\fR
+71 -40
View File
@@ -89,26 +89,32 @@ endif
test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_test.dll)
test_lib_output = $(test_lib_dir)/$(test_lib)
test_sourcefile_base_excludes = $(test_lib).exclude.sources
test_library = $(ASSEMBLY:$(ASSEMBLY_EXT)=)_test$(ASSEMBLY_EXT)
test_response = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).response
test_makefrag = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).makefrag
test_pdb = $(test_lib:.dll=.pdb)
test_flags = $(test_nunit_ref) $(TEST_MCS_FLAGS) $(TEST_LIB_MCS_FLAGS)
ifndef NO_BUILD
test_flags += -r:$(the_assembly)
test_assembly_dep = $(the_assembly)
endif
tests_CLEAN_FILES += $(test_lib_output) $(test_lib_output:$(ASSEMBLY_EXT)=.pdb)
tests_CLEAN_FILES += $(test_lib_output) $(test_response) $(test_makefrag)
xtest_sourcefile_base = $(PROFILE_PLATFORM)_$(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
xtest_sourcefile_base_excludes_full = $(PROFILE_PLATFORM)_$(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.exclude.sources)
xtest_sourcefile_base_excludes = $(xtest_sourcefile_base_excludes_full:_%=%)
xunit_test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xunit-test.dll)
xtest_lib_output = $(test_lib_dir)/$(xunit_test_lib)
xtest_response = $(depsdir)/$(xunit_test_lib).response
xtest_makefrag = $(depsdir)/$(xunit_test_lib).makefrag
xtest_flags = -r:$(the_assembly) $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS) /unsafe
xtest_library = $(ASSEMBLY:$(ASSEMBLY_EXT)=)_xtest$(ASSEMBLY_EXT)
xtest_response = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(xtest_library).response
xtest_makefrag = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(xtest_library).makefrag
xtest_flags = $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS) /unsafe
ifndef NO_BUILD
xtest_flags += -r:$(the_assembly)
xtest_assembly_dep = $(the_assembly)
endif
ifeq ($(wildcard $(xtest_sourcefile_base)),)
xtest_sourcefile_base = $(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
@@ -140,6 +146,10 @@ test_assemblies :=
ifdef HAVE_CS_TESTS
test_assemblies += $(test_lib_output)
ifdef TEST_SPLIT_ASSEMBLIES
test_assemblies += $(test_lib_output:.dll=.part1.dll) $(test_lib_output:.dll=.part2.dll) $(test_lib_output:.dll=.part3.dll)
endif
check: run-test
test-local: $(test_assemblies) $(test_lib_dir)/nunit-excludes.txt
run-test-local: run-test-lib
@@ -262,44 +272,42 @@ endif
TEST_FILES =
ifdef HAVE_CS_TESTS
TEST_FILES += `sed -e '/^$$/d' -e 's,^../,,' -e '/^\#.*$$/d' -et -e 's,^,Test/,' $(test_sourcefile_base)`
endif
ifdef HAVE_CS_TESTS
TEST_FILES += `sed -e '/^$$/d' -e 's,^../,,' -e '/^\#.*$$/d' -et -e 's,^,Test/,' $(test_sourcefile_base)`
$(test_lib_dir):
mkdir -p $@
test_library = $(ASSEMBLY:$(ASSEMBLY_EXT)=)_test$(ASSEMBLY_EXT)
test_sourcefile = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).sources
$(test_sourcefile): $(test_sourcefile_base) $(wildcard *_test.dll.sources) $(wildcard *_test.dll.exclude.sources) $(depsdir)/.stamp
$(GENSOURCES) --basedir:./Test --strict --platformsdir:$(topdir)/build "$@" "$(test_library)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
test_response = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).response
$(test_response): $(test_sourcefile) $(topdir)/build/tests.make $(depsdir)/.stamp
$(PLATFORM_CHANGE_SEPARATOR_CMD) <$(test_sourcefile) >$@
test_makefrag = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).makefrag
$(test_makefrag): $(test_sourcefile) $(topdir)/build/tests.make $(depsdir)/.stamp
@echo Creating $@ ...
@sed 's,^,$(build_lib): ,' $< >$@
@if test ! -f $(test_sourcefile).makefrag; then :; else \
cat $(test_sourcefile).makefrag >> $@ ; \
echo '$@: $(test_sourcefile).makefrag' >> $@; \
echo '$(test_sourcefile).makefrag:' >> $@; fi
$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) $(test_lib_output).nunitlite.config | $(test_lib_dir)
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response)
tests_CLEAN_FILES += $(test_sourcefile) $(test_response) $(test_makefrag)
ifdef TEST_SPLIT_ASSEMBLIES
$(test_lib_output:.dll=.part1.dll): $(test_lib_output) $(test_response).part1
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response).part1
$(test_lib_output:.dll=.part2.dll): $(test_lib_output) $(test_response).part2
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response).part2
$(test_lib_output:.dll=.part3.dll): $(test_lib_output) $(test_response).part3
ifneq ($(wildcard $(test_response).part3),)
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response).part3
endif
# part3 is optional so we need this empty target to silence make if it doesn't exist
$(test_response).part3: ;
tests_CLEAN_FILES += $(test_response).part1 $(test_response).part2 $(test_response).part3
endif
$(test_response): $(test_sourcefile_base) $(wildcard *_test.dll.sources) $(wildcard *_test.dll.exclude.sources) $(topdir)/build/tests.make $(depsdir)/.stamp
$(GENSOURCES) --basedir:./Test --strict --platformsdir:$(topdir)/build "$@" "$(test_library)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
$(test_makefrag): $(test_response)
@echo Creating $@ ...
@sed 's,^,$(test_lib_output) $(test_lib_output:.dll=.part1.dll) $(test_lib_output:.dll=.part2.dll) $(test_lib_output:.dll=.part3.dll): ,' $< >$@
-include $(test_makefrag)
build-test-lib: $(test_lib_output)
@echo Building testing lib
endif
@@ -336,8 +344,15 @@ ifdef COVERAGE
XTEST_COVERAGE_FLAGS = -O=-aot --profile=coverage:output=$(topdir)/class/lib/$(PROFILE_DIRECTORY)/coverage_xunit_$(ASSEMBLY).xml
endif
xtest_assemblies += $(xtest_lib_output)
ifdef XTEST_SPLIT_ASSEMBLIES
xtest_assemblies += $(xtest_lib_output:.dll=.part1.dll) $(xtest_lib_output:.dll=.part2.dll) $(xtest_lib_output:.dll=.part3.dll)
endif
check: run-xunit-test-local
xunit-test-local: $(xtest_lib_output) $(test_lib_dir)/xunit-excludes.txt $(test_lib_dir)/Xunit.NetCore.Extensions.dll $(test_lib_dir)/xunit.execution.dotnet.dll
xunit-test-local: $(xtest_assemblies) $(test_lib_dir)/xunit-excludes.txt $(test_lib_dir)/Xunit.NetCore.Extensions.dll $(test_lib_dir)/xunit.execution.dotnet.dll
run-xunit-test-local: run-xunit-test-lib
$(test_lib_dir)/xunit-excludes.txt: $(topdir)/build/tests.make | $(test_lib_dir)
@@ -360,19 +375,35 @@ run-xunit-test-lib: xunit-test-local
$(XTEST_REMOTE_EXECUTOR): $(topdir)/../external/corefx/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs | $(test_lib_dir)
$(TEST_COMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll $< -out:$@
$(xtest_lib_output): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src) $(XTEST_REMOTE_EXECUTOR) | $(test_lib_dir)
$(xtest_lib_output): $(xtest_assembly_dep) $(xtest_response) $(xunit_libs_dep) $(xunit_src) $(XTEST_REMOTE_EXECUTOR) | $(test_lib_dir)
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src)
xtest_response_preprocessed = $(xtest_response)_preprocessed
ifdef XTEST_SPLIT_ASSEMBLIES
$(xtest_lib_output:.dll=.part1.dll): $(xtest_lib_output) $(xtest_response).part1
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response).part1 $(xunit_src)
$(xtest_lib_output:.dll=.part2.dll): $(xtest_lib_output) $(xtest_response).part2
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response).part2 $(xunit_src)
$(xtest_lib_output:.dll=.part3.dll): $(xtest_lib_output) $(xtest_response).part3
ifneq ($(wildcard $(xtest_response).part3),)
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response).part3 $(xunit_src)
endif
# part3 is optional so we need this empty target to silence make if it doesn't exist
$(xtest_response).part3: ;
xtests_CLEAN_FILES += $(xtest_response).part1 $(xtest_response).part2 $(xtest_response).part3
endif
# This handles .excludes/.sources pairs, as well as resolving the
# includes that occur in .sources files
$(xtest_response): $(xtest_sourcefile_base) $(wildcard *xtest.dll.sources) $(wildcard $(xtest_sourcefile_base_excludes))
$(GENSOURCES) --strict --platformsdir:$(topdir)/build "$@" "$(xtest_sourcefile_base)" "$(xtest_sourcefile_base_excludes)"
# includes that occur in .sources files. It also handles splitting test assemblies into multiple parts.
$(xtest_response): $(xtest_sourcefile_base) $(wildcard *_xtest.dll.sources) $(wildcard *_xtest.dll.exclude.sources) $(topdir)/build/tests.make $(depsdir)/.stamp
$(GENSOURCES) --strict --platformsdir:$(topdir)/build "$@" "$(xtest_library)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
$(xtest_makefrag): $(xtest_response)
@echo Creating $@ ...
@sed 's,^,$(xtest_lib_output): ,' $< >$@
@sed 's,^,$(xtest_lib_output) $(xtest_lib_output:.dll=.part1.dll) $(xtest_lib_output:.dll=.part2.dll) $(xtest_lib_output:.dll=.part3.dll): ,' $< >$@
-include $(xtest_makefrag)
@@ -27,14 +27,28 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsRecipient))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsRecipientCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsRecipientEnumerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsSigner))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.ContentInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.EnvelopedCms))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.KeyAgreeRecipientInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.KeyTransRecipientInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12Builder))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12CertBag))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12Info))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12IntegrityMode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12KeyBag))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12SafeBag))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12SafeContents))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12SafeContentsBag))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12SecretBag))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs8PrivateKeyInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9AttributeObject))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9ContentType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9DocumentDescription))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9DocumentName))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9LocalKeyId))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9MessageDigest))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9SigningTime))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.PublicKeyInfo))]
@@ -42,10 +56,15 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfoCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfoEnumerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfoType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Rfc3161TimestampToken))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SignedCms))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SignerInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SignerInfoCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SignerInfoEnumerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifier))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifierOrKey))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifierOrKeyType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifierType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Xml.X509IssuerSerial))]
+24 -5
View File
@@ -558,6 +558,10 @@ public class Tests : TestsBase, ITest2
runtime_invoke_hybrid_exceptions();
return 0;
}
if (args.Length > 0 && args [0] == "new_thread_hybrid_exception") {
new_thread_hybrid_exception();
return 0;
}
assembly_load ();
breakpoints ();
single_stepping ();
@@ -2222,12 +2226,27 @@ public class Tests : TestsBase, ITest2
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void runtime_invoke_hybrid_exceptions () {
Type rtType = Type.GetType("RuntimeInvokeWithThrowClass");
ConstructorInfo rtConstructor = rtType.GetConstructor(Type.EmptyTypes);
object rtObject = rtConstructor.Invoke(new object[] { });
MethodInfo rtMethod = rtType.GetMethod("RuntimeInvokeThrowMethod");
rtMethod.Invoke(rtObject, new object[] { });
ConstructorInfo rtConstructor = rtType.GetConstructor(Type.EmptyTypes);
object rtObject = rtConstructor.Invoke(new object[] { });
MethodInfo rtMethod = rtType.GetMethod("RuntimeInvokeThrowMethod");
rtMethod.Invoke(rtObject, new object[] { });
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void new_thread_hybrid_exception() {
try
{
Thread thread = new Thread(new_thread_hybrid_exception2);
thread.Start();
}
catch (Exception sockEx)
{
}
}
public static void new_thread_hybrid_exception2()
{
throw new Exception("Error");
}
}
public class SentinelClass : MarshalByRefObject {
+13 -1
View File
@@ -470,7 +470,6 @@ public class DebuggerTests
var pdbFromMemory = assemblyMirror.GetPdbBlob ();
if (!File.Exists (pdbPath)) {
Assert.IsFalse (assemblyMirror.HasPdb);
Assert.IsTrue (assemblyMirror.HasFetchedPdb);
continue;
}
@@ -5151,6 +5150,19 @@ public class DebuggerTests
vm.Exit (0);
vm = null;
}
[Test]
public void TestNewThreadHybridSuspendException () {
TearDown ();
Start (dtest_app_path, "new_thread_hybrid_exception", forceExit: true);
var req2 = vm.CreateExceptionRequest (null, false, true, false);
req2.Enable ();
vm.Resume ();
var ev = GetNextEvent ();
Assert.IsInstanceOfType (typeof (ExceptionEvent), ev);
vm.Exit (0);
vm = null;
}
[Test]
public void TestAsyncDebugGenerics () {
@@ -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);
+25 -2
View File
@@ -5658,21 +5658,30 @@ namespace PEAPI {
char[] name;
Hashtable htable = new Hashtable();
Hashtable btable = new Hashtable (new ByteArrayHashCodeProvider (), new ByteArrayComparer ());
bool addInitByte = false;
bool initByteAdded = false;
internal MetaDataStream(char[] name, bool addInitByte) : base(new MemoryStream())
{
if (addInitByte) { Write((byte)0); size = 1; }
this.addInitByte = addInitByte;
this.name = name;
sizeOfHeader = StreamHeaderSize + (uint)name.Length;
}
internal MetaDataStream(char[] name, System.Text.Encoding enc, bool addInitByte) : base(new MemoryStream(),enc)
{
if (addInitByte) { Write((byte)0); size = 1; }
this.addInitByte = addInitByte;
this.name = name;
sizeOfHeader = StreamHeaderSize + (uint)name.Length;
}
void AddInitByte () {
if (addInitByte && !initByteAdded) {
Write((byte)0);
size += 1;
initByteAdded = true;
}
}
public uint Start {
get { return start; }
set { start = value; }
@@ -5706,6 +5715,7 @@ namespace PEAPI {
internal uint Add(string str, bool prependSize)
{
AddInitByte ();
Object val = htable[str];
uint index = 0;
if (val == null) {
@@ -5723,6 +5733,7 @@ namespace PEAPI {
}
internal uint Add (byte[] str, bool prependSize)
{
AddInitByte ();
Object val = btable [str];
uint index = 0;
if (val == null) {
@@ -5740,6 +5751,7 @@ namespace PEAPI {
internal uint Add(Guid guid, bool prependSize)
{
AddInitByte ();
byte [] b = guid.ToByteArray ();
if (prependSize) CompressNum ((uint) b.Length);
Write(guid.ToByteArray());
@@ -5749,6 +5761,7 @@ namespace PEAPI {
internal uint Add(byte[] blob)
{
AddInitByte ();
uint ix = size;
CompressNum((uint)blob.Length);
Write(blob);
@@ -5758,6 +5771,7 @@ namespace PEAPI {
internal uint Add(byte val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (1);
Write(val);
@@ -5767,6 +5781,7 @@ namespace PEAPI {
internal uint Add(sbyte val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (1);
Write(val);
@@ -5776,6 +5791,7 @@ namespace PEAPI {
internal uint Add(ushort val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (2);
Write(val);
@@ -5785,6 +5801,7 @@ namespace PEAPI {
internal uint Add(short val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (2);
Write(val);
@@ -5794,6 +5811,7 @@ namespace PEAPI {
internal uint Add(uint val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (4);
Write(val);
@@ -5803,6 +5821,7 @@ namespace PEAPI {
internal uint Add(int val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (4);
Write (val);
@@ -5812,6 +5831,7 @@ namespace PEAPI {
internal uint Add(ulong val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (8);
Write(val);
@@ -5821,6 +5841,7 @@ namespace PEAPI {
internal uint Add(long val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (8);
Write(val);
@@ -5830,6 +5851,7 @@ namespace PEAPI {
internal uint Add(float val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (4);
Write(val);
@@ -5839,6 +5861,7 @@ namespace PEAPI {
internal uint Add(double val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (8);
Write(val);
+2
View File
@@ -62,4 +62,6 @@ XTEST_LIB_REFS = System Facades/System.Threading.Tasks Microsoft.CSharp Facades/
XTEST_LIB_FLAGS = -unsafe -d:FEATURE_COMPILE
XTEST_RESX_RESOURCE_STRING = ../../../external/corefx/src/System.Collections.Immutable/src/Resources/Strings.resx
XTEST_SPLIT_ASSEMBLIES := $(filter monotouch%, $(PROFILE))
include ../../build/library.make
@@ -3,12 +3,10 @@
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AssertExtensions.cs
../../../external/corefx/src/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs
# System.Linq
# TODO: ../../../external/corefx/src/System.Linq/tests/*.cs
# System.Linq.Queryable
../../../external/corefx/src/System.Linq.Queryable/tests/*.cs
../../../external/corefx/src/Common/tests/System/Linq/SkipTakeData.cs
#split monotouch
#split monotouch_tv
#split monotouch_watch
# System.Linq.Expressions
../../../external/corefx/src/System.Linq.Expressions/tests/Array/*.cs:NewArrayBoundsTests.cs,ArrayAccessTests.cs,ArrayIndexTests.cs
@@ -56,7 +54,19 @@
../../../external/corefx/src/System.Linq.Expressions/tests/Unary/IncDecAssign/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/*.cs:StackSpillerTests.cs,ReadOnlyCollectionBuilderTests.cs
# System.Linq.Expressions
#split monotouch
#split monotouch_tv
#split monotouch_watch
# System.Linq
# TODO: ../../../external/corefx/src/System.Linq/tests/*.cs
# System.Linq.Queryable
../../../external/corefx/src/System.Linq.Queryable/tests/*.cs
../../../external/corefx/src/Common/tests/System/Linq/SkipTakeData.cs
# System.Linq.Parallel
../../../external/corefx/src/System.Linq.Parallel/tests/Combinatorial/*.cs
../../../external/corefx/src/System.Linq.Parallel/tests/Helpers/*.cs
../../../external/corefx/src/System.Linq.Parallel/tests/QueryOperators/*.cs:DefaultIfEmptyTests.cs,SingleSingleOrDefaultTests.cs
@@ -2,16 +2,15 @@ thisdir = class/System.Net.Http/FunctionalTests
SUBDIRS =
include ../../../build/rules.make
ASSEMBLY = System.Net.Http.FunctionalTests
LIBRARY = System.Net.Http.FunctionalTests.dll
NO_BUILD = yes
NO_INSTALL = yes
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks System.Net.Http
USE_XTEST_REMOTE_EXECUTOR = YES
XTEST_LIB_FLAGS = /resource:../../System/Test/TestData/testservereku.contoso.com.pfx
the_assembly = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/System.Net.Http.dll
include ../../../build/tests.make
include ../../../build/library.make
TEST_RUNTIME := MONO_URI_DOTNETRELATIVEORABSOLUTE=true $(TEST_RUNTIME)
@@ -0,0 +1,27 @@
using System.Reflection;
namespace System.Net.Http
{
partial class HttpClientHandler : HttpMessageHandler
{
static IMonoHttpClientHandler CreateDefaultHandler ()
{
string envvar = Environment.GetEnvironmentVariable ("XA_HTTP_CLIENT_HANDLER_TYPE")?.Trim ();
if (envvar?.StartsWith("System.Net.Http.MonoWebRequestHandler", StringComparison.InvariantCulture) == true)
{
Type monoWrhType = Type.GetType (envvar, false);
if (monoWrhType != null)
return (IMonoHttpClientHandler) Activator.CreateInstance (monoWrhType);
}
// Ignore other types of handlers here (e.g. AndroidHttpHandler) to keep the old behavior
// and always create SocketsHttpHandler for code like this if MonoWebRequestHandler was not specified:
//
// var handler = new HttpClientHandler { Credentials = ... };
// var httpClient = new HttpClient (handler);
//
// AndroidHttpHandler is used only when we use the parameterless ctor of HttpClient
return new SocketsHttpHandler ();
}
}
}
@@ -70,7 +70,7 @@ namespace System.Net.Http
TimeSpan? timeout;
bool disposed;
internal MonoWebRequestHandler ()
public MonoWebRequestHandler ()
{
allowAutoRedirect = true;
maxAutomaticRedirections = 50;
@@ -1328,7 +1328,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Http\src\System\Net\Http\StreamContent.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Http\src\System\Net\Http\StreamToStreamCopy.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Http\src\System\Net\Http\StringContent.cs" />
<Compile Include="HttpClientHandler.SocketsHandler.cs" />
<Compile Include="HttpClientHandler.SocketsHandler.Android.cs" />
<Compile Include="HttpClientHandler.cs" />
<Compile Include="HttpRequestMessage.Mono.cs" />
<Compile Include="IMonoHttpClientHandler.cs" />
@@ -8,27 +8,34 @@ namespace System.Net.Http {
static HttpMessageHandler CreateDefaultHandler ()
{
Type type = Type.GetType("Android.Runtime.AndroidEnvironment, Mono.Android");
if (type == null)
return GetFallback ("Invalid Mono.Android assembly? Cannot find Android.Runtime.AndroidEnvironment");
string envvar = Environment.GetEnvironmentVariable ("XA_HTTP_CLIENT_HANDLER_TYPE")?.Trim ();
MethodInfo method = type.GetMethod ("GetHttpMessageHandler", BindingFlags.Static | BindingFlags.NonPublic);
if (method == null)
return GetFallback ("Your Xamarin.Android version does not support obtaining of the custom HttpClientHandler");
if (string.IsNullOrEmpty (envvar))
return new HttpClientHandler ();
object ret = method.Invoke (null, null);
if (ret == null)
return GetFallback ("Xamarin.Android returned no custom HttpClientHandler");
if (envvar?.StartsWith ("System.Net.Http.MonoWebRequestHandler", StringComparison.InvariantCulture) == true)
{
Type monoWrhType = Type.GetType (envvar, false);
if (monoWrhType != null)
return new HttpClientHandler ((IMonoHttpClientHandler) Activator.CreateInstance (monoWrhType));
var handler = ret as HttpMessageHandler;
if (handler == null)
return GetFallback ($"{ret?.GetType()} is not a valid HttpMessageHandler");
return handler;
}
return new HttpClientHandler ();
}
Type handlerType = Type.GetType (envvar, false);
if (handlerType == null && !envvar.Contains (", "))
{
// if assembly was not specified - look for it in Mono.Android too
// (e.g. AndroidHttpHandler is there)
handlerType = Type.GetType (envvar + ", Mono.Android", false);
}
if (handlerType == null)
return new HttpClientHandler ();
if (Activator.CreateInstance (handlerType) is HttpMessageHandler msgHandler)
return msgHandler;
static HttpMessageHandler GetFallback (string message)
{
Console.WriteLine (message + ". Defaulting to System.Net.Http.HttpClientHandler");
return new HttpClientHandler ();
}
}
@@ -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; };
+4 -4
View File
@@ -2,15 +2,15 @@ thisdir = class/System.Net.Http/UnitTests
SUBDIRS =
include ../../../build/rules.make
ASSEMBLY = System.Net.Http.UnitTests
LIBRARY = System.Net.Http.UnitTests.dll
NO_BUILD = yes
NO_INSTALL = yes
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks
USE_XTEST_REMOTE_EXECUTOR = YES
XTEST_MCS_FLAGS = -nowarn:436
include ../../../build/tests.make
xtest_flags = $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS) /unsafe
include ../../../build/library.make
clean-local:
-rm -f $(tests_CLEAN_FILES) $(CLEAN_FILES)
Whitespace-only changes.
@@ -1 +1,2 @@
HttpClient.DefaultHandler.cs
HttpClientHandler.SocketsHandler.cs
@@ -1,2 +1,3 @@
#include socketshandler.sources
System.Net.Http/HttpClient.android.cs
HttpClientHandler.SocketsHandler.Android.cs
@@ -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);
}
}
}
@@ -423,8 +423,10 @@ namespace System.Runtime.Serialization.Json
XmlDictionaryString namespaceLocal = null;
if (nameLocal != null && nameLocal is string)
writer.WriteStartElement ((string) name, null);
else
else if (name is XmlDictionaryString)
writer.WriteStartElement ((XmlDictionaryString) name, null);
else
writer.WriteStartElement (name.ToString(), null);
}
void WriteEndElement ()
@@ -0,0 +1,115 @@
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;
namespace System.Security.Cryptography.Pkcs {
/// <summary>Enables the creation of PKCS#12 PFX data values. This class cannot be inherited.</summary>
public sealed class Pkcs12Builder {
/// <summary>Gets a value that indicates whether the PFX data has been sealed.</summary>
/// <returns>A value that indicates whether the PFX data has been sealed.</returns>
public bool IsSealed {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Add contents to the PFX in an bundle encrypted with a byte-based password from a byte array.</summary>
/// <param name="safeContents">The contents to add to the PFX.</param>
/// <param name="passwordBytes">The byte array to use as a password when encrypting the contents.</param>
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the contents.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> or <paramref name="pbeParameters" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter value is already encrypted.</exception>
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">
/// <paramref name="pbeParameters" /> indicates that <see cref="F:System.Security.Cryptography.PbeEncryptionAlgorithm.TripleDes3KeyPkcs12" /> should be used, which requires <see cref="T:System.Char" />-based passwords.</exception>
public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, byte[] passwordBytes, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// <summary>Add contents to the PFX in an bundle encrypted with a byte-based password from a span.</summary>
/// <param name="safeContents">The contents to add to the PFX.</param>
/// <param name="passwordBytes">The byte span to use as a password when encrypting the contents.</param>
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the contents.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> or <paramref name="pbeParameters" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter value is already encrypted.</exception>
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">
/// <paramref name="pbeParameters" /> indicates that <see cref="F:System.Security.Cryptography.PbeEncryptionAlgorithm.TripleDes3KeyPkcs12" /> should be used, which requires <see cref="T:System.Char" />-based passwords.</exception>
public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// <summary>Add contents to the PFX in an bundle encrypted with a char-based password from a span.</summary>
/// <param name="safeContents">The contents to add to the PFX.</param>
/// <param name="password">The span to use as a password when encrypting the contents.</param>
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the contents.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> or <paramref name="pbeParameters" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter value is already encrypted.</exception>
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, ReadOnlySpan<char> password, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// <summary>Add contents to the PFX in an bundle encrypted with a char-based password from a string.</summary>
/// <param name="safeContents">The contents to add to the PFX.</param>
/// <param name="password">The string to use as a password when encrypting the contents.</param>
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the contents.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> or <paramref name="pbeParameters" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter value is already encrypted.</exception>
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, string password, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// <summary>Add contents to the PFX without encrypting them.</summary>
/// <param name="safeContents">The contents to add to the PFX.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
public void AddSafeContentsUnencrypted (Pkcs12SafeContents safeContents) {
throw new PlatformNotSupportedException ();
}
/// <summary>Encodes the contents of a sealed PFX and returns it as a byte array.</summary>
/// <returns>A byte array representing the encoded form of the PFX.</returns>
/// <exception cref="T:System.InvalidOperationException">The PFX is not sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="false" />).</exception>
public byte[] Encode () {
throw new PlatformNotSupportedException ();
}
/// <summary>Seals the PFX against further changes by applying a password-based Message Authentication Code (MAC) over the contents with a password from a span.</summary>
/// <param name="password">The password to use as a key for computing the MAC.</param>
/// <param name="hashAlgorithm">The hash algorithm to use when computing the MAC.</param>
/// <param name="iterationCount">The iteration count for the Key Derivation Function (KDF) used in computing the MAC.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="iterationCount" /> parameter is less than or equal to 0.</exception>
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
public void SealWithMac (ReadOnlySpan<char> password, HashAlgorithmName hashAlgorithm, int iterationCount) {
throw new PlatformNotSupportedException ();
}
/// <summary>Seals the PFX against further changes by applying a password-based Message Authentication Code (MAC) over the contents with a password from a string.</summary>
/// <param name="password">The password to use as a key for computing the MAC.</param>
/// <param name="hashAlgorithm">The hash algorithm to use when computing the MAC.</param>
/// <param name="iterationCount">The iteration count for the Key Derivation Function (KDF) used in computing the MAC.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="iterationCount" /> parameter is less than or equal to 0.</exception>
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
public void SealWithMac (string password, HashAlgorithmName hashAlgorithm, int iterationCount) {
throw new PlatformNotSupportedException ();
}
/// <summary>Seals the PFX from further changes without applying tamper-protection.</summary>
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
public void SealWithoutIntegrity () {
throw new PlatformNotSupportedException ();
}
/// <summary>Attempts to encode the contents of a sealed PFX into a provided buffer.</summary>
/// <param name="destination">The byte span to receive the PKCS#12 PFX data.</param>
/// <param name="bytesWritten">When this method returns, contains a value that indicates the number of bytes written to <paramref name="destination" />. This parameter is treated as uninitialized.</param>
/// <returns>
/// <see langword="true" /> if <paramref name="destination" /> is big enough to receive the output; otherwise, <see langword="false" />.</returns>
/// <exception cref="T:System.InvalidOperationException">The PFX is not sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="false" />).</exception>
public bool TryEncode (Span<byte> destination, out int bytesWritten) {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,50 @@
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;
using System.Security.Cryptography.X509Certificates;
namespace System.Security.Cryptography.Pkcs {
/// <summary>Represents the PKCS#12 CertBag. This class cannot be inherited.</summary>
public sealed class Pkcs12CertBag : Pkcs12SafeBag {
/// <summary>Gets the uninterpreted certificate contents of the CertSafeBag.</summary>
/// <returns>The uninterpreted certificate contents of the CertSafeBag.</returns>
public ReadOnlyMemory<byte> EncodedCertificate {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Gets a value indicating whether the content type of the encoded certificate value is the X.509 public key certificate content type.</summary>
/// <returns>
/// <see langword="true" /> if the content type is the X.509 public key certificate content type (1.2.840.113549.1.9.22.1); otherwise, <see langword="false" />.</returns>
public bool IsX509Certificate {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12CertBag" /> class using the specified certificate type and encoding.</summary>
/// <param name="certificateType">The Object Identifier (OID) for the certificate type.</param>
/// <param name="encodedCertificate">The encoded certificate value.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="certificateType" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="encodedCertificate" /> parameter does not represent a single ASN.1 BER-encoded value.</exception>
public Pkcs12CertBag (Oid certificateType, ReadOnlyMemory<byte> encodedCertificate)
: base (null, default(ReadOnlyMemory<byte>)) {
throw new PlatformNotSupportedException ();
}
/// <summary>Gets the contents of the CertBag interpreted as an X.509 public key certificate.</summary>
/// <returns>A certificate decoded from the contents of the CertBag.</returns>
/// <exception cref="">The content type is not the X.509 public key certificate content type.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The contents were not valid for the X.509 certificate content type.</exception>
public X509Certificate2 GetCertificate () {
throw new PlatformNotSupportedException ();
}
/// <summary>Gets the Object Identifier (OID) which identifies the content type of the encoded certificte value.</summary>
/// <returns>The Object Identifier (OID) which identifies the content type of the encoded certificate value.</returns>
public Oid GetCertificateType () {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,13 @@
namespace System.Security.Cryptography.Pkcs {
/// <summary>Represents the kind of encryption associated with a PKCS#12 SafeContents value.</summary>
public enum Pkcs12ConfidentialityMode {
/// <summary>The SafeContents value is not encrypted.</summary>
None = 1,
/// <summary>The SafeContents value is encrypted with a password.</summary>
Password = 2,
/// <summary>The SafeContents value is encrypted using public key cryptography.</summary>
PublicKey = 3,
/// <summary>The kind of encryption applied to the SafeContents is unknown or could not be determined.</summary>
Unknown = 0
}
}
@@ -0,0 +1,59 @@
using System;
using System.Collections.ObjectModel;
using System.Security.Cryptography.Pkcs;
namespace System.Security.Cryptography.Pkcs {
/// <summary>Represents the data from PKCS#12 PFX contents. This class cannot be inherited.</summary>
public sealed class Pkcs12Info {
/// <summary>Gets a read-only collection of the SafeContents values present in the PFX AuthenticatedSafe.</summary>
/// <returns>A read-only collection of the SafeContents values present in the PFX AuthenticatedSafe.</returns>
public ReadOnlyCollection<Pkcs12SafeContents> AuthenticatedSafe {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Gets a value that indicates the type of tamper protection provided for the <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents.</summary>
/// <returns>One of the enumeration members that indicates the type of tamper protection provided for the <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents.</returns>
public Pkcs12IntegrityMode IntegrityMode {
get {
throw new PlatformNotSupportedException ();
}
}
internal Pkcs12Info () {
throw new PlatformNotSupportedException ();
}
/// <summary>Reads the provided data as a PKCS#12 PFX and returns an object view of the contents.</summary>
/// <param name="encodedBytes">The data to interpret as a PKCS#12 PFX.</param>
/// <param name="bytesConsumed">When this method returns, contains a value that indicates the number of bytes from <paramref name="encodedBytes" /> which were read by this method. This parameter is treated as uninitialized.</param>
/// <param name="skipCopy">
/// <see langword="true" /> to store <paramref name="encodedBytes" /> without making a defensive copy; otherwise, <see langword="false" />. The default is <see langword="false" />.</param>
/// <returns>An object view of the PKCS#12 PFX decoded from the input.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The contents of the <paramref name="encodedBytes" /> parameter were not successfully decoded as a PKCS#12 PFX.</exception>
public static Pkcs12Info Decode (ReadOnlyMemory<byte> encodedBytes, out int bytesConsumed, bool skipCopy = false) {
throw new PlatformNotSupportedException ();
}
/// <summary>Attempts to verify the integrity of the <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents with a password represented by a <see cref="System.ReadOnlySpan{System.Char}" />.</summary>
/// <param name="password">The password to use to attempt to verify integrity.</param>
/// <returns>
/// <see langword="true" /> if the password successfully verifies the integrity of the <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents; <see langword="false" /> if the password is not correct or the contents have been altered.</returns>
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.IntegrityMode" /> value is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12IntegrityMode.Password" />.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The hash algorithm option specified by the PKCS#12 PFX contents could not be identified or is not supported by this platform.</exception>
public bool VerifyMac (ReadOnlySpan<char> password) {
throw new PlatformNotSupportedException ();
}
/// <summary>Attempts to verify the integrity of the <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents with a password represented by a <see cref="T:System.String" />.</summary>
/// <param name="password">The password to use to attempt to verify integrity.</param>
/// <returns>
/// <see langword="true" /> if the password successfully verifies the integrity of the <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents; <see langword="false" /> if the password is not correct or the contents have been altered.</returns>
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.IntegrityMode" /> value is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12IntegrityMode.Password" />.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The hash algorithm option specified by the PKCS#12 PFX contents could not be identified or is not supported by this platform.</exception>
public bool VerifyMac (string password) {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,13 @@
namespace System.Security.Cryptography.Pkcs {
/// <summary>Represents the type of anti-tampering applied to a PKCS#12 PFX value.</summary>
public enum Pkcs12IntegrityMode {
/// <summary>The PKCS#12 PFX value is not protected from tampering.</summary>
None = 1,
/// <summary>The PKCS#12 PFX value is protected from tampering with a Message Authentication Code (MAC) keyed with a password.</summary>
Password = 2,
/// <summary>The PKCS#12 PFX value is protected from tampering with a digital signature using public key cryptography.</summary>
PublicKey = 3,
/// <summary>The type of anti-tampering applied to the PKCS#12 PFX is unknown or could not be determined.</summary>
Unknown = 0
}
}
@@ -0,0 +1,25 @@
using System;
using System.Security.Cryptography.Pkcs;
namespace System.Security.Cryptography.Pkcs {
/// <summary>Represents the KeyBag from PKCS#12, a container whose contents are a PKCS#8 PrivateKeyInfo. This class cannot be inherited.</summary>
public sealed class Pkcs12KeyBag : Pkcs12SafeBag {
/// <summary>Gets a memory value containing the PKCS#8 PrivateKeyInfo value transported by this bag.</summary>
/// <returns>A memory value containing the PKCS#8 PrivateKeyInfo value transported by this bag.</returns>
public ReadOnlyMemory<byte> Pkcs8PrivateKey {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12KeyBag" /> from an existing encoded PKCS#8 PrivateKeyInfo value.</summary>
/// <param name="pkcs8PrivateKey">A BER-encoded PKCS#8 PrivateKeyInfo value.</param>
/// <param name="skipCopy">
/// <see langword="true" /> to store <paramref name="pkcs8PrivateKey" /> without making a defensive copy; otherwise, <see langword="false" />. The default is <see langword="false" />.</param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="pkcs8privateKey" /> parameter does not represent a single ASN.1 BER-encoded value.</exception>
public Pkcs12KeyBag (ReadOnlyMemory<byte> pkcs8PrivateKey, bool skipCopy = false)
: base (null, default(ReadOnlyMemory<byte>)) {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,57 @@
using System;
using System.Security.Cryptography;
namespace System.Security.Cryptography.Pkcs {
/// <summary>Defines the core behavior of a SafeBag value from the PKCS#12 specification and provides a base for derived classes.</summary>
public abstract class Pkcs12SafeBag {
/// <summary>Gets the modifiable collection of attributes to encode with the SafeBag value.</summary>
/// <returns>The modifiable collection of attributes to encode with the SafeBag value.</returns>
public CryptographicAttributeObjectCollection Attributes {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Gets the ASN.1 BER encoding of the contents of this SafeBag.</summary>
/// <returns>The ASN.1 BER encoding of the contents of this SafeBag.</returns>
public ReadOnlyMemory<byte> EncodedBagValue {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Called from constructors in derived classes to initialize the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12SafeBag" /> class.</summary>
/// <param name="bagIdValue">The Object Identifier (OID), in dotted decimal form, indicating the data type of this SafeBag.</param>
/// <param name="encodedBagValue">The ASN.1 BER encoded value of the SafeBag contents.</param>
/// <param name="skipCopy">
/// <see langword="true" /> to store <paramref name="encodedBagValue" /> without making a defensive copy; otherwise, <see langword="false" />. The default is <see langword="false" />.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="bagIdValue" /> parameter is <see langword="null" /> or the empty string.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="encodedBagValue" /> parameter does not represent a single ASN.1 BER-encoded value.</exception>
protected Pkcs12SafeBag (string bagIdValue, ReadOnlyMemory<byte> encodedBagValue, bool skipCopy = false) {
throw new PlatformNotSupportedException ();
}
/// <summary>Encodes the SafeBag value and returns it as a byte array.</summary>
/// <returns>A byte array representing the encoded form of the SafeBag.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The object identifier value passed to the constructor was invalid.</exception>
public byte[] Encode () {
throw new PlatformNotSupportedException ();
}
/// <summary>Gets the Object Identifier (OID) identifying the content type of this SafeBag.</summary>
/// <returns>The Object Identifier (OID) identifying the content type of this SafeBag.</returns>
public Oid GetBagId () {
throw new PlatformNotSupportedException ();
}
/// <summary>Attempts to encode the SafeBag value into a provided buffer.</summary>
/// <param name="destination">The byte span to receive the encoded SafeBag value.</param>
/// <param name="bytesWritten">When this method returns, contains a value that indicates the number of bytes written to <paramref name="destination" />. This parameter is treated as uninitialized.</param>
/// <returns>
/// <see langword="true" /> if <paramref name="destination" /> is big enough to receive the output; otherwise, <see langword="false" />.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The object identifier value passed to the constructor was invalid.</exception>
public bool TryEncode (Span<byte> destination, out int bytesWritten) {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,171 @@
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;
using System.Security.Cryptography.X509Certificates;
namespace System.Security.Cryptography.Pkcs {
/// <summary>Represents a PKCS#12 SafeContents value. This class cannot be inherited.</summary>
public sealed class Pkcs12SafeContents {
/// <summary>Gets a value that indicates the type of encryption applied to the contents.</summary>
/// <returns>One of the enumeration values that indicates the type of encryption applied to the contents. The default value is <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.None" />.</returns>
public Pkcs12ConfidentialityMode ConfidentialityMode {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Gets a value that indicates whether this instance in a read-only state.</summary>
/// <returns>
/// <see langword="true" /> if this value is in a read-only state; otherwise, <see langword="false" />. The default value is <see langword="false" />.</returns>
public bool IsReadOnly {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Adds a certificate to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12CertBag" /> and returns the newly created bag instance.</summary>
/// <param name="certificate">The certificate to add.</param>
/// <returns>The bag instance which was added to the SafeContents.</returns>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="certificate" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="certificate" /> parameter is in an invalid state.</exception>
public Pkcs12CertBag AddCertificate (X509Certificate2 certificate) {
throw new PlatformNotSupportedException ();
}
/// <summary>Adds an asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12KeyBag" /> and returns the newly created bag instance.</summary>
/// <param name="key">The asymmetric private key to add.</param>
/// <returns>The bag instance which was added to the SafeContents.</returns>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
public Pkcs12KeyBag AddKeyUnencrypted (AsymmetricAlgorithm key) {
throw new PlatformNotSupportedException ();
}
/// <summary>Adds a nested SafeContents to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12SafeContentsBag" /> and returns the newly created bag instance.</summary>
/// <param name="safeContents">The nested contents to add to the SafeContents.</param>
/// <returns>The bag instance which was added to the SafeContents.</returns>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter is encrypted.</exception>
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
public Pkcs12SafeContentsBag AddNestedContents (Pkcs12SafeContents safeContents) {
throw new PlatformNotSupportedException ();
}
/// <summary>Adds a SafeBag to the SafeContents.</summary>
/// <param name="safeBag">The SafeBag value to add.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeBag" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
public void AddSafeBag (Pkcs12SafeBag safeBag) {
throw new PlatformNotSupportedException ();
}
/// <summary>Adds an ASN.1 BER-encoded value with a specified type identifier to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12SecretBag" /> and returns the newly created bag instance.</summary>
/// <param name="secretType">The Object Identifier (OID) which identifies the data type of the secret value.</param>
/// <param name="secretValue">The BER-encoded value representing the secret to add.</param>
/// <returns>The bag instance which was added to the SafeContents.</returns>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="secretType" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="secretValue" /> parameter does not represent a single ASN.1 BER-encoded value.</exception>
public Pkcs12SecretBag AddSecret (Oid secretType, ReadOnlyMemory<byte> secretValue) {
throw new PlatformNotSupportedException ();
}
/// <summary>Adds an encrypted asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from a byte-based password in an array and returns the newly created bag instance.</summary>
/// <param name="key">The asymmetric private key to add.</param>
/// <param name="passwordBytes">The bytes to use as a password when encrypting the key material.</param>
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
/// <returns>The bag instance which was added to the SafeContents.</returns>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, byte[] passwordBytes, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// <summary>Adds an encrypted asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from a byte-based password in a span and returns the newly created bag instance.</summary>
/// <param name="key">The asymmetric private key to add.</param>
/// <param name="passwordBytes">The bytes to use as a password when encrypting the key material.</param>
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
/// <returns>The bag instance which was added to the SafeContents.</returns>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// <summary>Adds an encrypted asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from a character-based password in a span and returns the newly created bag instance.</summary>
/// <param name="key">The asymmetric private key to add.</param>
/// <param name="password">The password to use when encrypting the key material.</param>
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
/// <returns>The bag instance which was added to the SafeContents.</returns>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, ReadOnlySpan<char> password, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// <summary>Adds an encrypted asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from a character-based password in a string and returns the newly created bag instance.</summary>
/// <param name="key">The asymmetric private key to add.</param>
/// <param name="password">The password to use when encrypting the key material.</param>
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
/// <returns>The bag instance which was added to the SafeContents.</returns>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, string password, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// <summary>Decrypts the contents of this SafeContents value using a byte-based password from an array.</summary>
/// <param name="passwordBytes">The bytes to use as a password for decrypting the encrypted contents.</param>
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.ConfidentialityMode" /> property is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.Password" />.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
/// -or-
/// The contents were not successfully decrypted.</exception>
public void Decrypt (byte[] passwordBytes) {
throw new PlatformNotSupportedException ();
}
/// <summary>Decrypts the contents of this SafeContents value using a byte-based password from a span.</summary>
/// <param name="passwordBytes">The bytes to use as a password for decrypting the encrypted contents.</param>
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.ConfidentialityMode" /> property is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.Password" />.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
/// -or-
/// The contents were not successfully decrypted.</exception>
public void Decrypt (ReadOnlySpan<byte> passwordBytes) {
throw new PlatformNotSupportedException ();
}
/// <summary>Decrypts the contents of this SafeContents value using a character-based password from a span.</summary>
/// <param name="password">The password to use for decrypting the encrypted contents.</param>
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.ConfidentialityMode" /> property is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.Password" />.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
/// -or-
/// The contents were not successfully decrypted.</exception>
public void Decrypt (ReadOnlySpan<char> password) {
throw new PlatformNotSupportedException ();
}
/// <summary>Decrypts the contents of this SafeContents value using a character-based password from a string.</summary>
/// <param name="password">The password to use for decrypting the encrypted contents.</param>
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.ConfidentialityMode" /> property is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.Password" />.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
/// -or-
/// The contents were not successfully decrypted.</exception>
public void Decrypt (string password) {
throw new PlatformNotSupportedException ();
}
/// <summary>Gets an enumerable representation of the SafeBag values contained within the SafeContents.</summary>
/// <returns>An enumerable representation of the SafeBag values contained within the SafeContents.</returns>
/// <exception cref="T:System.InvalidOperationException">The contents are encrypted.</exception>
public IEnumerable<Pkcs12SafeBag> GetBags () {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,20 @@
using System;
using System.Security.Cryptography.Pkcs;
namespace System.Security.Cryptography.Pkcs {
/// <summary>Represents the SafeContentsBag from PKCS#12, a container whose contents are a PKCS#12 SafeContents value. This class cannot be inherited.</summary>
public sealed class Pkcs12SafeContentsBag : Pkcs12SafeBag {
/// <summary>Gets the SafeContents value contained within this bag.</summary>
/// <returns>The SafeContents value contained within this bag.</returns>
public Pkcs12SafeContents SafeContents {
get {
throw new PlatformNotSupportedException ();
}
}
internal Pkcs12SafeContentsBag ()
: base (null, default(ReadOnlyMemory<byte>)) {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,27 @@
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;
namespace System.Security.Cryptography.Pkcs {
/// <summary>Represents the SecretBag from PKCS#12, a container whose contents are arbitrary data with a type identifier. This class cannot be inherited.</summary>
public sealed class Pkcs12SecretBag : Pkcs12SafeBag {
/// <summary>Gets a memory value containing the BER-encoded contents of the bag.</summary>
/// <returns>A memory value containing the BER-encoded contents of the bag.</returns>
public ReadOnlyMemory<byte> SecretValue {
get {
throw new PlatformNotSupportedException ();
}
}
internal Pkcs12SecretBag ()
: base (null, default(ReadOnlyMemory<byte>)) {
throw new PlatformNotSupportedException ();
}
/// <summary>Gets the Object Identifier (OID) which identifies the data type of the secret value.</summary>
/// <returns>The Object Identifier (OID) which identifies the data type of the secret value.</returns>
public Oid GetSecretType () {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,25 @@
using System;
using System.Security.Cryptography.Pkcs;
namespace System.Security.Cryptography.Pkcs {
/// <summary>Represents the ShroudedKeyBag from PKCS#12, a container whose contents are a PKCS#8 EncryptedPrivateKeyInfo. This class cannot be inherited.</summary>
public sealed class Pkcs12ShroudedKeyBag : Pkcs12SafeBag {
/// <summary>Gets a memory value containing the PKCS#8 EncryptedPrivateKeyInfo value transported by this bag.</summary>
/// <returns>A memory value containing the PKCS#8 EncryptedPrivateKeyInfo value transported by this bag.</returns>
public ReadOnlyMemory<byte> EncryptedPkcs8PrivateKey {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from an existing encoded PKCS#8 EncryptedPrivateKeyInfo value.</summary>
/// <param name="encryptedPkcs8PrivateKey">A BER-encoded PKCS#8 EncryptedPrivateKeyInfo value.</param>
/// <param name="skipCopy">
/// <see langword="true" /> to store <paramref name="encryptedPkcs8PrivateKey" /> without making a defensive copy; otherwise, <see langword="false" />. The default is <see langword="false" />.</param>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="encryptedPkcs8privateKey" /> parameter does not represent a single ASN.1 BER-encoded value.</exception>
public Pkcs12ShroudedKeyBag (ReadOnlyMemory<byte> encryptedPkcs8PrivateKey, bool skipCopy = false)
: base (null, default(ReadOnlyMemory<byte>)) {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,149 @@
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;
namespace System.Security.Cryptography.Pkcs {
/// <summary>Enables the inspection of and creation of PKCS#8 PrivateKeyInfo and EncryptedPrivateKeyInfo values. This class cannot be inherited.</summary>
public sealed class Pkcs8PrivateKeyInfo {
/// <summary>Gets the Object Identifier (OID) value identifying the algorithm this key is for.</summary>
/// <returns>The Object Identifier (OID) value identifying the algorithm this key is for.</returns>
public Oid AlgorithmId {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Gets a memory value containing the BER-encoded algorithm parameters associated with this key.</summary>
/// <returns>A memory value containing the BER-encoded algorithm parameters associated with this key, or <see langword="null" /> if no parameters were present.</returns>
public ReadOnlyMemory<byte>? AlgorithmParameters {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Gets the modifiable collection of attributes for this private key.</summary>
/// <returns>The modifiable collection of attributes to encode with the private key.</returns>
public CryptographicAttributeObjectCollection Attributes {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Gets a memory value that represents the algorithm-specific encoded private key.</summary>
/// <returns>A memory value that represents the algorithm-specific encoded private key.</returns>
public ReadOnlyMemory<byte> PrivateKeyBytes {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs8PrivateKeyInfo" /> class.</summary>
/// <param name="algorithmId">The Object Identifier (OID) identifying the asymmetric algorithm this key is for.</param>
/// <param name="algorithmParameters">The BER-encoded algorithm parameters associated with this key, or <see langword="null" /> to omit algorithm parameters when encoding.</param>
/// <param name="privateKey">The algorithm-specific encoded private key.</param>
/// <param name="skipCopies">
/// <see langword="true" /> to store <paramref name="algorithmParameters" /> and <paramref name="privateKey" /> without making a defensive copy; otherwise, <see langword="false" />. The default is <see langword="false" />.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="algorithmId" /> parameter is <see langword="null" />.</exception>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="algorithmParameters" /> parameter is not <see langword="null" />, empty, or a single BER-encoded value.</exception>
public Pkcs8PrivateKeyInfo (Oid algorithmId, ReadOnlyMemory<byte>? algorithmParameters, ReadOnlyMemory<byte> privateKey, bool skipCopies = false) {
throw new PlatformNotSupportedException ();
}
/// <summary>Exports a specified key as a PKCS#8 PrivateKeyInfo and returns its decoded interpretation.</summary>
/// <param name="privateKey">The private key to represent in a PKCS#8 PrivateKeyInfo.</param>
/// <returns>The decoded interpretation of the exported PKCS#8 PrivateKeyInfo.</returns>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="privateKey" /> parameter is <see langword="null" />.</exception>
public static Pkcs8PrivateKeyInfo Create (AsymmetricAlgorithm privateKey) {
throw new PlatformNotSupportedException ();
}
/// <summary>Reads the provided data as a PKCS#8 PrivateKeyInfo and returns an object view of the contents.</summary>
/// <param name="source">The data to interpret as a PKCS#8 PrivateKeyInfo value.</param>
/// <param name="bytesRead">When this method returns, contains a value that indicates the number of bytes read from <paramref name="source" />. This parameter is treated as uninitialized.</param>
/// <param name="skipCopy">
/// <see langword="true" /> to store <paramref name="source" /> without making a defensive copy; otherwise, <see langword="false" />. The default is <see langword="false" />.</param>
/// <returns>An object view of the contents decoded as a PKCS#8 PrivateKeyInfo.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The contents of the <paramref name="source" /> parameter were not successfully decoded as a PKCS#8 PrivateKeyInfo.</exception>
public static Pkcs8PrivateKeyInfo Decode (ReadOnlyMemory<byte> source, out int bytesRead, bool skipCopy = false) {
throw new PlatformNotSupportedException ();
}
/// <summary>Decrypts the provided data using the provided byte-based password and decodes the output into an object view of the PKCS#8 PrivateKeyInfo.</summary>
/// <param name="passwordBytes">The bytes to use as a password when decrypting the key material.</param>
/// <param name="source">The data to read as a PKCS#8 EncryptedPrivateKeyInfo structure in the ASN.1-BER encoding.</param>
/// <param name="bytesRead">When this method returns, contains a value that indicates the number of bytes read from <paramref name="source" />. This parameter is treated as uninitialized.</param>
/// <returns>An object view of the contents decrypted decoded as a PKCS#8 PrivateKeyInfo.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
/// -or-
/// The contents of <paramref name="source" /> indicate the Key Derivation Function (KDF) to apply is the legacy PKCS#12 KDF, which requires <see cref="T:System.Char" />-based passwords.
/// -or-
/// The contents of <paramref name="source" /> do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure.</exception>
public static Pkcs8PrivateKeyInfo DecryptAndDecode (ReadOnlySpan<byte> passwordBytes, ReadOnlyMemory<byte> source, out int bytesRead) {
throw new PlatformNotSupportedException ();
}
/// <summary>Decrypts the provided data using the provided character-based password and decodes the output into an object view of the PKCS#8 PrivateKeyInfo.</summary>
/// <param name="password">The password to use when decrypting the key material.</param>
/// <param name="source">The bytes of a PKCS#8 EncryptedPrivateKeyInfo structure in the ASN.1-BER encoding.</param>
/// <param name="bytesRead">When this method returns, contains a value that indicates the number of bytes read from <paramref name="source" />. This parameter is treated as uninitialized.</param>
/// <returns>An object view of the contents decrypted decoded as a PKCS#8 PrivateKeyInfo.</returns>
public static Pkcs8PrivateKeyInfo DecryptAndDecode (ReadOnlySpan<char> password, ReadOnlyMemory<byte> source, out int bytesRead) {
throw new PlatformNotSupportedException ();
}
/// <summary>Encodes the property data of this instance as a PKCS#8 PrivateKeyInfo and returns the encoding as a byte array.</summary>
/// <returns>A byte array representing the encoded form of the PKCS#8 PrivateKeyInfo.</returns>
public byte[] Encode () {
throw new PlatformNotSupportedException();
}
/// <summary>Produces a PKCS#8 EncryptedPrivateKeyInfo from the property contents of this object after encrypting with the specified byte-based password and encryption parameters.</summary>
/// <param name="passwordBytes">The bytes to use as a password when encrypting the key material.</param>
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
/// <returns>A byte array containing the encoded form of the PKCS#8 EncryptedPrivateKeyInfo.</returns>
/// <exception cref="T:System.Security.Cryptography.CryptographicException">
/// <paramref name="pbeParameters" /> indicates that <see cref="F:System.Security.Cryptography.PbeEncryptionAlgorithm.TripleDes3KeyPkcs12" /> should be used, which requires <see cref="T:System.Char" />-based passwords.</exception>
public byte[] Encrypt (ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// <summary>Produces a PKCS#8 EncryptedPrivateKeyInfo from the property contents of this object after encrypting with the specified character-based password and encryption parameters.</summary>
/// <param name="password">The password to use when encrypting the key material.</param>
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
/// <returns>A byte array containing the encoded form of the PKCS#8 EncryptedPrivateKeyInfo.</returns>
public byte[] Encrypt (ReadOnlySpan<char> password, PbeParameters pbeParameters) {
throw new PlatformNotSupportedException ();
}
/// <summary>Attempts to encode the property data of this instance as a PKCS#8 PrivateKeyInfo, writing the results into a provided buffer.</summary>
/// <param name="destination">The byte span to receive the PKCS#8 PrivateKeyInfo data.</param>
/// <param name="bytesWritten">When this method returns, contains a value that indicates the number of bytes written to <paramref name="destination" />. This parameter is treated as uninitialized.</param>
/// <returns>
/// <see langword="true" /> if <paramref name="destination" /> is big enough to receive the output; otherwise, <see langword="false" />.</returns>
public bool TryEncode (Span<byte> destination, out int bytesWritten) {
throw new PlatformNotSupportedException ();
}
/// <summary>Attempts to produce a PKCS#8 EncryptedPrivateKeyInfo from the property contents of this object after encrypting with the specified byte-based password and encryption parameters, writing the results into a provided buffer.</summary>
/// <param name="passwordBytes">The bytes to use as a password when encrypting the key material.</param>
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
/// <param name="destination">The byte span to receive the PKCS#8 EncryptedPrivateKeyInfo data.</param>
/// <param name="bytesWritten">When this method returns, contains a value that indicates the number of bytes written to <paramref name="destination" />. This parameter is treated as uninitialized.</param>
/// <returns>
/// <see langword="true" /> if <paramref name="destination" /> is big enough to receive the output; otherwise, <see langword="false" />.</returns>
public bool TryEncrypt (ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten) {
throw new PlatformNotSupportedException ();
}
/// <summary>Attempts to produce a PKCS#8 EncryptedPrivateKeyInfo from the property contents of this object after encrypting with the specified character-based password and encryption parameters, writing the result into a provided buffer.</summary>
/// <param name="password">The password to use when encrypting the key material.</param>
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
/// <param name="destination">The byte span to receive the PKCS#8 EncryptedPrivateKeyInfo data.</param>
/// <param name="bytesWritten">When this method returns, contains a value that indicates the number of bytes written to <paramref name="destination" />. This parameter is treated as uninitialized.</param>
/// <returns>
/// <see langword="true" /> if <paramref name="destination" /> is big enough to receive the output; otherwise, <see langword="false" />.</returns>
public bool TryEncrypt (ReadOnlySpan<char> password, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten) {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,32 @@
using System;
using System.Security.Cryptography.Pkcs;
namespace System.Security.Cryptography.Pkcs {
/// <summary>Represents the LocalKeyId attribute from PKCS#9.</summary>
public sealed class Pkcs9LocalKeyId : Pkcs9AttributeObject {
/// <summary>Gets a memory value containing the key identifier from this attribute.</summary>
/// <returns>A memory value containing the key identifier from this attribute.</returns>
public ReadOnlyMemory<byte> KeyId {
get {
throw new PlatformNotSupportedException ();
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs9LocalKeyId" /> class with an empty key identifier value.</summary>
public Pkcs9LocalKeyId () {
throw new PlatformNotSupportedException ();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs9LocalKeyId" /> class with a key identifier specified by a byte array.</summary>
/// <param name="keyId">A byte array containing the key identifier.</param>
public Pkcs9LocalKeyId (byte[] keyId) {
throw new PlatformNotSupportedException ();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs9LocalKeyId" /> class with a key identifier specified by a byte span.</summary>
/// <param name="keyId">A byte array containing the key identifier.</param>
public Pkcs9LocalKeyId (ReadOnlySpan<byte> keyId) {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,120 @@
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;
using System.Security.Cryptography.X509Certificates;
namespace System.Security.Cryptography.Pkcs {
public sealed class Rfc3161TimestampRequest {
public bool HasExtensions {
get {
throw new PlatformNotSupportedException ();
}
}
public Oid HashAlgorithmId {
get {
throw new PlatformNotSupportedException ();
}
}
public Oid RequestedPolicyId {
get {
throw new PlatformNotSupportedException ();
}
}
public bool RequestSignerCertificate {
get {
throw new PlatformNotSupportedException ();
}
}
public int Version {
get {
throw new PlatformNotSupportedException ();
}
}
internal Rfc3161TimestampRequest () {
throw new PlatformNotSupportedException ();
}
/// <param name="data" />
/// <param name="hashAlgorithm" />
/// <param name="requestedPolicyId" />
/// <param name="nonce" />
/// <param name="requestSignerCertificates" />
/// <param name="extensions" />
public static Rfc3161TimestampRequest CreateFromData (ReadOnlySpan<byte> data, HashAlgorithmName hashAlgorithm, Oid requestedPolicyId = null, ReadOnlyMemory<byte>? nonce = default(ReadOnlyMemory<byte>?), bool requestSignerCertificates = false, X509ExtensionCollection extensions = null) {
throw new PlatformNotSupportedException ();
}
/// <param name="hash" />
/// <param name="hashAlgorithm" />
/// <param name="requestedPolicyId" />
/// <param name="nonce" />
/// <param name="requestSignerCertificates" />
/// <param name="extensions" />
public static Rfc3161TimestampRequest CreateFromHash (ReadOnlyMemory<byte> hash, HashAlgorithmName hashAlgorithm, Oid requestedPolicyId = null, ReadOnlyMemory<byte>? nonce = default(ReadOnlyMemory<byte>?), bool requestSignerCertificates = false, X509ExtensionCollection extensions = null) {
throw new PlatformNotSupportedException ();
}
/// <summary>Create a timestamp request using a pre-computed hash value.</summary>
/// <param name="hash">The pre-computed hash value to be timestamped.</param>
/// <param name="hashAlgorithmId">The Object Identifier (OID) for the hash algorithm that produced <paramref name="hash" />.</param>
/// <param name="requestedPolicyId">The Object Identifier (OID) for a timestamp policy the Timestamp Authority (TSA) should use, or <see langword="null" /> to express no preference.</param>
/// <param name="nonce">An optional nonce (number used once) to uniquely identify this request to pair it with the response. The value is interpreted as an unsigned big-endian integer and may be normalized to the encoding format.</param>
/// <param name="requestSignerCertificates">
/// <see langword="true" /> to indicate the Timestamp Authority (TSA) must include the signing certificate in the issued timestamp token; otherwise, <see langword="false" />.</param>
/// <param name="extensions">RFC3161 extensions to present with the request.</param>
/// <returns>An <see cref="T:System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest" /> representing the chosen values.</returns>
public static Rfc3161TimestampRequest CreateFromHash (ReadOnlyMemory<byte> hash, Oid hashAlgorithmId, Oid requestedPolicyId = null, ReadOnlyMemory<byte>? nonce = default(ReadOnlyMemory<byte>?), bool requestSignerCertificates = false, X509ExtensionCollection extensions = null) {
throw new PlatformNotSupportedException ();
}
/// <param name="signerInfo" />
/// <param name="hashAlgorithm" />
/// <param name="requestedPolicyId" />
/// <param name="nonce" />
/// <param name="requestSignerCertificates" />
/// <param name="extensions" />
public static Rfc3161TimestampRequest CreateFromSignerInfo (SignerInfo signerInfo, HashAlgorithmName hashAlgorithm, Oid requestedPolicyId = null, ReadOnlyMemory<byte>? nonce = default(ReadOnlyMemory<byte>?), bool requestSignerCertificates = false, X509ExtensionCollection extensions = null) {
throw new PlatformNotSupportedException ();
}
public byte[] Encode () {
throw new PlatformNotSupportedException ();
}
public X509ExtensionCollection GetExtensions () {
throw new PlatformNotSupportedException ();
}
public ReadOnlyMemory<byte> GetMessageHash () {
throw new PlatformNotSupportedException ();
}
public ReadOnlyMemory<byte>? GetNonce () {
throw new PlatformNotSupportedException ();
}
/// <param name="responseBytes" />
/// <param name="bytesConsumed" />
public Rfc3161TimestampToken ProcessResponse (ReadOnlyMemory<byte> responseBytes, out int bytesConsumed) {
throw new PlatformNotSupportedException ();
}
/// <param name="encodedBytes" />
/// <param name="request" />
/// <param name="bytesConsumed" />
public static bool TryDecode (ReadOnlyMemory<byte> encodedBytes, out Rfc3161TimestampRequest request, out int bytesConsumed) {
throw new PlatformNotSupportedException ();
}
/// <param name="destination" />
/// <param name="bytesWritten" />
public bool TryEncode (Span<byte> destination, out int bytesWritten) {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,61 @@
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;
using System.Security.Cryptography.X509Certificates;
namespace System.Security.Cryptography.Pkcs {
public sealed class Rfc3161TimestampToken {
public Rfc3161TimestampTokenInfo TokenInfo {
get {
throw new PlatformNotSupportedException ();
}
}
internal Rfc3161TimestampToken () {
throw new PlatformNotSupportedException ();
}
/// <summary>Gets a Signed Cryptographic Message Syntax (CMS) representation of the RFC3161 timestamp token.</summary>
/// <returns>The <see cref="T:System.Security.Cryptography.Pkcs.SignedCms" /> representation of the <see cref="T:System.Security.Cryptography.Pkcs.Rfc3161TimestampToken" />.</returns>
public SignedCms AsSignedCms () {
throw new PlatformNotSupportedException ();
}
/// <param name="encodedBytes" />
/// <param name="token" />
/// <param name="bytesConsumed" />
public static bool TryDecode (ReadOnlyMemory<byte> encodedBytes, out Rfc3161TimestampToken token, out int bytesConsumed) {
throw new PlatformNotSupportedException ();
}
/// <param name="data" />
/// <param name="signerCertificate" />
/// <param name="extraCandidates" />
public bool VerifySignatureForData (ReadOnlySpan<byte> data, out X509Certificate2 signerCertificate, X509Certificate2Collection extraCandidates = null) {
throw new PlatformNotSupportedException ();
}
/// <param name="hash" />
/// <param name="hashAlgorithm" />
/// <param name="signerCertificate" />
/// <param name="extraCandidates" />
public bool VerifySignatureForHash (ReadOnlySpan<byte> hash, HashAlgorithmName hashAlgorithm, out X509Certificate2 signerCertificate, X509Certificate2Collection extraCandidates = null) {
throw new PlatformNotSupportedException ();
}
/// <param name="hash" />
/// <param name="hashAlgorithmId" />
/// <param name="signerCertificate" />
/// <param name="extraCandidates" />
public bool VerifySignatureForHash (ReadOnlySpan<byte> hash, Oid hashAlgorithmId, out X509Certificate2 signerCertificate, X509Certificate2Collection extraCandidates = null) {
throw new PlatformNotSupportedException ();
}
/// <param name="signerInfo" />
/// <param name="signerCertificate" />
/// <param name="extraCandidates" />
public bool VerifySignatureForSignerInfo (SignerInfo signerInfo, out X509Certificate2 signerCertificate, X509Certificate2Collection extraCandidates = null) {
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1,101 @@
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;
using System.Security.Cryptography.X509Certificates;
namespace System.Security.Cryptography.Pkcs {
public sealed class Rfc3161TimestampTokenInfo {
public long? AccuracyInMicroseconds {
get {
throw new PlatformNotSupportedException ();
}
}
public bool HasExtensions {
get {
throw new PlatformNotSupportedException ();
}
}
public Oid HashAlgorithmId {
get {
throw new PlatformNotSupportedException ();
}
}
public bool IsOrdering {
get {
throw new PlatformNotSupportedException ();
}
}
public Oid PolicyId {
get {
throw new PlatformNotSupportedException ();
}
}
public DateTimeOffset Timestamp {
get {
throw new PlatformNotSupportedException ();
}
}
public int Version {
get {
throw new PlatformNotSupportedException ();
}
}
/// <param name="policyId" />
/// <param name="hashAlgorithmId" />
/// <param name="messageHash" />
/// <param name="serialNumber" />
/// <param name="timestamp" />
/// <param name="accuracyInMicroseconds" />
/// <param name="isOrdering" />
/// <param name="nonce" />
/// <param name="timestampAuthorityName" />
/// <param name="extensions" />
public Rfc3161TimestampTokenInfo (Oid policyId, Oid hashAlgorithmId, ReadOnlyMemory<byte> messageHash, ReadOnlyMemory<byte> serialNumber, DateTimeOffset timestamp, long? accuracyInMicroseconds = default(long?), bool isOrdering = false, ReadOnlyMemory<byte>? nonce = default(ReadOnlyMemory<byte>?), ReadOnlyMemory<byte>? timestampAuthorityName = default(ReadOnlyMemory<byte>?), X509ExtensionCollection extensions = null) {
throw new PlatformNotSupportedException ();
}
public byte[] Encode () {
throw new PlatformNotSupportedException ();
}
public X509ExtensionCollection GetExtensions () {
throw new PlatformNotSupportedException ();
}
public ReadOnlyMemory<byte> GetMessageHash () {
throw new PlatformNotSupportedException ();
}
public ReadOnlyMemory<byte>? GetNonce () {
throw new PlatformNotSupportedException ();
}
public ReadOnlyMemory<byte> GetSerialNumber () {
throw new PlatformNotSupportedException ();
}
public ReadOnlyMemory<byte>? GetTimestampAuthorityName () {
throw new PlatformNotSupportedException ();
}
/// <param name="encodedBytes" />
/// <param name="timestampTokenInfo" />
/// <param name="bytesConsumed" />
public static bool TryDecode (ReadOnlyMemory<byte> encodedBytes, out Rfc3161TimestampTokenInfo timestampTokenInfo, out int bytesConsumed) {
throw new PlatformNotSupportedException ();
}
/// <param name="destination" />
/// <param name="bytesWritten" />
public bool TryEncode (Span<byte> destination, out int bytesWritten) {
throw new PlatformNotSupportedException ();
}
}
}
@@ -211,6 +211,22 @@
<Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.ProtectedData\src\System\Security\Cryptography\DataProtectionScope.cs" />
<Compile Include="Assembly\AssemblyInfo.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\EnvelopedCms.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12Builder.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12CertBag.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12ConfidentialityMode.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12Info.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12IntegrityMode.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12KeyBag.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12SafeBag.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12SafeContents.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12SafeContentsBag.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12SecretBag.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12ShroudedKeyBag.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs8PrivateKeyInfo.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs9LocalKeyId.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Rfc3161TimestampRequest.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Rfc3161TimestampToken.NotSupported.cs" />
<Compile Include="System.Security.Cryptography.Pkcs\Rfc3161TimestampTokenInfo.NotSupported.cs" />
<Compile Include="corefx\SR.cs" />
</ItemGroup>
<!--End of common files-->
Loaded 100 of 345 files, more files were not shown because too many files have changed in this diff. Show more