Compare commits

...
Author SHA1 Message Date
[email protected] c4e14ad8a4 Removed old test. 2019-06-17 11:33:09 -04:00
[email protected] f2c22c8ac4 Reverted white space changes to sgen-mono because it creates a big diff. 2019-06-14 13:29:04 -04:00
[email protected] c256a0fa80 Reverted trailing whitespace removal fro icall because it created a massive diff. 2019-06-14 13:26:33 -04:00
[email protected] 2885957720 Increased allocation in test. 2019-06-14 12:54:55 -04:00
[email protected] 74658ba46b Removed trailing whitespace. 2019-06-14 12:54:01 -04:00
[email protected] c9b277cd3b Removed extra whitespace. 2019-06-14 12:48:06 -04:00
[email protected] dd7f7d0976 Style issues. 2019-06-14 11:33:48 -04:00
[email protected] 1d0fc47618 Warmed up allocation in test. 2019-06-13 17:09:04 -04:00
[email protected] e3d1a191c2 Removed printfs. 2019-06-13 15:45:03 -04:00
[email protected] 94749fe6fb Removed more double counting. 2019-06-12 17:45:07 -04:00
[email protected] 3699cf07ae Removed some double counts. 2019-06-12 17:40:41 -04:00
[email protected] a0fe1a09e8 Fixed a bunch of errors in GCTest 2019-06-11 16:03:01 -04:00
[email protected] 274118e6b8 Added test for gc alloc count to corelib build. 2019-06-11 15:16:11 -04:00
[email protected] 39ed1bce7b Fixed things in GCTest.cs 2019-06-10 18:29:53 -04:00
[email protected] b6f92c45d2 Added tests for get bytes allocated. 2019-06-10 18:12:58 -04:00
[email protected] 066e0029af Removed unecessary size subtraction; used tlab_next as the end of allocated region in tlab. 2019-06-10 15:18:08 -04:00
[email protected] 0912bc0f6e Recorded allocation when tlabs are cleared. 2019-06-07 14:07:42 -04:00
[email protected] 0cc69fd165 Added counter increments to sgen_try_alloc_obj_nolock 2019-06-06 16:06:31 -04:00
[email protected] 7a75b4d9d5 Added counter increments to sgen_try_alloc_obj_nolock 2019-06-06 15:57:10 -04:00
[email protected] 7514f01302 Removed extra field I added to mono thread; unecessary declaration in mono-gc.h 2019-06-06 15:01:35 -04:00
[email protected] 013eacaf86 Removed macro. 2019-06-06 14:37:52 -04:00
[email protected] 5fc3062411 Increment counter on more allocaiton paths. 2019-06-06 13:56:54 -04:00
[email protected] fd15f967dc Added dummy method to null and boehm gc. 2019-06-05 21:08:07 -04:00
[email protected] f919f3d3db Updated icall to point at the new interface. 2019-06-05 16:32:19 -04:00
[email protected] 20e8a6dab6 Made total bytes allocated go through gc interface. 2019-06-04 17:19:40 -04:00
[email protected] 5761c3f874 Fixed typo in attribute. 2019-06-04 13:44:31 -04:00
[email protected] 223cf0bd19 Removed redundant icall. 2019-06-04 11:52:01 -04:00
[email protected] 54f317467e Added call into threads.c 2019-06-03 16:45:55 -04:00
[email protected] f63f78022c Merged changes from master
Merge branch 'master' of github.com:mono/mono into naricc/allocated_bytes
2019-06-03 15:37:51 -04:00
Alexander Köplinger 098de8b1ee [ci] Remove spaces in pipeline-netcore-runtime.yml
According to docs "names must contain only basic Latin alphabet letters (A-Z, a-z), numbers, and underscores (_)"
2019-06-03 19:56:37 +02:00
dotnet-maestro 369777b246 Update dependencies from https://github.com/dotnet/arcade build 20190602.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19302.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19302.2
2019-06-03 15:26:33 +02:00
monojenkins 283261cd1c [csproj] Update project files 2019-06-03 14:36:00 +02:00
Marek Safar eb99fdeb1a Update API 2019-06-03 14:36:00 +02:00
Marek Safar c84dc2ec55 [Mono.Profiler.Log] Add profiled data reader APIs 2019-06-03 14:36:00 +02:00
Katelyn Gadd 888c8b4621 Basic CI test coverage verifying that we can compile msbuild (#14242)
This adds a basic CI pass that attempts to compile the latest revision of msbuild and verifies that it produced an MSBuild.dll.
2019-06-03 12:03:36 +02:00
Rich Lander cab30bcecc Update TPN with Mono entry (#14744)
* Update TPN with Mono entry

* Update THIRD-PARTY-NOTICES.TXT

Add additional notice for Mono

* Update THIRD-PARTY-NOTICES.TXT

Update the Novell MIT-specific license

* Update THIRD-PARTY-NOTICES.TXT

Group various patterns of Mono license together
2019-06-03 09:05:18 +02:00
Jay Krell 018940f1bc Remove W32_UPDATE_LAST_ERROR_RESTORE_POINT that is not used and does not make sense to me, as to when it would be useful, having preserved LastError around many code paths through the years. 2019-06-03 09:04:16 +02:00
Jay Krell c5a628e86f Do not change Win32 lasterror in the first MONO_EXIT_GC_SAFE. 2019-06-03 09:04:16 +02:00
Aleksey Kliger a7578081e1 [sdks] Bump Android NDK, build tools and platform tools versions
Try to match Xamarin.Android master

Build tools and Platform tools: https://github.com/xamarin/xamarin-android/blob/f9f5b6cd120484b13df74e94638e07411d8693fa/Configuration.props#L100-L102

NDK: https://github.com/xamarin/xamarin-android/blob/f9f5b6cd120484b13df74e94638e07411d8693fa/build-tools/scripts/Ndk.targets#L4
2019-06-03 09:02:07 +02:00
Rich Lander 7c6efec792 Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/new/master/mcs/class/System.Data/Test
2019-06-03 08:57:09 +02:00
Rich Lander 474f20c5ea Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/tree/61559965a188d03456d6f7840a0cdabdf35c2400/mcs/tools/sqlsharp
2019-06-03 08:56:48 +02:00
Marek Safar 33136e3601 Merge pull request #14754 from Dotnet-GitSync-Bot/mirror-merge-10213317
Mirror changes from mono/coreclr
2019-06-03 08:47:04 +02:00
dotnet-maestro 0cab992234 Update dependencies from https://github.com/dotnet/arcade build 20190601.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19301.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19301.2
2019-06-03 08:45:59 +02:00
Dan Moseley 0e1b88b8ed Improve fatal err msg (dotnet/coreclr#24390)
* Improve fatal err msg

* Match SO format

* a

* Remove dead define

* More adjustments to ex msg

* And PAL

* Remove special case for SOE

* Remove excess Debug.Assert newline

* Remove excess newline

* typo

* New format

* Remove DebugProvider redundancy

* Adjustments

* Remove preceding newline

* Make other SOE and OOM consistent

* Tidy up assertion msg

* Fix missing newline after inner exception divider

* CR when no inner exception

* ToString never CR terminated

* disable corefx tests temporarily

Signed-off-by: dotnet-bot <[email protected]>
2019-06-02 13:57:10 +00:00
Rich Lander e27cda23e0 Update THIRD-PARTY-NOTICES.TXT
Add usage link
2019-06-01 20:41:40 +02:00
Rich Lander 015560df3d Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/blob/0f9bb15622b649db81974057f66669674ea47923/mcs/class/I18N/tools/cvt.sh
2019-06-01 20:41:40 +02:00
Rich Lander 72dfea91df Update THIRD-PARTY-NOTICES.TXT
Add entry for https://github.com/mono/mono/blob/a34c9c79c07156797499b6ed2ce43c5897263b57/mono/benchmark/logic.cs
2019-06-01 20:40:57 +02:00
dotnet-maestro 860cb934ec Update dependencies from https://github.com/dotnet/arcade build 20190531.5
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19281.5
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19281.5
2019-06-01 20:40:09 +02:00
Zoltan Varga 7e0585fa35 [wasm] Add document with wasm feature requests. 2019-06-01 10:42:46 -05:00
Zoltan Varga b0d2edff27 [arm64] Set a llvm target layout. Assert in llvm if the target layout is not set, the defaults used by 'opt' are not correct. (#14714)
* [arm64] Set a llvm target layout. Assert in llvm if the target layout is not set, the defaults used by 'opt' are not correct.

* Add a llvm target layout for amd64.
2019-06-01 01:33:57 -04:00
Stephen Toub 7294bbc140 Fix FileStream.FlushAsync() to behave like Flush() (dotnet/coreclr#24902)
Flush() behaves like Flush(false) and writes out any buffered data but doesn't P/Invoke to FlushFileBuffers/FSync to flush the OS buffers.

But whereas FlushAsync() is supposed to just be an async equivalent of Flush(), it's actually behaving like Flush(true).  This makes FlushAsync() inconsistent and much more expensive.  (This is separate from FlushAsync not actually being async, which is an impactful problem to be solved separately.)

This changes FlushAsync to behave like Flush()/Flush(false) rather than Flush(true).  If someone wants the FlushFileBuffers/FSync behavior, they can call Flush(true).

Signed-off-by: dotnet-bot <[email protected]>
2019-06-01 07:11:46 +02:00
Alexis Christoforides 7300066faa [MacSDK] Properly handle PATHs with spaces during package post-install (#14735) 2019-05-31 20:49:10 -07:00
Kenneth Pouncey df402845f2 [wasm][bindings] Add support for marshaling DateTime and DateTimeOffset (#14722)
* Add support for marshalling DateTime and DateTimeOffset

* Add type checking to Runtime.GetDateValue

- Update to use clr ToUnixTimeMillisecons and FromUnixTimeMilliseonds to replace manual calculations.
- Moved magic numbers to managed side to address comments left by Katelyn and Jay.
2019-06-01 05:11:59 +02:00
Ryan Lucia 43aeac9e1e Propagate error in mono_file_map_error on posix (#14710) 2019-05-31 17:19:32 -04:00
[email protected] 3f44389aad Merge branch 'master' of github.com:mono/mono into naricc/allocated_bytes 2019-05-31 15:02:08 -04:00
Ryan Lucia 5d088cf0de [coop] Add GC safe transitions around blocking OS API calls (#14612)
If this was not possible due to them being called during runtime initialization, a short comment was left noting the specific reason why.

Fixes #14377

This includes a couple other random fixes I noticed on the way, most notably replacing SEE_MASK_FLAG_DDEWAIT with SEE_MASK_FLAG_NOASYNC as the former is deprecated.
2019-05-31 14:39:22 -04:00
Jo Shields 0f4ac3f13e Bump version to 6.5.0 (#14728) 2019-05-31 12:59:57 -04:00
Aleksey Kliger 8004791be8 [metadata] Mark mono_type_is_generic_parameter as a MONO_API
Used by the MONO_CLASS_IS_INTERFACE macro.

Fixes https://github.com/mono/mono/issues/14005
2019-05-31 12:07:58 +02:00
Vlad Brezae caa4a753ca [marshal] Fix race between delegate marshaling and finalization
When passing a delegate to native code, we pass the delegate_trampoline which can be used to invoke the delegate from native code and we store this mapping (delegate_trampoline->delegate) in a hashtable so we can get a delegate for the delegate_trampoline, when marshalling the opposite way. If we are trying to marshal a ftnptr (for managed code) to a delegate and we don't find this mapping we can crash. This could happen if the finalization for some other delegate that uses the same ftnptr removes this entry from the table. We solve this by never freeing these entries. The first delegate-ftnptr pair will always be alive. This is easier, faster and potentially uses less memory than tracking in the hashtable every pair. There should be a small and limited set of methods marshalled to native.

Fixes https://github.com/mono/mono/issues/13231
2019-05-31 12:05:37 +02:00
Katelyn Gadd 8d858b20c5 Add CI test coverage for compiler server (#14145)
* Add a warning to the gensources Makefile so it's not confusing when it fails to compile in non-build profiles

* Add CI test script that verifies the compiler server functions

* Fix bugs

* Add compiler server tag to jenkins script

* Add +x

* Rename compiler server test tag
2019-05-31 12:03:31 +02:00
Steve Pfister d607506055 Merge pull request #14325 from HebaruSan/fix/listviewgroup-forecolor
Fix light on light ListViewGroup headers on dark theme
2019-05-30 22:05:37 -04:00
[email protected] b2b9703239 Made sgen-alloc retrieve stuf out of MonoThreadInfo 2019-05-30 17:16:40 -04:00
Ryan Lucia c6eaeeed85 Batch of runtime warning fixes on Darwin (#14713) 2019-05-30 16:35:47 -04:00
[email protected] 1b56a9eb8b Merge branch 'master' of github.com:mono/mono into naricc/allocated_bytes
Merging from master
2019-05-30 15:30:24 -04:00
[email protected] 70ecd9ea56 Commiting changes before I fork the repo. 2019-05-30 14:56:58 -04:00
Aleksey Kliger 615698f44e [monodroid] Exclude System.IO.Tests.File_Copy_str_str CoreFX testsuite
The test case CopyFileWithData_MemberData with input of size 1024 * 1024 * 10
causes the Xamarin.Android.Bcl_Tests to crash for some reason.  Temporarily
exclude this entire set of tests from running.

Also disable System.IO.Tests.FileInfo_CopyTo_str because it derives from the
above test class.
2019-05-30 19:33:32 +02:00
Stephen Toub eda4361b05 Handle nullable attributes on platforms that lack them
Signed-off-by: dotnet-bot <[email protected]>
2019-05-30 19:25:27 +02:00
Martin Baulig 19358243ed [corlib]: Move sre dependency into their own method in System.RuntimeType. (#14698)
* [corlib]: Move sre dependency into their own method in `System.RuntimeType`.

Move call to `TypeBuilderInstantiation.MakeGenericType` into a new
`System.RuntimeType.MakeTypeBuilderInstantiation` method to allow the
linker to remove it.

Requires linker PR https://github.com/mono/linker/pull/590.

* Bump linker.

* Bump cecil as well.

* Fix the build.

* Really fix the build.

* Bump API snapshot submodule

* [csproj] Update project files
2019-05-30 18:19:55 +02:00
dotnet-maestro b04d31702e Update dependencies from https://github.com/dotnet/arcade build 20190529.5
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19279.5
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19279.5
2019-05-30 18:02:38 +02:00
Jo Shields 4eda5f50eb [netcore] Fix duplicate publishing of metapackage (#14708) 2019-05-30 09:59:33 -04:00
Jay Krell e2d6361771 Remove JIT icall hashing by name and AOT JIT icall hashing. (#14644) 2019-05-30 12:39:55 +02:00
Jo Shields 2a5e8f0c37 [netcore] Add a metapackage for all supported runtimes 2019-05-30 09:21:05 +02:00
Jay Krell 815cb9da1a mono_mempool_alloc0: Don't give up the rest of the chunk (#14671)
when the allocation does not fit, i.e. when it is >= MONO_MEMPOOL_PREFER_INDIVIDUAL_ALLOCATION_SIZE.

Or at least make the code clearer and smaller.

"fixes" https://github.com/mono/mono/issues/14669.
2019-05-29 19:11:46 -04:00
Blightbuster 778fd0e2d3 Fix spelling in wasm sample docs (#14570) 2019-05-30 00:26:12 +02:00
dotnet-maestro a6bb97472c Update dependencies from https://github.com/dotnet/arcade build 20190528.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19278.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19278.1
2019-05-29 23:11:29 +02:00
Marek Safar 30a2eeb982 [System.Private.CoreLib] Reflect shared partition changes 2019-05-29 22:14:22 +02:00
Jan Kotas e920807341 Fix superfluous delegate allocations in Unix WaitSubsystem (#7454)
Fixes #7452

Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 22:14:22 +02:00
Stephen Toub ae89c386b4 Change StreamReader.ReadBufferAsync to return ValueTask<int> (#24810)
It's a private helper that's always directly awaited.  No need to allocate a task each time it's called and data is synchronously available.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 22:14:22 +02:00
Vladimir Sadov 76dee58018 Using AllocateUninitializedArray in array pool (dotnet/coreclr#24504)
* Just use `new T[]` when elements are not pointer-free

* reduce zeroing out when not necessary.

* use AllocateUninitializedArray in ArrayPool

Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 22:14:22 +02:00
Marek Safar 3285e0519e Move parts of WeakReference to shared partition (dotnet/coreclr#24800)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 22:14:22 +02:00
Jan Kotas 41522e6fdb Cleanup unnecessary code in exception formatting (dotnet/coreclr#24797)
* Cleanup unnecessary code in exception formatting

* Delete fNeedFileInfo argument for GetStackTrace

Fixes #8694

Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 22:14:22 +02:00
[email protected] 5115ab0100 Put things in icall-def.h in proper alphabetical order. 2019-05-29 15:34:53 -04:00
[email protected] 1df089428c Moved declartion of GetAllocatedBytes. 2019-05-29 15:10:05 -04:00
Rich Lander 83a9d92110 Update THIRD-PARTY-NOTICES.TXT 2019-05-29 18:47:07 +02:00
Rich Lander d97a62a14e Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/blob/7a1a832f6577ffb12d4d302d2868a5b1aaa5ec65/packaging/MacSDK/packaging/resources/postinstall#L96
2019-05-29 18:47:07 +02:00
Aleksey Kliger (λgeek) addc474eb0 [ci] Add Android Windows (Release) archive job to the pipeline (#14699) 2019-05-29 17:52:42 +02:00
Alexander Köplinger f46191114b [bcl] Add nunit exclude categories for monotouch/monodroid profiles (#14695)
We didn't set all the categories that the products used in our profiles.

Now that the products can consume the exclude categories from mono we
need to unify the values.

Removed ValueAdd since it's not used anymore and combined MacNotWorking
into NotOnMac.
2019-05-29 16:58:55 +02:00
Alexander Köplinger 4fcbbd8fb7 [System] Fix MultiCastOptionTest on WatchOS
With https://github.com/mono/mono/commit/cf69b4725976e51416bfdff22f3e1834006af00a it started doing DNS lookups for localhost and we don't have sockets on the watch.
2019-05-29 16:44:58 +02:00
Egor Bogatov 472465d6ba bump roslyn 2019-05-29 10:25:18 +02:00
Rich Lander ea3e3dd114 Update THIRD-PARTY-NOTICES.TXT 2019-05-29 10:20:21 +02:00
Rich Lander 51d58cf80c Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/blob/23e6f6f4b58d72800f4e27fa29a6b58806ff475f/mono/mini/bench.cs#L65
2019-05-29 10:20:21 +02:00
Rich Lander 1cea554b69 Update THIRD-PARTY-NOTICES.TXT 2019-05-29 10:20:01 +02:00
Rich Lander 1b038ee743 Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/tree/master/mcs/class/I18N/CJK/Test
2019-05-29 10:20:01 +02:00
Rich Lander 9cfe096cac Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/blob/29ee4e15806848ff5131c4bdd23ded786f5bc186/mono/benchmark/zipmark.cs
2019-05-29 10:19:41 +02:00
Marek Safar 088cbe3b04 [System.Private.CoreLib] Remove unused members and further cleanups 2019-05-29 09:44:58 +02:00
Marek Safar c03cc8361f [System.Private.CoreLib] Reflect shared partition changes 2019-05-29 09:43:57 +02:00
Marco Rossignoli 3d7a409154 Expose Path.TrimEndingDirectorySeparator (dotnet/coreclr#20805)
* expose TrimEndingDirectorySeparator

* address PR feedback

* updates

* address PR feedback

* fix comment

Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 09:43:57 +02:00
Egor Bogatov 9a11bd94a3 Move some CustomAttribute related types to shared (dotnet/coreclr#23651)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-29 09:43:57 +02:00
Vlad Brezae 04f4db7b87 [interp] Make --interp= not override last set execution mode (#14683)
It makes sense to pass --interp (--interp=-inline) while having another execution mode previously set up (like --full-aot-interp).

Cleanup code a little bit by killing mono_enable_interp which doesn't do much.
2019-05-29 10:02:23 +03:00
Katelyn Gadd add2a211b3 Infrastructure support / fixes for making compiler server the default (#14279)
* Fix enabling the compiler server using autogen, and force it off if mcs is being used

* autogen updates

* Formatting fixes

* Fix vbcs getting turned on if unspecified even if mcs was selected

* Dynamically evaluate ENABLE_COMPILER_SERVER each time we compile instead of evaluating it once at some arbitrary point during makefile evaluation

* More detailed comment based on testing

* Handle the /shared option in genproj so it doesn't fail

* Raise basic profile check requirement to 6.2 and hopefully assert that named pipes work

* Default compiler server to off for now.
2019-05-28 23:54:44 -07:00
Alexander Köplinger edd6c013b0 [sdks] Only package android-sources on macOS
rsync might not be installed on other platforms and we only need android-sources in one sdks archive.
2019-05-29 00:30:22 +02:00
Nathan Ricci 766b9f4616 More implementation. 2019-05-28 18:16:09 -04:00
Alexander Köplinger a2f66ddca1 [sdks] Don't package android-sources on Windows
We don't need it there.
2019-05-28 19:50:00 +02:00
Alexander Köplinger 4b1e9da414 [sdks] Add linker sources to android sdks archive (#14686)
(cherry picked from commit c96878fb16)
2019-05-28 18:57:46 +02:00
Alexander Köplinger 07c58ee2ed [bcl] Write newline-separated nunit/xunit excludes file for sdks archive (#14681)
During XI integration we noticed that just using the verbatim commandline
-exclude or -notrait is not ideal since XI uses the nunit/xunit APIs to
pass that information and not the command line parser.

Instead we now write the exclude categories/traits as a newline-separated file.
2019-05-28 18:49:26 +02:00
Stephen Toub a67c6a2b52 Add and apply nullable attributes (dotnet/coreclr#24679)
* Add and apply nullable attributes

* Adapt to API review decisions

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-28 18:14:19 +02:00
Vlad Brezae 5cbe938847 [interp] Share more wrappers for different interp in signatures (#14596)
[interp] Share more wrappers for different interp in signatures

The passed arguments are already considered to be gpointer in interp_entry and the real value is obtained using stackval_from_data. For types that are passed by value in a register the wrappers will be identical and we can share them.

This commit reduces the size used by interp_in wrappers (in fullaot-interp) by half. These wrappers still take a fair amount of size, which comes mainly from signatures including value types, which aren't shared.
2019-05-28 11:46:49 -04:00
Alexander Köplinger 20fcb62cbc Bump corefx to fix monodroid profile build on Windows 2019-05-28 15:35:17 +02:00
Aleksey Kliger (λgeek) 83f17b4cf9 [sdks] Build static binaries for Android SDK and LLVM with MXE (#14283)
We used to use the static MXE toolchain, but after switching to Homebrew, we
have to explicitly pass flags to build binaries that don't depend on the
MinGW32 GCC support libraries (libstdc++-6.dll, libwinpthread-1.dll and others)
when building the LLVM and Mono binaries.

The simplest approach is just to pass CMAKE_EXE_LINKER_FLAGS=-static to cmake
and LDFLAGS=-all-static to libtool.  The rest of the changes are just to make
it easier to do that by adding a configure flag and updating the SDKs
infrastructure.

We will also need an LLVM bump to actually build a new llvm archive with the
new build flags; until then, building Mono will provision an old build of LLVM
with the old build flags that still depends on libstdc++-6.dll.

---

An alternative approach instead of passing -all-static and -static would be to
probe for the assorted -static-libXYZ flags to GCC at configure time.  (For the
LLVM build we would need to hardcode them as that build doesn't go through
autoconf).  Right now Mono doesn't have any other DLL dependencies (other than
the core windows DLLs), so -all-static works just as well and is simpler.
2019-05-28 08:56:51 -04:00
Sebastien Pouliot 9fb44af2fe [mscorlib] Ensure monotouch[_runtime] API are identical (#14665)
* [mscorlib] Ensure monotouch[_runtime] API are identical

Ensure the API surface for `mscorlib.Core.dll` is identical between the
`monotouch` and `monotouch_runtime` (used for REPL and the interpreter).

This ensure code compiled against one will be fine when building against
the other (e.g. avoiding linker errors).

In practice this means:

1. Expose the API needed for `System.Reflection.Emit` in XI

	- throwing `PlatformNotSupportedException` **by default**; or
	- calling the mono runtime when the interpreter is enabled;

2. Do not expose additional, not supported, API (e.g. COM related)

	- `monotouch_runtime` configuration was built without `FULL_AOT_RUNTIME`
	  and that brings some other stuff that is not AOT related

Follow up to #14606

Existing diff

Removed methods:

```csharp
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access);
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, System.Collections.Generic.IEnumerable<Reflection.Emit.CustomAttributeBuilder> assemblyAttributes);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, Security.Policy.Evidence evidence);
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir);
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, System.Collections.Generic.IEnumerable<Reflection.Emit.CustomAttributeBuilder> assemblyAttributes, Security.SecurityContextSource securityContextSource);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, bool isSynchronized, System.Collections.Generic.IEnumerable<Reflection.Emit.CustomAttributeBuilder> assemblyAttributes);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions, bool isSynchronized);

[Obsolete ("Declarative security for assembly level is no longer enforced")]
public Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions, bool isSynchronized, System.Collections.Generic.IEnumerable<Reflection.Emit.CustomAttributeBuilder> assemblyAttributes);
```

Removed methods:

```csharp
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, Security.Policy.Evidence evidence);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions);
public virtual Reflection.Emit.AssemblyBuilder DefineDynamicAssembly (Reflection.AssemblyName name, Reflection.Emit.AssemblyBuilderAccess access, string dir, Security.Policy.Evidence evidence, Security.PermissionSet requiredPermissions, Security.PermissionSet optionalPermissions, Security.PermissionSet refusedPermissions, bool isSynchronized);
```

Added constructor:

```csharp
public AssemblyBuilder ();
```

Removed properties:

```csharp
public override string CodeBase { get; }
public override System.Reflection.MethodInfo EntryPoint { get; }
public override string EscapedCodeBase { get; }
public override System.Security.Policy.Evidence Evidence { get; }
public override string FullName { get; }
public override bool GlobalAssemblyCache { get; }
public override string ImageRuntimeVersion { get; }
public override bool IsDynamic { get; }
public override string Location { get; }
public override System.Reflection.Module ManifestModule { get; }
public override bool ReflectionOnly { get; }
```

Removed methods:

```csharp
public void AddResourceFile (string name, string fileName);
public void AddResourceFile (string name, string fileName, System.Reflection.ResourceAttributes attribute);
public ModuleBuilder DefineDynamicModule (string name, bool emitSymbolInfo);
public ModuleBuilder DefineDynamicModule (string name, string fileName);
public ModuleBuilder DefineDynamicModule (string name, string fileName, bool emitSymbolInfo);
public System.Resources.IResourceWriter DefineResource (string name, string description, string fileName);
public System.Resources.IResourceWriter DefineResource (string name, string description, string fileName, System.Reflection.ResourceAttributes attribute);
public void DefineUnmanagedResource (byte[] resource);
public void DefineUnmanagedResource (string resourceFileName);
public void DefineVersionInfoResource ();
public void DefineVersionInfoResource (string product, string productVersion, string company, string copyright, string trademark);
public override bool Equals (object obj);
public override object[] GetCustomAttributes (bool inherit);
public override object[] GetCustomAttributes (System.Type attributeType, bool inherit);
public override System.Type[] GetExportedTypes ();
public override System.IO.FileStream GetFile (string name);
public override System.IO.FileStream[] GetFiles (bool getResourceModules);
public override int GetHashCode ();
public override System.Reflection.Module[] GetLoadedModules (bool getResourceModules);
public override System.Reflection.ManifestResourceInfo GetManifestResourceInfo (string resourceName);
public override string[] GetManifestResourceNames ();
public override System.IO.Stream GetManifestResourceStream (string name);
public override System.IO.Stream GetManifestResourceStream (System.Type type, string name);
public override System.Reflection.Module GetModule (string name);
public override System.Reflection.Module[] GetModules (bool getResourceModules);
public override System.Reflection.AssemblyName GetName (bool copiedName);
public override System.Reflection.AssemblyName[] GetReferencedAssemblies ();
public override System.Reflection.Assembly GetSatelliteAssembly (System.Globalization.CultureInfo culture);
public override System.Reflection.Assembly GetSatelliteAssembly (System.Globalization.CultureInfo culture, System.Version version);
public override System.Type GetType (string name, bool throwOnError, bool ignoreCase);
public override bool IsDefined (System.Type attributeType, bool inherit);
public void Save (string assemblyFileName);
public void Save (string assemblyFileName, System.Reflection.PortableExecutableKinds portableExecutableKind, System.Reflection.ImageFileMachine imageFileMachine);
public void SetEntryPoint (System.Reflection.MethodInfo entryMethod, PEFileKinds fileKind);
public override string ToString ();
```

Added constructor:

```csharp
public ConstructorBuilder ();
```

Removed properties:

```csharp
public override System.Reflection.CallingConventions CallingConvention { get; }
public override System.Reflection.Module Module { get; }

[Obsolete]
public System.Type ReturnType { get; }
```

Removed methods:

```csharp
public void AddDeclarativeSecurity (System.Security.Permissions.SecurityAction action, System.Security.PermissionSet pset);
public void SetSymCustomAttribute (string name, byte[] data);
public override string ToString ();
```

Removed property:

```csharp
public override System.Reflection.Module Module { get; }
```

Added property:

```csharp
public override System.Reflection.MethodImplAttributes MethodImplementationFlags { get; }
```

Removed methods:

```csharp
public override System.Delegate CreateDelegate (System.Type delegateType);
public override System.Delegate CreateDelegate (System.Type delegateType, object target);
public override string ToString ();
```

Added properties:

```csharp
public override bool IsByRefLike { get; }
public override bool IsSZArray { get; }
public override bool IsVariableBoundArray { get; }
```

Removed method:

```csharp
public override bool IsAssignableFrom (System.Reflection.TypeInfo typeInfo);
```

Added constructor:

```csharp
public EventBuilder ();
```

Removed properties:

```csharp
public override int MetadataToken { get; }
public override System.Reflection.Module Module { get; }
```

Removed method:

```csharp
[Obsolete ("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
public void SetMarshal (UnmanagedMarshal unmanagedMarshal);
```

Added properties:

```csharp
public override bool IsByRefLike { get; }
public override bool IsConstructedGenericType { get; }
public override bool IsSZArray { get; }
public override bool IsTypeDefinition { get; }
public override bool IsVariableBoundArray { get; }
```

Removed methods:

```csharp
public override System.Type[] GetGenericParameterConstraints ();
public override bool IsAssignableFrom (System.Reflection.TypeInfo typeInfo);
public override bool IsInstanceOfType (object o);
```

Modified properties:

```diff
-public virtual int ILOffset { get; }
+public int ILOffset { get; }
```

Removed method:

```csharp
public virtual void MarkSequencePoint (System.Diagnostics.SymbolStore.ISymbolDocumentWriter document, int startLine, int startColumn, int endLine, int endColumn);
```

Added property:

```csharp
public override bool IsConstructedGenericMethod { get; }
```

Removed methods:

```csharp
public void AddDeclarativeSecurity (System.Security.Permissions.SecurityAction action, System.Security.PermissionSet pset);

[Obsolete ("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
public void SetMarshal (UnmanagedMarshal unmanagedMarshal);
public void SetSymCustomAttribute (string name, byte[] data);
```

Removed properties:

```csharp
public override int MetadataToken { get; }
public override System.Guid ModuleVersionId { get; }
public override string ScopeName { get; }
```

Removed methods:

```csharp
public System.Diagnostics.SymbolStore.ISymbolDocumentWriter DefineDocument (string url, System.Guid language, System.Guid languageVendor, System.Guid documentType);
public void DefineManifestResource (string name, System.IO.Stream stream, System.Reflection.ResourceAttributes attribute);
public System.Resources.IResourceWriter DefineResource (string name, string description);
public System.Resources.IResourceWriter DefineResource (string name, string description, System.Reflection.ResourceAttributes attribute);
public void DefineUnmanagedResource (byte[] resource);
public void DefineUnmanagedResource (string resourceFileName);
public override object[] GetCustomAttributes (bool inherit);
public override object[] GetCustomAttributes (System.Type attributeType, bool inherit);
public override System.Reflection.FieldInfo GetField (string name, System.Reflection.BindingFlags bindingAttr);
public override System.Reflection.FieldInfo[] GetFields (System.Reflection.BindingFlags bindingFlags);
protected override System.Reflection.MethodInfo GetMethodImpl (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers);
public override System.Reflection.MethodInfo[] GetMethods (System.Reflection.BindingFlags bindingFlags);
public System.Diagnostics.SymbolStore.ISymbolWriter GetSymWriter ();
public override System.Type GetType (string className);
public override System.Type GetType (string className, bool ignoreCase);
public override System.Type GetType (string className, bool throwOnError, bool ignoreCase);
public override System.Type[] GetTypes ();
public override bool IsDefined (System.Type attributeType, bool inherit);
public override bool IsResource ();
public override System.Reflection.FieldInfo ResolveField (int metadataToken, System.Type[] genericTypeArguments, System.Type[] genericMethodArguments);
public override System.Reflection.MemberInfo ResolveMember (int metadataToken, System.Type[] genericTypeArguments, System.Type[] genericMethodArguments);
public override System.Reflection.MethodBase ResolveMethod (int metadataToken, System.Type[] genericTypeArguments, System.Type[] genericMethodArguments);
public override byte[] ResolveSignature (int metadataToken);
public override string ResolveString (int metadataToken);
public override System.Type ResolveType (int metadataToken, System.Type[] genericTypeArguments, System.Type[] genericMethodArguments);
public void SetSymCustomAttribute (string name, byte[] data);
```

Modified properties:

```diff
-public virtual int Attributes { get; }
+public int Attributes { get; }
-public virtual string Name { get; }
+public string Name { get; }
-public virtual int Position { get; }
+public int Position { get; }
```

Removed method:

```csharp
[Obsolete ("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
public virtual void SetMarshal (UnmanagedMarshal unmanagedMarshal);
```

Removed interface:

```csharp
System.Runtime.InteropServices._SignatureHelper
```

Removed methods:

```csharp
public override bool Equals (object obj);
public override int GetHashCode ();
public override string ToString ();
```

Removed property:

```csharp
public override bool ContainsGenericParameters { get; }
```

Added properties:

```csharp
public override bool IsByRefLike { get; }
public override bool IsSZArray { get; }
public override bool IsSecurityCritical { get; }
public override bool IsSecuritySafeCritical { get; }
public override bool IsSecurityTransparent { get; }
public override bool IsVariableBoundArray { get; }
```

Removed methods:

```csharp
public void AddDeclarativeSecurity (System.Security.Permissions.SecurityAction action, System.Security.PermissionSet pset);
public override bool IsAssignableFrom (System.Reflection.TypeInfo typeInfo);
protected override bool IsValueTypeImpl ();
```

Removed methods:

```csharp
public static object GetActiveObject (string progID);
public static IntPtr GetComInterfaceForObjectInContext (object o, System.Type t);
public static int GetComSlotForMethodInfo (System.Reflection.MemberInfo m);
public static int GetEndComSlot (System.Type t);
public static IntPtr GetExceptionPointers ();
public static IntPtr GetIDispatchForObjectInContext (object o);
public static IntPtr GetITypeInfoForType (System.Type t);
public static IntPtr GetIUnknownForObjectInContext (object o);

[Obsolete ("This method has been deprecated")]
public static IntPtr GetManagedThunkForUnmanagedMethodPtr (IntPtr pfnMethodToWrap, IntPtr pbSignature, int cbSignature);
public static System.Reflection.MemberInfo GetMethodInfoForComSlot (System.Type t, int slot, ref ComMemberType memberType);

[Obsolete ("This method has been deprecated")]
public static System.Threading.Thread GetThreadFromFiberCookie (int cookie);
public static System.Type GetTypeForITypeInfo (IntPtr piTypeInfo);

[Obsolete]
public static string GetTypeInfoName (UCOMITypeInfo pTI);
public static System.Guid GetTypeLibGuid (ComTypes.ITypeLib typelib);

[Obsolete]
public static System.Guid GetTypeLibGuid (UCOMITypeLib pTLB);
public static System.Guid GetTypeLibGuidForAssembly (System.Reflection.Assembly asm);
public static int GetTypeLibLcid (ComTypes.ITypeLib typelib);

[Obsolete]
public static int GetTypeLibLcid (UCOMITypeLib pTLB);
public static string GetTypeLibName (ComTypes.ITypeLib typelib);

[Obsolete]
public static string GetTypeLibName (UCOMITypeLib pTLB);
public static void GetTypeLibVersionForAssembly (System.Reflection.Assembly inputAssembly, out int majorVersion, out int minorVersion);

[Obsolete ("This method has been deprecated")]
public static IntPtr GetUnmanagedThunkForManagedMethodPtr (IntPtr pfnMethodToWrap, IntPtr pbSignature, int cbSignature);
public static bool IsTypeVisibleFromCom (System.Type t);
public static int NumParamBytes (System.Reflection.MethodInfo m);

[Obsolete]
public static void ReleaseThreadCache ();
```

* [csproj] Update project files

* Bump API snapshot submodule
2019-05-28 14:39:38 +02:00
Kenneth Pouncey ad03563fb4 [wasm][ci] Enable ChakraCore tests (#14653)
- Chakra 1.11.9 release is now out which fixes https://github.com/microsoft/ChakraCore/issues/6037

Closes https://github.com/mono/mono/issues/13195
2019-05-28 10:29:29 +02:00
Dan Moseley da3e52793a Call derived ToString on inner exceptions (dotnet/coreclr#24793)
* Remove special Appx path and METHOD__EXCEPTION__TO_STRING

* Remove Exception.ToString(bool, bool)

* Remove Exception.InternalToString and callers

* Cache message

Signed-off-by: dotnet-bot <[email protected]>
2019-05-28 09:18:17 +02:00
Alexander Köplinger 7ca8e89ce7 [sdks] Explicitly set version of the mac/ios/watchos/tvos platform SDKs (#14663)
Otherwise the Xcode linker tries to guess the version from the path,
and since we use Xcode101.app it'd use sdk=101 as the version which is wrong.

By explicitly specifying e.g. `$(XCODE_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`
as the sysroot it correctly guesses sdk=12.1 instead.

See also https://github.com/xamarin/xamarin-macios/commit/834c0a9fd7062c0c25011721fd7d524b8a60b41e
2019-05-28 01:38:38 +02:00
Johan Lorensson 8d0ad4c816 Reduce stack size used by interpreter frame on Windows MSVC. (#14659)
Reduce stack size used by interpreter frame on Windows MSVC.

Interpreter frame was 1248 bytes in size under Windows MSVC. This was almost double the size of other platforms ~670 bytes. After investigating different constructs in interpreter switch statement in interp_exec_method_full, it turns out that local declared errors couldn't be reused over different case statements and added ~100 bytes each. Switching local declared errors to shared one, reduce the stack size down to ~670 bytes under Windows MSVC.
2019-05-27 17:55:52 -04:00
Jay Krell 07c5ecdf7b Introduce g_static_assert. (#14651)
ifdef __cplusplus
define g_static_assert(x) static_assert (x, "")
else
define g_static_assert(x) g_assert (x)
endif

It is, granted, C++11, not C++98, and some C variations.
2019-05-27 15:33:46 -04:00
Jay Krell 15eb9f7ba1 warning: 'emit_load' defined but not used [-Wunused-function] (#14646)
Rename emit_load_general to emit_load
2019-05-27 20:18:57 +02:00
Calvin Buckley 19e0a80ad1 Bump CoreFX and make necessary changes (#14660)
I myself am bumping for ODBC fixes. This includes a change to SslProtocols to include the Tls13 entry required by the CoreFX changes. (It doesn't wire it up to anything, including BTLS.)

* Fix CollectionTest.UnusableSyncLockTest test

The test checked whether the SyncRoot is of type object, but the corefx implementation switched to returning `this`.

* Bump API snapshot submodule
2019-05-27 19:30:19 +02:00
Marek Safar 00c43ce6e8 [System.Private.CoreLib] Resolve APIs mismatches 2019-05-27 17:32:26 +02:00
Johan Lorensson 164c257bb9 Merge pull request #14628 from lateralusX/lateralusX/interpreter-windows-x64-mini-regression-support
Fix interpreter mini regression test on Windows x64.
2019-05-27 17:00:06 +02:00
Stephen Toub 0eb9e611d2 Stop nulling out lock object in SemaphoreSlim (dotnet/coreclr#24776)
SemaphoreSlim.Dispose nulls out its lock object, and that's then used as an indication in other methods whether they should throw ObjectDisposedException.  But nulling out an object used for synchronization in other methods is a bad practice, and while SemaphoreSlim.Dispose is not thread-safe to be used concurrently with other usage of the instance, it's still confusing when such usage leads to NullReferenceExceptions due to trying to lock on a null lock object.  This change just changes the lock to be readonly, always set, and then whether the instance has been disposed is just a value set on that object (such that it's no larger than it used to be).

Signed-off-by: dotnet-bot <[email protected]>
2019-05-27 16:44:48 +02:00
Jan Kotas 278e11d840 Fix nulable annotations build break (dotnet/coreclr#24768)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-27 16:44:48 +02:00
Santiago Fernandez Madero 6ce793487c Fix nullable annotation in String.Join
Signed-off-by: dotnet-bot <[email protected]>
2019-05-27 16:44:48 +02:00
Santiago Fernandez Madero 3837ea0c64 Fix Guid.TryParse nullabel annotation
Signed-off-by: dotnet-bot <[email protected]>
2019-05-27 16:44:48 +02:00
Santiago Fernandez Madero d4eb0c4a9f Fix nullable annotation in Array.SetValue
Signed-off-by: dotnet-bot <[email protected]>
2019-05-27 16:44:48 +02:00
Marek Safar 0f4dd6bc49 Bump roslyn dependency 2019-05-27 15:55:54 +02:00
dotnet-maestro-bot 538ecf31ef Update BuildTools, CoreClr to preview4-04022-01, preview6-27721-71, respectively (master) (#24369)
* Update BuildTools, CoreClr to preview4-04022-01, preview6-27721-71, respectively

* Use `Nullable=enable` rather than `NullableContextOptions=enable`

* Resolving new nullability warnings

* PR Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-27 15:55:54 +02:00
Alexander Köplinger 1d4dab41a9 Add missing new files to Makefile.am, fix tarball build (#14656)
They were added in https://github.com/mono/mono/pull/14427
2019-05-27 15:21:26 +02:00
Rich Lander 5f87cb724f Create THIRD-PARTY-NOTICES.TXT
TPN for language files @ https://github.com/mono/mono/new/4fd4f46ca31141774d8dcd3b72d2171d32a49f67/mcs/class/I18N/West/Test
2019-05-27 09:31:14 +02:00
Alexander Köplinger 989ea49239 [System] Fix monotouch_runtime repl assemblies
They were missing some exclude files that caused unnecessary p/invokes to be retained.

Fixes https://github.com/mono/mono/issues/13526
2019-05-27 09:28:00 +02:00
lateralusX 1fc0ed9664 Review feedback. 2019-05-27 09:26:25 +02:00
Conrad Meyer e2a21cbac3 [System.Net.NetworkInformation] Fork FreeBSD from MacOs (#14619)
* [System.Net.NetworkInformation] Fork FreeBSD from MacOs

They are related, but not identical.  In particular, MacOS AF_INET6 is wrong
on FreeBSD and breaks IPv6 networking on FreeBSD.  Establish an inheritence
relationship with overrides for now; it's possible more differences will be
needed in the future.

This change is released under the MIT license.

* [csproj] Update project files
2019-05-27 09:21:07 +02:00
dotnet-maestro a12749adb6 Update dependencies from https://github.com/dotnet/arcade build 20190524.6
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19274.6
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19274.6
2019-05-27 09:18:18 +02:00
dotnet-maestro 3f7f652c76 Update dependencies from https://github.com/dotnet/arcade build 20190523.11
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19273.11
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19273.11
2019-05-27 09:18:18 +02:00
Jay Krell 393d7ef616 Widen MonoJumpInfo union to pointer-sized so mono_add_patch_info can just use target field blindly. (#14642)
just use target field blindly.
2019-05-26 18:30:18 +02:00
Jay Krell 489c40a548 Remove MONO_PATCH_INFO_METHOD_REL. (#14643)
It is not used, and it had a larger than pointer field
where a pointer was required, at least for 32bit hosted cross builds.
2019-05-25 10:30:53 -04:00
Zoltan Varga 7c837f58bc [jit] Also allow System.Runtime.CompilerServices.Unsafe intrinsics from the System.Runtime.CompilerServices assembly, not just corlib. (#14618)
* [jit] Also allow System.Runtime.CompilerServices.Unsafe intrinsics from the System.Runtime.CompilerServices assembly, not just corlib.

* [jit] Fix Unsafe.RefIsAddressLessThan()/RefIsAddressGreaterThan().
2019-05-25 10:30:04 -04:00
Alexander Kyte 9cb89c9ea9 [build] Provide in-tree llvm to mono correctly (#14607) 2019-05-25 01:10:21 -07:00
Ryan Lucia 96b1fd837d [coop] Transition various public APIs into an external/internal form to avoid unnecessary GC-unsafe calls (#14427)
Relevant issue: #14376

There are potentially more functions this can apply to, but this covers the ones listed in the issue and an extra one I found in the process.

Functions were either broken off into an external-only and internal version, or such a pair already existed and the internal version was moved from the source file to a separate `-internals` header, similarly to in 3c74df5667.

This gets slightly complicated with `mono_domain_set` and `mono_domain_set_internal`, both of which are currently public (thanks to 4beada2892) and have different signatures. Additionally, the latter does not actually include the gc-unsafe transition despite being public. 
I've opted to introduce `mono_domain_set_fast` as the 'internal' version of `mono_domain_set`, to add the proper gc-unsafe transition to `mono_domain_set_internal`, and then to migrate internal usage to `mono_domain_set_internal_with_options`. As part of that I've marked `mono_domain_set_internal` as external only, which is unfortunate naming-wise but I believe the best option here without introducing API breakage.
2019-05-24 19:09:00 -04:00
Alexander Kyte ea4ff9ba80 [llvm] Use CoreCLR GC interop configuration (#14598)
[llvm] Use CoreCLR GC interop configuration

Since they're identical right now, we can use the coreclr configuration
to make our IR more easily analyzed by tools built around LLVM.

```
class CoreCLRGC : public GCStrategy {
public:
  CoreCLRGC() {
    UseStatepoints = true;
    // These options are all gc.root specific, we specify them so that the
    // gc.root lowering code doesn't run.
    InitRoots = false;
    NeededSafePoints = 0;
    UsesMetadata = false;
    CustomRoots = false;
  }

  Optional<bool> isGCManagedPointer(const Type *Ty) const override {
    // Method is only valid on pointer typed values.
    const PointerType *PT = cast<PointerType>(Ty);
    // We pick addrspace(1) as our GC managed heap.
    return (1 == PT->getAddressSpace());
  }
};

/// A GCStrategy for the Mono Runtime.
class MonoGC : public GCStrategy {
public:
  MonoGC() {
    UseStatepoints = true;
    // These options are all gc.root specific, we specify them so that the
    // gc.root lowering code doesn't run.
    InitRoots = false;
    NeededSafePoints = 0;
    UsesMetadata = false;
    CustomRoots = false;
  }
};
```

Source: https://github.com/mono/llvm/blob/64c0343537016c153894dc60316bd7b316b812c8/lib/CodeGen/BuiltinGCs.cpp#L105-L137
2019-05-24 16:55:50 -04:00
Jay Krell f93d42dbf5 Cleanup: load_function_full -- avoid a string alloc/copy and cast. (#14625)
Cleanup: load_function_full -- avoid a string alloc/copy and cast.
2019-05-24 16:36:00 -04:00
Ryan Lucia 76c45bc2cb Fix build warning for orig_method (#14603)
Variable is only used here: https://github.com/mono/mono/blob/82a993124888d470d1057eae9546e5be76524dad/mono/mini/mini-trampolines.c#L743
2019-05-24 21:34:23 +02:00
Nathan Ricci bc29c2a6e1 More impelemtation for get allocated bytes. 2019-05-24 15:02:33 -04:00
Zoltan Varga 3ff4282abe [llvm] Remove JIT support for older llvm versions. (#14605) 2019-05-24 14:56:01 -04:00
musikhin b1c3216f89 Fix SqliteMembershipProvider initialization bug, issue #14234 (#14479)
On the stage of the initialization of the SqliteMembershipProvider the existed code always produced an error "Failed to map path '/'" in case if the ASP.NET application is placed not at the root path. Detailed step by step description of the problem is provided in the issue description.

The bug was that was implemented the call of the function with wrong parameters list. So the fix was in changing the function call. The same function call is also used in SqlMembershipProvider.cs.

Fixes #14234
2019-05-24 20:44:08 +02:00
Aleksey Kliger (λgeek) 94adfce735 [merp] Don't leak g_getenv return value (#14602)
[merp] Don't leak g_getenv return value

Coverity said:
```
     CID 1445100:  Resource leaks  (RESOURCE_LEAK)
     Failing to save or free storage allocated by "monoeg_g_getenv("MONO_CRASH_NOFILE")" leaks it.
```
2019-05-24 13:55:53 -04:00
Vlad Brezae 3d331568e1 [interp] Fix warning with coverity (#14613)
[interp] Fix warning with coverity
2019-05-24 13:36:10 -04:00
Alexander Kyte fb2233b337 [merp] Add assertions against initing dumper from signal handler (#13851) 2019-05-24 12:17:38 -04:00
lateralusX a895be83f6 Fix interpreter mini regression test on Windows x64.
First set of fixes to get the following tests working under interpreter
on Windows x64:

* mono/mini richeck
* mono/mini mixedcheck
* mono/mini fullaotmixedcheck
* mono/tests winx64structs.exe

Fixes are primarily related to Windows x64 ABI support in interpreter. Fixes
also makes sure our interpreter trampolines get unwind info making it possible
to debug through the trampolines on Windows x64.

Several fixes related to value types was needed, also fixed support for return
value types not fitting into registers, current implementation didn't return
passed in value type address in return register as mandated by both
System V and Win x64 ABI's.

Identified and fixed memory leak on every pinvoke from interpreter that needs stack.
Since Windows x64 ABI always use 32 bytes of stack allocated by caller, the
memory leak was hit on every pinvoke call.
2019-05-24 15:53:02 +02:00
Alexander Köplinger 82a9931248 [sdks] Fix min OSX version of runtime files in Mac SDK (#14615)
It was using an unescaped makefile variable in the template, i.e. ended up empty which meant the build just took the host version as the min version.

Fixed the variable and also moved it to CFLAGS/CXXFLAGS instead of CPPFLAGS to be consistent with ios.mk
2019-05-24 14:10:47 +02:00
Lee Culver ef9d54d151 Throw ObjectDisposedException instead of crashing when Cairo.Context handle == IntPtr.Zero (#14323)
* Throw ObjectDisposedException instead of crashing when Cairo.Context.handle == IntPtr.Zero

We are seeing instances where VS for Mac is crashing with a SIGSEGV when
calling into certain Cairo.Context functions.  Looking at the code, it's clear
that it's possible to have Context.handle == IntPtr.Zero after disposing the
object.

From research, it looks like passing a nullptr to raw cairo functions can
result in a SIGSEGV:
    https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/93807

This change adds check to see if Conext.handle == IntPtr.Zero in Context
painting, font, and path methods.  This will turn uncatchable SIGSEGVs
into ObjectDisposedException.

* Update Context.cs

* Ensure SetTarget results in a valid handle
2019-05-24 12:22:51 +02:00
Rich Lander 8f6a7b34ee Create THIRD-PARTY-NOTICES.TXT
TPN for https://github.com/mono/mono/blob/435f968102d0820ca65d63e1e741e4130b4d1303/support/ios/net/route.h
2019-05-24 12:08:47 +02:00
Jay Krell 0c7ed830ac [loaded LLVM] Add several missing MONO_LLVM_INTERNAL (#14589)
* [llvm] Remove unused default_mono_llvm_unhandled_exception.
It references mono_gchandle_get_target_internal which is not marked MONO_LLVM_INTERNAL
so attempts to run it will fail.

This is caught by linking wit -z now (https://github.com/mono/mono/pull/14562).

* [loaded LLVM] mono_debug_get_seq_points and mono_class_enum_basetype_internak MONO_LLVM_INTERNAL

* Mark mono_debug_method_lookup_location MONO_LLVM_INTERNAL.
Found by linking with -z now (https://github.com/mono/mono/pull/14562)
which we should probably do for this and other reasons.

* #include mono-compiler.h for MONO_LLVM_INTERNAL.

* [loaded LLVM] Mark mini_is_gsharedvt_variable_signature as MONO_LLVM_INTERNAL.
Found by https://github.com/mono/mono/pull/14562.

* Mark mono_print_ins MONO_LLVM_INTERNAL.

* mono_rgctx_info_type_to_str MONO_LLVM_INTERNAL

* [loaded LLVM] mono_compile_create_var MONO_LLVM_INTERNAL

* ifdef around use of MONO_LLVM_INTERNAL and hope

* remove include mono-compiler.h from public header to internal header

* MONO_API_NO_EXTERN_C mono_debug_method_lookup_location() instead of mono_debug_method_lookup_location() MONO_LLVM_INTERNAL to workaround possible lack of MONO_LLVM_INTERNAL.
2019-05-24 02:58:26 -07:00
Jay Krell 0d22880940 Make function pointers readonly. (#14470) 2019-05-24 02:58:03 -07:00
Santiago Fernandez Madero e1d628c18d Make AppDomain.GetThreadPrincipal() internal (dotnet/coreclr#24747)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-24 10:00:05 +02:00
Jan Kotas f670f46497 Delete FEATURE_TESTHOOK (dotnet/coreclr#24746)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-24 10:00:05 +02:00
David Wrighton 30fb72969e Fewer ilstubs in corelib from reflection apis (dotnet/coreclr#24708)
Rework use of marshalling for RuntimeTypeHandle, RuntimeModule, RuntimeAssembly, and IRuntimeMethodInfo as used by QCalls
- Remove special QCall only used marshallers for RuntimeAssembly, RuntimeModule and IRuntimeMethodInfo
- Following the pattern of ObjectHandleOnStack, implement QCall handle types for RuntimeAssembly/Module/TypeHandle. Use these in all QCalls that once passed the types directly.
- For uses of IRuntimeMethodInfo, follow the existing RuntimeMethodHandleInternal pattern

Also perform some replacement of bool marshalling with use of Interop.BOOL, and a few cases of using pointers instead of byref arguments.

Fix delivers a relatively small win on startup, and small throughput gains around reflection as IL stubs are no longer necessary for many functions in reflection that once needed them.

Reduces methods jitted on powershell startup from 422 to 399, (About 5%) but performance win is only about 5ms on ~400ms as the methods removed are simple.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-24 10:00:05 +02:00
Jan Kotas 50fac54741 Fix CoreRT build breaks
Signed-off-by: dotnet-bot <[email protected]>
2019-05-24 08:33:58 +02:00
Sebastien Pouliot 9ca1619d63 [System.Core] Ensure monotouch[_runtime] API are identical (#14606)
* [System.Core] Ensure monotouch[_runtime] API are identical

Ensure the API surface for `System.Core.dll` is identical between the
`monotouch` and `monotouch_runtime` (used for REPL and the interpreter).

This ensure code compiled against one will be fine when building against
the other (e.g. avoiding linker errors).

Removed methods:

```csharp
public void CompileToMethod (System.Reflection.Emit.MethodBuilder method);
public void CompileToMethod (System.Reflection.Emit.MethodBuilder method, System.Runtime.CompilerServices.DebugInfoGenerator debugInfoGenerator);
```

Removed methods:

```csharp
[Obsolete ("do not use this method")]
public static IRuntimeVariables MergeRuntimeVariables (IRuntimeVariables first, IRuntimeVariables second, int[] indexes);

[Obsolete ("do not use this method")]
public static System.Linq.Expressions.Expression Quote (System.Linq.Expressions.Expression expression, object hoistedLocals, object[] locals);
```

* [csproj] Update project files

* Bump API snapshot submodule
2019-05-24 01:44:24 +02:00
Nathan Ricci adb22ab81d Added the scaffolding for the call into the runtime. 2019-05-23 17:54:10 -04:00
Alexander Köplinger f5f3c6aabe [tests] Add xunit.execution.dotnet.dll to tests directory (#14595)
So it gets included in the sdks archive
2019-05-23 20:17:41 +02:00
Bernhard Urban b564c26cb5 [interp] set correct stack type on op_Implicit/op_Explicit intrinsics for native types (#14575)
[interp] set correct stack type on op_Implicit/op_Explicit intrinsics for native types

Needs some additional conversions which happen to be included by accident previously.

This fixes those warnings on amd64:
```
Test run:
image=/Users/lewurm/work/mono-dim-call/mono/mini/builtin-types.exe
BuiltinTests.test_0_nuint_fieldload: Store local stack type mismatch 0 1
BuiltinTests.test_0_much_casting: Store local stack type mismatch 0 1
Results: total tests: 84, all pass
Elapsed time: 0.026546 secs (0.026546, 0.000000)
```

and those warnings on armv7:
```
Test run: image=/mono/mono/mini/builtin-types.exe
BuiltinTests.test_0_nint_inc: 0011 arith type mismatch add.i4 0 1
BuiltinTests.test_0_nint_dec: 0011 arith type mismatch sub.i4 0 1
BuiltinTests.test_0_nint_implicit_decimal: 0034 arith type mismatch
add.i4 0 1
BuiltinTests.test_0_nuint_inc: 0011 arith type mismatch add.i4 0 1
BuiltinTests.test_0_nuint_dec: 0011 arith type mismatch sub.i4 0 1
BuiltinTests.test_0_nuint_implicit_decimal: 0034 arith type mismatch
add.i4 0 1
Results: total tests: 84, all pass
Elapsed time: 0.039214 secs (0.039214, 0.000000)
```
2019-05-23 12:56:16 -04:00
monojenkins 72eb2ee84a [Android] Fix runtime loading of DSOs for 64-bit processes (#14577)
[Android] Fix runtime loading of DSOs for 64-bit processes

Context: https://github.com/xamarin/xamarin-android/issues/2780

On Android the executable for the application is going to be
`/system/bin/app_process{32,64}` depending on the application's architecture.
However, libraries for the different architectures live in different
subdirectories of `/system`: `lib` for 32-bit apps and `lib64` for 64-bit ones.
Thus appending `/lib` below will fail to load the DSO for a 64-bit app, even if
it exists there, because it will have a different architecture. The quickest fix
is to use `lib64` explicitly for 64-bit Android apps.



<!--
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 #13281.

/cc @lambdageek @grendello
2019-05-23 10:56:37 -04:00
Bernhard Urban fa3b4812d7 [netcore] add some intrinsics for interpreter (#14547)
[netcore] add some intrinsics for interpreter

```console
$ MONO_ENV_OPTIONS='--interp' make -C netcore xtest-System.Runtime.Tests
Microsoft.DotNet.XUnitConsoleRunner v2.5.0 (64-bit .NET Core 3.0.0-preview5-27620-01)
  Discovering: System.Runtime.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Runtime.Tests (found 5266 of 5402 test cases)
  Starting:    System.Runtime.Tests (parallel test collections = on, max threads = 16)
[...]
  Finished:    System.Runtime.Tests
=== TEST EXECUTION SUMMARY ===
   System.Runtime.Tests  Total: 32485, Errors: 0, Failed: 23, Skipped: 2, Time: 126.432s
```
See failures here: https://gist.github.com/lewurm/c8372b0c7ba6a78cf8b7b7b8c7090820
2019-05-23 10:00:49 -04:00
dotnet-maestro 75de80a482 Update dependencies from https://github.com/dotnet/arcade build 20190522.13
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19272.13
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19272.13
2019-05-23 15:56:23 +02:00
Alexander Köplinger 9606a8f180 [bcl] Remove usages of mono-project.com/go-mono.com/google.com in tests (#14586)
Use example.com and example.org instead.

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

Note that not all of the things I replaced make an actual network request but I thought it'd be nice to be consistent.
2019-05-23 14:12:14 +02:00
Johan Lorensson d96fa3ab31 Merge pull request #14549 from lateralusX/lateralusX/add-coop-config-windows
Add ability to use cooperative suspend in configure step.
2019-05-23 09:21:43 +02:00
Jay Krell 8804dbac27 Fix decoding of WRAPPER_SUBTYPE_ICALL_WRAPPER and WRAPPER_SUBTYPE_INTERP_LMF. (#14546) 2019-05-23 01:43:19 -04:00
Jay Krell 37d6df9d67 Fix warning: (#14529)
aot-compiler.c: In function 'arch_init':
aot-compiler.c:1092:11: warning: unused variable 'has_custom_args' [-Wunused-variable]
  gboolean has_custom_args = !!acfg->aot_opts.llvm_llc;
2019-05-23 01:43:05 -04:00
Stephen Toub e1021fc68b Fix Path.Join argument nullable annotation (dotnet/coreclr#24719)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-23 07:18:33 +02:00
Marek Safar eb936495b3 Commit 29810a78e5b93d8da9fb921d096226d249fc75a5 added unconditional dependency on GetCpuUtilization (#24715)
Update projitems file inclusion

Signed-off-by: dotnet-bot <[email protected]>
2019-05-23 07:18:33 +02:00
Marius UngureanuandMartin Baulig fe74f62140 Plug leak of CustomAttribute initializer name (#14544)
* Plug leak of CustomAttribute initializer name

All the CustomAttribute initializer names (fields, property) except the last were leaked. Ensure all names are freed.

Fixes #14543

* Apply suggestions from code review

Co-Authored-By: Martin Baulig <[email protected]>
2019-05-22 22:59:20 -04:00
Larry Ewing 84bc4bfb8b Merge pull request #14552 from lewurm/interp-dimcall-fix
[interp] add missing enum check on constrained callvirt
2019-05-22 20:30:01 -05:00
Jay Krell ee1868e82f Close two race conditions. (#14510) 2019-05-23 01:47:29 +02:00
Alexander Köplinger 2c76de1ee1 [tests] Add Xunit.NetCore.Extensions.dll to tests directory (#14571)
So it gets included in the sdks archive
2019-05-22 19:48:07 +02:00
Bernhard Urban 574d87ca9f [driver] add --version=number (#14538)
* [driver] add --version-number

Useful for third parties consuming the version number of mono.

* s/--version-number/--version=number/g

* add man page entry
2019-05-22 18:49:38 +02:00
Marek Safar e2cc6fc40d [System.Private.CoreLib] Workaround for broken shared project file exclusion 2019-05-22 16:17:50 +02:00
dotnet-maestro 3ba95bba6a Update dependencies from https://github.com/dotnet/arcade build 20190521.7
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19271.7
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19271.7
2019-05-22 16:02:29 +02:00
Jay Krell 5334e32de9 More information to PowerPC assertion failure. (#14569) 2019-05-22 14:27:40 +02:00
Jay Krell d583190ce7 Add more information to a stackless faulting community line. (#14566) 2019-05-22 13:17:53 +02:00
Jay Krell 74faf39971 [PowerPC] Fix compile error. (#14564) 2019-05-22 13:15:27 +02:00
Marek Safar 6751700b20 [System.Private.Corelib] More nullable types tweaks 2019-05-22 12:47:11 +02:00
Egor Bogatov 64fe6a054c [netcore] Add Microsoft.Private.CoreFx.OOB package to corefx-restore.csproj (#14559)
* Add Microsoft.Private.CoreFx.OOB package

* Add GC.GetTotalAllocatedBytes stub

* Add missing icalls

* Add more tests to ignore

* Update GC.cs

* Add more tests to ignore

* Update Monitor.cs
2019-05-22 12:32:05 +02:00
Egor Bogatov 36193f5378 [netcore] Set System.Private.Corlib AssemblyVersion to 4.0.0.0 (#14556)
* clean up

* cleanup

* bump assembly version
2019-05-22 09:37:17 +02:00
Stephen Toub f5c8b3f7e9 Implement AppDomain.Monitoring*MemorySize (dotnet/coreclr#24610)
* Implement AppDomain.MonitoringTotalAllocatedMemorySize

* Change precise:true back to precise:false in GetTotalAllocatedBytes

Signed-off-by: dotnet-bot <[email protected]>
2019-05-22 09:33:36 +02:00
Mike Marynowski fdc9a1e7cc Modified format logic so that braces are not allowed in custom format specifiers (#23062)
* Modified format logic so that braces are not allowed in custom format specifiers.

* Disabled failing test temporarily and fixed code style issue.

PR needed to pass test: https://github.com/dotnet/corefx/pull/35820

* Slight changes to logic to better align the diff.

* Fixed counting error.

* Fix nullable

* Move exclusion near related test

* Add skip to new issue file

* Delete CoreFX.issues.json

Signed-off-by: dotnet-bot <[email protected]>
2019-05-22 09:33:36 +02:00
Egor Bogatov 7f03824327 [netcore] Fix PointerTests (#14557)
* Fix PointerTests

* Update CoreFX.issues.rsp
2019-05-22 08:24:40 +02:00
Stephen Toub 8ef0c136eb Reduce overhead of SemaphoreSlim.WaitAsync (dotnet/coreclr#24687)
This affects the case where SemaphoreSlim.WaitAsync is invoked, the operation completes asynchronously because there's no count available in the semaphore, and where a timeout and/or a cancellation token is passed to WaitAsync.  In that case, we need to wait for the underlying wait task to complete, for cancellation to be requested, or for the timeout to elapse.

There's currently one code path that handles this.  This change improves that slightly by avoiding a defensive array copy.  However, we can do much better when we get a cancelable token but no timeout, in which case we can avoid operations like Task.Delay, can register with the original cancellation token rather than a new one (which means we avoid forcing a new CancellationTokenSource's lazily-allocated partitions into existence), etc.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-22 08:23:06 +02:00
monojenkins 80963d3a8b [bcl] Update BCL Linked Size 2019-05-22 08:17:59 +02:00
Zoltan Varga e9fbb4210c [jit] Fix signed/unsigned comparisons in JitHelpers.EnumCompareTo () intrinsic. (#14553)
Fixes https://github.com/mono/mono/issues/14551.
2019-05-21 20:17:50 -04:00
Jay Krell f0cf94a5d1 MONO_PATCH_INFO_JIT_ICALL cleanup (#14545)
The most important point of the "temporary" aspect, esp. given
the complete conversion, is renaming MONO_PATCH_INFO_JIT_ICALL to MONO_PATCH_INFO_JIT_ICALL_ID.
Any accidental or merged MONO_PATCH_INFO_JIT_ICALL will fail to compile.
2019-05-21 17:04:02 -04:00
Alexander Kyte eaaf77189d [crash] Don't waitpid() if fork() fails (#14539) 2019-05-21 16:20:30 -04:00
Alexander Kyte 8c4c9a06cd [crash] Handle OOM/blocked allocation during crash dumper (#14540)
* [crash] Remove typo from crash sub-header

* [crash] Use error path that returns nonzero status
2019-05-21 16:20:15 -04:00
Tarek Mahmoud Sayed 107ff9732d Enhance the Missing Resources Exception Message (dotnet/coreclr#24645)
* Enhance the Missing Resources Exception Message

* Address the feedback

* Fix Nullable declaration

Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 18:22:05 +02:00
dotnet-maestro c02c4a8b53 Update dependencies from https://github.com/dotnet/arcade build 20190520.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19270.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19270.2
2019-05-21 17:08:48 +02:00
Bernhard Urban 539e3f8546 [interp] add missing enum check on constrained callvirt
This detail got lost when the code was duplicated here: https://github.com/mono/mono/pull/13154/files#diff-f115ce23fba6528256a47e2b7e8b0a19R1611

Fixes `mono/tests/dim-constrainedcall.il` on the interpreter. This PR will enable it: https://github.com/mono/mono/pull/14166
2019-05-21 16:31:11 +02:00
Jay Krell c1d01670d3 Initial icall-def.h / icall-def-netcore.h split. (#14489)
* Copy icall-def.h to icall-def-core.h.

* Manually preprocess icall-def.h vs. icall-def-core.h.
The only common part in this construction is the JIT icalls at the end.
There much overlap, now duplicated.

* Remove JIT icalls fro icall-def-core.h.

* Merge icall-def-core.h with master.

* Merge icall-def.h with master.

* Rename icall-def-core.h to icall-def-netcore.h.

* Remove more unused icalls
2019-05-21 14:50:09 +02:00
Andrew Arnott 13992b7f50 Avoid boxing in TextWriter.Write(StringBuilder) (dotnet/coreclr#24664)
Fixes #24663 by calling `Write(ReadOnlySpan<char>)` instead of `Write(object)` with a boxed `Memory<char>`.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 14:47:36 +02:00
Santiago Fernandez Madero 0d1ed39f45 Add IsVariableBoundArray to TypeDelegator (dotnet/coreclr#24637)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 14:47:36 +02:00
Tanner Gooding ad9de49bdb Fixing the Dragon4 algorithm to correctly handle when the first significant digit is after the cutoff (#24484)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 14:47:36 +02:00
Tarek Mahmoud Sayed 6986880de5 Ensure using single Utc object in TimeZoneInfo (dotnet/coreclr#24614)
Currently if calling GetSystemTimeZones, will return a list which in include Utc object created from the enumeration.  But when calling FindSystemTimeZoneById("UTC") will return the cached Utc object which is different than the one returned from the enumeration. This in general could be not a problem but it is better to ensure returned the same object from both APIs. The reason is in our internal code, we use some reference equality for the perf reason. Ensure the usage of Utc object will make it more reliable.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 14:47:36 +02:00
Anirudh Agnihotry 07de377517 Correcting documentation for span and memory slice (dotnet/coreclr#24612)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 14:47:36 +02:00
Levi Broderick 335c1206e9 Fix parameter names in ToUtf16 (dotnet/coreclr#24617)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 14:47:36 +02:00
lateralusX 70b26c9bc3 Add ability to use cooperative suspend in configure step.
Needed in order to setup CI lanes using --enable-cooperative-suspend.
2019-05-21 13:48:29 +02:00
Tarek Mahmoud Sayed 14de5cabbe Fix Handling time patterns with quotes (dotnet/coreclr#24589)
We encountered some cultures have a time patterns with single quotes which we should handle keeping the parts between quotes as fixed text inside the pattern and not treat it as any of the time specifiers

Signed-off-by: dotnet-bot <[email protected]>
2019-05-21 13:47:07 +02:00
monojenkins 98880bd6a5 [csproj] Update project files 2019-05-21 12:33:55 +02:00
Martin Baulig 1eb9161ca6 Removing some remoting and multi-appdomain APIs on wasm and the AOT test profiles.
Build / profile changes:
------------------------

* `build/profiles/testing_aot_common.make`: define `DISABLE_REMOTING = yes` and
  `NO_MULTIPLE_APPDOMAINS = yes`.

* `mcs/class/corlib/Makefile`: check `DISABLE_REMOTING` when setting
  `REFERENCE_SOURCES_FLAGS` (and don't define `FEATURE_REMOTING`, `MONO_COM`
   and `FEATURE_COMINTEROP`).

* added new `testing_aot_common_corlib.dll.exclude.sources`.  Several types in
  the `System.Runtime.Remoting.Messaging` namespace are used by the runtime in
  non-remoting scenarios, so those need to be preserved.
  For all other remoting namespaces, we only need a few stripped down stub versions
  of the some of the types; those have been added to a new `legacy` directory, so
  we can wildcard-exclude all the files here.

* added new `testing_aot_common_corlib.dll.sources`; this currently only contains
  `legacy/*.cs` to list above mentioned stub versions.

* added new `testing_aot_common_corlib_test.dll.exclude.sources` as a common test
  excludes file.

API Changes (conditional to `DISABLE_REMOTING`):
------------------------------------------------

* `mcs/class/corlib/legacy/`: add stub-versions for some of the remoting-related
  classes that are used by the runtime (so we can't completely remove those types):

  - `System.MarshalByRefObject`.
  - `System.Runtime.Remoting.IRemotingTypeInfo`.
  - `System.Runtime.Remoting.ObjectHandle`.
  - `System.Runtime.Remoting.RemotingServices`.
  - `System.Runtime.Remoting.Activation.ActivationServices`.
  - `System.Runtime.Remoting.Contexts.Context`.
  - `System.Runtime.Remoting.Messaging.ILogicalThreadAffinative`.
  - `System.Runtime.Remoting.Messaging.LogicalCallContext`.
  - `System.Runtime.Remoting.Proxies.TransparentProxy`.
  - `System.Runtime.Remoting.Proxies.RealProxy`.

  some of these have fields that need to be preserved; these are marked with
  appropriate `#region` pragmas.

All changes below are conditional to `DISABLE_REMOTING`.

* `System.Runtime.Remoting.Messaging.AsyncResult`: this class is used by some of
  the async code, so we can't completely remove it.  However, we can remove the
  `MonoMethodMessage call_message` field when `DISABLE_REMOTING`.

* `System.Runtime.Remoting.Messaging.MonoMethodMessage`: this class is also used
  by some runtime code and thus needs to be preserved. However, when `DISABLE_REMOTING`
  is defined, then we make some changes to it:
  - remove all iterfaces (`IMethodCallMessage`, `IMethodReturnMessage`, and `IInternalMessage`).
  - `Properties` throws `PlatformNotSupportedException`.

* `System.Runtime.InteropServices.Marshal`: disable some COM-related code.

* `System.Threading.Thread`: remove `CurrentContext` property.

* `System.Threading.ExecutionContext`: adjust conditional logic; don't define
  `FEATURE_REMOTING` if `DISABLE_REMOTING`.

* `System.Activator`: add `DISABLE_REMOTING` to the existing
   `#if FEATURE_REMOTING || MOBILE_LEGACY` conditional in this class.

* `System.AppDomain`: since we only have one domain, `DefaultDomain` will always
   return the root domain; comment out the call to `RemotingServices.GetDomainProxy`
   as well as some internal methods.

* `System.__ComObject`: stub out on `DISABLE_REMOTING` as well as `!FULL_AOT_RUNTIME`.

* `System.Runtime.Serialization.Formatters.Binary.BinaryFormatter`: adjust `IFormatter`
  versus `IRemotingFormatter` interface logic to use the former when `DISABLE_REMOTING`.

* `System.Runtime.Serialization.Formatters.Binary.BinaryObjectReader`: adjust existing
  `#if FEATURE_REMOTING || MOBILE_LEGACY` conditional to add `DISABLE_REMOTING` to it.

* `System.Diagnostics.CorrelationManager`: comment out some `CallContext.LogicalGetData()`
  and `CallContext.LogicalSetData`.

* `System.Diagnostics.TraceEventCache`: likewise.

Test changes:
-------------

* `mono/tests/Makefile.am`: conditionally disable some remoting tests.

* `corlib/Test/System.Runtime.Serialization/SerializationTest.cs`: conditionally
   disable all tests requiring remoting.

* `corlib/Test/System/ActivatorTest.cs`: same; trying to preserve as much as possible
  in this test.

* added some `DISABLE_REMOTING` and `DISABLE_SECURITY` conditionals to some of the tests.
2019-05-21 12:33:55 +02:00
Alexander Köplinger aee4cdd248 Bump gtk-sharp in bockbuild (#14537)
Brings in https://github.com/mono/gtk-sharp/pull/273.
2019-05-21 11:35:40 +02:00
Jay Krell c03814f8dc Replace string/hash-based MONO_PATCH_INFO_JIT_ICALL with enum-based MONO_PATCH_INFO_JIT_ICALL_ID. (#14512)
* Replace string/hash-based MONO_PATCH_INFO_JIT_ICALL with enum-based MONO_PATCH_INFO_JIT_ICALL_ID.

* Reconvert mono-llvm.c after merge with master.
2019-05-21 00:16:36 -04:00
Marius Ungureanu 57a3b24f75 Fix leak in mono_parse_options (#14533)
Fix leak in mono_parse_options

When MONO_ENV_OPTIONS is null, we would leak the array and buffer



<!--
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
-->
2019-05-20 18:25:55 -04:00
dotnet-maestro 52171b21a4 Update dependencies from https://github.com/dotnet/arcade build 20190520.1
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19270.1
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19270.1
2019-05-20 16:37:31 +02:00
dotnet-maestro 9e8717d885 Update dependencies from https://github.com/dotnet/arcade build 20190518.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19268.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19268.2
2019-05-20 16:37:31 +02:00
Zoltan Varga ccb505b6ec [llvm] Fix patching of calls from LLVM JITted code. (#14520)
* [runtime] Fix mono_icall_get_wrapper_full () to always compile the wrapper even if a trampoline was created previously.

* [jit] Add a mini_patch_llvm_jit_callees () function to patch callsite variables for LLVM JIT.

* [llvm] Patch LLVM JIT callees in trampolines as well. Patching after a method is compiled is not enough, since new callsites can be created after a method has been compiled.

* [llvm] Cleanup calls from JITted code. Compile referenced jit icall wrappers immediately, since the calls will not be patched.

* Add a missing MONO_LLVM_INTERNAL.
2019-05-20 10:22:26 -04:00
Bernhard Urban c2118341c6 [arm] one more attempt to fix slotsize issue on llvmonly (#14444)
* [arm] one more attempt to fix slotsize issue on llvmonly

Regression of https://github.com/mono/mono/pull/12992 & https://github.com/mono/mono/pull/14362

In the end, the actual fix boils down to:
```patch
--- a/mono/mini/mini-arm.c
+++ b/mono/mini/mini-arm.c
@@ -2374,7 +2374,7 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
                                lainfo->nslots = ALIGN_TO (ainfo->struct_size, 8) / 8;
                                lainfo->esize = 8;
                        } else {
-                               lainfo->nslots = ainfo->struct_size / sizeof (target_mgreg_t);
+                               lainfo->nslots = ALIGN_TO (ainfo->struct_size, sizeof (target_mgreg_t)) / sizeof (target_mgreg_t);
                                lainfo->esize = 4;
                        }
                        break;
```

Tested on `xamarin-macios/arm64_32-v3` branch:
* mscorlib
* mini
* dont link
* monotouch tests
* and a modified version of https://github.com/mono/mono/issues/8486#issuecomment-414365860 (added larger structs too)

with each device, Watch Series 3 (`armv7k`) and Watch Series 4 (`arm64_32`).

I hope that is the last iteration on this.

* remove arm64_32_abi
2019-05-20 03:09:35 -07:00
Jay Krell 1ecffe9554 Work toward JIT icall hash removal. (#14508)
i.e. when CEE_MONO_JIT_ICALL_ADDR takes enum instead of func.
2019-05-19 14:15:07 -07:00
dotnet-maestro d667baf94b Update dependencies from https://github.com/dotnet/arcade build 20190517.7
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19267.7
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19267.7
2019-05-18 22:18:21 -07:00
Egor Bogatov 616e06225a [netcore] Merge all *.rsp files into CoreFX.issues.rsp (#14513)
* merge rsp files into CoreFX.issues.rsp

* Update CoreFX.issues.rsp

* Update CoreFX.issues.rsp

* clean up

* Update CoreFX.issues.rsp

* download OS specific tests

* Update Makefile

* Add comments for build-local-corefx-test-% rule
2019-05-18 22:15:31 -07:00
Egor Bogatov bd7ec72362 [netcore] Fix Math.ILogB corner cases (#14500)
* Fix ILogb corner cases

* remove redundant tabs

* Add RSP for S.R.Extensions

* remove autotools magic

* add more comments
2019-05-18 20:59:38 -07:00
Egor Bogatov 29938ada1f [netcore] Respect attributes defined on parameters in Delegates (#14468)
* Respect attributes defined on Delegates

* remove 'var's

* Unwrap System.Reflection.Tests.PointerTests.*
2019-05-18 20:58:20 -07:00
Jay Krell 7601045796 Make mono_jit_icall_info MONO_LLVM_INTERNAL. (#14525) 2019-05-18 20:38:46 -07:00
Jay Krell 24c0f17b1c Add missing dependency on $(srcdir)/genmdesc.py. (#14515) 2019-05-18 14:18:46 -07:00
Larry Ewing 73baf1b291 Merge pull request #14490 from vargaz/bump-emsdk
[wasm] Bump emscripten to 1.38.31.
2019-05-18 13:31:55 -07:00
Bernhard Urban 45a1c98df8 [interp] disable inlining for built-in types (#14501)
[interp] disable inlining for built-in types

Fixes https://github.com/mono/mono/issues/14246
2019-05-18 14:45:57 -04:00
Jay Krell 3142f7d54d Reduce JIT icall hash use. (#14507)
* Reduce JIT icall hash use.

* PR: Rename mono_jit_icall_info_at to mono_find_jit_icall_info.

* Use enum instead of int, and update comment to reality (the assert is arguably leniently off by one.)

* Cast integer to enum for C++.

* More int vs. enum, and use two variables, and const.

* Undo a little fishing for CI failure.
2019-05-18 07:05:57 -07:00
Larry Ewing 63b16ae32f Merge pull request #14488 from jeromelaban/dev/jela/wasm-dlopen
[Wasm] Expand support for dynamic linking
2019-05-17 13:11:31 -07:00
Zoltan Varga 1972a3a95d [wasm] Emit more precise signatures for icalls. (#14494)
[wasm] Emit more precise signatures for icalls.
2019-05-17 13:46:01 -04:00
Johan Lorensson 42bc7daeb8 Merge pull request #14498 from lateralusX/lateralusX/fix-llvm-build-error
Fix Windows Mono LLVM build error on nightly master build.
2019-05-17 09:26:37 -07:00
Jo Shields 6a81662247 [netcore] Fixes for Arcade on private mirror (#14509)
* [netcore] Use bash explicitly for Arcade things

* [netcore] Work around https://github.com/dotnet/cli/issues/10014

* [netcore] Try forcing powershell Arcade on Windows
2019-05-16 22:31:23 -07:00
Zoltan Varga ab90b1f15b [wasm] Avoid sharing C icall functions between icalls, in wasm to avoid calling them with incorrect signatures. (#14493) 2019-05-17 00:53:55 -04:00
Alexander Köplinger 24275c9717 Add missing DARC files 2019-05-16 17:50:36 -07:00
Jo Shields 2b35b6bab4 [netcore] Build/upload Windows runtime nupkg (#14506)
* [netcore] Switch build properties from /p: to -p: due to MSYS2/dotnet bug

* [netcore] Switch from nuget pack to dotnet pack

* [netcore] Add Windows x64 build
2019-05-16 17:36:31 -07:00
Alexander Köplinger 871e6f5846 Manual DARC update from build '20190516.4' 2019-05-16 17:03:15 -07:00
Alexander Köplinger 6d404e4ede [netcore] Update dotnet feed url 2019-05-16 16:05:47 -07:00
Jérôme Laban 527abcd115 Update the driver to support MONO_TYPE_I
Add tests to validate boxing/unboxing
2019-05-16 13:54:12 -04:00
Alexis Christoforides 7082845114 [monodroid] Introduce 'win32 host' BCL build (#14424)
* [monodroid] Introduce 'win32 host' BCL build

* [sdks] Add _bcl_$(1)_BUILD_FLAGS variable to BclTemplate build step

Allows Android SDK on Windows to pass PROFILE_PLATFORM=win32

* [sdks] Pass _bcl_$(1)_BUILD_FLAGS when building the tests, too

* Copy test source exclusion files from the general monodroid profile

Apparently we don't fall back to the general exclusion sources for tests if the platorm-specific exclusion file does not exist.

* Also add win32 copies of the nunit exclude files:

files=$(find . -name "monodroid*_test*exclude.sources")
for file in $files
do
    name=$(basename $file)
    pushd $(dirname $file)
    cp $name win32_$name
    git add win32_$name
    popd
done

* [csproj] Update project files
2019-05-16 09:23:13 -07:00
Jérôme Laban 230f593eb6 Add missing extra exported method to allow Module.addFunction 2019-05-16 10:49:43 -04:00
Jay Krell da6cb6c685 Work towards removing JIT icall hashing. (#14474)
* Work towards removing JIT icall hashing.

* PR: Use enums instead of pointers.

* Fix int/enum mismatch.
2019-05-16 10:12:34 -04:00
Levi Broderick 88944be25c Make Label and OpCode readonly and IEquatable (dotnet/coreclr#24360)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-16 00:20:25 -07:00
lateralusX 142d1a9ca0 Fix Windows Mono LLVM build error on nightly master build. 2019-05-16 02:47:57 +02:00
Zoltan Varga 6a38d99535 [wasm] Bump emscripten to 1.38.31. 2019-05-15 16:46:05 -07:00
Filip Navara ad698c9878 [netcore] Exclude some unused icalls (#14475)
* [netcore] Exclude unused native locale icalls

* Fix builds with mono_feature_disable_sockets, currently not enabled by configure script

* [netcore] Don't compile in System.IO icall in netcore profile
2019-05-15 18:29:01 -04:00
Jérôme Laban 7a1e382925 Adjust spaces 2019-05-15 15:49:09 -04:00
Jérôme Laban 52557848ba Force import all libraries in dynamic mode, addFunction support 2019-05-15 15:03:37 -04:00
Jérôme Laban a1db6e83ed [Wasm] Add binding support for IntPtr 2019-05-15 15:03:37 -04:00
Jay Krell ebd0cdad5e Make genmdesc output better typed and more readable. (#14477)
* Make genmdesc output better typed and more readable -- almost hand-maintainable
but no clear route to actually hand-maintainable.

* Replace != with < and undo debug code.
2019-05-15 13:16:25 -04:00
Jérôme Laban 4d023b6bf8 [Wasm] Force libstdcxx to be included in the main module in release-dynamic 2019-05-14 22:28:34 -04:00
Jay Krell 495a93305b Add two asserts to mono_emit_jit_icall. (#14459) 2019-05-13 23:22:26 -07:00
Tanner Gooding f34d562641 Fixing S.P.Corelib to not double include files and ensure that S.N.V is marked #nullable enable (#24526)
* Changing EnableDefaultCompileItems=false to EnableDefaultItems=false

* Taking the VS auto-fixes for the solution and corelib csproj

* Removing the duplicated T4 file includes in the main csproj

* Regenerating the included T4 templates

* Fixing S.P.Corelib to properly list available platforms/configurations

* Add a comment on the T4 template service

Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Sung Yoon Whang be552ca506 Fix EventCounter disable logic (dotnet/coreclr#24519)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Andrew Au 5c401e1572 Remove obsolete comments
Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Stephen Toub 061d44d72e Tweak a few nullable annotations (dotnet/coreclr#24494)
- Assembly.ToString() won't return null
- Several attributes have the intent that their arguments are non-nullable, even though they don't check and throw; the annotations should match the intent in such cases.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Stephen Toub 0130eaecb8 Fix netstandard build for nullable annotations
Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Stephen Toub 1f36289bab Fix netfx build with nullable annotations
Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Alexander Kyte 4b111f373e [merp] Add an env var to disable all mono_crash files (#14407) 2019-05-13 09:36:43 -04:00
Zoltan Varga 008a0fb04a [corlib] Avoid preserving all fields of AppDomain. Don't preserve fields of Marshal, the runtime doesn't need them. 2019-05-12 22:49:14 -07:00
Alexander Köplinger ca5e8f207b [sdks] Lipo arm64_32 binaries for watchOS 2019-05-12 17:46:49 -07:00
Zoltan Varga c09128d8ff [corlib] Preserve AppDomain::DoTypeBuilderResolve () using a PreserveDependency attribute. (#14462) 2019-05-12 20:08:12 -04:00
Angelo Compagnucci f29eae3e35 configure: check for c++ availability (#14461)
Since commit d8af775, c++ compiler is required to compile.
This patch checks if the c++ compiler is available as soon as possible
and returns an error in case it is not found.

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

Signed-off-by: Angelo Compagnucci <[email protected]>
2019-05-12 15:43:00 -07:00
Alexander Köplinger db2f0ab3a5 [sdks] Use -pathmap CSC option for iOS/Mac
This allows the products to install the sources at a known location.
2019-05-12 10:23:46 -07:00
Jay Krell a1c476c04d Convert rest of JIT icall registration to static info. (#14455)
* Convert rest of JIT icall registration to static storage.

* PR: Expand macros manually (they can actually emcompass more, not less, another time).
2019-05-11 18:42:04 -07:00
Egor Bogatov 1049f06668 hide props 2019-05-11 09:53:48 +02:00
Marek Safar 73b82f02af Merge pull request #14458 from monojenkins/bclsizediff
[bcl] Update BCL Linked Size
2019-05-11 09:41:33 +02:00
Marek Safar 547ba43104 [System.Private.CoreLib] nullable warnings fixes 2019-05-11 09:40:04 +02:00
Johan Lorensson 072883b7fa Bump boringssl to include fix for Windows path's in lookup dirs. (#14435) 2019-05-11 02:20:00 -04:00
monojenkins f0d6e855ef [bcl] Update BCL Linked Size 2019-05-11 03:26:26 +00:00
Aleksey Kliger (λgeek) f4b86bbb41 [sdks] Build Android SDK on Windows (#14402)
Modify the sdks/builds/ infrastructure to support compiling the Android SDK on Windows.

The initial goal of this commit is to build only the monodroid BCL on Windows.  Compilation of the host and cross-compiler mono binaries is future work.

There's one kind of hacky bit in here.  Had to make sure that scripts/ci/run-jenkins.sh does _not_ set MONO_EXECUTABLE.  Normally windows builds use the msvc in-tree compiled mono binary to build the BCL.  In the case of the SDKs, we don't build that msvc binary, and we just use the usual (cygwin) mono to build the BCL.

* [sdks] allow building on cygwin

* [sdks] Start adding stub templates to llvm.mk

* [sdks] provision-android stubs for win32

* [sdks] Pass cygwin host triple to calls to configure on win32

* [sdks] Add runtime stub templates

* [sdks] Add android stub templates for win32

This is enough to get configure-android to work on cygwin x86_64

* [sdks] On win32, the HostMxe build is the host buildwe want the x86_64-w64-mingw32 toolchain, not the cygwin toolchain

* [sdks] For android on cygwin depend on the mingw64-{x86_64,i686}-zlib

* [sdks] Add android SDK build artifacts to .gitignore

* [sdks] Add AndroidCrossMXETemplate stub to android.mk for Windows builds

* [sdks] Fixup comments in android.mk

* [sdks] use UNAME=Windows for Cygwin and WSL

Don't assume Cygwin is the build platform for Windows Android SDK builds.

Keep using UNAME for coarse platform descriptions.
Switch to HOST_ARCH_MINGW32 instead of CYGWIN_BUILD_MACHINE for variable holding
the machine part of the host triplet for Windows.

* [sdks] Dummy provision-mxe target for windows

* [ci] Don't provision-android on Windows

It doesn't work yet.

* [sdks] temporarily turn off android-host-mxe-Win64-release

Needs mingw64-x86_64-zlib on all the CI builds bots.

* FIXME: hack - don't set MONO_EXECUTABLE to the msvc mono for Android SDK build

* [sdks] drop LLVMProvisionTemplateStub
2019-05-10 19:14:50 -04:00
Bernhard Urban 1d90dcfd35 [arm64] set MONO_ARCH_HAVE_UNWIND_BACKTRACE for watch4 (#14440)
[arm64] set MONO_ARCH_HAVE_UNWIND_BACKTRACE for watch4

Fixes a couple of mscorlib test failures, failing with
> Stack walks are not supported on this platform
2019-05-10 14:05:54 -04:00
Alexis Christoforides aedaf15f27 Revert "[System] Add FSEvent FileSystemWatcher to 'monotouch' BCL pro… (#14316)
* Revert "[System] Add FSEvent FileSystemWatcher to 'monotouch' BCL profile"

This reverts commit 46fc5352f3dfe0027e684a0f61e71130fccd559f.

While iOS FileSystemWatcher works, we now find that it is using unofficially-available  symbols and cannot publish apps using those.

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

* [csproj] Update project files
2019-05-10 12:50:03 -04:00
Jay Krell 04252ff724 Remove some malloc from JIT icall registration. (#14431)
Disallow duplicate JIT icall registration (by name, address, or new static info storage).
2019-05-10 08:36:29 -04:00
Johan Lorensson 991c7b6a61 Merge pull request #14425 from lateralusX/lateralusX/fix-profiler-on-windows
Add log profiler support to Mono MSVC build.
2019-05-10 12:50:28 +02:00
Egor Bogatov d06a42d56c TextInfo.ChangeCase should not use CultureInfo.CurrentCulture (#14105)
* Fix TextView

* Update CultureInfoTest.cs
2019-05-10 11:04:52 +02:00
Marek Safar affb833a6d Clean up local nullable enable 2019-05-10 10:51:17 +02:00
dotnet-bot ef5530ca28 fixing server error and syncing the repos 2019-05-10 10:51:17 +02:00
Stephen Toub b31b703b89 Turn on nullability for all of Corelib (dotnet/coreclr#24497)
* Enable nullable at the project level

* Remove `#nullable enable` from individual files

Removes `#nullable enable` from almost all .cs files in System.Private.CoreLib. I left it only in the ~30 files (out of ~1480 that had it) that are mirrored to corefx, that are built into projects by corefx that don't yet set NullableContextOptions at the project level, and that use nullable annotations; otherwise, they'd break the corefx build.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-10 10:51:17 +02:00
Johan Lorensson 5f41fb86be Merge pull request #14332 from lateralusX/lateralusX/add-llvm-windows-msvc-build-packaging-support
Add LLVM Windows MSVC build/packaging/archive/download support.
2019-05-10 10:33:43 +02:00
Filip Navara 643b2ebfc6 [netcore] Enable MSVC builds of Mono w/ ENABLE_NETCORE (#14418)
* Enable MSVC builds of Mono w/ ENABLE_NETCORE

* Fix non-netcore build

* Move the ENABLE_NETCORE definition to config.h where it belongs

* Replace .def with linker #pragmas

* TARGET_WIN32 -> HOST_WIN32 && HOST_X86

* Pick up MONO_ENABLE_NETCORE from cygconfig.h

* Make `./configure --with-core=only` MSVC builds working

* Include netcore sources unconditionally, move the condition into the .c file

* Fix MSVC C++ netcore build on Win32
2019-05-10 10:26:44 +02:00
Martin Baulig 0e5e464cff Add a few DISABLE_SECURITY conditionals. (#14300)
* Add a few `DISABLE_SECURITY` conditionals.

* [csproj] Update project files

* Fix tests.
2019-05-10 10:17:00 +02:00
Ryan Lucia 0c70519707 Fix minor build warning (#14426)
Fix minor build warning
2019-05-10 04:06:00 -04:00
Zoltan Varga 29fb43eb09 [corlib] Change the RuntimeModule.GetGuid and RuntimeAssembly.GetAotId icalls to return a byte array. (#14393)
* [corlib] Change the RuntimeModule.GetGuid and RuntimeAssembly.GetAotId icalls to return a byte array instead of a string, so it doesn't have to be parsed by the Guid ctor. Also allocate the arrays in the c# code and pass them to the icalls.
2019-05-09 20:34:55 -04:00
Jay Krell 77ab9ee0b8 Do not allocate handles in ReleaseMutex. (#14403)
* Do not allocate handles in ReleaseMutex.
Take advantage of thread/internal_thread maturity/pinning.

There are arguments for and against this.

It is arguably better to use handles everywhere.
But it is dubious to require an allocation to release a lock.
Releasing a lock should be infallible.
And surviving low memory shouldn't be a lost cause, imho..

This diff could also be viewed as an opportunistic cycle/size optimization
and be placed under ifdef -- ifdef THREAD_ALWAYS_PINNED orsuch.

This is an alternative to https://github.com/mono/mono/pull/14397.

* PR: Move comments.
2019-05-09 20:54:56 +02:00
lateralusX 2a703e72ff Add log profiler support to Mono MSVC build.
Several fixes to the log profiler in order to work on Windows.

* Add new dynamic library project to build log profiler on Windows MSVC.
* Fix dependecy between log profiler and Mono.
* Rewrite command pipe logic on Windows since it's not supported to select
  on both sockets and pipes.
* Several additional socket fixes needed for log profiler to work on Windows.
2019-05-09 18:33:00 +02:00
Egor Bogatov 735489b10b [netcore] Fix HideDetectionHappensBeforeBindingFlagChecks (#14336)
* Hide public property in Base if there is a private in Derived

* Update excludes-System.Runtime.Tests.rsp

* Update RuntimePropertyInfo.cs
2019-05-09 18:27:24 +02:00
Bernhard Urban a093cbddba [metadata] use handle stack in mono_runtime_object_init_handle (#14399)
Fixes this crash on watchOS with llvmonly:
```
(lldb) bt 35
* thread %1, name = 'tid_303', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x4d55545c)
  * frame %0: 0x01ab81de mscorlibtests`sgen_vtable_get_descriptor(vtable=0x4d555458) at sgen-client-mono.h:29:33
    frame %1: 0x01a9e278 mscorlibtests`major_copy_or_mark_object_canonical at sgen-marksweep-drain-gray-stack.h:158:10
    frame %2: 0x01a9debc mscorlibtests`major_copy_or_mark_object_canonical(ptr=0x182f260c, queue=0x01dd4894) at sgen-marksweep.c:1363
    frame %3: 0x019d31f2 mscorlibtests`mono_handle_stack_scan(stack=0x17e200b0, func=(mscorlibtests`major_copy_or_mark_object_canonical + 1 at sgen-marksweep.c:1362), gc_data=0x01dd4894, precise=1, check=1) at handle.c:340:5
    frame %4: 0x01a45680 mscorlibtests`sgen_client_scan_thread_data(start_nursery=0x00000000, end_nursery=0xffffffff, precise=1, ctx=ScanCopyContext @ 0x01dd4580) at sgen-mono.c:2254:5
    frame %5: 0x01a93e80 mscorlibtests`job_scan_thread_data(worker_data_untyped=0x00000000, job=0x0511c004) at sgen-gc.c:1416:2
    frame %6: 0x01adef0a mscorlibtests`sgen_workers_enqueue_job(generation=1, job=0x0511c004, enqueue=0) at sgen-workers.c:184:3
    frame %7: 0x01a9334a mscorlibtests`enqueue_scan_from_roots_jobs(gc_thread_gray_queue=0x01dd4894, heap_start=0x00000000, heap_end="", ops=0x01c6aaac, enqueue=0) at sgen-gc.c:1661:2
    frame %8: 0x01a94d16 mscorlibtests`major_copy_or_mark_from_roots(gc_thread_gray_queue=0x01dd4894, old_next_pin_slot=0x01dd4864, mode=COPY_OR_MARK_FROM_ROOTS_SERIAL, object_ops_nopar=0x01c6aaac, object_ops_par=0x00000000) at sgen-gc.c:2070:2
    frame %9: 0x01a95658 mscorlibtests`major_start_collection(gc_thread_gray_queue=0x01dd4894, reason="LOS overflow", concurrent=0, old_next_pin_slot=0x01dd4864) at sgen-gc.c:2189:2
    frame %10: 0x01a92ccc mscorlibtests`major_do_collection(reason="LOS overflow", is_overflow=0, forced=1) at sgen-gc.c:2362:2
    frame %11: 0x01a8e9ce mscorlibtests`sgen_perform_collection_inner(requested_size=21616, generation_to_collect=1, reason="LOS overflow", forced_serial=1, stw=1) at sgen-gc.c:2563:14
    frame %12: 0x01a8e76c mscorlibtests`sgen_perform_collection(requested_size=21616, generation_to_collect=1, reason="LOS overflow", forced_serial=1, stw=1) at sgen-gc.c:2640:2
    frame %13: 0x01a8e73e mscorlibtests`sgen_ensure_free_space(size=21616, generation=1) at sgen-gc.c:2514:2
    frame %14: 0x01a99184 mscorlibtests`sgen_los_alloc_large_inner(vtable=0x185749d0, size=21616) at sgen-los.c:380:2
    frame %15: 0x01a81c0a mscorlibtests`sgen_alloc_obj_nolock(vtable=0x185749d0, size=21616) at sgen-alloc.c:172:16
    frame %16: 0x01a44940 mscorlibtests`mono_gc_alloc_vector(vtable=0x185749d0, size=21616, max_length=900) at sgen-mono.c:1317:20
    frame %17: 0x00a5b408 mscorlibtests`aot_wrapper_icall_mono_gc_alloc_vector + 102
    frame %18: 0x00a56818 mscorlibtests`mscorlib_wrapper_alloc_object_AllocVector_intptr_intptr + 324
    frame %19: 0x01092b26 mscorlibtests`mscorlibtests1_MonoTests_System_DecimalTest2__ctor + 7286
    frame %20: 0x00a78912 mscorlibtests`aot_wrapper_gsharedvt_out_sig_pinvoke_void_this_ + 28
    frame %21: 0x00a4a4d2 mscorlibtests`mscorlib_wrapper_runtime_invoke_object_runtime_invoke_sig_void_intptr_intptr_object_intptr_intptr_intptr + 312
```

The hint here was that the crash happened in `mono_handle_stack_scan ()` and inspecting the handle stack there. After enabling `MONO_HANDLE_TRACK_OWNER` and `MONO_HANDLE_TRACK_SP` in `handle.h`, I got this:
```
warning: Handle 0x17886a0c (object = 0x16e73fd0) (allocated from "../../../../../mono/metadata/object.c:3182") is leaking.

    frame %1: 0x019833ba mscorlibtests`mono_handle_new(obj=0x01f194a0, info=0x17882600, owner="../../../../../mono/metadata/gc.c:1337") at handle.c:183:2
    frame %2: 0x019823c0 mscorlibtests`mono_gc_alloc_handle_string(vtable=0x17888760, size=24, len=5) at gc.c:1337:9
    frame %3: 0x019de896 mscorlibtests`mono_string_new_size_handle(domain=0x16e73fd0, len=5, error=0x01dc804c) at object.c:6643:6
    frame %4: 0x019d6fc4 mscorlibtests`mono_string_new_size_checked(domain=0x16e73fd0, length=5, error=0x01dc804c) at object.c:6655:2
    frame %5: 0x019de64e mscorlibtests`mono_string_new_utf16_checked(domain=0x16e73fd0, text=0x1842ab10, len=5, error=0x01dc804c) at object.c:6536:6
    frame %6: 0x019debc2 mscorlibtests`mono_string_new_checked(domain=0x16e73fd0, text="ar-SA", error=0x01dc804c) at object.c:6778:7
    frame %7: 0x019b06a8 mscorlibtests`construct_culture(this_obj=0x01f19428, ci=0x01b2d878, error=0x01dc804c) at locales.c:357:2
    frame %8: 0x019b0e3a mscorlibtests`ves_icall_System_Globalization_CultureInfo_internal_get_cultures(neutral='\0', specific='\x01', installed='\0') at locales.c:714:9
    frame %9: 0x007061f0 mscorlibtests`aot_wrapper___System_dot_Globalization_System_dot_Globalization_dot_CultureInfo__internal_get_cultures_pinvoke_cl2a_System_2eGlobalization_2eCultureInfo_5b_5d__cl4_bool_cl4_bool_cl4_bool_cl2a_System_2eGlobalization_2eCultureInfo_5b_5d__cl4_bool_cl4_bool_cl4_bool_ + 100
    frame %10: 0x00704fb2 mscorlibtests`mscorlib_System_Globalization_CultureInfo_GetCultures_System_Globalization_CultureTypes + 192
    frame %11: 0x0100f422 mscorlibtests`mscorlibtests1_MonoTests_System_DateTimeTest_Parse_Bug53023b + 192
    frame %12: 0x00a28702 mscorlibtests`aot_wrapper_gsharedvt_out_sig_pinvoke_void_this_ + 28
    frame %13: 0x009fa2c2 mscorlibtests`mscorlib_wrapper_runtime_invoke_object_runtime_invoke_sig_void_intptr_intptr_object_intptr_intptr_intptr + 312
    frame %14: 0x019278f2 mscorlibtests`mono_llvmonly_runtime_invoke(method=0x17953820, info=0x1842a9a0, obj=0x053b7c40, params=0x00000000, exc=0x01dc8550, error=0x01dc88a4) at mini-runtime.c:3000:2
```

@lambdageek suggested this fix after showing this trace to him. As far as I understand we do _not_ know the root cause yet. The handle leak happens in this trace:
```
(lldb) mbt
* thread %1
  * frame %0: 0x0176192c mscorlibtests`do_debug_me_please_kkthx at object.c:128:2
    frame %1: 0x01761a62 mscorlibtests`mono_runtime_object_init_handle(this_obj=MonoObjectHandle @ 0x01b53fbc, error=0x01b5404c) at object.c:146:3
    frame %2: 0x0176191e mscorlibtests`mono_runtime_object_init_checked(this_obj_raw=0x01fde880, error=0x01b5404c) at object.c:176:2
    frame %3: 0x0173ce32 mscorlibtests`ves_icall_System_Globalization_CultureInfo_internal_get_cultures(neutral='\0', specific='\x01', installed='\0') at locales.c:712:4
    frame %4: 0x004931d8 mscorlibtests`aot_wrapper___System_dot_Globalization_System_dot_Globalization_dot_CultureInfo__internal_get_cultures_pinvoke_cl2a_System_2eGlobalization_2eCultureInfo_5b_5d__cl4_bool_cl4_bool_cl4_bool_cl2a_System_2eGlobalization_2eCultureInfo_5b_5d__cl4_bool_cl4_bool_cl4_bool_ + 100
    frame %5: 0x00491f9a mscorlibtests`mscorlib_System_Globalization_CultureInfo_GetCultures_System_Globalization_CultureTypes + 192
    frame %6: 0x00d9b8f4 mscorlibtests`mscorlibtests1_MonoTests_System_DateTimeTest_Parse_Bug53023b + 192
    frame %7: 0x007b56ea mscorlibtests`aot_wrapper_gsharedvt_out_sig_pinvoke_void_this_ + 28
```
`mono_runtime_object_init_checked ()` already should take care of the handle stack 😕
2019-05-09 11:31:24 -04:00
Alexander Köplinger a597cee5b0 [sdks] Add .cs source files to ios archive
XI/XM install the Mono sources as part of their package.
2019-05-09 17:24:35 +02:00
Alexander Köplinger 969c04b141 [packaging] Add some missing .pdb's to Windows MSI (#14420) 2019-05-09 16:14:21 +02:00
Jay Krell 2524d5613b Usually do not create a handle in mono_runtime_invoke_handle. (#14404)
Use mono_runtime_invoke_handle_void instead.
2019-05-09 16:13:21 +02:00
Egor Bogatov b4e565f21b [netcore] Set of workarounds for ArrayTests (#14369)
* Fix ushort to char conversion

* fix one more test

* Enable more Array tests

* fix comment

* Fix CreateInstance_NotSupportedType_ThrowsNotSupportedException

* Address feedback

* Update ArraySortHelper.cs

* fix compilation error?

* bump corefx-tests, fix one more array.copy issue
2019-05-09 14:36:44 +02:00
Alexander Köplinger 8370fe318b [sdks] Make sure the mono-version.txt directory exists 2019-05-09 11:48:56 +02:00
Jay Krell c7697e0643 Mechanize strings in marshal.c register_icall and cleanup a little. (#14357)
The less mechical parts:
 - spell out monoeg_g_free
 - register_dyn_icall not used, remove
 - register_icall_no_wrapper only used once, spell it out instead

This is nice cosmetically on its own and will help remove JIT icall hashing.
2019-05-09 10:03:55 +02:00
Alexander Köplinger be571243e4 Bump helix-binaries
Helix recently started using Python 3 so we need to have a compatible xunit-reporter.py script.
2019-05-09 09:44:53 +02:00
Jay Krell 997190c12c Introduce enum and static data for JIT icalls, that are currently hashed (#14359)
* Introduce enum and static data for JIT icalls, that are currently hashed
by string and address and use dynamic allocation.

These will be used shortly.

* PR: Move MONO_JIT_ICALLS content from class-internals.h to jit-icall-reg.h.
Not clear what is the best name but moving along.
2019-05-09 02:06:52 -04:00
Ryan Lucia 6a20b25cc6 [corlib] Implement AssemblyBuilder.get_ReflectionOnly() (#14406)
* [corlib] Implement AssemblyBuilder.get_ReflectionOnly()

Fixes #13028

* Bump API snapshot submodule
2019-05-08 23:53:35 +02:00
Ryan Lucia 2894e57ed7 [gitignore] Add crash dump files, .dylib.dSYM directories, and test-path (#14408)
[gitignore] Add crash dump files, .dylib.dSYM directories, and test-path

Wasn't sure where in the file to best put the .dylib.dSYM stuff, so suggestions are welcome
2019-05-08 17:36:11 -04:00
Larry Ewing 0dd432096b Merge pull request #14203 from kjpou1/wasm-sdk-lower-version
[wasm][sdk] Fix warning NU1604, does not contain an inclusive lower b…
2019-05-08 11:44:03 -05:00
Alexander Köplinger 622ae6b8d4 [sdks] Add Mono version to ios/mac archive 2019-05-08 17:07:20 +02:00
Bernhard Urban 19f57ad0b8 [llvmonly] make local copy of trace_ips pointer from exception object (#14400)
Fixes a race in llvmonly (watchOS):
```
Process 397 stopped
* thread %10, name = 'tid_8e2f', stop reason = EXC_BAD_ACCESS (code=1, address=0x28)
    frame %0: 0x0177f690 mscorlibtests`mono_llvm_load_exception at mini-exceptions.c:3886:23
   3883                 size_t upper = mono_array_length_internal (mono_ex->trace_ips);
   3884
   3885                 for (int i = 0; i < upper; i += TRACE_IP_ENTRY_SIZE) {
-> 3886                         gpointer curr_ip = mono_array_get_internal (mono_ex->trace_ips, gpointer, i);
   3887                         for (int j = 0; j < TRACE_IP_ENTRY_SIZE; ++j) {
   3888                                 gpointer p = mono_array_get_internal (mono_ex->trace_ips, gpointer, i + j);
   3889                                 trace_ips = g_list_append (trace_ips, p);
Target 0: (mscorlibtests) stopped.

(lldb) mbt
* thread %10
  * frame %0: 0x0177f690 mscorlibtests`mono_llvm_load_exception at mini-exceptions.c:3886:23
    frame %1: 0x00e23b7a mscorlibtests`mscorlibtests1_MonoTests_System_LazyTest__c__DisplayClass16_0__ConcurrentInitializationb__1 + 254
    frame %2: 0x0087af98 mscorlibtests`mscorlib_wrapper_delegate_invoke__Module_invoke_void + 610
    frame %3: 0x00368856 mscorlibtests`mscorlib_System_Threading_ThreadHelper_ThreadStart_Context_object + 448
  [...]
(lldb) p/x mono_ex
(MonoException *) $2 = 0x01d9e968
(lldb) p/x mono_ex->trace_ips
(MonoArray *) $3 = 0x00000000
(lldb) thread list
Process 397 stopped
  thread %1: tid = 0x38772, 0x018156aa mscorlibtests`jit_info_table_copy_and_split_chunk(table=0x17635a00, chunk=0x17b767f0) at jit-info.c:483:28, name = 'tid_303', queue = 'com.apple.main-thread'
  thread %3: tid = 0x387ad, 0x1c4f9764 libsystem_kernel.dylib`__psynch_cvwait + 24, name = 'SGen worker'
  thread %4: tid = 0x387b0, 0x1c4f1224 libsystem_kernel.dylib`semaphore_wait_trap + 8, name = 'Finalizer'
  thread %5: tid = 0x387b5, 0x1c4fa6cc libsystem_kernel.dylib`__workq_kernreturn + 8
  thread %6: tid = 0x387b6, 0x1c4f11d4 libsystem_kernel.dylib`mach_msg_trap + 20, name = 'com.apple.uikit.eventfetch-thread'
* thread %10: tid = 0x389a6, 0x0177f690 mscorlibtests`mono_llvm_load_exception at mini-exceptions.c:3886:23, name = 'tid_8e2f', stop reason = EXC_BAD_ACCESS (code=1, address=0x28)
  thread %11: tid = 0x38985, 0x1c4f9764 libsystem_kernel.dylib`__psynch_cvwait + 24, name = 'tid_8113'
  thread %12: tid = 0x38986, 0x1c4f123c libsystem_kernel.dylib`semaphore_timedwait_trap + 8, name = 'Thread Pool Worker'
  thread %13: tid = 0x38987, 0x1c4f123c libsystem_kernel.dylib`semaphore_timedwait_trap + 8, name = 'Thread Pool Worker'
  thread %14: tid = 0x389a3, 0x1c4f123c libsystem_kernel.dylib`semaphore_timedwait_trap + 8, name = 'Thread Pool Worker'
  thread %15: tid = 0x389a4, 0x1c4f123c libsystem_kernel.dylib`semaphore_timedwait_trap + 8, name = 'Thread Pool Worker'
  thread %16: tid = 0x389a5, 0x1c4f123c libsystem_kernel.dylib`semaphore_timedwait_trap + 8, name = 'Thread Pool Worker'
(lldb) thread select 1
* thread %1, name = 'tid_303', queue = 'com.apple.main-thread'
    frame %0: 0x018156aa mscorlibtests`jit_info_table_copy_and_split_chunk(table=0x17635a00, chunk=0x17b767f0) at jit-info.c:483:28
   480                          jit_info_table_split_chunk (chunk, &new_table->chunks [j], &new_table->chunks [j + 1]);
   481                          j += 2;
   482                  } else {
-> 483                          new_table->chunks [j] = table->chunks [i];
   484                          ++new_table->chunks [j]->refcount;
   485                          ++j;
   486                  }
(lldb) mbt
* thread %1
  * frame %0: 0x018156aa mscorlibtests`jit_info_table_copy_and_split_chunk(table=0x17635a00, chunk=0x17b767f0) at jit-info.c:483:28
    frame %1: 0x01815304 mscorlibtests`jit_info_table_chunk_overflow(table=0x17635a00, chunk=0x17b767f0) at jit-info.c:579:10
    frame %2: 0x018146ee mscorlibtests`jit_info_table_add(domain=0x16624cc0, table_ptr=0x16624d9c, ji=0x176f4428) at jit-info.c:614:33
    frame %3: 0x01814662 mscorlibtests`mono_jit_info_table_add(domain=0x16624cc0, ji=0x176f4428) at jit-info.c:674:2
    frame %4: 0x0175f5da mscorlibtests`mono_aot_find_jit_info(domain=0x16624cc0, image=0x16c07200, addr=0x00271ff1) at aot-runtime.c:3710:3
    frame %5: 0x0181443e mscorlibtests`mono_jit_info_table_find_internal(domain=0x16624cc0, addr=0x00271ff1, try_aot=1, allow_trampolines=0) at jit-info.c:306:9
    frame %6: 0x018145e0 mscorlibtests`mono_jit_info_table_find(domain=0x16624cc0, addr=0x00271ff1) at jit-info.c:335:9
    frame %7: 0x01780212 mscorlibtests`build_stack_trace(frame_ctx=0x01c2fb18, state=0x01c2ffb8) at mini-exceptions.c:392:31
    frame %8: 0x1c598aa2 libunwind.dylib`_Unwind_Backtrace + 232
    frame %9: 0x0177f4fc mscorlibtests`throw_exception(ex=0x01d9e968, rethrow=0) at mini-exceptions.c:3800:3
    frame %10: 0x0177f3c8 mscorlibtests`mono_llvm_throw_exception(ex=0x01d9e968) at mini-exceptions.c:3823:2
    frame %11: 0x00439ed0 mscorlibtests`mscorlib_System_Runtime_ExceptionServices_ExceptionDispatchInfo_Throw + 116
    frame %12: 0x00271ff0 mscorlibtests`mscorlib_System_LazyHelper_ThrowException + 98
    frame %13: 0x002730c2 mscorlibtests`mscorlib_System_Lazy_1_T_REF_CreateValue + 194
    frame %14: 0x00273390 mscorlibtests`mscorlib_System_Lazy_1_T_REF_get_Value + 128
    frame %15: 0x0027307a mscorlibtests`mscorlib_System_Lazy_1_T_REF_CreateValue + 122
    frame %16: 0x00273390 mscorlibtests`mscorlib_System_Lazy_1_T_REF_get_Value + 128
    frame %17: 0x00e22eb0 mscorlibtests`mscorlibtests1_MonoTests_System_LazyTest_ConcurrentInitialization + 1422
    frame %18: 0x008948e2 mscorlibtests`aot_wrapper_gsharedvt_out_sig_pinvoke_void_this_ + 28
    frame %19: 0x008664a2 mscorlibtests`mscorlib_wrapper_runtime_invoke_object_runtime_invoke_sig_void_intptr_intptr_object_intptr_intptr_intptr + 312
```
2019-05-08 09:39:59 -04:00
Zoltan Varga f879e35e3e [runtime] Use MAP_JIT automatically when running under a hardened runtime on osx. (#14395)
* [runtime] Use MAP_JIT automatically when running under a hardened runtime on osx.

* Fix memory ordering.
2019-05-08 07:20:55 -04:00
Alexander Köplinger 76f3d2da55 [sdks] Add Mono binaries to mac archive 2019-05-08 12:42:54 +02:00
Jay Krell 8928ed6fd8 Mechanize strings in mini-runtime.c register_jit_icall. (#14374)
* Mechanism strings to register_dyn_icall in mini-runtime.c.
That is both, generate them kinda, and make them available for some later manipulation.

* Mechanize strings for JIT icall registration in mini-runtime.c.
Generate them slightly and make them amenable to crude preprocessor transforms later.

* Try to improve github diff presentation.
2019-05-08 03:46:31 -04:00
lateralusX 6fc4fe419d Bump LLVM to include build/package/upload/download of Windows LLVM builds. 2019-05-08 09:24:38 +02:00
Zoltan Varga 5ccb9854b8 [interp] Add tracing support. Return values are not yet supported. (#14389) 2019-05-07 23:16:20 -04:00
Jo Shields 1ecbff9e93 Don't apply MONO_ATTR_FORMAT_PRINTF to mono_error_set_argument (#14385)
The constructor for mono_error_set_argument lacks a `const char *msg_format`
so clearly we shouldn't be applying formatting from an entirely
unrelated parameter.

This was flagged by `-Werror=format-security`
2019-05-07 15:52:35 -04:00
Jo Shields 80f99fc37d Remapping should affect GAC search paths considered by the loader (#14384)
Closes: #14366

Fixes Mac package failures during IronRuby compilation
2019-05-07 15:32:30 -04:00
Alexis Christoforides 2454ccb800 [corlib] Fix exception 'replacement' in IsolatedStorageFile.MoveFile()
This was caused by changes in File.Move coming from https://github.com/mono/mono/pull/12000
2019-05-07 14:33:27 -04:00
Larry Ewing b0ec83c4d0 Merge pull request #14370 from lewing/mixed-sample
[wasm] Add a mixed target for sample
2019-05-07 11:05:50 -05:00
Alexander Köplinger bf7faa00ad [sdks] Add Mono libraries to mac archive 2019-05-07 17:43:03 +02:00
Alexander Köplinger b39d38ece1 [sdks] Add mono-2.pc to mac archive
Xamarin.Mac needs it.
2019-05-07 17:43:03 +02:00
Alexander Köplinger ece23539f1 [sdks] Add Mono libraries and frameworks to iOS archive 2019-05-07 17:43:03 +02:00
Alexander Köplinger 5c4f523065 [sdks] Remove --with-monotouch from configure arguments
They are only needed for BCL builds and those are disabled by --disable-mcs-build
2019-05-07 17:43:03 +02:00
Alexander Köplinger 37f3fa17a1 [sdks] Fix README.md 2019-05-07 17:43:03 +02:00
Johan Lorensson 5bcf166375 Merge pull request #14375 from lateralusX/lateralusX/fix-mutex-leak-on-gc
Mutex memory leak on sgen GC (nursery, major).
2019-05-07 13:57:05 +02:00
Juan Antonio Cano b5b9ac7456 Fix for #14353 (#14354) 2019-05-07 11:40:55 +02:00
Bernhard Urban 8913a1a73e [arm] fix armv7k regression on struct passing (#14362)
We can't use `slotsize=8` on `armv7k` as it leads to stack corruption.

Note that `mtouch` already calls the AOT compiler with `--aot=mtriple=arm64_32-ios`, so no changes are required there.

Regression introduced by https://github.com/mono/mono/pull/12992

Fixes https://github.com/mono/mono/issues/13454
2019-05-07 05:24:55 -04:00
lateralusX c5d014397a Mutex memory leak on sgen GC (nursery, major).
During GC we allocate a gray queue protected by a mutex, sgen_gray_object_queue_init.
This mutex is never destroyed when clearing up the object containing it,
sgen_gray_object_queue_dispose, so it will leak. Overtime this could cause
OOM on some systems depending on how memory related to system primitives are
handled and partitioned.
2019-05-07 10:20:31 +02:00
Anirudh Agnihotry f46b93c5f4 making DiagnosticCounter internal (dotnet/coreclr#24427)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-07 07:02:02 +02:00
Jay Krell b3ecd17109 Mechanize strings in cominterop register_jit_icall. (#14356)
This reduces the current source code and will be useful in eliminating JIT icall hashing.
2019-05-06 19:31:03 -04:00
Jay Krell 072ff8fcfb Mechanize strings in remoting.c register_icall. (#14360)
This will help remove/reduce JIT icall hashing, as the
name will also be a field name or token paste to an enum value.
2019-05-06 19:29:42 -04:00
Thays Grazia 1294e4d0e5 A deadlock happens when during a process_suspend there is a pending invoke and then when it's calling the invoke there is another call to process_suspend in the same thread. (#14368) 2019-05-06 19:24:02 -03:00
Jay Krell a41be28871 Make mono_fmod extern "C and not static, to simplify later (#14355)
* Make mono_fmod extern "C and not static, to simplify later
removal of JIT icall hashing. Making it more consistent with other icalls.
Costing maybe one instruction in some slow paths.

* Move mono_fmod from mini-runtime.c to jit-icalls.c.

* Fix declaratoin of mono_fmod.
2019-05-06 23:49:29 +02:00
Aaron Robinson b8cf9823a8 Port all managed product binaries to use SDK style projects (#24285)
Convert managed product binary to use SDK project system.
 - Uses Arcade for versions strings
 - Overrides Arcade defined output paths - should change in the future

Signed-off-by: dotnet-bot <[email protected]>
2019-05-06 20:20:25 +02:00
Krzysztof Wicher 8ab1154d23 Nullable: System.Collections.Generic remainder (dotnet/coreclr#24340)
* Nullable: System.Collections.Generic remainder

* apply review feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-06 16:57:18 +02:00
sancheolz 3e51e7d222 [WinForms] fix EditingCellFormattedValue getter and setter for bool value (#13845)
* [WinForms] If DataGridViewCheckBoxCell not in threeState mode
EditingCellFormattedValue must return true or false, instead of
value of CheckState type

* [WinForms] DataGrid: fix type check in EditingCellFormattedValue setter.
When set bool value to EditingCellFormattedValue there will be exception.
Type equality must be done through IsAssignableFrom not direct

* [WinForms] DataGrid: Add test for EditingCellFormattedValue getter and setter.
2019-05-06 15:11:49 +02:00
monojenkins b6a652c072 Bump API snapshot submodule 2019-05-06 15:00:15 +02:00
Marek Safar ad3a5196dc [Facades] Include missing enums in System.Memory 2019-05-06 15:00:15 +02:00
Alexander Köplinger 4eea0870e1 [tests] Write nunit/xunit exclude categories to a file (#14281)
So we can include it in the SDKs archive.
2019-05-06 13:59:03 +02:00
Ben Adams 3bb7f82d00 Move AsyncMethodBuilder.SetStateMachine to non-generic (#24403)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-06 10:55:35 +02:00
pedestrianlove f60a397ab5 Remove special casing (#14155)
* match the parameter

* Removed special handling.

Removed special handling of TypedReference and RuntimeArgumentHandle

* Remove the whole special casing block

* Revert part of last commit

Restored the check for IsByRefLikeAttribute

* Corrected the function name
2019-05-06 02:00:16 -04:00
Larry Ewing 8d80ccc897 Merge pull request #14259 from jeromelaban/dev/jela/wasm-dlopen
[Wasm] Add support for P/Invoke through dynamic linking
2019-05-05 16:39:52 -05:00
Patrik Švikruha b30604fe9f fix typos - expext to expect in wasm test 2019-05-05 12:39:29 +02:00
Larry Ewing 59caa3e992 Add replace ContainsKey with a consistency check in object registration (#14343) 2019-05-05 08:04:37 +02:00
lateralusX edc7c34502 Add execute permissions on build scripts. 2019-05-04 13:29:36 +02:00
Larry Ewing b2a9049de4 Merge pull request #14331 from BrzVlad/feature-interp-ldsflda-opt
[interp] Optimize ldsflda opcode
2019-05-04 00:55:38 -05:00
Egor Bogatov 534c6883b1 [netcore] Fix CreateInstance_PublicOnlyValueTypeWithPrivateDefaultConstructor_T… (#14321)
* Fix CreateInstance_PublicOnlyValueTypeWithPrivateDefaultConstructor_ThrowsMissingMethodException

* Update excludes-System.Runtime.Tests.rsp

* Update RuntimeType.cs
2019-05-04 06:36:03 +02:00
Jan Kotas 744d3b7713 Fix CoreRT build breaks
Signed-off-by: dotnet-bot <[email protected]>
2019-05-04 06:25:52 +02:00
Filip Navara b7876417d3 Implement String.IsAscii in shared CoreLib and use it for [Is]Normalize[d] for all runtimes (#24373)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-04 06:25:52 +02:00
Levi Broderick f96706874d Vector.CopyTo / TryCopyTo should be readonly methods (dotnet/coreclr#24359)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-04 06:25:52 +02:00
Larry Ewing 887887a7fe Merge pull request #14340 from lewing/wasm-link-descriptor
[wasm] Add --link-descriptor arg to packager
2019-05-03 22:56:13 -05:00
Jérôme Laban ff4839d99e Regenerate m2n trampolines 2019-05-03 20:42:10 -04:00
Jérôme Laban 40981f0cfd Adjust indentation 2019-05-03 20:40:31 -04:00
Jérôme Laban 21743bd58d Add vifffff and viffffff trampolines 2019-05-03 20:40:30 -04:00
Jérôme Laban 04b8dd0f9b Fix invalid emscripten path file name 2019-05-03 20:39:18 -04:00
Jérôme Laban ca9892c340 Lookup pinvoke_names in wasm_dl_load first 2019-05-03 20:39:18 -04:00
Jérôme Laban 4c034a4678 Adjust indentation 2019-05-03 20:39:18 -04:00
Jérôme Laban ee6603916d Make wasm dlopen use only for release-dynamic configuration 2019-05-03 20:39:18 -04:00
Jérôme Laban 8a0e78d5a9 Move -s MAIN_MODULE=1 to all configurations
This will avoid emscripten to call abort() because  MAIN_MODULE is not defined.
2019-05-03 20:39:18 -04:00
Jérôme Laban b5b860f8d7 Make libmono_icall_table_la_LIBADD and libmono_ilgen_la_LIBADD conditional to wasm. 2019-05-03 20:39:18 -04:00
Jérôme Laban 8bddfdb2d2 Fix indentation, spacing. 2019-05-03 20:39:17 -04:00
Jérôme Laban f8371d8114 Generate m2n after update 2019-05-03 20:39:17 -04:00
Jérôme Laban c48414e9ef Apply fix for emscripten issue
https://github.com/emscripten-core/emscripten/issues/8511
2019-05-03 20:30:00 -04:00
Jérôme Laban 935bc21276 Fix indentation 2019-05-03 20:30:00 -04:00
Jérôme Laban 3f303a5033 Adjust release-dynamic output 2019-05-03 20:30:00 -04:00
Jérôme Laban ecd8c210e0 Add more driver cookies 2019-05-03 20:30:00 -04:00
Jérôme Laban aaccedfbfb Adjust touch of the release-dynamic folder 2019-05-03 20:30:00 -04:00
Jérôme Laban 6207844e39 try build release-dynamic 2019-05-03 20:29:59 -04:00
Jérôme Laban 51abc92b6e mono emscripten double loading issue 2019-05-03 20:29:59 -04:00
Jérôme Laban a1cda38793 Workaround for second dlopen failure returns non-null 2019-05-03 20:29:59 -04:00
Jérôme Laban 195e7f0b05 Add missing include 2019-05-03 20:29:59 -04:00
Jérôme Laban b50d35f620 Add minimal dl support 2019-05-03 20:29:59 -04:00
Jérôme Laban f334609ad5 Add EXPORT_ALL
https://github.com/emscripten-core/emscripten/blob/399cd460a4c7f12fbc7104cc7d1e7e20e7b574bf/tests/test_browser.py#L3420
2019-05-03 20:29:58 -04:00
Jérôme Laban 96e4e2f532 Enable dynamic linking support for mono 2019-05-03 20:29:58 -04:00
Larry Ewing 4cc2c190c0 Merge pull request #14309 from lewing/icall-branch
[wasm] generate icall_trampoline_dispatch as nested branches
2019-05-03 17:56:32 -05:00
Larry Ewing ea912ff155 Merge pull request #14306 from radical/bump_msbuild_master
[msbuild] Bump to pick up test fixes
2019-05-03 16:12:56 -05:00
Larry Ewing 0262d10220 Add --link-descriptor arg to packager to allow custom linker configuration 2019-05-03 13:45:21 -05:00
Jo Shields cae7795990 [netcore] Unique Asset Manifest filenames per branch 2019-05-03 14:41:44 -04:00
Larry Ewing 1d86f1a792 Order the groupings preferentially by length to reduce the worst case 2019-05-03 13:31:55 -05:00
Jo Shields 2331437db0 [netcore] Install and use GNU sed on Mac 2019-05-03 14:02:12 -04:00
Jo Shields 4b6f7f090a [netcore] Looks like dependsOn only references base job name, not each leg 2019-05-03 13:41:45 -04:00
Jo Shields 7fcf315af7 [netcore] Add OSX build (#14337) 2019-05-03 13:32:47 -04:00
Jo Shields 99853eeeb3 [netcore] Publish to BAR too (#14334) 2019-05-03 10:49:41 -04:00
Martin Baulig 40372422e7 Add a few RuntimeFeature.IsDynamicCodeSupported conditionals. (#14284)
* Add a few `RuntimeFeature.IsDynamicCodeSupported` conditionals.

* Update RuntimeMethodInfo.cs
2019-05-03 16:09:48 +02:00
lateralusX f42c1e0a67 Add option to restore VS build env from file. 2019-05-03 15:14:22 +02:00
lateralusX 568813b93b Add support for cygwin and WSL in helper build scripts. 2019-05-03 15:14:21 +02:00
lateralusX 488e15e8ab Add support to include external build LLVM binaries in Mono build output. 2019-05-03 15:14:21 +02:00
lateralusX f83d9f3575 Add LLVM SDK build/package support for Windows msvc build LLVM. 2019-05-03 15:14:21 +02:00
Zoltan Varga 231da41c78 [corlib] Avoid a runtime crash on new ArgIterator(new RuntimeArgumentHandle()). 2019-05-03 12:55:41 +02:00
Vlad Brezae ccdc79fd9e [interp] Optimize ldsflda opcode
2-4x speedup
2019-05-03 13:54:06 +03:00
Sung Yoon Whang 2867365120 Add Series/CounterType to CounterPayload and IncrementingCounterPayload (#24349)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-03 09:08:20 +02:00
Jay Krell d37cd2c2fc ld -Bsymboli so dynamic linker does not get betweem mono and itself. (#14298) 2019-05-03 02:29:56 -04:00
Paul Hebble 955faeac52 Fix light on light ListViewGroup headers on dark theme 2019-05-02 22:16:06 -05:00
Zoltan Varga 15f9b329c0 [runtime] Fix the signature of the AppDomain:DoUnhandledException () icall. (#14322) 2019-05-02 22:44:08 -04:00
Larry Ewing 795fed8852 Merge pull request #14319 from lewing/set-options-strdup
[wasm] Define wasm_strdup when setting options
2019-05-02 20:25:18 -05:00
Larry Ewing e6422bc3b4 Define wasm_strdup when setting options 2019-05-02 14:24:36 -05:00
Zoltan Varga 8312f0abe3 [wasm] Add a --runtime-arg= argument to runtime-tests.js to allow setting runtime arguments like --trace. (#14305) 2019-05-02 14:46:18 -04:00
Krzysztof Wicher 6ea6d1a481 Add using System.Diagnostics on some files
Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Stephen Toub b607d622ff Delete stale compilation constants from AsyncIteratorMethodBuilder (#37331)
I accidentally left these MICROSOFT_BCL_ASYNCINTERFACES_PACKAGE references in as part of some recent churn.  This compilation constant isn't set anywhere.

And the CORERT ifdef is no longer needed now that we've consolidated the code to shared.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Stephen Toub b1c8ebcdd4 Add ManualResetValueTaskSourceCore / AsyncIterateMethodBuilder to Microsoft.Bcl.AsyncInterfaces (#37320)
* Add ManualResetValueTaskSourceCore / AsyncIterateMethodBuilder to Microsoft.Bcl.AsyncInterfaces

These two types needed modifications to target .NET Standard 2.0 and are the necessary pieces to enable the compiler to compile async iterators.

- Copied ManualResetValueTaskSourceCore.cs from coreclr and tweaked it.  I opted to do this rather than ifdef because the changes are not localized and I didn't want to significantly perturb the primary implementation.
- Added a few ifdefs to the shared AsyncIteratorMethodBuilder.  It already had ifdefs, so I just added to it.
- Added a test project, and included the existing ManualResetValueTaskSourceCore tests.  I had to disable two of the tests because of some of the optimization differences.
- Augmented those tests to validate that the compiler is able to successfully generate iterators and await foreach them.

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Ludovic Henry 7336f1d621 Implement GC.RegisterMemoryLoadChangeNotification (dotnet/coreclr#24202)
* Implement GC.RegisterMemoryLoadChangeNotification

This allows users to register a callback to be called whenever the
memory load is between a low and high thresholds. The idea is to allow
them to tweak their memory usage based on the available memory.

It is only internal for now because we are not confident on the shape of
the API and if it's the best we can provide users. This needs to go
through a few iterations with first party users like ASP.NET or corefx.

WIP for https://github.com/dotnet/coreclr/issues/18619

* fixup! Implement GC.RegisterMemoryLoadChangeNotification

* fixup! Implement GC.RegisterMemoryLoadChangeNotification

* fixup! Implement GC.RegisterMemoryLoadChangeNotification

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Dan Moseley 4b40a182b1 Adjust some terms (dotnet/coreclr#24351)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Krzysztof Wicher e09ca81503 Nullable: Interop and src/System remainder (dotnet/coreclr#24328)
* Nullable: Interop and src/System remainder

* apply feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Krzysztof Wicher c8b4fc18c3 Nullable: System.Collections remainder (non-generic) (dotnet/coreclr#24326)
* Nullable: System.Collections remainder (non-generic)

* apply feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Blake Hensley 6f1121badb Added overloads to Path.Join (dotnet/coreclr#24307)
* Added overloads to Path.Join

* Refactor Path.Join and Path.Combine to use ValueStringBuilder

* Use proper defined const for empty string

* Fix Windows-specific const

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Stephen Toub 8c5f625792 Move the new ConfigureAwait/WithCancellation extension methods to a new type (#24331)
We decided after all to put these on a different type, TaskAsyncEnumerableExtensions.  This commit adds the new type.  We can delete the methods in the old location once corefx consumes an updated build and switches over to using the new ones.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Santiago Fernandez Madero 3c0290dfcd Merge pull request dotnet/coreclr#24258 from dotnet/NullableFeature
Merge nullable feature into master

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Buyaa Namnan a25a0c2fc6 Fix test failures
Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Krzysztof Wicher 50a010a39f fix build errors after merge
Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Santiago Fernandez Madero 8f883a789f Nullable: Comparers, Dictionary and Friends (dotnet/coreclr#23971)
* Nullable: Comparers, Dictionary and Friends

* Add object constraint to Dictionary

* Fix warning from new compiler and annotating dictionary

* PR Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
buyaa-n 3183fd2028 Nullable for Type class (dotnet/coreclr#23489)
System.Type, System.Reflection nullability

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Krzysztof Wicher ab23b7e07d Nullable: System.Diagnostics.Tracing (dotnet/coreclr#24070)
* Nullable: System.Diagnostics.Tracing

* apply feedback

* fix one more comment

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Bernhard Urban 1cbd5cbacf [arm] amend stack pointer properly in exception trampoline (#14310)
The previous attempt ( https://github.com/mono/mono/pull/14078 ) only fixed it for ABIs where the stack pointer alignment is 8 bytes. ABIs, such as watchOS, require 16 byte alignment.
2019-05-02 13:48:41 -04:00
Alexander Kyte b15631d641 [llvm] Widen vector equality (OP_PCMPEQx) (#14292)
* [llvm] Widen vector equality (OP_PCMPEQx)

Fixes https://github.com/mono/mono/issues/14261
Fixes https://github.com/mono/mono/issues/14143

This was causing an issue when trying to inline
System.Numerics.Vectors.Vector`1<byte>:Equals into System.Span.IndexOf
from System.Memory.dll as provided by nuget. I believe that it is
comparing the result of a SIMD operation on two SIMD registers there with a
SIMD register full of zero bytes.

When we produce the Equals call (no inline), we spill the SIMD <4 x i32>
vector to the stack in the caller, and we then later load it
with the widened type used here <16 x i8>.

When we inline, we end up making the args into XMOV opcodes,
and then doing the "pcmpeqb" mini opcode with the return values
from those operations. This becomes a register to register no-op
copy, and the original <4 x i32> gets compared against the <16 x i8>
type:

```
  %116 = icmp eq <16 x i8> zeroinitializer, <4 x i32> %115
```

This does not go the way we want it to. It reliably leads to IndexOf
breaking and only finding the desired byte in the portion not processed
by the SIMD code (in the last few elements of the array).

This fix checks if the input dimensions differ, and does a conversion.
This produces the following IR:

```
  %114 = bitcast <4 x i32> %99 to <16 x i8>
  %115 = icmp eq <16 x i8> %114, %113
  %116 = sext <16 x i1> %115 to <16 x i8>
  %117 = icmp eq <16 x i8> zeroinitializer, %116
```

* [llvm] Widen vector greater-than

Here we do the same trick used in the above fix, but for the parallel greater-than operation.
2019-05-02 12:24:35 -04:00
Jay Krell d371432a10 Move three trivial threadpool icalls to callers. (#14296)
ves_icall_System_Threading_ThreadPool_PostQueuedCompletionStatus
 ves_icall_System_Threading_ThreadPool_BindIOCompletionCallbackNative
 ves_icall_System_Threading_ThreadPool_IsThreadPoolHosted
2019-05-02 10:25:58 -04:00
Jo Shields 748da2e4a9 [netcore] Onboard Arcade (#14301) 2019-05-02 10:24:10 -04:00
Friedrich von Never c9c50f85f4 Fix #14255: correct type and bitness for TARGETS request of X11 clipboard 2019-05-02 14:23:02 +02:00
Egor Bogatov ea917ba76a [netcore] clean up excludes-System.Runtime.Tests.rsp (#14294)
* update System.Runtime.Tests.rsp

* Update System.Private.CoreLib.csproj

* Update excludes-System.Runtime.Tests.rsp

* Invoke AppContext.OnProcessExit from runtime

* remove Utf16/Utf8 tests

* Implement LoadFromPath

* make NativeLibrary os specific

* Add missing LoadWithPartialName

* Update Assembly.cs

* Update Assembly.cs

* Update NativeLibrary.Unix.cs
2019-05-02 14:00:39 +02:00
Larry Ewing 2e97d6edd7 Merge pull request #14295 from vargaz/mixed-eh-5
[runtime] Fix some mixed EH problems.
2019-05-02 01:46:36 -05:00
Larry Ewing f557414b61 Try out a branching trampoline dispatch 2019-05-01 23:29:48 -05:00
Ankit Jain 3fe8360358 [msbuild] Bump to pick up test fixes 2019-05-01 15:43:27 -04:00
Alexis Christoforides 2fc4d80c99 corlib] Add API that was dropped during the coreFX System.IO integration (#14265) 2019-05-01 11:24:21 -04:00
Marek Safar cece97035d Make block optimized ClearWithoutReferences fully shared (#24312)
Signed-off-by: dotnet-bot <[email protected]>
2019-05-01 09:28:17 +02:00
Zoltan Varga 781d20bab4 [runtime] Fix some mixed EH problems. 2019-05-01 02:00:56 -04:00
Zoltan Varga e431093f73 [aot] Avoid passing -march=arm to llc when using thumb, it forces arm32 code generation. (#14288)
Fixes https://github.com/mono/mono/issues/14247.
2019-04-30 20:47:27 -04:00
Ankit Jain a27a7737c4 Update nuget.exe too 2019-04-30 20:12:08 +02:00
Ankit Jain 450e296221 Bump msbuild to track xplat-master 2019-04-30 20:12:08 +02:00
Tanner Gooding 285992a721 Updating System.Numerics.Vector<T> to use the readonly members feature. (#23827)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 18:29:44 +02:00
monojenkins 0da2ba771b [csproj] Update project files 2019-04-30 12:14:57 +02:00
lateralusX 81ce33f6b6 Add minimal COM support into WinAOT BCL profile and Windows Mono runtime.
Technologies like SharpDX uses a minimal set of COM support from runtime
and System.Runtime.InteropServices.Marshal:

AddRef
Release
QueryInterface

All these are low level wrappers around methods in IUknown interface and
doesn't need any of the additional runtime COM support enabled to work.

Technologies like CoreRT includes these methods in their full AOT
profile, meaning that SharpDX can run on CoreRT on Windows platforms. Mono's
WinAOT profile and runtime currently don't, making it impossible  to use
SharpDX.

This PR adds the needed methods into WinAOT profile and also make
sure corresponding icalls always gets included on Windows build Mono runtime.
2019-04-30 12:14:57 +02:00
Marek Safar 92cb0369bb Fix the build 2019-04-30 09:39:12 +02:00
Levi Broderick 98846ea2ff Add more span-based Vector<T> ctors and CopyTo methods (#23333)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 09:39:12 +02:00
Egor Bogatov 5702e95cea Move DefaultBinder.CanConvert.cs to shared (dotnet/coreclr#23931)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 09:39:12 +02:00
Michal Strehovský 7bca6da11f Move NativeLibrary to the shared partition (dotnet/coreclr#24143)
I'm taking the LibraryNameVariation helper from System.Runtime.Loader for the ride as well because it's a general purpose probing logic that is useful in a managed implementation of NativeLibrary.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 09:39:12 +02:00
dschinde 6291956230 Improve pref of Array.IndexOf() for certain T. (dotnet/coreclr#24293)
Applies changes to `Array.IndexOf()` and `Array.LastIndexOf()` similar
to the changes made in #20855, so that types other than `byte` and
`char` can use use the fast vectorized path.

Also allows 32-bit and 64-bit types for which
`RuntimeHelpers.IsBitwiseEquatable<T>()` returns `true` to use the
faster implementation of `IndexOf` and `LastIndexOf` from
`MemoryExtensions`.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 09:39:12 +02:00
Jan Kotas cee1268335 Workaround memset alignment sensitivity (dotnet/coreclr#24302)
* Workaround memset alignment sensitivity

memset is up to 2x slower on misaligned block on some types of hardware. The problem is uneven performance of "rep stosb"
used to implement the memset in some cases. The exact matrix on when it is slower and by how much is very complex.

This change workarounds the issue by aligning the memory block before it is passed to memset and filling in the potential misaligned
part manually. This workaround will regress performance by a few percent (<10%) in some cases, but we will gain up to 2x improvement
in other cases.

Fixes #24300

Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 09:39:12 +02:00
Anirudh Agnihotry b3eeab7410 Improve Precision to 10 microseconds in timespan (dotnet/coreclr#24279)
* Increasing precision properly and leaving the rounding of to casting operator

* disabling corefx tests in coreclr and addressing feedback

* correcting test project name

* Fix json

Signed-off-by: dotnet-bot <[email protected]>
2019-04-30 07:48:31 +02:00
Zoltan Varga cf10cb7238 [wasm] Add support for pinvokes in user assemblies. (#14253)
The --pinvoke-libs=x argument to packager.exe can be used to generate pinvoke linking tables.
'x' is a list of library names used in DllImport declarations, i.e. --pinvoke-libs=libtest is used
to link with [DllImport ("libtest")].
2019-04-29 19:20:28 -04:00
Larry Ewing 498974d09a Merge pull request #14199 from kjpou1/wasm-sdk-cl-args
[wasm][sdk] Add command line quoting and escaping to WasmLinkAssembli…
2019-04-29 17:33:44 -05:00
Marek Safar dc683e5cd3 Fix the build 2019-04-29 22:47:13 +02:00
Steve MacLean c86a8f843e Fix Satellite Assembly loading (dotnet/coreclr#24191)
* Fix Satellite Assembly loading

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes #20979

* Call ResolveSatelliteAssembly from native

Only call ResolveSatelliteAssembly from native when
resolving a satellite assembly

* PR Feedback

Minimize string creation
Remove unnecessary if null checks
Eliminate corner cases by only allowing one case insensitive matching directory.

* ResolveSatelliteAssembly should ...

ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly

Simplify code.
Add Debug.Assert

* Remove case insensitive culture search

* PR Feedback

* Fix parentAssembly logic

* Fixes from initial testing

* Add probe for lower case culture name

* PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-29 22:47:13 +02:00
Anirudh Agnihotry f503eb7dbc Revert "Dummy commit" (dotnet/coreclr#24197)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-29 22:47:13 +02:00
Anipik 45f19a5577 Dummy commit
Signed-off-by: dotnet-bot <[email protected]>
2019-04-29 22:47:13 +02:00
Anipik c94f194278 synving with coreclr 2019-04-29 22:10:14 +02:00
Marek Safar c6c25db0c2 Mirror changes from mono/coreclr,corefx,corert (#14163)
Mirror changes from mono/coreclr,corefx,corert
2019-04-29 19:30:57 +02:00
monojenkins 344df07dd2 [csproj] Update project files 2019-04-29 15:47:04 +02:00
Martin Baulig 23343ab506 Remove ClientRealProxy on wasm and testing_aot. 2019-04-29 15:47:04 +02:00
Martin Baulig 06487590ff Define DISABLE_SECURITY and DISABLE_REMOTING on wasm and testing_aot. 2019-04-29 15:47:04 +02:00
Martin Baulig b22ed1a09f Make testing_aot_full tests build again in System.Security. (#14244)
* Make `testing_aot_full` tests build again in System.Security.

* Add System.Security tests.
2019-04-29 15:43:33 +02:00
Kenneth Pouncey 1faa0ec279 Set an explicit version.
Address review comments by Katelyn Gadd
2019-04-29 05:51:06 +02:00
Jay Krell 90a91429ae Remove libgcc_s_seh-1.dll dependency when targeting Win32 with gcc. (#14251)
Don't use popcount intrinsic.
Alternative but not exactly contradictory to https://github.com/mono/mono/pull/14248.

Note that this is a single inlinable instruction on x86,
if you assume at least SSE4 from circa 2007, which I am avoiding here.
2019-04-27 21:57:17 -04:00
Vlad Brezae 6d9c4c24d2 [interp] Optimize enum Hasflag (#14173)
* [interp] Optimize enum.HasFlag for csc pattern

Avoid boxing and slow call. Makes it 100x faster.

* [interp] Optimize enum.HasFlag for mcs pattern

* [interp] Transform ldc.i4 + conv.i8 into ldc.i8

Simplifies code, making enum.HasFlag optimization work for long enums.
2019-04-27 12:14:16 +03:00
Kenneth Pouncey 5d9ecd7112 [wasm][bindings] Refactor WebAssembly.Core object instantiation. (#14191)
* Refactor WebAssembly.Core object instantiation.

- Move the supported Core object identification into javascript.
- Runtime the core object type is now passed into the Runtime from javascript binding support instead of being housed in managed code.

* Address review comments.

* Fix indentation

* Implement suggestion by Katelyn Gadd to use Symbol instead of a Map or WeakMap.

- This removes the previous mono_wasm_core_map used for type mapping.
- Attach a special named symbol for `wasm type` to the prototype property for the Core objects that we have bound.
- The Managed Type is stored in the symbol property that will be passed to the managed side.
2019-04-27 09:27:22 +02:00
monojenkins 87000b43bb [bcl] Update BCL Linked Size 2019-04-27 08:38:28 +02:00
Vlad Brezae a68022ae7e [interp] Optimize special static field access (#14202)
* [interp] Optimize special static field access

3x faster. For value types 10x.

* [interp] Remove duplicated code

* [interp] Further optimize thread static field access

Provides an additional 50% perf gain.
2019-04-27 00:28:12 +03:00
Vlad Brezae 6fb7b496bd [interp] Don't change next_jit_code_hash during imethod transform (#14240)
This field is used by the internal hash table to link nodes and it can be changed during hash table insertion of other imethods. Copying this field back was leading to random hangs in hash table lookup.
2019-04-26 17:20:33 +02:00
Zoltan Varga c2e540331d [runtime] Add a python version of the offsets tool. (#14229)
* [runtime] Add a python version of the offsets tool.

This version only depends on python and libclang. It currently only
works on osx.

* [runtime] Add a dummy structure needed by the python version of the offsets tool.

* [offsets-tool-py] Change some argument names for compatibility.

* [wasm] Use the python offsets tool on osx, the c# version is 32 bit, and the 64 bit version doesn't work.

* [wasm] Fix the ordering of mono libraries on the link line.
2019-04-26 11:12:24 -04:00
Martin Baulig 5e2069746c Avoid HashAlgorithm.Create() on FULL_AOT_RUNTIME. (#14228) 2019-04-26 14:08:36 +02:00
Kenneth Pouncey c97840f414 Replace the command line generation using string formatting with the ProcessArguments routines that will add escaping and quoting to the parameters and as necessary.
- The routine specifically will escape path separators when needed for instance on windows instead of using the simplified `.Replace ("\\", "\\\\")` as previously implemented.
- The routine will also add quoting when necessary.
2019-04-26 12:00:30 +02:00
Kenneth Pouncey cefbe81ee9 Rebase WasmLinkAssemblies 2019-04-26 11:12:08 +02:00
Jo Shields d44e45c32e [netcore] Avoid touching or using submodules in coreonly mode 2019-04-26 08:53:25 +02:00
Jo Shields 82a60e239f [netcore] Copy in 3 files, to avoid need for corert submodule in coreonly 2019-04-26 08:53:25 +02:00
Jérôme Laban 95cc5b2f45 Add missing pinvoke-tables-default.h from build artifacts. (#14237)
[Wasm] Add missing pinvoke-tables-default.h from build artifacts

This change restores the ability to build wasm AOT apps outside the mono source tree.
2019-04-26 00:45:45 -04:00
Martin Baulig 19387b1f41 Disable "unreachable code" warnings on wasm. (#14230) 2019-04-25 22:02:53 +02:00
Jo Shields 3521df4cf4 [netcore] Smarter version numbering of nupkg (#14011)
The version number in version.h only shows e.g. "6.3.0", and we
want full version numbers ideally, to match what our Mac pkg files
show. This logic calculates that version number.
2019-04-25 15:42:56 -04:00
Jo Shields b1d54d2e42 [netcore] Fix make dist following https://github.com/mono/mono/pull/14167 (#14233) 2019-04-25 14:27:46 -04:00
Jay Krell 8eec35bcdd Fix arm32 tailcall_reg/tailcall_membase. (#14187)
* Revert "[Tailcall] [arm] [jit] Fix moving tailcall parameters. (#12701)"

This reverts commit 257efc6374.

* When moving parameters for tailcall, and having pushed ip,
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes https://github.com/mono/mono/issues/11489.
2019-04-25 13:10:06 -04:00
Egor Bogatov 591d6d0a21 [netcore] ASP.NET Core sample (#14224)
* ASP.NET Core sample

* update makefile

* update Home page

* Update Makefile

* remove ASPNET_SHAREDRUNTIME

* replace mvc with web sample
2019-04-25 18:28:56 +02:00
Alexis Christoforides e541be2da2 [monodroid] Enable System.IO.Pipes (#14160)
* [monodroid] Enable System.IO.Pipes

* Bump API snapshot submodule

* [csproj] Update project files
2019-04-25 11:05:11 -04:00
monojenkins 3d7a63ba17 [csproj] Update project files 2019-04-25 09:17:13 +02:00
Martin Baulig 0a5a9ec821 Remove DISABLE_REMOTING conditional. 2019-04-25 09:17:13 +02:00
Martin Baulig b07f68a61c Getting rid of the DISABLE_REMOTING conditional. 2019-04-25 09:17:13 +02:00
Vlad Brezae 913951b350 [interp] Don't check for exception in native wrappers (#14184)
We already do it when we get back to the interpreter.
2019-04-25 10:09:11 +03:00
Johan Lorensson 45a3eef924 Merge pull request #14101 from lateralusX/lateralusX/add-coop-support-windows-msvc
Add hybrid/cooperate suspend runtime support on Windows.
2019-04-25 02:53:13 -04:00
Bernhard Urban b658792614 [interp] fix op_explicit for cast from nfloat to nint and vice versa (#14201)
Fixes https://github.com/xamarin/xamarin-macios/issues/5809
2019-04-25 08:37:01 +02:00
monojenkins 1e9ea1c616 [bcl] Update BCL Linked Size 2019-04-25 08:15:15 +02:00
Kenneth Pouncey e412e520f5 [wasm][sdk] Add dotnet new custom template. (#14183)
* [wasm][sdk] Add dotnet new custom template.

```
Templates                                         Short Name         Language          Tags
----------------------------------------------------------------------------------------------------------------------------
Mono WebAssembly Starter                          wasm               [C#]              Mono/WebAssembly
```

Example use:

```
dotnet new wasm -n Test.WebAssembly -o Test.WebAssembly
```

* Package the template files
2019-04-25 05:50:54 +02:00
Kenneth Pouncey 7f6deb2b6f [wasm] [bindings] Package doc .xml files (#14174) 2019-04-25 05:49:54 +02:00
Filip Navara 019b4563d3 [netcore] Restore Roslyn compilers from NuGet to allow up-to-date version to be used (#14157)
* Restore Roslyn compilers from NuGet to allow up-to-date version to be used

* Move the Roslyn version to makefile, ensure that it is updated before building System.Private.CoreLib

* Pass the whole path to Roslyn props file instead of just Roslyn version to dotnet build

* Make the Roslyn restore compatible with .NET Core 2.2 SDK
2019-04-24 17:24:46 +02:00
Egor Bogatov 95b873997a [netcore] Don't wrap CustomAttributeNamedArgument into CustomAttributeNamedArgument (#14180)
* don't wrap CustomaAttributeNamedArg

* fix BlockCopy failing test

* update NETCORETESTS_VERSION and NETCOREAPP_VERSION

* avoid typedard creation in netcore

* fix merge issue
2019-04-24 17:23:51 +02:00
Alexander Kyte 0d9e13f983 [llvm] Propagate nonnull attribute through LLVM IR (#13697)
## Summary

This change allows LLVM to identify unnecessary null checks. We mark GOT accesses (including those made by LDSTR) and new object calls as nonnull.

Since LLVM won't propagate this, we propagate from definition to usage, across casts, and from usage to definition (conditionally).

This enables it to remove a significant portion of some benchmarks. 

In real-world code, we can expect to see this remove the unnecessary null checks made by private methods. 

## Example

### C#:

Note that the constant strings are trivially non-null. This PR spots and propagates that. 

```

   static void ThrowIfNull(string s)
    {
        if (s == null)
            ThrowArgumentNullException();
    }

    static void ThrowArgumentNullException()
    {
        throw new ArgumentNullException();
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    static int Bench(string a, string b, string c, string d)
    {
        ThrowIfNull(a);
        ThrowIfNull(b);
        ThrowIfNull(c);
        ThrowIfNull(d);

        return a.Length + b.Length + c.Length + d.Length;
    }

    [Benchmark(Description = nameof(NoThrowInline))]
    public int Test() => Bench("a", "bc", "def", "ghij");

```

### Before:

```

define hidden monocc i32 @NoThrowInline_MainClass_Bench_string_string_string_string(i64*  %arg_a, i64* %arg_b, i64* %arg_c, i64*  %arg_d) #6 gc "mono" {
BB0:
  br label %INIT_BB1

INIT_BB1:                                         ; preds = %BB0
  br label %INITED_BB2

INITED_BB2:                                       ; preds = %INIT_BB1
  br label %BB3

BB3:                                              ; preds = %INITED_BB2
  br label %BB2

BB2:                                              ; preds = %BB3
  notail call monocc void @NoThrowInline_MainClass_ThrowIfNull_string(i64* %arg_a)
  notail call monocc void @NoThrowInline_MainClass_ThrowIfNull_string(i64* %arg_b)
  notail call monocc void @NoThrowInline_MainClass_ThrowIfNull_string(i64* %arg_c)
  notail call monocc void @NoThrowInline_MainClass_ThrowIfNull_string(i64* %arg_d)
  %0 = bitcast i64* %arg_a to i32*
  %1 = getelementptr i32, i32* %0, i32 4
  %t50 = load volatile i32, i32* %1
  %2 = bitcast i64* %arg_b to i32*
  %3 = getelementptr i32, i32* %2, i32 4
  %t52 = load volatile i32, i32* %3
  %t53 = add i32 %t50, %t52
  %4 = bitcast i64* %arg_c to i32*
  %5 = getelementptr i32, i32* %4, i32 4
  %t55 = load volatile i32, i32* %5
  %t56 = add i32 %t53, %t55
  %6 = bitcast i64* %arg_d to i32*
  %7 = getelementptr i32, i32* %6, i32 4
  %t58 = load volatile i32, i32* %7
  %t60 = add i32 %t56, %t58
  br label %BB1

BB1:                                              ; preds = %BB2
  ret i32 %t60
}

```

### After:

Note: safepoint in below code is added by backend, not part of this change

```

define hidden monocc i32 @NoThrowInline_MainClass_Bench_string_string_string_string(i64* nonnull %arg_a, i64* nonnull %arg_b, i64* nonnull %arg_c, i64* nonnull %arg_d) #6 gc "mono" {
BB0:
  %0 = getelementptr i64, i64* %arg_a, i64 2
  %1 = bitcast i64* %0 to i32*
  %t50 = load volatile i32, i32* %1, align 4
  %2 = getelementptr i64, i64* %arg_b, i64 2
  %3 = bitcast i64* %2 to i32*
  %t52 = load volatile i32, i32* %3, align 4
  %t53 = add i32 %t52, %t50
  %4 = getelementptr i64, i64* %arg_c, i64 2
  %5 = bitcast i64* %4 to i32*
  %t55 = load volatile i32, i32* %5, align 4
  %t56 = add i32 %t53, %t55
  %6 = getelementptr i64, i64* %arg_d, i64 2
  %7 = bitcast i64* %6 to i32*
  %t58 = load volatile i32, i32* %7, align 4
  %t60 = add i32 %t56, %t58
  %8 = load i64*, i64** getelementptr inbounds ([37 x i64*], [37 x i64*]* @mono_aot_NoThrowInline_llvm_got, i64 0, i64 7), align 8
  %9 = load i64, i64* %8, align 4
  %10 = icmp eq i64 %9, 0
  br i1 %10, label %gc.safepoint_poll.exit, label %gc.safepoint_poll.poll.i

gc.safepoint_poll.poll.i:                         ; preds = %BB0
  %11 = load void ()*, void ()** bitcast (i64** getelementptr inbounds ([37 x i64*], [37 x i64*]* @mono_aot_NoThrowInline_llvm_got, i64 0, i64 25) to void ()**), align 8
  call void %11() #8
  br label %gc.safepoint_poll.exit

gc.safepoint_poll.exit:                           ; preds = %BB0, %gc.safepoint_poll.poll.i
  ret i32 %t60
}

```

## Dependencies 

This depends on https://github.com/mono/linker/pull/528.
2019-04-24 16:53:47 +02:00
Jo Shields 5c02267668 [netcore] Fix escaping (#14209) 2019-04-24 10:50:16 -04:00
Jo Shields 1fe9041e4b [netcore] This is a bash script, not a batch file. Correct env var use. (#14207) 2019-04-24 10:09:27 -04:00
Larry Ewing 194070823c Merge pull request #14192 from kjpou1/wasm-fix-cl
[wasm][tests] Fix browser test command line arguments.
2019-04-24 08:59:39 -05:00
Jo Shields 9d4c9a89f1 [netcore] Try passing dnceng PAT for internal builds (#14204) 2019-04-24 09:21:21 -04:00
lateralusX 0d390066ca Fix race condition under wow64 for cooperative suspended threads.
Under hybrid suspend a thread can be cooperative suspended but still
checked for a platform critical region under wow64. Since thread is
not preemptive suspended we can't reliably call GetThreadContext and
doing so could also (even correctly) return a context flagged as critical
triggering an assert in stw for cooperative suspended threads.
2019-04-24 14:16:03 +02:00
lateralusX f26e30c38a Add hybrid/cooperate runtime support on Windows. 2019-04-24 14:15:45 +02:00
Kenneth Pouncey c5aa3ecdec [wasm][sdk] Fix warning NU1604, does not contain an inclusive lower bound 2019-04-24 13:57:16 +02:00
Santiago Fernandez Madero 7bd9e122aa Fix build errors in Interop.Errors
Signed-off-by: dotnet-bot <[email protected]>
2019-04-24 11:02:06 +02:00
Santiago Fernandez Madero be620ee542 Disable warning in ValueStringBuilder.ToString
Signed-off-by: dotnet-bot <[email protected]>
2019-04-24 11:02:06 +02:00
Kenneth Pouncey 9a0ce7242c [wasm][sdk] Add command line quoting and escaping to WasmLinkAssemblies ToolTask.
- This resolves a few issues when executing `monolinker.exe` from windows build.
2019-04-24 10:52:45 +02:00
Alexander Köplinger 4873b27706 [acceptance-tests] Run roslyn tests using in-tree mono instead of system mono (#14186)
We were inadvertently running the roslyn tests against the system mono in CI.
Instead we now install mono to a custom prefix, prepend that to PATH and run
the roslyn tests against the correct mono we just built.
2019-04-24 08:50:58 +02:00
Kenneth Pouncey fd0b6a769a [wasm][tests] Fix command line arguments.
- Add `.pdb` file support to the karma config.
2019-04-24 06:50:02 +02:00
Katelyn Gadd 14e83aab44 Add roslyn bump instructions next to roslyn-binaries 2019-04-23 18:38:55 -04:00
Zoltan Varga fdc2dce384 [netcore] Convert netcore/Makefile.am to a normal makefile, get the configure variables from config.make. (#14167)
* [netcore] Convert netcore/Makefile.am to a normal makefile, get the configure variables from config.make.

* [netcore] Convert mcs/class/System.Private.CoreLib/Makefile.am to a normal makefile.
2019-04-23 17:01:23 -04:00
Jo Shields 73c2145c28 [netcore] Fix error in sed, screwing up submodules (#14189) 2019-04-23 16:45:53 -04:00
Jo Shields 4a144ac103 Merge pull request #14188 from directhex/mangle-submodules-internally
[netcore] Mangle .gitmodules on internal project to internal mirrors
2019-04-23 16:23:42 -04:00
Jo Shields 6e10a33a07 [netcore] Mangle .gitmodules on internal project to internal mirrors 2019-04-23 16:01:58 -04:00
Zoltan Varga c1c7a739cc [netcore] Throw the correct exception for byref returns returning null, .net core throws a nullref. (#14128) 2019-04-23 12:05:50 -04:00
Bernhard Urban 223e0bd78d [aot] partial revert of #14043 (#14135)
We need to emit a real call here. On arm/android we would emit this now:
```asm
ldr pc, =label
.ltorg         # place address of `label` here.
```
which is a jump to `label`, not a call.

We need a different solution to make larger assemblies work, but for now
I revert it so the `2019-02` intergration is unblocked.

Partial revert of #14043
2019-04-23 15:53:05 +02:00
Thays Grazia aed21f3e4b [DIM] Throwing AmbiguousImplementationException on call of multiple candidate implementations. (#14127)
* Adding AmbiguousImplementationException exception and throwing this when there are multiple candidate implementations.
2019-04-23 09:48:39 -03:00
Filip Navara 921f00352f [netcore] Establish a baseline for make xtestpass (#14072)
* Bump CoreFX version, include few more packages

* Add exclusions for System.Collections.NonGeneric.Tests

* Exclude tests that crash runtime

* Add more exclusions for known failures

* Exclude System.Utf8String.Experimental.Tests, it is CoreCLR specific
Exclude System.ComponentModel.Composition.Registration.Tests, the published version throws PNSE for all methods

Please enter the commit message for your changes. Lines starting

* Make a list of known non-passing tests and establish baseline for 'make xtestpass'

* Add exclusions

* Reenable System.Net.NameResolution.Functional.Tests

* Reenable System.Net.Sockets.Tests

* Reenable System.Diagnostics.Tracing.Tests

* Reenable System.Net.Http.Functional.Tests

* Reenable System.Net.HttpListener.Tests

* Reenable System.CodeDom.Tests

* Reenable System.Linq.Expressions.Tests

* Reenable System.Threading.ThreadPool.Tests

* Reenable System.Runtime.Tests

* Reenable System.Collections.Tests

* Reenable System.Threading.ThreadPool.Tests

* Reenable System.Memory.Tests

* Reenable System.Linq.Parallel.Tests

* Update exclusions for System.Diagnostics.Process.Tests

* Reenable System.Dynamic.Runtime.Tests

* Reenable System.Runtime.Numerics.Tests

* Sort excluded tests

* Reenable System.Reflection.Tests

* Reenable System.Reflection.Emit.Tests

* Reenable System.Linq.Parallel.Tests

* Reenable System.Diagnostics.TraceSource.Tests

* Reenable System.Threading.Tests

* Disable tests that trigger UI on macOS

* Update System.Runtime.Tests exclusion list

* Update line numbers
2019-04-23 14:44:39 +02:00
Jay Krell 1ffb5fb83f Cleanup patch_info code a little. (#14037)
e.g. whenever underlying representation is nul terminated string.
 MONO_PATCH_INFO_LDSTR_LIT
 MONO_PATCH_INFO_OBJC_SELECTOR_REF
almost the same as
 MONO_PATCH_INFO_JIT_ICALL
 MONO_PATCH_INFO_JIT_ICALL_ADDR
 MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL

MONO_PATCH_INFO_LDSTR_LIT no longer allocate
 and copy the string from the AOT image into image_pool.

g_str_equal check pointer equality first.
While obviously correct, not obviously faster,
as it adds cost when strings are unequal.

Uninline g_str_equal, seems cleaner, but perhaps less efficient.

Combine the switch-exit and default: paths,
as only one case other than default exited the switch.

Lift out other common subexpressions.
2019-04-23 10:57:31 +02:00
Kenneth Pouncey 778f3a4925 [wasm][sdk] Fixes to the sdk packages (#14120)
* Package the wasm and wasm Facades correctly.

* Move the build props and targets file to netstandard2.0 build directory.

* Place framework .props file properly for build

* Place runtime .props file properly for build

* A little cleanup and add escaping windows path separator.

- There are problems executing mononlinker.exe on windows if the windows path separators are not escaped.
2019-04-23 07:17:26 +02:00
Zoltan Varga 2477d73d58 [runtime] Fix a warning. (#14168) 2019-04-22 20:56:48 -04:00
Zoltan Varga 0a95f46f30 [llvm] Remove unused dlsym_cb. (#14164) 2019-04-22 20:56:33 -04:00
Zoltan Varga f1d1bd6084 [llvmonly] Enable invariant loads from preinited got slots. (#14027) 2019-04-22 18:03:36 -04:00
Aleksey Kliger (λgeek) 43540e6649 [image] Create MonoImageStorage to own the image raw data (#13942)
* [image] Create MonoImageStorage to own the image raw data

Create a new data structure: MonoImageStorage.

It is an object that will have the responsibility for the raw data of a
MonoImage.  It has a string key and a refcount that is used to share a
MonoImageStorage between multiple MonoImage objects.

The reason we need this is because the current MonoAssembly/MonoImage design is
broken for multiple domains and (more evidently) it will be broken when we add
AssemblyLoadContext support.  The issue is that a MonoImage may be shared
between multiple domains (or ALCs), but it has a 'references' field which
points to a single other MonoAssembly.

This is a problem because the references of an image may be resolved
differently in different domains (or ALCs).

The eventual solution will be to stop sharing MonoImages based on path name (or
in the case of in-memory images based on a name made up from the address of the
byte blob).

However we still don't want to open the same data more than once (if we're on a
config where we don't have mmap, we malloc some memory and dump the data in
there - we don't want to do that multiple times for the same file).

So the solution is to create this MonoImageStorage object and make it possible
to share it based on path name, but don't give it any responsibilities except
for owning the memory.  It doesn't know anything about metadata or assemblies
or any of that stuff - it just owns a chunk of memory and knows when and how to
free it.

This commit just adds the MonoImageStorage object and wires it up in MonoImage
loading.  There should be no observable behavioral changes from this commit.

* [win32] call FreeLibrary from MonoImageStorage dtor, not mono_image_close_except_pools

If we're sharing a MonoImageStorage, only call FreeLibrary when the storage is
finally destroyed, not every time one of the images is closed.
2019-04-22 14:43:11 -04:00
Steve MacLean f318317bbd Remove create assembly name (dotnet/coreclr#24154)
* Remove RuntimeAssembly.CreateAssemblyName

Fixes #24135

CreateAssemblyName was not compatible with AssemblyLoadContext isolation.

Assembly.Load(string)
Assembly.LoadWithPartialName(string)
Activator.CreateInstance(...)

* Remove unused AssemblyNameNative::Init arguments

* Temp disable corefx CreateInstanceAssemblyResolve

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:49:48 +00:00
dotnet-maestro-bot ba4e9450aa Update BuildTools, CoreClr to preview4-03917-01, preview5-27618-71, respectively (master) (#24060)
* Update BuildTools, CoreClr to preview4-03917-01, preview5-27618-71, respectively

* Fix build errors

* Disable warning with pragma and linked issue

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:49:47 +00:00
Steve MacLean 9cf417d5b7 Fix Timezone whitespace (dotnet/coreclr#24137)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:49:41 +00:00
Tanner Gooding 2119795cae Pulling in CoreFX changes and fixing up Sse2.StoreLow to be Sse2.StoreScalar (#24123)
* Update dependencies from https://github.com/dotnet/corefx build 20190419.5

    - Microsoft.NETCore.Platforms - 3.0.0-preview5.19219.5
    - Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview5.19219.5

* Removing the Sse2.StoreLow(long/ulong*, ...) methods that have been replaced

* Moving the Sse2.StoreLow(long/ulong*, ...) tests to be Sse2.StoreScalar tests

* Fixing some existing usages of Sse2.StoreLow(long/ulong*, ...)

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:47 +00:00
Koundinya Veluri b1255e5f83 Implement APIs for some threading metrics (CoreCLR) (dotnet/coreclr#24113)
Implement APIs for some threading metrics (CoreCLR)

API review: https://github.com/dotnet/corefx/issues/35500

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:47 +00:00
Krzysztof Wicher a97a684f25 Nullable: couple of missing #nullable enable (dotnet/coreclr#24094)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:46 +00:00
Stephen Toub 029b95b2c5 Nullable: System.Collections.Concurrent (dotnet/coreclr#24054)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:45 +00:00
Benjamin Bartels 8430f02a5a Fixed ChunkEnumerator.Current NRE (dotnet/coreclr#24076)
* Fixed ChunkEnumerator.Current NRE

* Added Nullable Flow analysis annotation comment

* Changed TODO-NULLABLE comment to link to appropriate issue

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:44 +00:00
Santiago Fernandez Madero 7d24b8eeef Fix StringBuilder annotations and debug.asserts (dotnet/coreclr#24069)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:44 +00:00
Stephen Toub a19c49cf77 Nullable: Addition COM types (dotnet/coreclr#24032)
Somehow these slipped through previous rounds of annotating.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:45:42 +00:00
Stephen Toub c9d58058fc Fix a few internal nullable annotations and comments (dotnet/coreclr#23987)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:43:21 +00:00
Stephen Toub 656238b95b Nullable: System.Runtime.InteropServices.CustomMarshalers/WindowsRuntime (#23930)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:43:20 +00:00
Stephen Toub dd29d74ca4 Nullable: src\System\Runtime\InteropServices (dotnet/coreclr#23936)
* Nullable: src\System\Runtime\InteropServices

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:43:20 +00:00
buyaa-n f7c25c025c Nullable: Enums, Structures from Reflection folder (dotnet/coreclr#23933)
* Nullable: Enums, Structures from Reflection

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:43:19 +00:00
Anirudh Agnihotry 8104af8221 Nullable System.ComponentModel, System.Diagnostics.CodeAnalysis, System.Diagnostics.Contracts (#23910)
* Nullable System.ComponentModel, System.Diagnostics.CodeAnalysis, System.Diagnostics.Contracts

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:42:09 +00:00
Stephen Toub f1901501e8 Nullable: Runtime serialization, COM, Vector, remaining IO, and other (#23895)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:42:05 +00:00
Stephen Toub bde9213406 Nullable: System.Runtime.CompilerServices (dotnet/coreclr#23886)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:38:01 +00:00
Krzysztof Wicher 2126d5a92c Nullable: Globalization native interop + some missing files (#23914)
* Nullable: globalization native + some missing files

* address feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:38:00 +00:00
Stephen Toub 01917a7a4a Update Version annotations to match changes in master (#23917)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:38:00 +00:00
Anirudh Agnihotry 06441b788f Nullable: System.Diagnostics (dotnet/coreclr#23753)
* added nullable annotation for system.Diagnostics

* fixing build errors with nullableFeature branch

* stephen feedback

* annotating files in the shared folder

* removing newline, correxting message and adding comments

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:37:59 +00:00
Anirudh Agnihotry 74dc838b36 Nullable System.Diagnostics.Store (dotnet/coreclr#23874)
* removing using systems and adding nullability for System.Diagnostics.SymbolStore

* annotating the class that implements the internal interface

* adding bang to fix failure

* correcting the byte array declarations

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:37:58 +00:00
Anirudh Agnihotry 452db22237 Nullable: Interop.Adavapi32 (dotnet/coreclr#23875)
* interop definations nullified

* reverting null check and adding arguments nullable to match win32 function definations

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:37:57 +00:00
Santiago Fernandez Madero 88f40c0547 Fix build errors due to merge conflicts
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:37:53 +00:00
Krzysztof Wicher b4ed8f6782 Nullable: Interop: Kernel32 and few others (dotnet/coreclr#23880)
* Nullable: Interop: Kernel32 and few others

* fix compile errors (new compiler)

* address feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:35:22 +00:00
Stephen Toub 933536a87a Address follow-up PR feedback on System nullability annotations (#23878)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:35:00 +00:00
Stephen Toub 3418f9c1f8 Nullable: System (most of it) (dotnet/coreclr#23774)
* Nullable: shared\System (most of it)

And some other things it touches.

* Nullable: src\System (most of it)

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:32:38 +00:00
Anirudh Agnihotry 1e64bf5c1c Nullable Internal.Win32.RegistryKey (dotnet/coreclr#23856)
* anootated registrykey

* Fixing the build for windows

* Adding bang after the resize argument

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:28:33 +00:00
Krzysztof Wicher 6f07ebbfc6 Nullable: System.Resources (dotnet/coreclr#23830)
* nullable: system.resources

* apply feedback

* apply another feedback

* fix SR.cs after rebase

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:28:33 +00:00
Stephen Toub 074f8a9e6c Nullable: Attributes, SafeHandles, and misc (dotnet/coreclr#23810)
* Nullable: Attributes, SafeHandles, and misc

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:28:28 +00:00
Stephen Toub 7d9c1bc28d Nullable: System.IO (dotnet/coreclr#23732)
* Nullable: System.IO

Everything exception StreamReader, StreamWriter, BinaryReader, BinaryWriter, which are waiting for some changes in master to propagate over to the feature branch.

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:27:20 +00:00
Santiago Fernandez Madero c7abb47a8a Fix build errors with new compiler
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:27:19 +00:00
Krzysztof Wicher 62ab4ced87 Nullable: System.Text (dotnet/coreclr#23708)
* Nullable: System.Text

* apply feedback

* simplify second enc.Clone() call

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:27:15 +00:00
Tanner Gooding a7e61a0a10 Nullable: System.Runtime.InteropServices.Marshal (dotnet/coreclr#23699)
* Nullable: System.Runtime.InteropServices.Marshal

* Fixing the nullable annotations for BindToMoniker and GetObjectForIUnknown

* Fixing the nullability of PtrToStringAuto(IntPtr, int)

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:26:04 +00:00
Anirudh Agnihotry a9193f4dc3 adding null annotations (dotnet/coreclr#23744)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:24:08 +00:00
Stephen Toub 2996c13498 Nullable: Array (dotnet/coreclr#23746)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:24:07 +00:00
Stephen Toub e329b82c14 Nullable: Span and friends (dotnet/coreclr#23734)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:24:06 +00:00
Jay Krell 800701fe3f Small step toward reduction/elimination of JIT icall hashing. (#14149)
Ultimate goal is to significantly reduce or maybe completely
eliminate the hashing of JIT icalls.

It is not a small change.

This is a small digestable albeit tedious step toward that.

The "names" of opcode emulation icalls are needed for
token pasting and/or struct fields. They are needed without quotes.

This PR removes the quotes.
And then for now, just always restores them.

This is extracted from https://github.com/mono/mono/pull/14047
as a step toward making it easier to review.
2019-04-22 11:04:32 +02:00
Vlad Brezae afc16a8733 [interp] Fix buffer overflow when incrementing sp
Fixes https://github.com/mono/mono/issues/14079
2019-04-21 10:06:34 +03:00
Alexander Köplinger 6b73e8db82 Bump monolite (#14144)
Looks like monolite was broken somehow. Rebuild it.
2019-04-20 00:35:18 +02:00
Larry Ewing 061fb88295 Merge pull request #14136 from kjpou1/wasm-function-tests
[wasm] Fix NRE WebAssembly.Core.Array during initialization
2019-04-19 16:08:12 -05:00
Aleksey Kliger (λgeek) 7ba1f77f6d [loader] Don't store through a null ptr (#14110)
* [loader] Dont't store through a null ptr

If 'status' is null, don't try to write to it.

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

* [metadata] Protect writes to MonoImageOpenStatus* in a few places.

When possible assert that `MonoImageOpenStatus *status` arguments to various
functions in the runtime aren't null.  There are a few places (MONO_API) where
it's possible that callers are passing null.  In that case, use a local
MonoImageOpenStatus, or check for null before doing assignments.
2019-04-19 15:57:31 -04:00
pedestrianlove 1bdffd21cb Make dedicated MonoError for mono_error_set_argument_out_of_range (#14119)
* Make dedicated MonoError for mono_error_set_argument_out_of_range
2019-04-19 12:13:21 -04:00
Jay Krell 435feaaa02 [Coop] Convert performance counters and performance counter categories. (#13623)
* Cut down on strlen calls.
But keep the shared memory format unchanged to match .NET. (i.e. don't
put string lengths in it).

* PR: MONO_ENTER_NO_SAFEPOINTS instead of gchandle.

Push/pop frames in loops and mind the return/goto/break/continue carefully, instead of using assignment.

*PR: Reduce gsize to adequate int, move multiple int declarations to same line.

* PR: Fix prototypes in disabled code.

* PR: Spell out `int` as `gint32`.

Use an uppercase guid to workaround Windows problem.

* A bit more true to the previous version.
* Reduce diff a little.
* if (is_ok()) around one line instead of goto around it.
* Restore some old code.
* Restore more verbosity, that used to have a point but no longer does.
2019-04-19 11:27:16 -04:00
Kenneth Pouncey 12aa4de4a7 Add tests for WebAssemlby.Core.Array initialization
- Add tests for WebAssembly.Core.Function
2019-04-19 13:21:35 +02:00
Kenneth Pouncey 02d72c7e85 Fix NRE WebAssembly.Core.Array 2019-04-19 13:20:31 +02:00
Zoltan Varga 84f6e1dfac [llvm] Avoid looking up intrinsics by name in most cases. (#14029)
[llvm] Avoid looking up intrinsics by name in most cases.
2019-04-19 04:15:54 -04:00
Tanner Gooding 54776b2541 Adding Sse2.StoreScalar(long*, V128) which will replace Sse2.StoreLow(long*, V128) (#24102)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-19 08:34:08 +02:00
Larry Ewing e0e3592c20 Merge pull request #14129 from lewing/sample-tfm
[wasm] Fix the samples target framework
2019-04-18 21:24:47 -05:00
Larry Ewing 45bf2cf557 Add a mixed target for sample 2019-04-18 21:05:13 -05:00
Katelyn Gadd d9c1f37780 Fix start-compiler-server (#14117) 2019-04-18 14:54:25 -07:00
Zoltan Varga f7dff29c6c [aot] Add a depfile= argument which causes the AOT compiler to write out a gcc style dep file listing the dependencies between the output file and all referenced assemblies. (#14124)
* [aot] Add a depfile= argument which causes the AOT compiler to write out a gcc style dep file listing the dependencies between the output file and all referenced assemblies.

* Add a manpage entry.

* Update after comments.
2019-04-18 16:41:47 -04:00
Larry Ewing 783f8e9c07 Fix the samples target framework 2019-04-18 14:49:35 -05:00
Larry Ewing eaba6c608c Merge pull request #14113 from vargaz/netcore-pinvoke
[wasm] Fix the types of the generated function declarations in the pinvoke table.
2019-04-18 11:43:09 -05:00
Thays Grazia bc2d8e7c92 Protecting boxing a null value (#14018)
When a static method is called the obj is not used, so it can be null and it doesn't need to be boxed.
Adding an assert in the method to prevent other crash in this method if a NULL is received.
2019-04-18 13:29:21 -03:00
Bernhard Urban dacee19252 [interp] disable tail call opt if managed debugger is enabled (#14098)
[interp] disable tail call opt if managed debugger is enabled 

Fixes https://github.com/mono/mono/issues/12981
2019-04-18 11:56:10 -04:00
Alexander Köplinger 9dcb8311ef [ci] Workaround races in the tests build (#14121)
We're still seeing some failing tests build sometimes.
2019-04-18 15:51:40 +02:00
Vincent Povirk 8c2d1829c1 Respect call convention modopts in native wrappers. (#14017)
MS's C++ compiler emits code that uses this.
2019-04-18 09:44:31 -04:00
Justin Needham a738d0e284 Update documentation for --with-large-heap
This Flags only applies to the Boehm GC
2019-04-18 13:59:27 +02:00
Johan Lorensson 90869d7708 Merge pull request #13931 from lateralusX/lateralusX/external-direct-icalls-symbol-name
Add support for direct icalls using external functions not in icall-def.h.
2019-04-18 06:20:54 -04:00
Jay Krell c7e5f4150b mono_remoting_marshal_init in mono_marshal_get_proxy_cancast to register icalls. (#14097)
Alternatively move the registration to mono_remoting_init.
2019-04-18 10:10:47 +02:00
Filip Navara 7e35b5128b [netcore] Fix failures in System.Tests.MulticastDelegateTests (#14096) 2019-04-18 08:39:31 +02:00
Egor Bogatov 61dbc22bfd [netcore] improve Windows support (#14100)
* better Windows support

* remove unzip.py

* move FeaturePortableTimer to csproj
2019-04-18 08:30:11 +02:00
Zoltan Varga 569be02071 [netcore] Fix the tests. (#14108)
* [netcore] Fix the tests.

* Fix Monitor class too.
2019-04-18 08:23:01 +02:00
Katelyn Gadd b043647c48 Adjust roslyn mcs dll deploy list based on #13755. Keep Tasks.Extensions and Memory because their facades are only deployed on mobile. 2019-04-18 08:21:31 +02:00
Larry Ewing 93c45bae27 Merge pull request #14088 from vargaz/wasm-direct-calls
[llvmonly] Allow direct calls to inflated methods since they can initialize themselves correctly now.
2019-04-17 17:55:00 -05:00
Larry Ewing 1cd911a844 Merge pull request #14041 from kjpou1/wasm-sdk-packages
[wasm] [sdk] Build and package the sdk nugets.
2019-04-17 17:32:27 -05:00
Zoltan Varga 9551e22ba9 [wasm] Fix the types of the generated function declarations in the pinvoke table. 2019-04-17 14:53:52 -04:00
Vlad Brezae 3f11315916 [interp] Small vt opcode optimisations (#14040)
[interp] Simplify cpobj.vt

[interp] Optimize stelem.vt/ldelem.vt

[interp] Avoid unnecessary write barrier for ldobj.vt
Write barriers are only required for stores in the major heap/los.

[interp] Simplify ldfld.vt/stfld.vt
2019-04-17 20:47:48 +02:00
Vlad Brezae 183de1c302 [interp] Improve boxing/unboxing (#14048)
* [interp] Remove redundant check

It can't be an enum if it is stored on the vtstack

* [interp] Optimize boxing

Makes boxing of primitives 4x faster and boxing of vt 3x faster.

* [interp] Remove unneccessary check in unbox

We do the same check as jit. Makes unboxing 10x faster.

* [interp] Extract some duplicate code for boxing

* [interp] Fix boxing of nullable with constrained calls

Before the box opcode optimization, it was handling nullable. When normally boxing a nullable we call the Box method, but this is awkward when doing a constrained call, so we just add a separate opcode. This is slightly slower than calling Box, but much faster than the old code using the generic mono_value_box_checked.
2019-04-17 21:38:19 +03:00
lateralusX c31b4dd5b4 Review feedback. 2019-04-17 17:04:08 +02:00
Egor Bogatov afcd30d8c2 [netcore] Fix two System.Tests.PseudoCustomAttributeTests tests (#14073)
Now all custom attribute related tests pass in System.Runtime.Tests.
Also this PR fixes broken acceptance tests for regular mono introduced in https://github.com/mono/mono/pull/13809
2019-04-17 16:39:38 +02:00
Vlad Brezae 1b4a2a68f5 [interp] Fix interp strmfld vt (#14086)
* [interp] Fix store remote value type field

Looks like the culprit for some random mcs tests failures

* [interp] Delete dummy code
2019-04-17 16:40:07 +03:00
Jay Krell d882ea388a Replace two element hash table with two element array and cheap linear search. (#14049)
Replace two element hash table with two element array and cheap linear search.

Maybe I misunderstand the code?
Or significant expansion is expected?
2019-04-17 05:06:28 -04:00
Jay Krell cd5e14a3cc Factor the function mono_call_add_patch_info out of a few lines of repeated code in many backends. (#13970)
This notably does not apply to amd64, x86.
They have more logic intertwined around the patch when they emit the call.
2019-04-17 09:41:54 +02:00
Zoltan Varga 9e10afd3d6 [netcore] Create netcore specific versions of refsource classes. (#14074) 2019-04-17 08:56:16 +02:00
Zoltan Varga 605ea1555c [llvmonly] Add stubs for methods which cannot be compiled since they can be called directly. 2019-04-16 19:44:28 -04:00
Jay Krell 6a39d91078 Remove a few string allocs/copies, i.e. for generic trampoline names. (#14038) 2019-04-17 00:37:10 +02:00
Bernhard Urban 98a1d40584 [arm] align stack pointer in throw trampoline (#14078)
This is a regression introduced by e46fa20466

Fixes https://github.com/mono/mono/issues/13672
2019-04-17 00:36:05 +02:00
Zoltan Varga 08f4d74daf [wasm] Only aot with interp support when in mixed mode. 2019-04-16 16:40:17 -04:00
Zoltan Varga 61d6860f21 [llvmonly] Make direct calls to more methods, not enabled yet. 2019-04-16 16:39:21 -04:00
Zoltan Varga d257f7a663 [aot] Prepend the assembly name to the mangled method names. 2019-04-16 16:38:52 -04:00
Zoltan Varga 3ef6463a03 [netcore] Allow cross-module direct calls to alloc wrappers. 2019-04-16 14:55:05 -04:00
Filip Navara e10034c1ff Update CustomAttributeExtensions to call Attribute class to get proper parameter validation. Fixes System.Reflection.Extensions.Tests. 2019-04-16 19:35:35 +02:00
Marek Safar 3c2025bb58 Reflect shared partition changes 2019-04-16 19:24:43 +02:00
Filip Navara d5a4f9b8a9 Move EventSource to shared CoreLib partition (dotnet/coreclr#23925)
* Move most of EventSource to shared CoreLib partition

* Reenable some code that can be shared with Microsoft.Diagnostics.Tracing.EventSource.Redist in CoreFX

* Remove unused functions

* Fix placement of #endregion

* Clean up P/Invoke prototypes

* Move remaining code from EventSource_CoreCLR to shared partition (guarded by !CORERT)

* Remove more unnecessary marshalling attributes

* Move remaining CoreRT/ProjectN code to shared partition

* Avoid using Windows errors on non-Windows platforms

Signed-off-by: dotnet-bot <[email protected]>
2019-04-16 19:24:43 +02:00
Zoltan Varga b71e29a62d [llvmonly] Allow direct calls to inflated methods since they can initialize themselves correctly now. 2019-04-16 13:19:19 -04:00
Zoltan Varga 1c568bf16f [aot] Change how the context is computed in init_aot_method (). Instead of (#14026)
getting it from the caller, save it in the aot image and read it back.
This will make it possible to emit direct calls to gshared methods later.
2019-04-16 11:30:16 -04:00
Jay Krell 18f0bf055e Register mono_gc_wbarrier_generic_nostore_internal regular with its own name, not dynamic with a special name. (#14042) 2019-04-16 13:34:46 +02:00
Jay Krell 6225a9b031 Register g_free icall regular, as monoeg_g_free. (#14044)
The point here is that register_dyn is a bit obscure and could use clarification.
2019-04-16 13:34:29 +02:00
Egor Bogatov 8cd9b562ea [netcore] Fix WaitHandle.SignalAndWait (#13809)
* fix failing tests

* Add build-corefx-test-for- rule

* Update WaitHandle.cs

* fix S.T.T.rsp file

* fix build

* bump corlib version

* handle new errors in old mono

* Update w32handle.c
2019-04-16 12:04:02 +02:00
Egor Bogatov d2054f6cc0 [netcore] Fix System.Tests.PseudoCustomAttributeTests.* tests (#14065)
* fix Custom Attribute tests

* fix CA

* fix CA

* Update MonoCustomAttrs.cs

* fix MarshalAsAttribute

* Update MarshalAsAttribute.cs

* Update MarshalAsAttribute.cs
2019-04-16 11:51:26 +02:00
Zoltan Varga edae380da5 [netcore] Add linker descriptor for corelib. (#14064)
* [netcore] Add linker descriptor. This is just a copy of the mscorlib descriptor.

* [netcore] Update linker descriptor for netcore.

* Remove com/remoting related classes.
* Other smaller changes.

* [netcore] Allow loading corlib from MONO_PATH.

* Update System.Private.CoreLib.xml
2019-04-16 11:48:12 +02:00
Levi Broderick 7ae2e1e769 Fix incorrect bit match pattern in UTF-16 validation (dotnet/coreclr#24015)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-16 11:27:33 +02:00
Jan Kotas d99f005b4b Fold ResourceSet::CommonInit into constructor (dotnet/coreclr#23993)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-16 11:27:33 +02:00
Egor Bogatov 128aec0590 Add "partial" to MarshalAsAttribute (dotnet/coreclr#24014)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-16 11:27:33 +02:00
Jan Kotas 31b890bd2e Remove redundant UnderlyingSystemType calls (dotnet/coreclr#24000)
UnderlyingSystemType is virtual

Signed-off-by: dotnet-bot <[email protected]>
2019-04-16 11:04:44 +02:00
Kenneth Pouncey aa01f6fb75 Add sdk package solution to be built by dotnet command. 2019-04-16 09:19:35 +02:00
Filip Navara fbac2cb6f0 [netcore] Fix couple of custom attribute tests (#14063)
* Revert "[netcore] fix some CustomAttribute related tests (#14056)"

This reverts commit b1af4c2726.

* Add parameter validation to Attribute.GetCustomAttribute

* Fix indentation
2019-04-16 08:10:54 +02:00
Kenneth Pouncey 81b0163bca Merge branch 'master' of https://github.com/mono/mono into wasm-sdk-packages 2019-04-16 05:20:44 +02:00
Kenneth Pouncey eb98d562b0 [wasm] [packager] Run mono-cil-strip from wasm-tools (#14035)
* [wasm] Add mono-cil-strip to the wasm tools build

* Run mono-cil-strip.exe from tools.
2019-04-16 04:55:29 +02:00
Zoltan Varga 9d91df98df [llvmonly] Fix a buffer overflow. (#14057) 2019-04-15 19:23:05 -04:00
Bernhard Urban 9ff3b0d65e [aot] change method table generation so that it works for larger assemblies on ARM (#14043)
[aot] change method table generation so that it works for larger assemblies on ARM

At the end of the AOT compilation, we dump a table containing all method
entrypoints using the toolchain linker to resolve the addresses. Previously
we used `bl` for that, however on larger assemblies the offset might
overflow the 24bit immediate (thus, the linker bailing out with
"Error: branch out of range"). Instead, using `ldr pc,=<label>` followed
by `.ltorg` emits the full 32bit address to a method. That takes 8 bytes
for each method instead of 4 bytes.


( I couldn't reopen https://github.com/mono/mono/pull/3486 anymore)
2019-04-15 18:25:51 -04:00
Egor Bogatov b1af4c2726 [netcore] fix some CustomAttribute related tests (#14056)
* fix CA

* fix CA

* remove redundant checks

* remove redundant checks
2019-04-15 19:06:52 +02:00
Filip Navara 30e947a667 Fix stack overflow introduced in 012ac05aa9 2019-04-15 16:59:08 +02:00
Filip Navara 012ac05aa9 [netcore] Misc. fixes (#14050)
* Check for lower bounds on non-zero-based arrays

* Grab correct version of System.Reflection.Context

* Move Attribute type validation to fix checking for custom attributes using interface types

* Fix parameter checks
2019-04-15 15:02:47 +02:00
Vlad Brezae 79f15ccd35 [interp] Static field access fixes (#14009)
* [interp] Further optimize static vt field access

We don't require any write barrier checking since we always copy between interpreter vt_stack and static data. We can also include the vt size in the code stream. Makes it over 1.5x times faster.

* [interp] Fix static field access using ldfld/stfld

Static field access using the ldfld/stfld instructions was not updated when stsfld/ldsfld were optimized.

* [interp] Fix special static vtype field access
2019-04-15 15:35:34 +03:00
Kenneth Pouncey a487fb83b6 use dotnet instead of msbuild 2019-04-15 14:25:52 +02:00
Filip Navara 8c85c29841 [netcore] Switch to msbuild nuget which is available for all platforms (#13989)
* Switch to msbuild nuget which is available for all platforms

* Remove check-env rule dependency

* Add missing reference to System.Composition.TypedParts

* Sort references by name
2019-04-15 11:30:46 +02:00
Kenneth Pouncey 58196e1aab [wasm] [sdk] Build and package the sdk nugets. 2019-04-15 10:26:58 +02:00
Marco Rossignoli 64799bb439 improve entropy (dotnet/coreclr#23591)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-15 08:53:55 +02:00
Egor Bogatov 2a8028f7ce [netcore] Do not inline if [DynamicSecurityMethod] exists (#14032)
* fix crash

* fix build
2019-04-15 08:34:23 +02:00
Raz Friman 791139bead Remove unused offset calculation (dotnet/coreclr#23793)
Utf8Parser has a redundant calculation of date time offset.

Fix #21834

Signed-off-by: dotnet-bot <[email protected]>
2019-04-15 08:32:36 +02:00
Levi Broderick daa940339c Remove old method names from Rune (dotnet/coreclr#23938)
* Remove old method names from Rune, reenable suppressed tests

* Revert re-enablement of failing ArraySegment tests

Signed-off-by: dotnet-bot <[email protected]>
2019-04-15 08:32:36 +02:00
Jay Krell cfdcf29478 Remove redundant check of llvm_acfg->aot_opts.direct_icalls. (#14028) 2019-04-14 15:58:17 -04:00
Filip Navara 7ac572217d [netcore] Make System.Private.CoreLib and host APIs compilable on Windows (#13943)
* Fix Windows builds of CLR hosting API

* Make System.Private.CoreLib compilable on Windows

* Remove accidental change

* Fix Unix build

* Update GlobalizationMode.cs

* Update GlobalizationMode.Unix.cs
2019-04-14 18:58:40 +02:00
Jay Krell 568c822ae9 Remove constant parameter to mono_tls_get_tls_setter and mono_tls_get_tls_getter. (#13894)
It doesn't matter, but for code clarity.
Also strengthen the types of both of these, though rarely enough to avoid casts.
2019-04-14 16:24:18 +02:00
Marek Safar 233f5ad096 Reflect shared partition changes 2019-04-14 15:54:18 +02:00
Jan Kotas 30d94ae529 Fix AssemblyName regression
Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
Jan Kotas 1baa703c92 Move GCMemoryInfo to shared partition
Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
dotnet-maestro-bot 592dac20f9 Update BuildTools, CoreClr to preview4-03913-01, preview5-27612-73, respectively (master) (#23916)
* Update BuildTools, CoreClr to preview4-03913-01, preview5-27612-73, respectively

* Fix nullable build errors

Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
Jan Kotas 88c35b4974 Delete unused AssemblyName._hashForControl and related code (#23972)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
Steve MacLean 64c0733212 EnterContextualReflection handle null (dotnet/coreclr#23953)
* EnterContextualReflection handle null

* Add ContextualReflection MockAssembly test

* Fix ContextualReflection typo

Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
Jan Kotas a49d96b057 Delete outdated comment
Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
Filip Navara b672c05ad0 Move DateTime Windows implementation to shared CoreLib (#23888)
* Move DateTime Windows implementation to shared CoreLib

* Make all the BOOL/struct marshalling explicit

* internal -> private

* Use unsafe code on all layers, remove unnecessary fixed blocks

Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:54:18 +02:00
Jan Kotas 13183af5c3 Delete COMPlus_FinalizeOnShutdown (dotnet/coreclr#23595)
This compat quirk is increasingly more broken since the framework is generally not compatible with, and we have not heard anybody actually using it.

Changed Environment.HasShutdownStarted to unconditionally return false. It does not make sense for it to ever return true with shutdown finalization disabled.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-14 15:44:21 +02:00
Kenneth Pouncey a26c8bca81 Updating to recent sdk 1.38.30. (#14023)
osx binaries are now available.

```

touch .stamp-wasm-checkout-and-update-emsdk
cd /Users/Jimmy/websharp/projects/mono/sdks/builds/toolchains/emsdk && ./emsdk install sdk-1.38.30-64bit
Fetching all tags from Emscripten Github repository...
Done. 158 tagged releases available, latest is 1.38.30.
Fetching all tags from Binaryen Github repository...
Done. 85 tagged Binaryen releases available, latest is 1.38.30.
Fetching all precompiled tagged releases..
Downloading: /Users/Jimmy/websharp/projects/mono/sdks/builds/toolchains/emsdk/llvm-tags-32bit.txt from https://s3.amazonaws.com/mozilla-games/emscripten/packages/llvm/tag/osx_32bit/index.txt
Downloading: /Users/Jimmy/websharp/projects/mono/sdks/builds/toolchains/emsdk/llvm-tags-64bit.txt from https://s3.amazonaws.com/mozilla-games/emscripten/packages/llvm/tag/osx_64bit/index.txt, 2629 Bytes
Downloading: /Users/Jimmy/websharp/projects/mono/sdks/builds/toolchains/emsdk/upstream/lkgr.json from https://storage.googleapis.com/wasm-llvm/builds/linux/lkgr.json, 4641 Bytes
Installing SDK 'sdk-1.38.30-64bit'..
Installing tool 'clang-e1.38.30-64bit'..
Downloading: /Users/Jimmy/websharp/projects/mono/sdks/builds/toolchains/emsdk/zips/emscripten-llvm-e1.38.30.tar.gz from https://s3.amazonaws.com/mozilla-games/emscripten/packages/llvm/tag/osx_64bit/emscripten-llvm-e1.38.30.tar.gz, 318164889 Bytes

```
2019-04-13 06:08:18 -04:00
dotnet-maestro[bot] 3e19f1b052 Update dependencies from dotnet/corefx (dotnet/coreclr#23893)
* Update dependencies from https://github.com/dotnet/corefx build 20190411.2

- Microsoft.NETCore.Platforms - 3.0.0-preview5.19211.2
- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview5.19211.2

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

- Microsoft.NETCore.Platforms - 3.0.0-preview5.19211.22
- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview5.19211.22

* Removing renamed HWIntrinsic APIs from S.P.Corelib

* Updating the hwintrinsiclistxarch to match the new intrinsic API names

* Updating the HWIntrinsic generated tests to use the new API names

Signed-off-by: dotnet-bot <[email protected]>
2019-04-13 08:13:39 +02:00
monojenkins 21d82e7d0b [bcl] Update BCL Linked Size 2019-04-13 08:09:56 +02:00
Marek Safar cc5886e3d5 Reflect shared partition changes 2019-04-12 23:45:22 +02:00
Steve MacLean 28e5883c8d Contextual reflection (dotnet/coreclr#23740)
* Add ContextualReflection APIs

Add ContextualReflection APIs approved in dotnet/corefx#36236
Fix issue #22213

* SetParentAssembly even when IsCollectible()
* ContextualReflection tests

* PR Feedback
* Add more usage tests

Add using statement tests
Add bad usage tests including Assert.Throws<>

* Only initialize on set
* Add XML API comments
* Unify VerifyIsolation
* Fix unused expectedAssembly
* Remove ContextualReflectionScope throw
* Clean up TestResolveMissingAssembly et. al
* Remove unused QCall::AppDomainHandle
* Remove AppDomainBaseObject
* Pass AssemblyLoadContext as managed object to native
* Fix AssemblyLoadContextBaseObject packing

* AssemblyLoadContext backing stores

Use explicit backing stores for events and properties

* Remove StaticAsyncLocalCurrentContextualReflectionContext
* Remove PermissionSetObject

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Egor Bogatov 1fc8151c7c Move AssemblyName to shared (dotnet/coreclr#23737)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Ludovic Henry 1271a16b46 Make GC.GetGCMemoryInfo public (dotnet/coreclr#23779)
* Make GC.GetGCMemoryInfo public

This is to be used to allow users to optimize memory consumption based
on what's available to the GC and on the system.

This is based on https://github.com/dotnet/corefx/issues/34631

* Address reviews

- Pass GCMemoryInfo struct to native in place of many arguments
- Make GCMemoryInfo.HeapSize and GCMemoryInfo.Fragmentation long in place of IntPtr

* Address reviews

- Mark GCMemoryInfo readonly

* Rearrange fields and match managed/native names

* Fix compilation

* Use getter shorthand

* Address API Design Review

https://github.com/dotnet/corefx/issues/34631#issuecomment-481358549

* Fix comments

* Fix comments

* Do everything in managed

* Address review

 - Remove unecessary [StructLayout.Sequential]
 - Remove "_" prefix for parameters variables

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Tarek Mahmoud Sayed 79ee7156df Update Range.GetOffsetAndLength (dotnet/coreclr#23855)
* Update Range.GetOffsetAndLength

Make it return offset and length tuple instead of the old Type Range.OffsetAndLength

* Fix the return Tuple fields names

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Tanner Gooding 608be919cb Tweaking some APIs according to user feedback. (dotnet/coreclr#23857)
* Updating the Avx2.ConvertToVector256UInt APIs to return a signed type (matching the native signature and Sse41 APIs).

* Adding explicit overloads for `Sse41.ConvertToVector128Int*` and `Avx2.ConvertToVector256Int*` that take a pointer

* Updating the word ordering for the Compare/CompareScalar methods.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Sung Yoon Whang 28c375e962 Expose new EventCounter APIs (dotnet/coreclr#23808)
* rename BaseCounter to DiagnosticCounter

* Change MetaData->Metadata

* Make EventSource and Name a property for counter classes

* Make the counter APIs public

* fix build errors

* Change float to double

* Few cleanups, fix test

* fix GetMetadataString

* PR feedback

* More PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Jan Kotas 261191886e Disable nullability-related warnings
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 23:45:22 +02:00
Vlad Brezae e30e45f94b [interp] Optimize ldobj/stobj (#13761)
* [interp] Remove dead code

It doesn't make sense to dereference a value type

* [interp] Emit faster instructions for ldobj

* [interp] Emit faster instructions for stobj

* [interp] Simply ldobj vt

This makes it 10x faster

* [interp] Make ldind.r8 unaligned friendly
2019-04-12 21:50:05 +03:00
Levi Broderick e3dd143a5d Clarify comment in 3-byte processing
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 585f55636a Add missing check to 3-byte processing logic
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 51bac6357b PR feedback: Clarify 3-byte sequence processing
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 5246c85995 Fix compilation failure in Utf16Utility
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick d0ec53204d PR feedback: document tempUtf8CodeUnitCountAdjustment usage
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 5034af7331 PR feedback: Clarify charIsNonAscii vector usage
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 02505b8dbd PR feedback: Validate nint definitions
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 94bd111713 PR feedback: Remove redundant endianess checks
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick a92e26d2b4 PR feedback: CountNumberOfLeadingAsciiBytesFrom24BitInteger
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick e1d5e9f79e PR feedback: Fix typos
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 5f292a145d Re-flow Utf8Utility.Helpers
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 445efebc58 Rename DWORD -> UInt32 throughout API surface
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 7bb04786ec Add comments tracking JIT workarounds.
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick d015b30937 Fix incorrect Debug.Assert statements
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick f241bc0016 Expand masks in Utf8Utility, fix const in fallback path
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 9f2d23cf50 PR feedback: Enable SSE2 in Utf16Utility code
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick d7feacf303 PR feedback - Simplify CountNumberOfLeadingAsciiBytesFrom24BitInteger - Extract some consts out to top of file w/ comments
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 4d112e6ef1 PR feedback: GetElement(0) -> Sse2.StoreLow
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 2ecf1e7a20 Simplify vectorized logic; remove unnecessary adjustment
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick f2e4d316e7 Clarify that vector read is unaligned
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 639df30083 Remove SSE41.X64 optimization from AsciiUtility RyuJIT now handles this optimally
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 5a17d4224b Improve perf of "is ASCII?" inner loop in UTF-8 validation.
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick 77863a7ab0 Hook up new UTF-8 logic through UTF8Encoding - Add vectorized UTF-16 validation and transcoded byte counts - Move Utf16Utility into Unicode namespace alongside Utf8Utility - Fix some bugs in DecoderNLS's draining logic
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Levi Broderick a86f468670 Add optimized UTF-8 validation and transcoding logic - Hook it up through the existing Utf8 public static APIs - Move some shared methods out of ASCIIUtility - Hook it up through the Utf8String ctor
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Steve MacLean 9501ef8cfb Fix Assembly.LoadFromPartialName(string) (dotnet/coreclr#23912)
Assembly.LoadFromPartialName(string) should not throw FileNotFoundException, but
should rather return null.

ArgumentException should use nameof(partialName)

Fixes #19817

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Stephen Toub 23b6c94d58 Fix Version's comparer operators to allow null (dotnet/coreclr#23898)
Previously for `<`/`<=` it would throw if `v1` argument was null, but for `>`/`>=` would throw if the `v1` argument was null, albeit using `v1` in the exception parameter name.  It's also not expected for comparisons like this to throw, in general.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Filip Navara 2e480766b3 Move TimerQueue.TickCount Windows implementation to shared CoreLib (#23838)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 19:22:35 +02:00
Alexander Köplinger b1c39e4e3d [corlib] Disable FileTest.SymLinkStats() on TVOS
Symlinks on TVOS run into sandboxing restrictions. We've already disabled a similar test.

This test was added recently as part of 26e0b1deec.

(cherry picked from commit b85fdbdb10)
2019-04-12 14:27:41 +02:00
Jay Krell 22bbf4416a Increase gsharedvt trampolines by 10% from 4000 to 4400.
There are many minor arguments here.

Where this matters most -- iOS -- the pool is already dynamic.

Other platforms could use a dynamic pool or JIT (despite FullAOT).
Using JIT would defeat the test coverage.

Mitigates https://github.com/mono/mono/issues/13888.
If this feels too tenative, go bigger.
2019-04-12 08:30:15 +02:00
Maxim Lipnin ded4fa6558 [w32error] Add ENONET error case 2019-04-12 08:29:02 +02:00
Santiago Fernandez Madero 990a90fea0 Add back using to EventSourceException
Signed-off-by: dotnet-bot <[email protected]>
2019-04-12 08:15:02 +02:00
Maxim Lipnin 3657c0239a Remove #if-def for TypedReference.MakeTypedReference readonly restriction 2019-04-12 08:07:07 +02:00
Kenneth Pouncey 0d6f7a9e6f Add tests for past issues to catch regressions. (#13981)
- Add IssuesTestSuite to test suite make build.
- Add new issues spec and test calls.
2019-04-12 04:55:14 +02:00
Jo Shields a7c7f903f3 Merge pull request #13998 from directhex/extradist_20190411
[netcore] hand-craft a dist-recursive rule for System.Private.CoreLib
2019-04-11 15:15:29 -04:00
Jo Shields 40e7b26702 [netcore] hand-craft a dist-recursive rule for System.Private.CoreLib
`make dist` stopped erroring in #13961 but didn't actually work, because
the relevant Makefile.am was not distributed, causing configure to fail
(because the Makefile.am was cited as an input, unconditionally).

We can't rely on the dist-recusrive from library.make or build.make because
this lib is in a weirdo format which doesn't comply with the requirements
of those helpers, so craft a simple handwritten replacement for our special
case
2019-04-11 11:04:01 -04:00
Zoltan Varga 5036336df8 [jit] Make dlmalloc use mono_valloc so it picks up the MAP_JIT flag on osx. (#13979)
Fixes https://github.com/mono/mono/issues/13878.
2019-04-11 09:19:42 -04:00
Miguel de Icaza 56db577988 [debugger-agent]: Print error if the socket can not be created, remove assert that probed the wrong value, Coverity 1307166 (#13860) 2019-04-11 09:38:17 -03:00
Zoltan Varga 1a76a455a7 Add missing DynamicSecurityMethod attributes. 2019-04-11 11:21:02 +02:00
Zoltan Varga 8b1a18784d [jit] Disable inlining for methods with [System.Security.DynamicSecurityMethod], its used to make methods which contain a StackCrawlMark.
Also check that the attribute is present for StackMaekMark locals.
2019-04-11 11:21:02 +02:00
Marek Safar 995bbb998c Merge pull request #13815 from radical/nuget-5
[nuget] Bump to nuget 5.0.0
2019-04-11 11:08:41 +02:00
Alexander Köplinger ec045a52b0 [cil-strip] Fix reading of undefined NativeType values in old Cecil (#13954)
cil-strip crashed when processing this method: https://github.com/mono/corefx/blob/f54e64b341a7b114c3502e197b46670cacb28639/src/Microsoft.CSharp/tests/DefaultParameterTests.cs#L88

It uses `MarshalAs((UnmanagedType)2000)`, i.e. an undefined value for the native type. The old Cecil embedded in cil-strip tried to read more than one byte which blows up in this case.

Upstream Cecil just reads a single byte:
https://github.com/jbevain/cecil/blob/1b79b96d29f1e8e9ba832191b1b42ea9cb750d20/Mono.Cecil/AssemblyReader.cs#L3700-L3703

Fixes https://github.com/mono/mono/issues/13639
2019-04-11 11:08:25 +02:00
sancheolz 4eb4173b57 [WinForms] Fix displayed image in TreeNode when ImageIndex set to -2
When ImageIndex in TreeNode set to -2 must not displayed any image
2019-04-11 10:51:59 +02:00
Filip Navara 8ba5a5201f [netcore] Implement Assembly.GetExecutingAssembly with stack mark parameter (#13903)
* Implement Assembly.GetExecutingAssembly with stack mark parameter

* Address PR feedback
2019-04-11 04:31:22 -04:00
Filip Navara 847296f1f0 [netcore] Fix marshalling of ref ptr return types (#13914)
* Fix marshalling of ref ptr return types

* Revert assert -> exception change
2019-04-11 04:31:11 -04:00
Filip Navara a26f73dcd9 Do not crash the runtime in System.Reflection.Emit.ILGeneration tests (#13917) 2019-04-11 04:30:59 -04:00
Johan Lorensson 562ac284e4 Merge pull request #13959 from filipnavara/link-windows
[windows] Link libgcc statically on Windows
2019-04-11 04:18:47 -04:00
Patrik Švikruha 49cc696bd7 fix link in README.MD
fix link to WebAssembly packager.exe in README.MD
2019-04-11 09:50:26 +02:00
Maxim Lipnin 068e8fe042 Use DNS.GetHostAddressesAsync instead of sync version (#13949)
Fixes #13163
2019-04-11 09:07:14 +02:00
Johan Lorensson 0c1489b836 Merge pull request #13946 from lateralusX/lateralusX/merge-icall-hash-maps
Merge icall_hash and icall_hash_foreign into one.
2019-04-11 02:58:59 -04:00
Kenneth Pouncey e0eff41f9e Add generated xml doc to sdk build. (#13965)
- Add the WebAssembly.Bindings.xml to the package.
- Add the WebAssembly.Net.Http.xml to the package.
2019-04-11 07:36:56 +02:00
Kenneth Pouncey 75d74f2eb6 [wasm] Revert Update to emscripten 1.38.30 https://github.com/mono/mono/pull/13759 (#13964)
- 1.38.30 is still not available for mac:
2019-04-11 05:01:36 +02:00
Thays Grazia bf8d7ef448 Cleaning exceptions during static constructor loading (#13962)
Cleaning exceptions during static constructor loading

Reset the stack_trace and trace_ips because the type initialization exception is reused.
Fixes #13714
2019-04-10 18:25:49 -04:00
Jo Shields 9d4d20b389 Merge pull request #13976 from directhex/another-llvm-symbol
Add another symbol for loadedllvm
2019-04-10 15:46:09 -04:00
Jo Shields 8fa16b329c Add another symbol for loadedllvm
Closes https://github.com/mono/mono/issues/13974
2019-04-10 15:45:30 -04:00
Alexander Köplinger 39e5c5f057 [corlib] Disable a ParameterInfoTest test on MONOTOUCH
It needs SRE and even with interpreter config this doesn't work yet.

(cherry picked from commit 766b3204c3)
2019-04-10 21:00:20 +02:00
Marek Safar c10e8da1b5 Merge pull request #13972 from filipnavara/netcore-nullability
[netcore] Disable nullability-related warnings
2019-04-10 19:08:07 +02:00
Marek Safar e1164a8dbd Merge pull request #13963 from Dotnet-GitSync-Bot/mirror-merge-10135517
Mirror changes from mono/corefx,coreclr,corert
2019-04-10 19:07:08 +02:00
Jo Shields fd8598a994 Merge pull request #13973 from directhex/netcore-pipeline
[netcore] Add a Pipeline yaml for Core build
2019-04-10 12:44:50 -04:00
Jason Imison c16b4cff44 [MacSDK] Bump F# to 4.5 (#10919)
* Use a custom prefix instead of trying to infer it, which doesn't work under bockbuild.

The following line is problematic in the scope of building the Mac SDK package (using bockbuild):

https://github.com/fsharp/fsharp/blob/ccfccbacfdb16b2ab143cf83f5ece20f738fd864/mono/config.make#L5

It's problematic because where `mono` lives in this case would be something like `/macsdk-staging-dir/bin/mono` which is not the actual prefix (prefix here being the final destination, `/Library/Frameworks/Mono.framework/...`) but a staging area that bockbuild uses (this is how we build on system prefixes without installing on CI)

For the F# build, bockbuild expects things to end up  in `/fsharp-staging-dir/$(prefix)` (because that's what most `make install`s do when given `DESTDIR=/fsharp-staging-dir/`). If things end up in _any other_ directory in `/fsharp-staging-dir/`  (like `/fsharp-staging-dir/macsdk-staging-dir` in our case) that would cause us to miss packaging those files (this has happened before, with packages that have broken or different use of `DESTDIR`). So there is an added write-protection for anywhere in `/fsharp-staging-dir` that *isn't*  `/fsharp-staging-dir/$(prefix)` , because a write-protection error, while obtuse, is much preferable to missing the fact that some files are not packaged (as would have happened here)

So the fix is to stop trying to infer the prefix, and return to providing it explicitly to the build system (this used to be the case via the `configure` step)

* Also, if we are doing an override of the 'make' command, we need to take care of passing DESTDIR ourselves too

* Since now we perform 'make install' on the make step, make the 'install' step into a no-operation.

* Look for sn where mono is, not in the final destination (which again, may not be the same)
2019-04-10 12:35:44 -04:00
Jo Shields 08a8880ddd Merge pull request #13961 from directhex/makedist_again
[netcore] Fix `make dist`
2019-04-10 12:08:11 -04:00
Jo Shields 992b0249f0 [netcore] Add a Pipeline yaml for Core build 2019-04-10 11:33:20 -04:00
Filip Navara 226d5a0885 Disable nullability-related warnings 2019-04-10 17:31:39 +02:00
Johan Lorensson b016a0a945 Make nullable embedding API's public. (#13950)
Currently we have two nullable API's that will have value in the public
embedding API (already requestsed by users), eliminating the needs to go
from native->managed and back to get nullable information about a type.

mono_class_is_nullable
mono_class_get_nullable_param

This PR moves them from class-internals.h into class.h and mark them
with MONO_API and when needed include GC UNSAFE/SAFE transition.
2019-04-10 11:29:00 -04:00
Alexander Köplinger e8caaa1dbd [configure] Add failsafe for missing submodules (#13957)
GitHub provides a way to download a .zip/.tar.gz of the repository content in their UI, however the archive doesn't contain git submodules.

The mono build then fails with confusing "missing file" errors.

Since GitHub doesn't let us disable the archive download we should at least add some logic to detect this broken case and bail out.
2019-04-10 15:26:28 +02:00
Alexander Köplinger 183b22b4db [System.Net.Http] Make some tests specific to HttpClientHandler
Otherwise they throw PNSE on e.g. WatchOS.

(cherry picked from commit 0b6dbfa349)
2019-04-10 15:03:50 +02:00
Martin Baulig 22c6ed3f1c Add conditionals allowing some calenders to be disabled. (#13730)
Add `GlobalizationMode.Invariant` conditionals to some calendar code.

This allows the Japanese, Taiwan and Hebrew calendars to be disabled.
2019-04-10 13:44:11 +02:00
lateralusX dd2d363e76 WASM driver uses incompatible signatures for icall lookup.
uses_handles parameter is a gboolean -> int32_t in Mono but was uint8_t
in WASM implementation. This triggered a problem when a uninitialized
gboolean was used and only parts of it got set and method still returns
an address, indicating success. This is a different behavior compared to
Mono's default implementation. Fix to this particular problem was to init
the gboolean variable before calling, but good to make sure the signatures are in
sync anyways.
2019-04-10 10:16:32 +02:00
lateralusX 18bba37796 Merge icall_hash and icall_hash_foreign into one.
icalls registered with mono_add_internal_call, mono_add_internal_call_with_flags
or mono_add_internal_call_internal ended up in two different hash tables
depending if they were "foreign" or not. This caused double lookups in
mono_lookup_internal_call_full. There are also use cases where it could be
interesting to keep additional flags related to the icall, that could be
used by codegen for various optimization.

This PR merge the two hash tables into one and add a flag describing icall
details. The flag could later be extended with additional behaviors going
forward if needed.
2019-04-10 10:10:27 +02:00
Aleksey Kliger 72c8776d8f [utils] stub mono_setmmapjit on Win32 and Wasm 2019-04-09 17:35:35 -04:00
Miguel de Icaza bc4a1ac85a Do not use MAP_JIT by default, instead make this something that is toggled by Xamarin.Mac which needs it 2019-04-09 17:35:35 -04:00
Jan Kotas c828db526f Update CoreRT for changes in shared partition
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:31:08 -07:00
Stephen Toub 84b81ac290 Improve RuntimeHelpers.GetSubArray (dotnet/coreclr#23829)
* Improve RuntimeHelpers.GetSubArray

This change does three things.

First, it fixes `GetSubArray` to work when the supplied array is actually a `U[]` where `U : T`.  Currently this case ends up throwing an exception inside of span, which doesn't like working with arrays covariantly.

Second, it fixes argument validation so that we throw an ArgumentNullException if the input array is null rather than NullReferenceException.

Third, it improves the performance of `GetSubArray` for the 95% common case where either `T` is a value type or the type of the array matches the `T` type specified.

* Only use `Array.Empty<T>` when `typeof(T[]) == array.GetType()`

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:26 -07:00
Stephen Toub 2570c11ec4 Fix two new nullable warnings with latest compiler
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:26 -07:00
Hugh Bellamy 727ff4b34d Remove remaining devdocs and cleanup ComponentModel code (#23175)
* Remove remaining devdocs and cleanup ComponentModel code

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:25 -07:00
Jeremy Koritzinsky 6a5487c8e1 Match PtrToStringUTF8 to the other PtrToString* families. (#23731)
* Match PtrToStringUTF8 to the other PtrToString* families.

* Make PtrToString*(IntPtr,int) exceptions consistent.

* Exclude out-of-date tests in CoreFX.

* Update exclusions to cover tests that are now throwing ArgumentOutOfRangeExceptions instead of ArgumentExceptions.

* Fix parameter order for exception.

* Pass value to exception.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:24 -07:00
Steve MacLean 7cf81c817b Whitespace (dotnet/coreclr#23772)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:23 -07:00
Tanner Gooding b7d729d2ef Update the JIT to recognize the IsSupported property for all HWIntrinsics (#23751)
* Moving some JITDUMP calls into Compiler::lookupNamedIntrinsic

* Marking the IsSupported methods as Intrinsic for all HWIntrinsic ISAs

* Updating the hwintrinsic importation to more generally handle IsSupported and ThrowPNSE

* Applying formatting patch.

* Adding using System.Runtime.CompilerServices to the various x86 PlatformNotSupported HWIntrinsic files

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:22 -07:00
Stephen Toub 51d6b9bf02 Don't null out references in Stream/BinaryReader/Writer (#23725)
These types null out some fields on Dispose, and some of those fields are accessible directly via exposed properties, which means that nulling them out would either force us to annotate those properties as being nullable or would require us to lie about them being nullable.  Nulling them out also makes it easier to accidentally null ref in the implementation, and prevents us from making the fields readonly.

It should be exceedingly rare that you dispose of one of these objects and then keep it alive while also being concerned about keeping alive the other helper objects the type uses.  So this change just uses a separate flag to track disposal, and avoids nulling out the fields, which is not a common practice elsewhere in the framework.

This will be a visible change in that after Dispose, properties like StreamWriter.BaseStream/Encoding will now return the stream/encoding rather than null.  In theory that could break someone if they were using those properties to determine whether the writer had been disposed, but that seems unlikely / similar fallout from most any bug fix, and objects generally aren't supposed to be touched after Dispose, anyway.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:21 -07:00
Grant fccd3ad15b Revert optimization (dotnet/coreclr#23759)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:19 -07:00
Levi Broderick a55709fa7a Improve performance of Memory<T>.Span property getter (#23750)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:19 -07:00
Santiago Fernandez Madero ebe0d573b8 Fix Debug.Assert in GenericDelegateCache (dotnet/coreclr#23755)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:18 -07:00
Santiago Fernandez Madero b3d4e338cf Fix merge conflicts on Delegate and String.resx
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:17 -07:00
Stephen Toub 28c0991cfc Fix build break due to conflicting PRs (dotnet/coreclr#23726)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:16 -07:00
Krzysztof Wicher 0ff89565f5 Nullable: shared/System/Security (dotnet/coreclr#23623)
* Nullable: shared/System/Security

* fix windows

* address feedback

* IIIIdentity.Identity?

* apply feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:15 -07:00
Stephen Toub e90270aefb Nullable: Streams (dotnet/coreclr#23703)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:09 -07:00
Bernhard Urban de1fc96374 [aot] use g_malloc () instead of malloc () (#13953)
[aot] use g_malloc () instead of malloc ()

Unbreaks jemalloc support as it hooks into `g_malloc ()` instead of replacing `malloc ()`.

```
%4  0x000055ee6af0d27b in sigabrt_signal_handler (_dummy=6, _info=0x7ffc7b0c4ff0, context=0x7ffc7b0c4ec0) at mini-posix.c:232
%5  <signal handler called>
%6  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
%7  0x00007f4ae0d73801 in __GI_abort () at abort.c:79
%8  0x000055ee6b2ab6ed in rtree_child_leaf_tryread (elm=0x55ee6b75b028 <je_extents_rtree+704104>, dependent=true) at src/rtree.c:205
%9  0x000055ee6b2ab95f in je_rtree_leaf_elm_lookup_hard (tsdn=0x7f4ae1f05738, rtree=0x55ee6b6af1c0 <je_extents_rtree>, rtree_ctx=0x7f4ae1f05758, key=94482510772944, dependent=true, init_missing=false) at src/rtree.c:292
%10 0x000055ee6b242f70 in rtree_leaf_elm_lookup (tsdn=0x7f4ae1f05738, rtree=0x55ee6b6af1c0 <je_extents_rtree>, rtree_ctx=0x7f4ae1f05758, key=94482510772944, dependent=true, init_missing=false) at include/jemalloc/internal/rtree.h:369
%11 0x000055ee6b242fb5 in rtree_read (tsdn=0x7f4ae1f05738, rtree=0x55ee6b6af1c0 <je_extents_rtree>, rtree_ctx=0x7f4ae1f05758, key=94482510772944, dependent=true) at include/jemalloc/internal/rtree.h:394
%12 0x000055ee6b2431ee in rtree_szind_slab_read (tsdn=0x7f4ae1f05738, rtree=0x55ee6b6af1c0 <je_extents_rtree>, rtree_ctx=0x7f4ae1f05758, key=94482510772944, dependent=true, r_szind=0x7ffc7b0c6000, r_slab=0x7ffc7b0c6004) at include/jemalloc/internal/rtree.h:446
%13 0x000055ee6b24d468 in ifree (tsd=0x7f4ae1f05738, ptr=0x55ee6c7dfad0, tcache=0x7f4ae1f058f0, slow_path=true) at src/jemalloc.c:2126
%14 0x000055ee6b24de06 in mono_jefree (ptr=0x55ee6c7dfad0) at src/jemalloc.c:2290
%15 0x000055ee6b2c6c68 in monoeg_g_free (ptr=0x55ee6c7dfad0) at gmem.c:83
%16 0x000055ee6adefafa in emit_method_code (acfg=0x7f4ae0986000, cfg=0x7f4ae0ad4e00) at aot-compiler.c:6243
%17 0x000055ee6adf9534 in emit_code (acfg=0x7f4ae0986000) at aot-compiler.c:9704
%18 0x000055ee6ae04a9d in emit_aot_image (acfg=0x7f4ae0986000) at aot-compiler.c:13535
%19 0x000055ee6ae03b7c in mono_compile_assembly (ass=0x7f4ae09a9300, opts=374434303, aot_options=0x7f4ae093c000 "bind-to-runtime-version,outfile=./../../class/lib/build-linux//Microsoft.CodeAnalysis.CSharp.dll.so", global_aot_state=0x7ffc7b0c6438) at aot-compiler.c:13357

```
2019-04-09 16:25:53 -04:00
Stephen Toub a8ba76c4c1 Nullable: System.Threading.Tasks (dotnet/coreclr#23691)
* Nullable: System.Threading.Tasks

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:25 -07:00
Santiago Fernandez Madero 1675c9e7d4 Nullable: All remaining exceptions (dotnet/coreclr#23676)
* Nullable: All remaining exceptions

* Fix build break and PR Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:21 -07:00
Stephen Toub e4865826f1 Nullable: ReaderWriterLockSlim (dotnet/coreclr#23657)
* Nullable: ReaderWriterLockSlim

* Address PR feedback

* Audit System.Threading for unannotated statics

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:19 -07:00
Stephen Toub 1e799563fc Nullable: System.Threading (dotnet/coreclr#23663)
Finishes off annotation of the System.Threading namespace, not including subnamespaces.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:18 -07:00
Stephen Toub 2a9ae82761 Nullable: Interlocked, Volatile (dotnet/coreclr#23655)
Also fixing the class? annotation on public LazyInitializer methods.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:17 -07:00
buyaa-n 75f54646fb Nullable: System.Enum
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:16 -07:00
Krzysztof Wicher 192062ee5b Nullable: globalization remainder (dotnet/coreclr#23526)
* Nullable: remainder of globalization

* annotate windows specific files

* add TODO-NULLABLE next to TODO suggesting comments

* fixes after merging other globalization annotations, apply feedback

* fix windows

* address feedback

* fix windows

* fixes

* apply feedback

* remove workaround

* s_Invariant?, couple of Debug.Asserts

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:15 -07:00
Stephen Toub e5828e1a8d Nullable: System.Buffers (dotnet/coreclr#23619)
* Nullable: System.Buffers

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:12 -07:00
Stephen Toub aad1b221c5 Nullable: AsyncLocal (dotnet/coreclr#23618)
* Nullable: AsyncLocal

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:10 -07:00
Stephen Toub 95d18423a4 Nullable: WaitHandles (dotnet/coreclr#23604)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:09 -07:00
Stephen Toub 02f2718c86 Nullable: SemaphoreSlim (dotnet/coreclr#23628)
* Nullable: SemaphoreSlim

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:08 -07:00
Stephen Toub 4a47ccbfaf Nullable: ExecutionContext (dotnet/coreclr#23611)
* Nullable: ExecutionContext

* Add TODO comments

* Fix conflict with ThreadPool PR

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:07 -07:00
Stephen Toub 1b6614ea4a Fix build break due to nullable PR conflicts (dotnet/coreclr#23641)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:06 -07:00
Stephen Toub 406cfbc6d3 Nullable: ThreadLocal (dotnet/coreclr#23626)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:05 -07:00
Stephen Toub c9b17e9bed Nullable: Lazy (dotnet/coreclr#23639)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:04 -07:00
Stephen Toub 6f1aaede58 Nullable: SpinWait/Lock (dotnet/coreclr#23613)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:03 -07:00
Stephen Toub 557efaa549 Nullable: CancellationToken (dotnet/coreclr#23609)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:02 -07:00
Stephen Toub 015cc4c0f3 Nullable: ManualResetEventSlim (dotnet/coreclr#23630)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:00 -07:00
Stephen Toub 2bcad8bd47 Nullable: SynchronizationContext (dotnet/coreclr#23634)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:23:00 -07:00
Santiago Fernandez Madero 6daecf7f18 Nullable: Annotate remaining System.*Exception (dotnet/coreclr#23585)
* Nullable: Annotate remaining System.*Exception

* PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:59 -07:00
Stephen Toub 1e0dc722cc Nullable: ThreadPool (dotnet/coreclr#23600)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:57 -07:00
Dan Moseley 7e2fad45c5 Annotate Unix interop (dotnet/coreclr#23589)
* Unix interop

* More interop

* Fix

* fix

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:56 -07:00
Tanner Gooding b04c1e800a Nullable: System.Runtime.Intrinsics
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:55 -07:00
Tanner Gooding e5f984a353 Fixing the StringInfo constructor to work with the nullability analysis
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:53 -07:00
Krzysztof Wicher 70759684c3 Nullable: DateTimeFormat, DateTimeFormatInfoScanner, SortKey, StringInfo, TextElementEnumerator, TimeSpanFormat, TimeSpanParse (#23486)
* nullable: DateTimeFormat, DateTimeFormatInfoScanner, SortKey, StringInfo, TextElementEnumerator, TimeSpanFormat, TimeSpanParse

* prefix workaround comment with TODO-NULLABLE

* add TODO-NULLABLE

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:52 -07:00
Krzysztof Wicher 3b1c91d8cf Nullable: NumberFormatInfo, CultureInfo (dotnet/coreclr#23459)
* Nullable: NumberFormatInfo, CultureInfo

* fix build

* fix windows

* fix APPX issue

* another appx failure

* get rid of line split

* mark retVal as nullable

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:51 -07:00
Santiago Fernandez Madero 69a0897eb7 Nullable: Exception, SystemException, Argument*Exception (#23515)
* Nullable: Exception, SystemException, Argument*Exception

* Add Debug.Assert rather than comment

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:50 -07:00
Santiago Fernandez Madero e2f1a0913e Nullable: make Object.ToString() return nullable (dotnet/coreclr#23510)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:49 -07:00
Santiago Fernandez Madero 9ff4795adb Nullable: System.Double, System.Single (dotnet/coreclr#23503)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:22:48 -07:00
Jo Shields 96246ab598 [netcore] Fix make dist
```
make[5]: Entering directory `/mnt/jenkins/workspace/build-source-tarball-mono/mcs/class/System.Private.CoreLib'
make[5]: Leaving directory `/mnt/jenkins/workspace/build-source-tarball-mono/mcs/class/System.Private.CoreLib'

make[5]: *** No rule to make target `dist-recursive'.  Stop.
make[4]: *** [dist-recursive] Error 1
```
2019-04-09 16:06:26 -04:00
Alexander Köplinger c3541fc543 [nunit-lite] Use .NOTPARALLEL to possibly fix some races
We're seeing occasional build errors on CI that seem to be some kind
of race when compiling nunit-lite and nunit-lite-console.
2019-04-09 20:44:43 +02:00
Filip Navara f90133579f Link libgcc statically on Windows 2019-04-09 18:52:12 +02:00
Jo Shields 430307e24b [netcore] Runtime nupkg fixes (#13934)
We can now build `--with-core=only` on Linux or Mac with the same makefile, and have a functional `make nupkg` rule which attempts to produce a .nupkg of the runtime in the format consumed by core-setup.
2019-04-09 17:41:46 +02:00
Jo Shields 6544999e86 Merge pull request #13955 from directhex/more-loadedllvm-magic
Make sure mini_method_is_default_method is in loaded LLVM
2019-04-09 11:28:34 -04:00
Jo Shields 2c42f8d317 Make sure mini_method_is_default_method is in loaded LLVM
mono: symbol lookup error: /usr/lib/libmono-llvm.so: undefined symbol: mini_method_is_default_method
2019-04-09 10:53:53 -04:00
Rolf Bjarne Kvinge 6492dd3a6f [corlib] Fix a few NSLogWriter issues. (#13799)
* [corlib] Make NSLogWriter thread-safe.

* [corlib] Simplify newline checking in NSLogWriter.

Checking the StringBuilder buffer after writing to it instead of the input
string/char[] makes the code somewhat simpler.

* [corlib] Fix NSLogWriter.Write to take into account the index and count parameters.
2019-04-09 14:58:15 +02:00
Johan Lorensson 00b8b21e72 Merge pull request #13928 from lateralusX/lateralusX/use-tls-key-lmf-add-windows
Use TLS_KEY_LMF_ADDR on Windows when pusing lmf frame.
2019-04-09 05:26:35 -04:00
Filip Navara 4449463256 [netcore] Allow reflection invocation of methods with ByRef return types (#13901)
CoreCLR allows reflection on methods with ByRef return types under certain conditions. The PR implementing it is https://github.com/dotnet/coreclr/pull/17639.

Mono already implemented most of it in the marshalling code but artificially blocked it in `ves_icall_InternalInvoke`. I changed the condition for the exception to match the condition in `emit_invoke_call` (marshal-ilgen.c). It's similar to the condition in CoreCLR, but it may not handle byref-like types correctly. It would have to fixed on both places if it turns out to be the case.

The remaining issue is that null references returned in ByRef are not checked and converted to correct exception. It should result in `NullReferenceException` with special message that doesn't get wrapped in `TargetInvocationException`. I put a TODO marker at a place where I think it should be handled, but it's a bit over my head to implement it.

/cc @vargaz
2019-04-09 10:42:18 +02:00
Johan Lorensson fd4539b0ed Merge pull request #13930 from lateralusX/lateralusX/add-supported-additional-defines-windows
Make sure additional supported enable defines ends up in config.h on Windows.
2019-04-09 04:16:44 -04:00
lateralusX 491a4d5da8 Add support for direct icalls not defined in icall-def.h.
An icall declaration can now use the following attribute:

MonoDirectICallSymbolNameAttribute("MyNativeCFunction")

and if not already defined in icall-def.h and direct-icalls are used when
AOT compile the assembly, a direct call will use symbol defined in attribute
as the symbol for direct call. Using this attribute will also enable inlining
for the specific icall wrapper generating inlined direct icalls to external
defined native methods.

This feature is valuable when embedding the runtime and extend with icalls
added using mono_add_internal_call. By applying the above attribute, it is
possible to do AOT with direct-icalls and get static linked icalls without
the need to extend and rebuild cross compiler in the process.
2019-04-09 08:55:29 +02:00
Kenneth Pouncey 68278f0326 [wasm] Core Bindings for SharedArrayBuffer (#13913)
* Add support for core SharedArrayBuffer.

- Add SharedArrayBuffer implementation
- Add SharedArrayBuffer constructors to TypedArray implemenations

* Add tests for SharedArrayBuffer.

- Refactored the test code to add specific test files for Core Bindings.  This separates the tests into specific test regions.
- Moved bindings tests from the http tests to the core bindings tests.

* Cleanup debugging code.
2019-04-09 08:46:36 +02:00
Alexander Kyte b0ae9dbdaa [merp] Restore non-assertion behavior in debugger-engine.c (#13865) 2019-04-08 22:23:35 -04:00
Zoltan Varga 69b6667e2f [llvm] If a true/false branch of a conditional branch is marked as out-of-line, emit an llvm.expect call. (#13915) 2019-04-08 21:57:44 -04:00
Katelyn Gadd ef99519ae5 Bump macsdk msbuild hash to msbuild that uses new roslyn, matching mono master (#13852) 2019-04-09 01:21:39 +02:00
Alexander Köplinger 3903a50e43 [System.Data] Remove unnecessary file from xunit tests (#13935)
It contained DllImports to some Windows APIs which causes issues on xamarin-macios which expects all pinvokes to exist.

Turns out we don't even need that file.
2019-04-08 23:51:34 +02:00
Larry Ewing e51645a560 Merge pull request #13759 from kjpou1/wasm-update-sdk
[wasm] Update to emscripten 1.38.30
2019-04-08 13:23:55 -05:00
lateralusX 03071d5aca Make sure additional supported enable defines ends up in config.h on Windows. 2019-04-08 16:59:10 +02:00
lateralusX f204ccf058 Use TLS_KEY_LMF_ADDR on Windows when pusing lmf frame. 2019-04-08 16:33:03 +02:00
Bernhard Urban 6c774081b5 [AOT] fix winaot LLVM profile (#13909)
[AOT] fix winaot LLVM profile

Regression due to https://github.com/mono/mono/pull/13877
2019-04-08 10:16:37 -04:00
Jo Shields 7b3bb4bfe0 Merge pull request #13918 from directhex/reenable_llvm_test
Reenable LLVM JIT CI
2019-04-08 09:47:14 -04:00
Alexander Köplinger ea13df0e75 Bump bockbuild to get GTK fix (#13912)
https://github.com/mono/bockbuild/pull/93
2019-04-08 15:46:55 +02:00
Jo Shields d52bfac874 Reenable LLVM JIT CI 2019-04-08 09:35:22 -04:00
Zoltan Varga e6385a35c9 [jit] Avoid adding a needless zext which confuses abcrem. (#13890)
[jit] Avoid adding a needless zext which confuses abcrem.

Fixes https://github.com/mono/mono/issues/13889.
2019-04-08 09:06:11 -04:00
Alexander Köplinger da34285bc1 Revert "[image] Create MonoImageStorage to own the image raw data (#13892)" (#13916)
This reverts commit a56573fb7c.
2019-04-08 13:09:46 +02:00
Egor Bogatov b49e72950e [llvm] do not emit safe points for simple methods (#13887)
* do not emit sp on method entry for simple methods

* do not emit sp on method entry for simple methods

* address feedback
2019-04-08 10:53:52 +02:00
Filip Navara f13239aae8 Fix cut & paste error in TypeLoadException constructor 2019-04-08 08:53:57 +02:00
Filip Navara 194c275878 Reenable working Enum tests 2019-04-08 08:53:20 +02:00
Zoltan Varga 8170457d4f [netcore] Remove an assertion which is no longer needed. 2019-04-08 08:48:54 +02:00
Kenneth Pouncey b6237c392f [wasm] Javascript Core Function (#13528)
* Add JavaScript Core support for Function

* Fix compile

* Fix bindings tests

* Add Core Function tests

- TestFunctionSum
   - Create a new Function with a body that returns the sum of two numbers
   - call method `Call` on the sum Function

- TestFunctionApply
   - Return the Math.min function from the Global Math space
   - Call method `Apply` on the min Function to return the minimum value from an array.

* Use Core Function to determine streaming instead of calling InvokeJS which uses javascript Eval.

* Move nested array checking to managed code as per review comments.

- This removes the icall as per review suggestion.
2019-04-08 07:09:27 +02:00
Zoltan Varga e8b77c3af7 [wasm] Generate the pinvoke tables. (#13897)
* [wasm] Generate the pinvoke tables.

Put the default non-linked version of the table into version control, usable by the interpreter only build.

* Add a comment to the generated file.
2019-04-07 06:20:19 -04:00
Aleksey Kliger (λgeek) a56573fb7c [image] Create MonoImageStorage to own the image raw data (#13892)
Create a new data structure: MonoImageStorage.

It is an object that will have the responsibility for the raw data of a
MonoImage.  It has a string key and a refcount that is used to share a
MonoImageStorage between multiple MonoImage objects.

The reason we need this is because the current MonoAssembly/MonoImage design is
broken for multiple domains and (more evidently) it will be broken when we add
AssemblyLoadContext support.  The issue is that a MonoImage may be shared
between multiple domains (or ALCs), but it has a 'references' field which
points to a single other MonoAssembly.

This is a problem because the references of an image may be resolved
differently in different domains (or ALCs).

The eventual solution will be to stop sharing MonoImages based on path name (or
in the case of in-memory images based on a name made up from the address of the
byte blob).

However we still don't want to open the same data more than once (if we're on a
config where we don't have mmap, we malloc some memory and dump the data in
there - we don't want to do that multiple times for the same file).

So the solution is to create this MonoImageStorage object and make it possible
to share it based on path name, but don't give it any responsibilities except
for owning the memory.  It doesn't know anything about metadata or assemblies
or any of that stuff - it just owns a chunk of memory and knows when and how to
free it.

This commit just adds the MonoImageStorage object and wires it up in MonoImage
loading.  There should be no observable behavioral changes from this commit.
2019-04-07 05:23:29 -04:00
Filip Navara 9a63a2d41f Propagate System.Globalization.Invariant from runtimeconfig.json to GlobalizationMode 2019-04-07 08:56:52 +02:00
Filip Navara eddd208dfb Update CoreFX / Runtime versions, download the CoreFX binaries and use them for running the tests 2019-04-07 08:43:06 +02:00
Jay Krell b3917b60ec Remove obsolete AOT relocations for code clarity, assuming no need to support old AOT images. (#13893)
Remove mono_get_throw_exception_by_name declaration.
2019-04-07 02:21:36 -04:00
Miguel de Icaza 7116ecaf4e [metadata] Fix memory leak for the last iteration of the loop, Coverity #1444258 (#13856) 2019-04-06 11:46:27 +02:00
Miguel de Icaza 8567415aea [Coverity] Ensure that we never return -1 from pagesize operation, helps eliminate many false positives (#13863) 2019-04-06 11:41:28 +02:00
Miguel de Icaza af4b09ba27 [metadata] Handle condition in ftell, Coverity 1307192 (#13862)
ftell can be a negative value, handle that scenario.
2019-04-06 11:35:07 +02:00
Filip Navara f29dd7622c [netcore] Implement RuntimeImports.RhBulkMoveWithWriteBarrier (#13840)
* [netcore] Implement RuntimeImports.RhBulkMoveWithWriteBarrier

* Add the actual write barrier to RhBulkMoveWithWriteBarrier

* Rename ves_icall_System_Runtime_RuntimeImports_Memmove_wbarrier to ves_icall_System_Runtime_RuntimeImports_RhBulkMoveWithWriteBarrier

Fixes 15 failures in System.Memory.Tests.
2019-04-06 11:26:55 +02:00
Filip Navara d074481a29 [netcore] Fix Marshal.IsPinnable regression (#13876)
Fix regression from https://github.com/mono/mono/pull/13807/files#diff-e881a4d9491559282e7ae2021f8ad3a4R54.

CoreCLR code for reference: https://github.com/dotnet/coreclr/blob/2f4a7564beb6f8c1f4929504ee2221953d25fc39/src/vm/marshalnative.cpp#L276-L278

Fixes `System.Tests.StringTests.Ctor_CharPtr_DoesNotAccessInvalidPage` in `System.Runtime.Tests`.

My understanding is that IsPinnable should return `true` for:
- Any blittable type
- Any array of blittable types
- Any array of primitive types (covers bool[])
- String, Utf8String (handled separately in managed code in Mono)

It should not return `true` for:
- Primitive non-blittable type
- Value types that are not blittable (eg. contain pointers to other GC objects)
2019-04-06 11:21:07 +02:00
Filip Navara 6346235702 [netcore] More Array.Copy fixes (#13842)
Remaining errors:
```
/Users/filipnavara/Documents/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs(391,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    System.Tests.ArrayTests.Copy_SZArray(sourceArray: [0, 1, 2, 3, null, ...], sourceIndex: 2, destinationArray: [204, 204, 204, 204, 204, ...], destinationIndex: 5, length: 3, expected: [204, 204, 204, 204, 204, ...]) [FAIL]
      System.InvalidCastException : Specified cast is not valid.
      Stack Trace:
        /Users/filipnavara/Documents/mono/mcs/class/System.Private.CoreLib/System/Array.cs(170,0): at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
        /Users/filipnavara/Documents/mono/mcs/class/System.Private.CoreLib/System/Array.cs(87,0): at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length)
        /Users/vsts/agent/2.149.2/work/1/s/src/System.Runtime/tests/System/ArrayTests.cs(1293,0): at System.Tests.ArrayTests.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Array expected)
        /Users/vsts/agent/2.149.2/work/1/s/src/System.Runtime/tests/System/ArrayTests.cs(1243,0): at System.Tests.ArrayTests.Copy_SZArray(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Array expected)
        /Users/filipnavara/Documents/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs(391,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    System.Tests.ArrayTests.SetValue_Casting_Invalid [FAIL]
      Assert.Throws() Failure
      Expected: typeof(System.InvalidCastException)
      Actual:   (No exception was thrown)
      Stack Trace:
        /Users/vsts/agent/2.149.2/work/1/s/src/System.Runtime/tests/System/ArrayTests.cs(3939,0): at System.Tests.ArrayTests.SetValue_Casting_Invalid()
        /Users/filipnavara/Documents/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs(391,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
```

The last Copy_SZArray test case is `yield return new object[] { new object[] { 0, 1, 2, 3, null, 5, 6, 7, 8, 9 }, 2, new int?[] { 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc }, 5, 3, new int?[] { 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 2, 3, null, 0xcc, 0xcc } };`
2019-04-06 11:17:32 +02:00
Kenneth Pouncey d12d4c9f45 [wasm] Fix Uint8ClampedArray.From(byte[]) invalid cast (#13790)
* Handle Uint8ClampedArray from byte[] array correctly.

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

* Add tests for TypedArray.From

* Fix assert descriptions.

* Add TypedArrayTypeCode which is an enum of typed array types.

- Add tests
2019-04-06 10:36:33 +02:00
Marek Safar 1ae3a94254 Reflect shared code changes 2019-04-06 08:07:10 +02:00
Marek Safar fe75f010c2 Move parts of delegate to shared partition (dotnet/coreclr#23552)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-06 08:07:10 +02:00
Bernhard Urban 61100b24e0 [AOT] remove confusing llcopts flag (#13877)
[AOT] remove confusing llcopts flag

Introduced by
https://github.com/mono/mono/commit/2eeaf888c1d0a681c8705bd609f76196d8fb82ed
2019-04-05 16:05:56 -04:00
Jo Shields 0fc2363a4a Merge pull request #13866 from lambdageek/fix-no-gc-unsafe-dl-fallback-register
[mono-dl] Don't do thread state transitions in mono_dl_fallback_register
2019-04-05 15:50:57 -04:00
Alexander Kyte 5f5c51f3ef [merp] Fix image size reported (#13847)
* [merp] Point managed image_size at correct size field

* [merp] Bump merp version number

Fixes #13834
2019-04-05 21:26:13 +02:00
Alexander Kyte 715d33c46e [llvm] Make GOT a typed struct (#13803) 2019-04-05 15:25:09 -04:00
Vlad Brezae 47a0ad469b [interp] Add intrinsics for common object methods (#13762)
GetHashCode is 2x faster while GetType is 10x faster.
2019-04-05 22:10:16 +03:00
Zoltan Varga 25157c4ccd [netcore] Avoid loading the globalization native lib in invariant mode. (#13853)
* [netcore] Avoid loading the globalization native lib in invariant mode.

* Fix a c++-ism.
2019-04-05 14:48:00 -04:00
Filip Navara 7bf675a760 Remove -noappdomain and -noshadow too 2019-04-05 18:00:49 +02:00
Filip Navara b60ca5fb6b Keep the xunit parallelization setting at default value to allow 'Xunit.CollectionBehavior(DisableTestParallelization = true)' override 2019-04-05 18:00:49 +02:00
Alexander Kyte 0cbdcd8e5a [llvm] Give LLVM noalias info about alloc functions (#13801)
From: https://llvm.org/docs/LangRef.html

```
Furthermore, the semantics of the noalias attribute on return values are stronger than the semantics of the attribute when used on function arguments. On function return values, the noalias attribute indicates that the function acts like a system memory allocation function, returning a pointer to allocated storage disjoint from the storage for any other object accessible to the caller.
```

Think this probably helps LLVM reorder the method calls, telling it that allocating won't return a pointer to something else on the stack.
2019-04-05 17:12:34 +02:00
Aleksey Kliger (λgeek) c434294b24 [metadata] Don't free_aggregate_modifiers in mono_metadata_free_type (#13785)
The aggregate modifiers container is owned by a MonoImageSet.  The aggregate
modifiers may be shared by more than one MonoType that happen to need the same
modifiers. (Similar to how generic instantiations are shared)

When the image set is cleaned up the aggregate modifier cleanup will free the
types in the aggregate modifiers container (the call to
free_aggregate_modifiers in mono_metadata_clean_for_image).

With this extra call to free_aggregate_modifiers in mono_metadata_free_type may
cause the same memory to be freed twice.

Fixes https://github.com/mono/mono/issues/13775
2019-04-05 11:01:24 -04:00
Jay Krell 36c5f3f370 Add MONO_PATCH_INFO_TRAMPOLINE_FUNC_ADDR and MONO_PATCH_INFO_SPECIFIC_TRAMPOLINE_LAZY_FETCH_ADDR. (#13794)
* Add MONO_PATCH_INFO_LAZY_FETCH_ADDR and MONO_PATCH_INFO_TRAMP_ADDR.
These are int-based alternatives to MONO_PATCH_INFO_JIT_ICALL_ADDR + sprintf.

This clarifies work to remove the JIT icall hash tables that are used with:
 MONO_PATCH_INFO_JIT_ICALL
 MONO_PATCH_INFO_JIT_ICALL_ADDR
 MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL

making it easier to make those enum-based, indexing a fixed size dense array.

As a related side effect, that could be achieved otherwise,
this fixes apparent leaks.

And clarify MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL slightly, by making
searches for it find one more hit.

That is, those three enums are mostly used with a fixed set of strings.
Except for as in this PR where they are used with indefinite strings.
The removal of the indefinite strings eases replacement of the fixed
set of strings with an enum.

* Bump MONO_AOT_FILE_VERSION.

* PR feedback: Remove unused code and historical commentary.
Also updated PR title with more verbose actual names of the new symbols:
  `MONO_PATCH_INFO_TRAMPOLINE_FUNC_ADDR`
  `MONO_PATCH_INFO_SPECIFIC_TRAMPOLINE_LAZY_FETCH_ADDR`

* Add missing break.
2019-04-05 03:43:28 -04:00
Zoltan Varga 3344bd64c8 [netcore] System.Runtime.InteropServices test fixes. (#13807)
* [netcore] Fix Marshal test failures.

* [netcore] Add exclusions for System.Runtime.InteropServices.Tests.

* [netcore] Make an icall internal.

* Add more test exclusions.

* Address review comments.
2019-04-05 02:13:52 -04:00
Zoltan Varga 22e2cd87a7 [interp] Add more netcore intrinsics. (#13849)
* [interp] Add more netcore intrinsics.

* Address review comments.

* Fix a warning.
2019-04-05 02:13:34 -04:00
Alexander Köplinger 7030a95c84 Fix .vscode/c_cpp_properties.json 2019-04-05 01:04:12 +02:00
Aleksey Kliger 275d1f5d16 [mono-dl] Don't do thread state transitions in mono_dl_fallback_register
1. it doesn't touch the managed runtime

2. it may be called (arguably it ought to be called only) before the runtime is
initialized (and in particular before the current thread is attached).
2019-04-04 18:09:41 -04:00
Vlad Brezae 474305cbce [interp] Fix GetFunctionPointer (#13708)
This method returns a function pointer that can be called with a calli instruction. On interpreter we use a pointer to InterpMethod while on jit we use the native code address. Normally, GetFunctionPointer should return the InterpMethod pointer if called from interp or the native code address if called from jit. Since we don't have any information about the execution engine of the caller, we solve this by intrinsifying all these calls, that happen in the interpreter.

Passing such function pointers between jitted and interp code is probably still unreliable.

Fixes https://github.com/mono/mono/issues/13654
2019-04-04 22:19:50 +02:00
Jo Shields 4b46c5fca4 Merge pull request #13858 from kg/disable-llvmjit-on-ci
Disable llvmjit in the packaging test ci lane so we can turn the lane back on
2019-04-04 16:14:54 -04:00
Katelyn Gadd 5e58ed80c8 Disable llvmjit in this ci lane so we can turn the lane back on 2019-04-04 12:46:45 -07:00
Thays Grazia beb81d3deb [DIM] Do not order implemented interfaces (#13721)
This test https://github.com/dotnet/coreclr/blob/1649da12db73c8c07513c9168cb30ec70c310063/tests/src/Regressions/coreclr/20452/twopassvariance.il

On mono we were ordering the list of implemented interfaces and shouldn't do this as it's described on ECMA-335 Section II.12.2.1 and II.12.2.2.
The ordering was removed on ilasm and some changes were needed on metadata either because it's not ordered anymore.

There were two bugs, one on ilasm and other on class initialization on mono.

### ILAsm ###

If we get the .exe generated by .net Framework it doesn't execute on mono without modifications because we ordered the implemented interfaces list by id. And doing that the order defined on source code is ignored.

If we get the .exe generated by Mono it doesn't execute on .net Framework because on IlAsm we order the list and loose the order defined on source code.

The interfaces on metadata before these changes on IlAsm were like this:
```
1: Fooer1 implements class IFoo<class Derived>
2: Fooer1 implements class IFoo<class Base>
3: Fooer2 implements class IFoo<class Base>
4: Fooer2 implements class IFoo<class Derived>
5: Fooer3 implements class IFoo<object>
6: Fooer3 implements class IBar<class Derived>
7: Fooer3 implements class IBaz<class Base>
8: IBar implements class IFoo<!0>
9: IBaz implements class IFoo<!0>
10: Fooer4 implements IQux
11: Fooer4 implements class IBar<class Derived>
12: IQux implements class IFoo<class Base>
13: IQux implements class IFoo<class Derived>
14: Fooer5 implements IQux
15: Fooer5 implements class IBar<class Derived>
16: Fooer6 implements class IBar<class Base>
17: Fooer6 implements class IFoo<class Base>
18: Fooer7 implements class IFoo<class Base>
19: Fooer7 implements class IBar<class Base>
```

And After the changes they follow the definition order which is the same order of IlAsm for .net framework and .net core.
```
1: IBar implements class IFoo<!0>
2: IBaz implements class IFoo<!0>
3: IQux implements class IFoo<class Base>
4: IQux implements class IFoo<class Derived>
5: Fooer1 implements class IFoo<class Base>
6: Fooer1 implements class IFoo<class Derived>
7: Fooer2 implements class IFoo<class Derived>
8: Fooer2 implements class IFoo<class Base>
9: Fooer3 implements class IBaz<class Base>
10: Fooer3 implements class IBar<class Derived>
11: Fooer3 implements class IFoo<object>
12: Fooer4 implements IQux
13: Fooer4 implements class IBar<class Derived>
14: Fooer5 implements class IBar<class Derived>
15: Fooer5 implements IQux
16: Fooer6 implements class IFoo<class Base>
17: Fooer6 implements class IBar<class Base>
18: Fooer7 implements class IBar<class Base>
19: Fooer7 implements class IFoo<class Base>
```

### Mono vtable layout ###

Internally when Mono computes the interface table for each class, it would previously sort the interfaces by `MonoClass:interface_id` which is a unique id assigned (roughly) in load order.  This was incorrect because the order of the interfaces determines the final vtable for the class.  This PR changes the interface table computation so that the interfaces of a single class are ordered in declaration order, following ECMA. 

One consequence is that we can no longer use binary search with the interface id as the key to find out if a class implements an interface.  We have to do a linear scan. On the other hand, we expect that the number of interfaces implemented by a single class is small in practice.

This is how the Vtable for Fooer1 and Fooer2 looks like after the changes:
```
*** Vtable for class 'Fooer1' at "FINALLY" (size 6)
[O][000][INDEX 000] object:ToString () [0x7fd78681db20]
[O][001][INDEX 001] object:GetHashCode () [0x7fd78681daf8]
[O][002][INDEX 002] object:Finalize () [0x7fd78681dad0]
[O][003][INDEX 003] object:Equals (object) [0x7fd78681daa8]
[I][004][INDEX 000] IFoo:Gimme () [0x7fd786503800]
[I][005][INDEX 000] IFoo:Gimme () [0x7fd7865038c0]
Packed interface table for class Fooer1 has size 2
[000][UUID 078][SLOT 004][SIZE 001] interface IFoo[Base]
[001][UUID 079][SLOT 005][SIZE 001] interface IFoo[Derived]
```
and
```
*** Vtable for class 'Fooer2' at "FINALLY" (size 6)
[O][000][INDEX 000] object:ToString () [0x7fd78681db20]
[O][001][INDEX 001] object:GetHashCode () [0x7fd78681daf8]
[O][002][INDEX 002] object:Finalize () [0x7fd78681dad0]
[O][003][INDEX 003] object:Equals (object) [0x7fd78681daa8]
[I][004][INDEX 000] IFoo:Gimme () [0x7fd7865038c0]
[I][005][INDEX 000] IFoo:Gimme () [0x7fd786503800]
Packed interface table for class Fooer2 has size 2
[000][UUID 079][SLOT 004][SIZE 001] interface IFoo[Derived]
[001][UUID 078][SLOT 005][SIZE 001] interface IFoo[Base]
```

This is how the VTable for Fooer1 and Fooer2 looks like before the changes, as you can see Packed interface table are the same in Fooer1 and Fooer2, so the behavior of both classes was the same:

```
Vtable for class 'Fooer1' at "FINALLY" (size 6)
[O][000][INDEX 000] object:ToString () [0x7fcf3801d920]
[O][001][INDEX 001] object:GetHashCode () [0x7fcf3801d8f8]
[O][002][INDEX 002] object:Finalize () [0x7fcf3801d8d0]
[O][003][INDEX 003] object:Equals (object) [0x7fcf3801d8a8]
[I][004][INDEX 000] IFoo:Gimme () [0x7fcf37c29880]
[I][005][INDEX 000] IFoo:Gimme () [0x7fcf37c29940]
Packed interface table for class Fooer1 has size 2
[000][UUID 076][SLOT 004][SIZE 001] interface IFoo[Base]
[001][UUID 077][SLOT 005][SIZE 001] interface IFoo[Derived]
```

```
Vtable for class 'Fooer2' at "FINALLY" (size 6)
[O][000][INDEX 000] object:ToString () [0x7fcf3801d920]
[O][001][INDEX 001] object:GetHashCode () [0x7fcf3801d8f8]
[O][002][INDEX 002] object:Finalize () [0x7fcf3801d8d0]
[O][003][INDEX 003] object:Equals (object) [0x7fcf3801d8a8]
[I][004][INDEX 000] IFoo:Gimme () [0x7fcf37c29940]
[I][005][INDEX 000] IFoo:Gimme () [0x7fcf37c29880]
Packed interface table for class Fooer2 has size 2
[000][UUID 076][SLOT 005][SIZE 001] interface IFoo[Base]
[001][UUID 077][SLOT 004][SIZE 001] interface IFoo[Derived]
```
2019-04-04 15:38:21 -03:00
Zoltan Varga aba1bac992 [llvm] Fix llvm JIT. (#13835)
[llvm] Fix llvm JIT.

<!--
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
-->
2019-04-04 09:46:06 -04:00
Stephen Toub 463e323a9c Don't null out buffer in MemoryStream on Capacity reset (#23700)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 15:32:31 +02:00
Bernhard Urban 83243d9a3a [fullaot+interp] add Facades to this profile (#13824)
* [fullaot+interp] add Facades to this profile

* [csproj] Update project files
2019-04-04 11:58:53 +02:00
Kenneth Pouncey 55a6457f58 [wasm] Disable debugger tests (#13827) 2019-04-04 11:44:30 +02:00
Sung Yoon Whang 80d5c49c52 Add CPU runtime counter (dotnet/coreclr#23680)
* Add cpu counter

* Fix windows build

* Make the counter just return current CPU usage as %

* Add Unix

* Fix unix build

* Some cleanup

* rename

* fixing some build errors

* some cleanup

* remove unused using

* more cleanup

* newline

* Address PR feedback

* more pr feedback

* More feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 11:35:46 +02:00
Filip Navara 281721bea0 Move null check into separate method to prevent unnecessary conversion of null into ReadOnlySpan (#23616)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 11:35:46 +02:00
Jeremy Koritzinsky d8f557209d Change Auto charset to mean UTF-8 off-Windows (dotnet/coreclr#23664)
Match Mono's behavior by changing the Auto character set to mean UTF-8 on non-Windows platforms (new behavior) and UCS-2/UTF-16 on Windows (current behavior).

Fixes #23464
Fixes dotnet/corefx#32442

Impact of breaking change: It is highly unlikely that anyone is actively using current behavior since it is inconsistent with Mono and doesn't match any native system APIs on non-Windows platforms (they're all UTF-8 based).

We will need to update our documentation to reflect this updated behavior.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 11:35:46 +02:00
Alexander Köplinger e75ba60277 Update csproj file 2019-04-04 11:09:55 +02:00
Jan Vorlicek 2f0ae8e621 Remove s_isProcessExiting and Clear of ALC list at exit
Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 11:09:04 +02:00
Jan Vorlicek 41316a7438 Deliver Unload event at exit for all ALCs
Sending it just for collectible ALCs is not correct at process exit.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 11:09:04 +02:00
Jan Vorlicek a449662610 Fix accidental non-collectible context unloading
The OnProcessExit was iterating over the s_contextsToUnload and calling
Unload on each of the contexts. However the s_contextsToUnload is a
misnomer, it contains all the contexts, both collectible and
non-collectible ones. So we were calling Unload on non-collectible
contexts too there. That resulted in InvalidOperationException being
thrown from the OnProcessExit.

This change fixes that by calling unload only on ALCs whose
IsCollectible returns true. It also renames the s_contextsToUnload to
s_allContexts.

Close #22902

Signed-off-by: dotnet-bot <[email protected]>
2019-04-04 11:09:04 +02:00
Filip Navara 9270f159bf [netcore] Improve support for rare enum types (#13825)
* [netcore] Improve support for rare enum types (IntPtr, UIntPtr, Single, Double, Char, Boolean backing types)

* Add back Intrinsic attribute

* Update Enum.cs
2019-04-04 11:08:07 +02:00
Egor Bogatov 271c4448b4 [netcore] Implement missing Math and MathF methods (#13833)
* Add missing Math(f) methods

* remove extra empty line
2019-04-04 10:37:05 +02:00
Vlad Brezae e6c43065f7 [interp] Optimize static vtype field access (#13769)
We want to avoid calling stackval_to/from methods. Also include the field address in the instruction stream. This makes static vtype field access 10x faster.

Refactor the code a bit.
2019-04-04 11:06:19 +03:00
Alexander Köplinger af92a7fc54 [corlib] Disable EncodingTest.AllEncodingsAreSerializable() on XM4.5 too
(cherry picked from commit 9eb2dbf4cc)
2019-04-04 01:57:21 +02:00
Alexander Köplinger 2f6753a179 Bump bockbuild 2019-04-04 00:12:44 +02:00
Alexander Köplinger 011b333848 Bump linker to latest master (#13818)
(cherry picked from commit 6717c3422a)
2019-04-03 23:42:07 +02:00
Filip Navara c27e3c58c0 [netcore] Implement RuntimeAssembly.InternalLoadAssemblyName 2019-04-03 22:58:41 +02:00
Vlad Brezae cfa75e8ca5 [gsharedvt] Fix sizeof opcode (#13817)
[gsharedvt] Fix sizeof opcode

We were setting the stack type by using another global local named ins.

This lead to missing methods in the aot image due to invalid IL. Fixes https://github.com/mono/mono/issues/13479.
2019-04-03 14:26:00 -04:00
Jo Shields 4c07ca4e46 Merge pull request #13828 from directhex/loadedllvmaot
Add MONO_LLVM_INTERNAL to re-fix LLVM AOT with loadedllvm
2019-04-03 14:09:29 -04:00
Jo Shields 124025fc4d Merge pull request #13750 from directhex/test-installed-prefix-mono
Add tests to ensure `make install` prefix is functional
2019-04-03 13:38:20 -04:00
Jo Shields 656208c004 Add MONO_LLVM_INTERNAL to re-fix LLVM AOT with loadedllvm 2019-04-03 13:19:57 -04:00
Vlad Brezae f98a81b488 [interp] Add intrinsics for Math operations (#13635) 2019-04-03 19:56:35 +03:00
Marek Safar 9bdf6c2c6c [netcore] Simplify runtime and tests synchronization 2019-04-03 17:35:14 +02:00
Alexander Köplingeranddirecthex 4df8ca38d6 Update scripts/ci/run-test-make-install.sh
Co-Authored-By: directhex <[email protected]>
2019-04-03 10:47:10 -04:00
Alexis Christoforides bd25e86727 [MacSDK] Bump bockbuild for fix to https://github.com/mono/mono/issues/13804 2019-04-03 10:41:10 -04:00
Jo Shields 8bd6a288b5 Add tests to ensure make install prefix is functional
Adds 5 quick checks, on prefix-tests tag:
* Build a basic file with mcs
* Build a basic file with Roslyn
* AOT an assembly
* LLVM AOT an assembly (loadedllvm)
* LLVM JIT an assembly (loadedllvm)

This should let us spot regressions affecting installed prefixes sooner
2019-04-03 09:11:54 -04:00
Filip Navara 180915ffa6 [netcore] Improve element type checks in Array.Copy and Array.ConstrainedCopy (#13811)
* [netcore] Improve element type checks in Array.Copy and Array.ConstrainedCopy

* Reshuffle ifs
2019-04-03 12:09:51 +02:00
Ankit Jain 285443b5d4 [nuget] Bump to nuget 5.0.0 2019-04-03 04:26:15 -04:00
Filip Navara ced517784b [netcore] Reenable some methods on RuntimeType 2019-04-03 10:23:56 +02:00
Jan Kotas 757a07c284 Avoid unnecessary SetLastError on PInvokes (dotnet/corefx#36544)
These console PInvokes are used in nearly every app. Omitting unnecessary SetLastError
will save us from generating marshalling stub for them.

Signed-off-by: dotnet-bot <[email protected]>
2019-04-03 10:20:58 +02:00
Filip Navara bd8ec57901 [netcore] Bump SDK version 2019-04-03 10:16:28 +02:00
Jay Krell 5ed727ed8e Rename cabs/cimag/creal to mono_cabs/mono_cimag/mono_creal without macro to rename. (#13663)
Also make cimag/creal macros for guaranteed inlining -- instead of passing structs by value.
And add spaces before parens to follow coding convention (which is designed
to ease low tech searches for entire words).

This was agreed to when the code was first ported to C++ but got dropped.
The compromise though was to put the defines relatively late to limit their impact.
2019-04-03 03:26:28 -04:00
Alexander Köplinger 02946b7ced [bcl] Fix compiling nunitlite when PARENT_PROFILE is defined (#13791)
In this case we relied on nunitlite to be compiled when the parent profile is compiled. That doesn't work however if we compile the child profile first (e.g. during a parallel make) since it'll
complain about missing nunitlite.dll.

We now compile nunitlite in the child profiles too even though we don't use it.
This is an alternative solution to what I tried in https://github.com/mono/mono/pull/5357 since I couldn't get it to work and this should be the easier fix.

It allows us to finally remove the `-i` (ignore errors) from the CI scripts and catch test assembly breakages in mobile profiles which we ignored before.
2019-04-02 21:41:43 +02:00
Jo Shields 688ac23fb6 Merge pull request #13797 from directhex/remove-csc-dim-some-more
Remove csc-dim script, since csc-dim is gone
2019-04-02 14:04:55 -04:00
Filip Navara 02be9aeba3 [netcore] Cleanup + test fixes (#13795)
Avoid using `wget` since it's not installed on macOS by default.
2019-04-02 17:49:20 +02:00
Jo Shields d828e92449 Remove csc-dim script, since csc-dim is gone 2019-04-02 11:20:38 -04:00
Egor Bogatov 3bb6fe8797 [netcore] Fix few Array tests (#13756)
* fix test

* fix tests

* Fix ArgumentNullException empty ParamName

* System.Text.Tests.StringBuilderTests are fine

* fix BlockCopy test

* enable more tests

* Enable more tests

* address feedback
2019-04-02 14:48:53 +02:00
Alexander Köplinger 448cf31a8d [System] Clear MONO_CFG_DIR before starting mcs in CodeDOM CSharpCodeGenerator for XM4.5 (#13742)
* [System] Clear MONO_CFG_DIR before starting mcs in CodeDOM CSharpCodeGenerator

This showed up in the xamarin-macios 2019-02 integration.
When you used Xslt with a custom C# script in a Xamarin.Mac Full application
we'd try to launch mcs via CodeDOM to compile the script.

This started failing in 2019-02 because System.Native (mono-native) wasn't found,
the reason is that XM sets MONO_CFG_DIR to point to the Contents/MonoBundle
in the app bundle where it packages the global config file with dllmaps.

However the started Mono wasn't able to find mono-native since the config
there uses a different name for the file.

To prevent that we now clear MONO_CFG_DIR so it uses the default value for the
mono process we're starting (note that setting it to String.Empty doesn't work)

* Make it specific to XM 4.5
2019-04-02 10:46:07 +02:00
Zoltan Varga df846bcbc9 [netcore] Fixes for System.Reflection tests. (#13776)
* [netcore] Add error checking for assembly version parsing, pass the full 32 bit value to managed code.

* [netcore] Implement RuntimeType.StructLayoutAttribute.

* [runtime] Implement RuntimeFieldHandle.GetValueDirect (), convert SetValueDirect () to handles.

* [netcore] Implement Assembly.GetFiles ()/GetForwardedTypes ().

* [runtime] Handle 'ARM' as a valid architecture in assembly name parsing.

* [netcore] Implement ParameterInfo.MarshalAsAttribute, AssemblyName.EscapedCodeBase.

* [netcore] Add exclusions for System.Reflection.Tests.

* [netcore] Update test exclusions.

* [netcore] Fix CustomAttributeExtensions.

* [netcore] Add a list of passing test suites.

* [netcore] Add a missing argument check.

* Update Object.cs
2019-04-02 09:02:25 +02:00
Krzysztof Wicher b7140b3a9e PermissionSet: follow netfx more in order to avoid workarounds with nullable (#23637)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-02 08:54:54 +02:00
Krzysztof Wicher 9bbfc63c4c Change PermissionSet.SyncRoot to return this instead of null (#23631)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-02 08:36:39 +02:00
Filip Navara a63a85b21d [netcore] Add exception for System.Threading.ThreadPool tests 2019-04-02 00:08:49 +02:00
Filip Navara ed01dc0e92 [netcore] Add exception for System.IO tests 2019-04-02 00:08:49 +02:00
Filip Navara 8b2463b57c [netcore] Add exception for System.Text.Json tests 2019-04-02 00:08:49 +02:00
Levi Broderick b4b41e15d5 Fix bad Debug.Assert statements in UTF-8 processing (dotnet/coreclr#23627)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-01 23:36:28 +02:00
Zoltan Varga cee8934bce [netcore] Fix a number of SRE argument checking failures. 2019-04-01 23:20:38 +02:00
Zoltan Varga 7b2d7dfd6f [netcore] Implement RuntimeMethodInfo.GetPseudoCustomAttributes (). 2019-04-01 23:20:38 +02:00
Zoltan Varga 476514ec98 [sre] Emit custom modifiers for return values. 2019-04-01 23:20:38 +02:00
Acid Chicken (硫酸鶏) 004f1ba107 Add new era in Japan called "Reiwa" (dotnet/coreclr#23614)
* Add new era in Japan called "Reiwa"

* Update Japanese eras English names

refs: <https://github.com/dotnet/coreclr/pull/23614#issuecomment-478680005>

Signed-off-by: dotnet-bot <[email protected]>
2019-04-01 23:05:21 +02:00
Filip Navara a1e65c0559 [netcore] Fix TrySetApartmentStateUnchecked return value 2019-04-01 23:04:41 +02:00
Jo Shields 262a543a17 Fix tarball builds 2019-04-01 15:50:51 -04:00
Alexander Köplinger 7a9cb8f420 Apply API snapshot and csproj changes from https://github.com/mono/mono/pull/13767 2019-04-01 21:45:41 +02:00
Martin Baulig f42f1026cd Add netcore/Makefile to .gitignore (#13771) 2019-04-01 20:14:22 +02:00
Zoltan Varga 37a09e9eb0 [interp] Add Internal.Runtime.CompilerServices.Unsafe intrinsics. (#13732)
[interp] Add Internal.Runtime.CompilerServices.Unsafe intrinsics.
2019-04-01 13:15:52 -04:00
Jay Krell ff1d485b56 Fix a few deficiencies in mono_path_filename_in_basedir. Mainly strstr. (#13719)
* Fix a few deficiencies in mono_path_filename_in_basedir.
The main one is that strstr is too loose.
Add tests.
Make it case insensitive on Win32 and allow some denormal input.
 Note that case sensitivity is a function of file system, not
 operating system, but a lot of code gets it wrong, so here does too.

Add more data to asserts.

Account for test reality -- filename is not absolute.

The Win32 code paths can be tested on Unix and vice versa
w/o compromise. See https://github.com/mono/mono/pull/13707

* Reduce testing per PR feedback.

* Edit/add comments.
This is an attempt to clarify and hopefully doesn't backfire.

* Try to make tests clearer, and stop skipping some oops.

* PR: Restore case insensitivity testing on Windows. Tweak a little bit.

* Include the .c file instead of .h to fix some builds.
2019-04-01 12:43:10 -04:00
Jo Shields c4eb7d679b Merge pull request #13767 from directhex/master
Bump version to 6.3
2019-04-01 11:40:54 -04:00
Jo Shields b198ef5ad6 Bump version to 6.3 2019-04-01 10:43:21 -04:00
Filip Navara acb8dd1183 Fix WASM build (#13763)
Broken by https://github.com/mono/mono/pull/13712.
2019-04-01 12:15:50 +02:00
Alexander Köplinger 7c62c3b838 Update API snapshot 2019-04-01 11:33:15 +02:00
monojenkins df0b3ae630 [bcl] Update BCL Linked Size 2019-04-01 08:12:39 +02:00
Kenneth Pouncey a26ef0b6a1 [wasm] Update to emscripten 1.38.30 2019-04-01 06:02:43 +02:00
Marek Habersack acbeffd073 [sdks,mac] Remove dependency on MXE in favor of MinGW
It turns out that homebrew now has a package for the MinGW gcc-based windows
cross compiler which is awesome as it allows us to skip building MXE and use the
latest version of the GCC suite pre-packaged for Mac. This commit removes almost
all traces of MXE (except for `mxe.mk` itself, because I don't know if any bot
or external tool, whatever, use targets in it) and adds the following brew
packages to SDK bot provisioning as well as to the `provision-mxe` target of
Mono SDKs:

  * mingw-w64
  * xamarin/xamarin-android-windeps/mingw-zlib

The latter package builds a Windows version of zlib using MinGW and it comes
from Xamarin's own homebrew tap at https://github.com/xamarin/homebrew-xamarin-android-windeps/blob/f4cc90845ff1953800d8d71035566a12d9b7aa24/mingw-zlib.rb

Additionally, this commit adds a new `configure` flag: `--with-static-zlib=PATH`
which allows one to specify the static zlib archive to use when linking Mono.
The static archive supersedes the otherwise indicated or detected zlib. This is
the recommended mode of operation for MinGW builds as it avoids problems with
`zlib.dll` versions on the target machine.
2019-03-31 11:51:13 -04:00
Filip Navara 9ccfd778e3 [System.Private.CoreLib/mscorlib] Implement Interlocked.MemoryBarrierProcessWide (#13712)
* Implement Interlocked.MemoryBarrierProcessWide

* Bump MONO_CORLIB_VERSION

* Bump API snapshot submodule
2019-03-31 12:08:51 +02:00
Ganbarukamo41 e894d683f9 Implement IEquatable to Memory and ReadOnlyMemory (dotnet/coreclr#23586)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-31 09:51:23 +02:00
Egor Bogatov 282a9635b3 fix IsPinnable 2019-03-31 09:50:09 +02:00
Marcos Cobeña Morián 4747e3c057 Fixed casing (#13736) 2019-03-30 16:53:24 +01:00
Steve MacLean 7ffd5ed8aa Assembly.Load ALC name (dotnet/coreclr#23574)
Use normalized path for ALC name

Signed-off-by: dotnet-bot <[email protected]>
2019-03-30 00:39:00 +01:00
Alexander Köplinger 5cce664b6f Update System.Net.Http for Watch
(cherry picked from commit 4e3ef48ff0)
2019-03-30 00:13:07 +01:00
Alexander Köplinger bb4a72ae3b Bump binary-reference-assemblies
(cherry picked from commit 0366d7da15)
2019-03-29 23:51:52 +01:00
Alexander Köplinger a2462e19e9 [System.Net.Http] Add IVT to Xamarin.* assemblies and update Mac
NSUrlSessionHandler is in Foundation namespace on XM

(cherry picked from commit 5460d8af74)
2019-03-29 23:48:52 +01:00
Marek Safar 4d7931cd0f enable more tests 2019-03-29 23:30:00 +01:00
Marek Safar c302bfdc66 [netcore] Reorder test targets 2019-03-29 23:30:00 +01:00
Marek Safar b3fc4b1263 [System.Private.CoreLib] Adopt delegate to netcore 2019-03-29 23:30:00 +01:00
Marek Safar ec0618dd9e [System.Private.CoreLib] Fix the type conflicts with corefx types 2019-03-29 23:30:00 +01:00
Jo Shields 37a4bd4c08 Fix for OpenBSD scope error in https://github.com/mono/mono/pull/13633 2019-03-29 16:54:26 -04:00
Martin Baulig ccb95fc05f [wasm]: Disable managed collation on wasm. (#13684)
* The `SimpleCollator` class now implements a new internal interface `ISimpleCollator`.
  In `CompareInfo`, we reference it by that interface everywhere except `GetCollator ()`,
  so we can `#if`-def it out.

  Later on, we will use the linker to do this dynamically with some sort of conditional,
  but even then the interface is required to limit references to the `SimpleCollator` type
  to one single method.

* Add `Mono.Globalization.Unicode/SimpleCollator.cs` to `wasm_corlib.dll.exclude.sources`.

* `corlib/Makefile`: remove collation resources on WASM.

* Added new `[Category ("ManagedCollator")]` to the relevant tests.
2019-03-29 21:31:17 +01:00
Aleksey Kliger (λgeek) 20b523ee9c [arm] Don't use C++ keyword as a variable name (#13744)
Fixes the nightly C++ Jenkins jobs
https://jenkins.mono-project.com/job/test-mono-mainline-linux-cxx/
2019-03-29 16:27:49 -04:00
Alexander Köplinger 41672cbc74 Bump binary-reference-assemblies 2019-03-29 19:43:24 +01:00
Alexander Köplinger 15a0b97b10 [System.Net.Http] Move Mac/iOS specific HttpMessageHandler's to Xamarin.*.dll (#13746)
* Revert "[System.Net.Http] Move NSUrlSessionHandler from xamarin-macios to mono (#13229)"

This reverts commit 5bf74a9954.

* [System.Net.Http] Move Mac/iOS specific HttpMessageHandler's to Xamarin.*.dll

We decided to move these types into Xamarin products since they can't be
used without the underlying infrastructure anyway.

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-29 19:27:07 +01:00
Jo Shields 9ebf3a834c Merge pull request #13747 from directhex/dependency_tracking_is_hard
Add missing assemblies needed by Roslyn snapshot
2019-03-29 14:03:40 -04:00
Jo Shields ece0f7cc26 Add missing assemblies needed by Roslyn snapshot 2019-03-29 14:03:06 -04:00
Jo Shields fbc7da2a3f Merge pull request #13633 from rfht/master
Fix DNS Name Resolution Failure on OpenBSD (GitHub issue #8168)
2019-03-29 13:27:48 -04:00
Filip Navara a7a225ceaf [netcore] Guard for skipFrames overflow, update test exclusions (#13745)
* [netcore] Guard for skipFrames overflow

* [netcore] Remove Timer tests exclusion

* [netcore] Remove unnecessary null check
2019-03-29 17:53:52 +01:00
Katelyn Gadd 0de947787c Add missing roslyn assemblies to mcs package makefile (#13738)
* Add missing roslyn assemblies to mcs package makefile

* Remove deploy step for dynamic interface methods prototype since current roslyn has DIM

Roslyn picked up some new dependencies that I failed to add to a Makefile containing a list of its dependencies. This may fix some scenarios (not covered by CI) that result in csc and/or msbuild not working.
2019-03-29 16:39:11 +01:00
Koundinya Veluri 3eef668848 Change Timer implementation on Unixes to use only one scheduling thread (#7071)
* Change Timer implementation on Unixes to use only one scheduling thread

- Separated from https://github.com/dotnet/corert/pull/7066

* Address feedback from https://github.com/dotnet/corert/pull/7066

* Remove reference to s_lock

* Reduce work inside lock

* Move _id

* Fix duplicate timers in scheduled timer list, move info to TimerQueue

Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 15:21:46 +01:00
Egor Bogatov 8cce577994 Update tests 2019-03-29 14:56:22 +01:00
Filip Navara 7ea8460025 Make the DnsTest more resilient to multi-IP DNS results (#13737)
Sometimes Google DNS is/was returning "dns.google" for reverse query of 8.8.8.8 and 8.8.4.4 instead of the expected "google-public-dns-a.google.com" and "google-public-dns-b.google.com". Since "dns.google" resolves to both 8.8.8.8 and 8.8.4.4 in random order the round-trip tests for IP -> hostname -> IP were failing when they got the other IP.

This changes the logic in the hostname -> IP check to check whether the expected IP is any one of the returned ones (ie. non necessarily the first one).
2019-03-29 14:54:49 +01:00
Tanner Gooding 40532637b9 Updating BuildTools, CoreCLR to preview4-03828-01, preview4-27528-71, respectively (#23536)
* Removing FeedTasksPackageVersion from dependencies.props
* The corresponding metadata was removed in https://github.com/dotnet/coreclr/pull/22884

* Updating BuildTools, CoreCLR to preview4-03828-01, preview4-27528-71, respectively

* Adding a ! in String.Searching.cs

Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 14:46:41 +01:00
Zoltan Varga 77e99d080d [netcore] Ongoing work. (#13731) 2019-03-29 12:47:16 +01:00
Ben Adams 20c9bdc20a Avoid boxing allocations for async in Tier0 (dotnet/coreclr#22984)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 08:04:23 +01:00
Marek Safar afb35526cf Simplify StackFrame class (dotnet/coreclr#23483)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 08:04:23 +01:00
Jan Kotas 9d354a7332 Delete RuntimeThread.cs (dotnet/coreclr#23532)
No longer needed

Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 08:04:23 +01:00
Levi Broderick e2c52c86d3 Improve performance of Marvin32 (dotnet/coreclr#22816)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 08:04:23 +01:00
Sung Yoon Whang 419b334239 Fix increment calculation in IncrementingPollingCounter (#23502)
* Add test for IncrementingPollingCounter

* Fix a bug in Increment calculation in IncrementingPollingCounter

* Remove setting DisplayName property since that's a private property for now

* fix comment

* Remove unused variables

Signed-off-by: dotnet-bot <[email protected]>
2019-03-29 07:56:07 +01:00
Santiago Fernandez Madero cbf08f3dd6 Nullable: System.Object (dotnet/coreclr#23466)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 20:17:41 +01:00
Krzysztof Wicher b2e00ef754 Nullable: all calendars (dotnet/coreclr#23469)
* calendar

* nullable: all calendars

* fix likely corert error

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 20:17:41 +01:00
Santiago Fernandez Madero bc096b344f Nullable: System.Char (dotnet/coreclr#23480)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 20:17:41 +01:00
Egor Bogatov 2522547cd5 [netcore] Improve xtest command (#13703)
The python script now also extracts downloaded zips and `make xtest-%` is now able to consume these artifacts.
E.g.
```
make xtest-System.Collections.Tests COREFX_ROOT=/prj/corefx-repo
```
We still need COREFX_ROOT because of two missing files:
`CoreFx.Private.TestUtilities.dll` and `xunit.console.deps.json`
maybe I should just add them to our repo?

Also this PR fixes `RemoteExecutorConsoleApp` problems for `make xtest-%`
2019-03-28 18:00:34 +01:00
Larry Ewing 49ba9f32ec Merge pull request #13705 from kjpou1/wasm-issue-12871
[wasm] Fix System.DllNotFoundException: libc
2019-03-28 11:44:43 -05:00
Alexander Köplinger f48b0a70c3 [Mono.Runtime.Tests] Remove duplicate file in .sources 2019-03-28 16:40:07 +01:00
simplejackcoder e3471b915d GetPinnableReference on String.cs (dotnet/coreclr#23428)
* GetPinnableReference on String.cs

* Add attributes for debugger and performance

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 16:31:00 +01:00
Jo Shields 7e99ce2960 Merge pull request #13700 from directhex/compress-with-xz
Switch `make dist` format from BZip2 to XZ.
2019-03-28 11:22:09 -04:00
Radek Doulik 4cf13bcd16 [profiler] Add duration=NUM parameter to AOT profiler (#13688)
* [profiler] Add duration=NUM parameter to AOT profiler

It instructs the AOT profiler to write the data after NUM seconds
measured from runtime initialization.

* [profilers] Added aot:duration=NUM parameter description
2019-03-28 10:54:36 -04:00
Alexander Köplinger c6b066a7ab Bump corefx to get unit test reliability fix (#13709) 2019-03-28 15:46:21 +01:00
Jo Shields ac0f7ece35 Merge pull request #13699 from directhex/no-more-monograph
Delete monograph. Closes https://github.com/mono/mono/issues/7845
2019-03-28 10:18:53 -04:00
Maxim Lipnin 03e3608b87 Move checks for empty command text to SqlCommand 2019-03-28 15:02:24 +01:00
Maxim Lipnin b1a0ee371a Throw ArgumentException if there is no active statement during reading a row 2019-03-28 15:02:24 +01:00
Filip Navara 8f99674718 Update Makefile 2019-03-28 14:36:07 +01:00
Filip Navara 141493c473 Separate out common code from pinvoke_probe_for_module_relative_directories into pinvoke_probe_for_module_in_directory 2019-03-28 14:36:07 +01:00
Filip Navara 4648210f3b [netcore] Move P/Invoke directory lookup from mono_dl_fallback to pinvoke_probe_for_module_relative_directories 2019-03-28 14:36:07 +01:00
Filip NavaraandAleksey Kliger 3e05b4ea77 [netcore] Handle NATIVE_DLL_SEARCH_DIRECTORIES for p/invoke
Co-authored-by: Aleksey Kliger <[email protected]>
2019-03-28 14:36:07 +01:00
Jan Kotas 8bad65acb8 Move QueryPerformanceCounter PInvokes to shared (dotnet/corefx#36409)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
buyaa-n e76b69f37b Nullable updates for byte type (dotnet/coreclr#23460)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
buyaa-n 1feba9a019 Nullable changes for boolean type (dotnet/coreclr#23451)
* Nullable changes for boolean type

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
Santiago Fernandez Madero 6b79fcecc8 Nullable: String (dotnet/coreclr#23450)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
Krzysztof Wicher 6ac3ca34e7 nullable: number (dotnet/coreclr#23454)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
Krzysztof Wicher c0f4d63fa0 Nullable: Uint32, (U)Int16, (U)Int64 (dotnet/coreclr#23449)
* Nullable: UInt32

* (U)Int16, (U)Int64

* Make NumberFormatInfo non-nullable

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
Krzysztof Wicher 23b6018c77 Nullable: Int32 (dotnet/coreclr#23443)
* Nullable: Int32

* remove restore and move nullable up front

* remove trailing \n after #nullable to make it easier to remove later

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
Steve MacLean dae859e9e2 ALC Enhancement nits (dotnet/coreclr#23506)
isCollectible default should be false
String should be string

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:13:48 +01:00
Steve MacLean ea3b4ae05f ALC enhancements (dotnet/coreclr#22273)
* Initial implementatation of ALC enhancements

Add public constructor with name
Add Name property
Add Assemblies property
Add All property
Override ToString
Name Default and Assembly.Load(...) ALCs
Add AssemblyLoadContext30Extensions test

Signed-off-by: dotnet-bot <[email protected]>
2019-03-28 14:02:28 +01:00
Vlad Brezae 23aa609af7 [interp] Small changes (#13691)
* [interp] Extract the code pushing lmf in separate function

There is no reason to not optimize the code inside do_icall

* [interp] Remove dead code

Trace ips are filled in mono_handle_exception_internal
2019-03-28 13:12:17 +01:00
Zoltan Varga 34f3b8947c [llvm] Fix the computation of size of gshared instances in another place.
Fixes https://github.com/mono/mono/issues/13610.
2019-03-28 13:07:45 +01:00
Filip Navara d261a9ace1 [netcore] Implement missing functions in RegisteredWaitHandle and EventWaitHandle 2019-03-28 08:30:20 +01:00
Jay Krell 83acc1a343 Restore domain in error path. (#13662)
* In mono_threadpool_enqueue_work_item, if mono_runtime_invoke_checked fails,
still restore domain.

In mono_threadpool_enqueue_work_item, acknowledge with a comment but do not change
that mono_domain_set failing leads to returning success.

In mono_threadpool_enqueue_work_item, refactor for sharing code without loss
of efficiency or hopefully clarity.

* Keep this line duplicated:
`mono_runtime_invoke_checked (unsafe_queue_custom_work_item_method, NULL, args, error);`
2019-03-28 02:20:53 -04:00
Jay Krell 3fae397cce Cleanup mono_marshal_get_icall_wrapper (#13661)
Every caller was consistently forming the same name based on callinfo->name
and passing callinfo->func and callinfo->sig.
Pass callinfo instead and do the common work in mono_marshal_get_icall_wrapper.

This has the following side effects:
 Do not form and free name when there is a cache hit. This seems like a nice optimization.
 Allow name when there is a cache hit. This is unintended. We could assert if it is a problem.
2019-03-28 02:20:35 -04:00
Kenneth Pouncey 4904dac430 [wasm] Fix System.DllNotFoundException: libc
Fixes issue: https://github.com/mono/mono/issues/12871
2019-03-28 06:42:10 +01:00
Zoltan Varga 5433bd030e [runtime] Revert daf92b9e62. (#13696)
Fixes https://github.com/mono/mono/issues/13607.
2019-03-27 23:46:43 +01:00
Jo Shields a9c340a063 Switch make dist format from BZip2 to XZ.
Closes https://github.com/mono/mono/issues/9267
2019-03-27 15:50:25 -04:00
Jo Shields 38fdb39cac Delete monograph. Closes https://github.com/mono/mono/issues/7845 2019-03-27 15:45:06 -04:00
Alexander Köplinger 77cf4cc4f8 [tests] Remove MONOMAC ifdef from BCL tests (#13694)
It was set by xamarin-macios when they were still taking the raw .cs source files
but since we switched to prebuilt binaries we need to replace it with
some define we're actually setting in Mono.

Most cases can be replaced by just XAMMAC_4_5 since MOBILE is defined on the xammac profile.
2019-03-27 20:21:48 +01:00
Jo Shields e40d76cb4a Merge pull request #13673 from directhex/runtime-nupkg
Runtime nupkg generation
2019-03-27 14:39:17 -04:00
Alexander Köplinger e8c660ce90 [mono] Don't try "open" handlers on iOS/Android in ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (#13693)
When you use `Process.Start()` with `UseShellExecute=true` (which is the default on Mono/.NET Framework, but false on .NET Core) then we'd still try to first start the file directly, before falling back to trying the "open" handlers like xdg-open to launch the file.

Presumably we do this so that on mobile you can still start a process without needing to explicitly set `UseShellExecute=false`.

However we don't need to try the fallback on iOS/Android since the "open" handlers won't work there anyway.

This recently showed up on the Xamarin.iOS Mono 2019-02 integration where we started running the `System.Diagnostics.ProcessTest` suite and the `Start1_FileName_NotFound()` would fail at `#C6` because the native error code wasn't 2 (file not found) but 13 (invalid data). This is because it tried
to use `/usr/bin/open` which doesn't work of course so it got to the `mono_w32error_set_last (ERROR_INVALID_DATA)` on L2088.
2019-03-27 19:11:48 +01:00
Jo Shields a48e2c8e10 Add some RID detection, and use it to allow runtime nupkg generation
We cannot presume more than just "linux" or "osx" in our RIDs, because
if we want to enable --host vs --build, we can't detect the OS from
the runtime environment.

This is an okay compromise for now.
2019-03-27 10:28:50 -04:00
Jo Shields 7f04ffa847 Add possibility of generating a runtime .nupkg for Mono (Mac-only right now) 2019-03-27 10:28:50 -04:00
Filip Navara 7a74f15949 [netcore] Fix stack size for new threads 2019-03-27 15:23:59 +01:00
Marek Safar fdc4920d5f [System.Private.CoreLib] Implement exceptions capturing 2019-03-27 15:22:50 +01:00
Maxim Lipnin a9f3b8ca54 Port 13553 "Fix transition offset logic" to master 2019-03-27 14:57:03 +01:00
Filip Navara c45f622d97 [netcore] Fix thread debugging messages 2019-03-27 14:33:54 +01:00
Tanner Gooding e658a7d478 Cleaning up the P/Invoke signatures for QPF and QPC to avoid marshalling and pinning (#36071)
* Cleaning up the P/Invoke signatures for QPF and QPC to avoid marshalling and pinning

* Responding to PR feedback.

* Dropping support for low resolution stopwatch

* Removing BestFitMapping=false

* Removing unneeded unsafe declarations

* Addressing more PR feedback

* Fixing the pal_time header file

* Fixing the Unix P/Invoke signatures for GetTimestamp and GetTimestampResolution to return ulong.

* Fixing GetTimestampResolution to scale the result for HAVE_CLOCK_MONOTONIC

Signed-off-by: dotnet-bot <[email protected]>
2019-03-27 14:32:40 +01:00
lateralusX b98013086e Fix incorrect use of FreeHGlobal on Marshal UTF8 allocated string. 2019-03-27 14:23:44 +01:00
Zoltan Varga c7d6919ceb [netcore] Download test assets from the dotnet-core blob feed. 2019-03-27 14:22:41 +01:00
sancheolz a68389fe9a Fix NRE when combobox was disposed and Text set (#13665)
If combobox already was disposed and we setting Text field there will be NullReferenceException. On .net winforms there no excetions.
2019-03-27 13:02:56 +01:00
Alexander Köplinger 1bc213fac1 [System.Xml] Don't hardcode nunit-lite-console in GeneratedCodeAttribute
Instead determine it at runtime.
2019-03-27 11:39:22 +01:00
Alexander Köplinger 5602acf399 [corlib] Skip FileTest.LastWriteTimeSubMsCopy on older iOS Simulators (#13681)
When we switched to using the corefx System.IO.File implementation we also switched to an implementation that uses the `copyfile()` standard library call on macOS/iOS to copy files. This should preserve file metadata such as timestamps.

However there's a small edge case: when using an older version of the iOS Simulator < 11.0 the `copyfile()` call doesn't copy sub-second timestamps, presumably because older iOS ran on HFS which doesn't support that.
When we run this simulator on modern macOS which uses APFS and thus supports sub-second timestamps the origin file used for the test _does_ have sub-second timestamps and the test would fail.

We now skip the test in such environments.

PS: why did this not fail with the old Mono implementation? We used to always call utimes() on the destination file after copying to copy metadata, which in turn would update the file in the simulator host.
It doesn't seem worth it to replicate that behavior for this small edge case.
2019-03-27 11:26:16 +01:00
Katelyn Gadd e9d847d0f6 Bump roslyn binaries to 3.1.0 and add VBCSCompiler.exe to the set of paths auto-detected by configure.ac (#13518)
* Reconfigure bump for PR test

* Actually bump submodule this time probably

* Bump submodule

* Revert "Bump submodule"

This reverts commit b47679be10d3c38d40673cf73e0dc48a300318bc.

* Bump submodule

* Modify csi-test.csx to manually reference netstandard 2.0, because this is required for some reason

* Checkpoint: Test modifying csi.rsp instead of csi-test

* Git

* Update submodule

* Update submodule compiler path

* Remove binaries-new submodule

* Update to latest roslyn-binaries revision and update path in configure.ac
2019-03-27 09:17:24 +01:00
Zoltan Varga 4bb8637454 [netcore] Fix some thread failures. 2019-03-27 09:15:45 +01:00
Zoltan Varga de89d6dc77 [netcore] Fix ArgumentException argument order. 2019-03-27 09:15:45 +01:00
Zoltan Varga 593853ef06 [netcore] Disable boehm. 2019-03-27 09:15:45 +01:00
Martin Baulig 1af992a5ff Split AppDomain.DoTypeResolve(object) into DoTypeResolve() and DoTypeBuilderResolve(). (#13142)
* Instead of having one `AppDomain.DoTypeResolve(object)` that checks at runtime whether
  the argument is a `string` or a `TypeBuilder`, use two strongly-typed methods
  `DoTypeResolve(string)` and `DoTypeBuilderResolve(TypeBuilder)`.

* Add both to the `corlib/LinkerDescriptor/mscorlib.xml`.

* Adjust the code in `appdomain.c` accordingly.

* Bump corlib version.

This is part of a larger on-going project to improve the linker logic.

The rationale behind this is that the new `AppDomain.DoTypeResolve(string)`
that is being called from `mono_domain_try_type_resolve_name()` should not
reference `TypeBuilder`, to allow the linker to remove some of the
`System.Reflection.Emit` types.
2019-03-27 01:51:38 -04:00
Jay Krell 636160148f Cleanup double semi-colons. (#13660)
Cleanup double semi-colons.
2019-03-26 23:45:42 -04:00
Filip Navara fea837d6d3 Fix sample path 2019-03-26 20:47:21 +01:00
Filip Navara b9b6923a58 Exception stack trace should be null when not thrown yet 2019-03-26 20:47:21 +01:00
Marek Safar 06cdc67e2f [System.Private.CoreLib] Implement StackTrace construction from current thread 2019-03-26 19:52:00 +01:00
Egor Bogatov 2f1c1d3b2c [netcore] Implement Array.Sort (#13674)
* Update Array.cs

* implement Array.Sort
2019-03-26 18:10:23 +01:00
Martin Baulig 22073ed676 Cosmetic: remove accidentally added gensources debugging flag. (#13678) 2019-03-26 18:02:55 +01:00
Bernhard Urban 5e70d5ee51 [intrinsics] sync implementation with IL code (#13647)
* [intrinsics] sync implementation with IL code

Before the intrinsic implemented
```
ldarg.0
ldarg.1
sizeof !!T
mul
conv.i
add
ret
```

now it implements
```
ldarg.0
ldarg.1
sizeof !!T
conv.i
mul
add
ret
```

`conv.i` and `mul` have been swapped. Also see https://github.com/mono/mono/pull/13609

* fix op_sext_i4 usage
2019-03-26 12:30:18 -04:00
Zoltan Varga 9d652a972a [llvm] Fix the computation of size of gshared instances in emit_args_to_vtype (). (#13659)
Fixes https://github.com/mono/mono/issues/13610.
2019-03-26 16:28:59 +01:00
Filip Navara e7011c780f Convert from ucontext_t (or platform equivalent) to MonoContext early and propagate it through 2019-03-26 10:56:49 +01:00
Filip Navara 69abf8f5e4 Preserve the native crash context instead of MonoContext to allow printing managed stack trace later 2019-03-26 10:56:49 +01:00
Filip Navara d8e53c515d [netcore] Change loader behaviour to disable assembly remapping and allow loading newer assembly versions 2019-03-26 09:03:04 +01:00
Marek Safar 86506fbdbd [System.Private.CoreLib] Implement StackFrame initialization 2019-03-26 08:39:15 +01:00
Larry Ewing ed2d3504d6 Merge pull request #13620 from kjpou1/wasm-misc-cleanup
[wasm] Remove specific link to framework file when building test-suite
2019-03-25 13:55:51 -05:00
Bernhard Urban 64e17113b2 [amd64] use 32bit variant of lea_membase for 32bit operations (#13642)
[amd64] use 32bit variant of lea_membase for 32bit operations

Consider
```
 xor %r15, %r15       // %r15 = 0x0
 dec %r15d            // %r15 = 0xffff_ffff
 lea 0x1(%r15), %rdx  // %rdx = 0x1_0000_0000 but should be 0x0
```

instead `lea 0x1(%r15), %edx` should be generated.


Fixes #13452
Fixes #13597
2019-03-25 14:25:43 -04:00
Larry Ewing 05a40c67ea Merge pull request #13636 from kjpou1/wasm-add-bindings
[wasm] [packager] Remove the unnecessary call to add_bindings()
2019-03-25 12:13:01 -05:00
Egor Bogatov e653d48b3a [netcore] Improve xunit console runner (#13648)
* improve xunit runner

* improve xunit runner
2019-03-25 16:40:42 +01:00
Larry Ewing 478656ff1d Merge pull request #13416 from kjpou1/wasm-websocket-tests
[wasm][tests] Add WebSocket tests
2019-03-25 09:12:29 -05:00
Zoltan Varga 1fb3b3b87d [netcore] Add System.Reflection.Emit support. (#13613) 2019-03-25 15:04:36 +01:00
Marek Safar 48b8f5ce47 Revert "Do not use MAP_JIT by default, instead make this something that is toggled by Xamarin.Mac which needs it"
This reverts commit a4c8606767.
2019-03-25 14:56:41 +01:00
Johan Lorensson cae256c3b0 Merge pull request #13571 from lateralusX/lateralusX/add-utc-timezone-on-fallback
Add UTC timezone in WinRT GetSystemTimeZones fallback implementation.
2019-03-25 09:30:47 -04:00
Jay Krell 8feaad70f0 Remove const on struct fields. (#13624)
It is unusual and not useful.
2019-03-25 08:36:38 -04:00
Miguel de Icaza a4c8606767 Do not use MAP_JIT by default, instead make this something that is toggled by Xamarin.Mac which needs it 2019-03-25 12:00:41 +01:00
Johan Lorensson 1ff137d950 Merge pull request #13572 from lateralusX/lateralusX/change-test-spincount
Increase spin-count on test to not end up in frequent sleeps on multicore machines.
2019-03-25 06:48:41 -04:00
Kenneth Pouncey 85d86d2215 [wasm] Remove the unnecessary call to add_bindings() when runtime.js is generated. 2019-03-25 11:38:28 +01:00
Jay Krell 004314e9dd [windows]Fix and cleanup configure.ac parsing for MONO_CORLIB_VERSION and ACINIT. (#13630)
Not just a guid or an uppercase guid.
2019-03-25 10:55:15 +01:00
Bernhard Urban eb1cb188a6 [interp] fix "This greater-than-or-equal-to-zero comparison of an unsigned value is always true" reported by Coverity (#13625)
[interp] fix "This greater-than-or-equal-to-zero comparison of an unsigned value is always true" reported by Coverity
2019-03-25 05:45:59 -04:00
Egor Bogatov ac2fb76ed0 [netcore] Marshal.IsPinnable (#13628)
Needed for MSBuild.
Stream changes were copied from [CoreRT](https://github.com/dotnet/corert/blob/master/src/System.Private.CoreLib/src/System/IO/Stream.CoreRT.cs).
IsPinnable - perhaps it should be an icall/intrinsics for better perf?
[CoreCLR impl for IsPinnable (InternalCall)](https://github.com/dotnet/coreclr/blob/1f3f474a13bdde1c5fecdf8cd9ce525dbe5df000/src/vm/marshalnative.cpp#L257)
[CoreRT impl for IsPinnable](https://github.com/dotnet/corert/blob/master/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs#L114) (and [MightBeBlittable](https://github.com/dotnet/corert/blob/master/src/System.Private.CoreLib/src/System/Runtime/InteropServices/InteropExtensions.cs#L60))
2019-03-25 10:22:54 +01:00
Nick Schonning 47cc95bbb6 typo: Double word "both" (dotnet/corefx#36272)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 65b123d5e9 typo: Double word "never" (dotnet/corefx#36300)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning f1bde8bbaa typo: Double word "to" (dotnet/corefx#36264)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 659cf556ef typo: Double word "that" (dotnet/corefx#36269)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 83133240dc typo: Double word "a" (dotnet/corefx#36271)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 2a659f1cda typo: Double word "in" (dotnet/corefx#36270)
* typo: Double word "in"

* Update src/System.Console/src/System/Console.cs

Co-Authored-By: nschonni <[email protected]>

Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 0f3c093b09 typo: Double word "the" (dotnet/corefx#36274)
* typo: Double word "the"

* Apply suggestions from code review

Co-Authored-By: nschonni <[email protected]>

Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 0719b0209c typo: Double word "this" (dotnet/corefx#36273)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 4b2c08e01b typo: Double word "are" (dotnet/corefx#36275)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 42199a6297 typo: Double word "types" (dotnet/corefx#36276)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 84bc77cabf typo: Double word "is" (dotnet/corefx#36283)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Nick Schonning 32c4104e44 typo: Double word "we" (dotnet/corefx#36288)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Egor Bogatov b3287d7157 [netcore] Semaphore (#13627)
* Update Semaphore.cs

* netcore Semaphore

* Update Semaphore.cs
2019-03-25 08:51:52 +01:00
Nick Schonning 21b1ee3b62 typo: Double word "as" (dotnet/corefx#36277)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 08:34:52 +01:00
Jay Krell fd1baed2af Remove the parsing, hashing, locking, allocations associated with JIT icall signatures. (#13579)
* Remove the parsing, hashing, locking, allocations associated with JIT icall signatures.
Make them statically allocated, single-instanced at compile time, and almost
statically initialized.

Fix C++ and x86.

More x86 fix.

Fix ARMv5.

Undo tedious work to be redone instead of merged from old.

Put all signatures back, prepare for automated conversion.

Replace all the register_icall strings with:

my @a = ("double double",
"long long long",
"long long int32",
"double double double",
"ulong float",
"ulong double",
"long float",
"double int32",
"float float float",
"long double",
"object ptr int int32",
"double ptr",
"int int int ptr ptr ptr",
"int obj ptr",
"int obj",
"int ptr int int ptr object",
"int32 double",
"int32 int32 int32",
"int32 int32 ptr",
"int32 obj",
"int32 object ptr ptr ptr",
"int32 object",
"int32 ptr ptr ptr ptr ptr int32",
"int32 ptr ptr",
"obj ptr int",
"obj ptr",
"object int object object",
"object int object",
"object int",
"object int32",
"object object ptr ptr",
"object object ptr",
"object object",
"object ptr int int int int",
"object ptr int int int",
"object ptr int int",
"object ptr int ptr",
"object ptr int",
"object ptr int32",
"object ptr ptr int32",
"object ptr ptr ptr ptr ptr",
"object ptr ptr",
"object ptr",
"object",
"ptr int",
"ptr obj",
"ptr object int ptr ptr",
"ptr object int32 int32",
"ptr object ptr ptr",
"ptr object ptr",
"ptr object",
"ptr ptr int ptr",
"ptr ptr int",
"ptr ptr int32",
"ptr ptr ptr ptr",
"ptr ptr ptr",
"ptr ptr",
"ptr",
"uint32 double",
"uint32 ptr int32",
"void double ptr",
"void int",
"void int32",
"void obj ptr",
"void object object ptr",
"void object object",
"void object ptr int32 int32",
"void object ptr int32",
"void object ptr",
"void object",
"void ptr int int object",
"void ptr int object",
"void ptr int ptr",
"void ptr int",
"void ptr int32",
"void ptr object int32",
"void ptr ptr int",
"void ptr ptr int32",
"void ptr ptr ptr",
"void ptr ptr",
"void ptr",
"void ptr object",
"void",
);

while (my $line = <>)
{
	if ($line =~ /register|mono_create_icall_signature/ && $line =~ /"/)
	{
		for my $from (@a)
		{
			my $to = "mono_icall_sig_$from";
			$to =~ s/ /_/g;
			$to =~ s/"//g;
			$to =~ s/"//g;
			$to =~ s/"//g;
			$line =~ s/\Q"$from"\E/$to/;
		}
	}
	print($line);
}

Remove whitespace from end of line.

Convert the strings to smaller arrays, of chars now,
that are scaled offsets into MonoDefaults, or -1 for ptrref.

Use smaller encoding.

fix merge

cleanup

* Larger representation that handles alignment.

* Try to undo external changel.

* Fix AOT.

* Fix code search and comments

* Restore warning in this PR.

* More ARM signatures.

* Change representation from pointer to offset.
  Use sizeof for the special case ptrref.
Comments. Perhaps too much.
asserts. Perhaps too much.
A little bit more verbose/readable but essentially the same thing otherwise.
 Perhaps too verbose.

* The initializer all-but-must be pointer-sized.
Even if the values fit in much smaller.
Add comments.
On obscure systems size_t is smaller than a pointer so
gsize or uintptr_t is required. Use gsize.

* Spaces before parens.

* PR: Use enum instead of offsetof.
Use may_alias some.
mono builds with -fno-strict-aliasing, but we had recent
aliasing problem (the enum operators with older g++)
and this looks a little hazardous

We could also have a separate integer or array of byte or array of integer or perhaps string
to resolve the aliasing.

integer: 16 values, 8 max -- could just use an int instead of this array business,
but the representation would be full with no room for expansion.
We are not wasting any/much memory here -- maybe one word per the 200 signatures,
because of sloppyness around any_size_array.

Work a little on dealiasing.
Comment some aliases and make obj/object, int/ptr, bool/boolean share values.

* tweak: Compute all the values once and then directly index small local array.

* Adjust comments to new reality.
Add comments explaining aliasing.

* Add casts to attempt to abide by strict aliasing rules.
2019-03-24 23:16:32 -04:00
thfrwn 6d3aa51dd3 Fix DNS Name Resolution Failure on OpenBSD (GitHub issue #8168) 2019-03-24 17:10:22 -07:00
Kenneth Pouncey 5e61de3a2c Modify packager to load the .pdb files for framework packages. (#13608) 2019-03-24 08:33:27 +01:00
リーフストーム 0b58483fa8 Fix handle leak in cominterop (#13536) 2019-03-23 15:15:57 -04:00
Alexander Köplinger d4953f63ca [sdks] Easier labels for pipeline parts 2019-03-23 10:42:42 +01:00
Alexander Köplinger afdf77b053 [sdks] Build Android Linux Mono SDKs package on CI 2019-03-23 10:30:45 +01:00
Levi Broderick 6ddc22cefe Replace slow implementations in ASCIIUtility with fast implementations (#22516)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-23 09:56:52 +01:00
Jérôme Laban 5134c0fec6 Include the corebindings.c in the package output (#13606)
This update restores the ability to use the packager outside of the mono source tree.
2019-03-23 07:11:01 +01:00
Alexander Kyte 0eac33443d [runtime] Add MONO_LLVM_INTERNAL to *get_aot_init_wrapper* marshal funcs (#13611) 2019-03-23 01:36:58 -04:00
Kenneth Pouncey 1b7c7561ab Remove specific link to framework file when building test-suite 2019-03-23 05:32:51 +01:00
Tarek Mahmoud Sayed 612c1b9f42 Apply Optimization in Index.GetOffset suggested by Levi (#23349)
* Apply Optimization in Index.GetOffset suggested by Levi

* Add Comment

* address the feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-03-22 23:30:09 +01:00
Marek Safar 871975de4e Adopt to shared Exception 2019-03-22 23:27:38 +01:00
Marek Safar 7541d7e5fb Move Exception to shared partition (dotnet/coreclr#23361)
* Move Exception to shared partition

* Remove class name caching

* Not useful comments removal

Signed-off-by: dotnet-bot <[email protected]>
2019-03-22 23:27:38 +01:00
Andrew Hoefling 8fe79b4c8e Updated Exception Handling for Collection<T> (dotnet/coreclr#23290)
* Updated Argument Helper param from list->collection since the parameter name is collection

* Updated exception message to use an out of range exception that doesn't explicitly reference a list

* Simplified if statements that verify if the index is out of range

* Updated if logic to be simplified using (uint)

* Updated exception handling to throw ThrowHelper.ThrowArgumentOutOfRange_IndexException() when the ExceptionArgument was 'Index'

Signed-off-by: dotnet-bot <[email protected]>
2019-03-22 23:27:38 +01:00
Thays Grazia 4abc661805 [DIM] Method call of a class that implements a protected nested interface (#13558)
* Unexpected System.MethodAccessException is thrown for a method call of a class that implements a protected interface inside another interface.

```
public interface I1
{
    protected interface T1
    {
        void M1();
    }

    protected class T2
    {}

    protected struct T3
    {}

    protected enum T4
    {
        B
    }
}

class Test1 : I1
{
    static void Main()
    {
        I1.T1 a = new Test2();
        a.M1();
        System.Console.WriteLine(new I1.T2());
        System.Console.WriteLine(new I1.T3());
        System.Console.WriteLine(I1.T4.B);
    }

    class Test2 : I1.T1
    {
        public void M1()
        {
            System.Console.WriteLine("M1");
        }
    }
}
``


Fixing this case Test1 implements I1<int> but can access methods from I1<object>
public interface I1<X>
{
    protected interface T1
    {
        void M1();
    }

    protected class T2
    {}

    protected struct T3
    {}

    protected enum T4
    {
        B
    }
}

class Test1 : I1<int>
{
    static void Main()
    {
        I1<object>.T1 a = new Test2();
        a.M1();
        System.Console.WriteLine(new I1<object>.T2());
        System.Console.WriteLine(new I1<object>.T3());
        System.Console.WriteLine(I1<object>.T4.B);
    }

    class Test2 : I1<object>.T1
    {
        public void M1()
        {
            System.Console.WriteLine("M1");
        }
    }
}
2019-03-22 18:37:16 -03:00
Marek Safar 1a4014dbc0 Move Buffer constants to platform specific files (dotnet/coreclr#23352)
* Move Buffer constants to platform specific files

* Add explicit access modifier

Signed-off-by: dotnet-bot <[email protected]>
2019-03-22 21:57:24 +01:00
Aleksey Kliger (λgeek) d465a7ad65 [aot] cleanup MonoError in add_extra_method_with_depth (#13605)
I missed something in the code review for #13581.  Need to cleanup MonoError if it's not ok.
2019-03-22 21:24:56 +01:00
Egor Bogatov e72d6d9e1c [netcore] Implement missing bits in Mutex (#13591)
Needed for xunit console runner tool.
2019-03-22 18:54:20 +01:00
Zoltan Varga b4f4acc133 [aot] Avoid an assert which can happen in normal usage. (#13581)
Fixes https://github.com/mono/mono/issues/13455.
2019-03-22 16:02:15 +01:00
Alexander Köplinger c8508e56b6 [ci] Build macOS .pkg PR builds on a separate bot (#13600)
This allows us to get faster results.
2019-03-22 15:19:24 +01:00
Alexander Köplinger a766d2e802 Bump linker to latest master (#13594)
* Bump linker to latest master

The linker source were reorganized a little bit, e.g. sources in src/

* [csproj] Update project files
2019-03-22 10:10:08 +01:00
Vlad Brezae 216e4aa405 [interp] Make transform phase more flexible (#13516)
* [interp] Fix instruction length

* [interp] Don't generate directly into linear code stream

Allocate each instruction into the mempool and link them together. At the end of code generation and after all potential optimisation passes, we will compact this code into its final form.

* [interp] Add support for branch relocations

For each branch instruction, we store in its data field the il offset that we are branching to. During the final code generation, we resolve all backward branches and add relocs for forward branches. These relocs are then resolved after all instructions have been emitted in the final code stream.

* [interp] Extract vararg call code in separate instruction

It requires a different instruction size and is extremely rare code.

* [interp] Fix backwards branch with large offset

We were adding an unsigned instead of subtracting.

* [interp] Fix line numbers

For each il offset that generated interpreter instructions we store the native offset, during the compaction phase.

* [interp] Fix seq points

We have to defer SeqPoint data creation during the compact generation phase, because that's when we have native offset information. We add a flags field to the interpreter instruction to store any relevant information coming from the compilation phase.

* [interp] Make verbose logging a bit nicer

We no longer have the native offset during the first IL instruction interation. Maybe we should bring back logging for the IL -> IR mapping during the compaction phase.

* [interp] Remove some dead code
2019-03-22 10:06:10 +02:00
Kenneth Pouncey 31cb0e28a5 Fix indentation to address review comments 2019-03-22 05:13:12 +01:00
Jo Shields 21cfdbe81c Make test runner able to deal with whitespace patterns other than newline (#13587)
Helix wasn't running our runtime tests as expected, because the test runner expected newline-separated tests to run, and we were generating space-separated.

Following "be liberal in what you accept" philosophy, and to prevent this issue in the future, just deal with "whitespace separated" rather than "this specific whitespace and no other"
2019-03-22 00:23:28 +01:00
Alexis Christoforides c803e6f75b Xamarin.Android integration fixes (#13589)
Backport of #12940.

- Disable other failing tests (they are tests that are newly added, not regressions)
- Look for mono_pal_init() directly in the System.Native library
- [configure] Have libmono-native depend on libmono(-sgen) for the Android build
If this is not done, Android is not able to resolve mono symbols that are used in mono-native (e.g. mono_add_internal_call_with_flags), and will refuse to load the library with 'cannot locate symbol' errors
2019-03-22 00:15:08 +01:00
Egor Bogatov 0fc15b168f [netcore] Xunit console runner (#13592)
* xunit console runner

* add more xunit args

* use rsp file
2019-03-21 23:43:48 +01:00
Zoltan Varga 53bef4aec4 [llvmonly] Add gsharedvt in wrappers to calls which could go to the interpreter. (#13548)
[llvmonly] Add gsharedvt in wrappers to calls which could go to the interpreter.

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




<!--
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
-->
2019-03-21 15:56:06 -04:00
Vlad Brezae 8423f0e9a0 [interp] Enable compile all debug option also on interp (#13570)
[interp] Enable compile all debug option also on interp
2019-03-21 12:05:48 -04:00
Kenneth Pouncey 2b37e1c0b5 Add tests for send and receive of text and binary messages. 2019-03-21 16:37:36 +01:00
Johan Lorensson 7e8d4303fa Couple of fixes to LLVM AOT compiler on Windows x64. (#13474)
* Enable MSVC objects on LLVM >= 6.00
* Always used PIC relocation-model on Windows x64 due to LLVM problem with
static triggering incorrect ADDR32 relocation entries in 64-bit objects.
* Add CodeView symbol format instead of DWARF for Windows x64.
* Fix LLVM outfile when doing static link to not end up in temp directory.
* Only add /DEFAULTLIB when using MSVC and not doing static compile. For
static compile the needed libraries must be added when objects get's linked
and since the needed libraries are c-runtime libraries, should be transparent
for most applications consuming the object files.
2019-03-21 10:05:01 -04:00
Kenneth Pouncey 6513fffcd7 Add tests for
- Client Close
- Host Close with CloseStatus and CloseStatusDescription filled in from Host.
2019-03-21 14:22:31 +01:00
Bernhard Urban 5852d1cf74 [arm] respect potential spilling for overflow flag check (#13564)
[arm] respect potential spilling for overflow flag check

```
  18 int_sbb R77 <- R54 R57
  19 store_membase_reg [arm_fp + 0x24] <- R77
  20 cond_exc_c OverflowException
```
this wasn't properly handled by the arch lowering pass.

Fixes https://github.com/mono/mono/issues/13284
2019-03-21 08:15:31 -04:00
Nikita Voronchev 037faa47cc [WinForms] Related Forms closing issue (#13150) (#13151)
Fixes #13150
2019-03-21 12:57:55 +01:00
lateralusX b554e0ea2c Increase spin-count on test to not end up in frequent sleeps on multicore machines. 2019-03-21 11:43:55 +01:00
lateralusX 33ea64cf7e Add UTC timezone in WinRT GetSystemTimeZones fallback implementation.
Needed by tests when hitting fallback solution in TimeZoneInfo.WinRT.cs.

Fix also sort the TimeZones similar to how its done in .NET Framework/Core.
2019-03-21 11:38:29 +01:00
Zoltan Varga 6a0a5bf3ca [netcore] Implement/fix enum/nullable comparers. 2019-03-21 11:33:34 +01:00
Zoltan Varga a6dc1cec3b [netcore] Implement RuntimeAssembly.GetSatelliteAssembly (). 2019-03-21 11:33:34 +01:00
Zoltan Varga 622bb8d5d5 [jit] Add JitHelpers.EnumEquals ()/EnumCompareTo () intrinsics. 2019-03-21 11:33:34 +01:00
Egor Bogatov 36a62bbf8a [netcore] Implement missing bits in ThreadPool (#13566)
* implement missing bits in ThreadPool

* remove [SecurityCritical]
2019-03-21 11:29:43 +01:00
Kenneth Pouncey 7dbcf1ed4b Add more tests for websockets. 2019-03-21 11:02:43 +01:00
Kenneth Pouncey a15526af3a [wasm][websockets]Fix Error Code not reported correctly with ClientWebSocket 2019-03-21 11:01:24 +01:00
Jan Kotas f2065c849a Hoist calls to IsBitwiseEquatable (dotnet/coreclr#23381)
Smaller IL is easier for JIT

Signed-off-by: dotnet-bot <[email protected]>
2019-03-21 08:10:47 +01:00
Marek Safar 701ca04b36 Update with shared partition changes 2019-03-21 08:05:14 +01:00
Jan Kotas 48114c0375 Unify EnumInfo and NamesAndValues
Signed-off-by: dotnet-bot <[email protected]>
2019-03-21 08:05:14 +01:00
Alexander Kyte 42c3b73ac1 [merp] Fix anon allocation, use MAP_PRIVATE 2019-03-21 07:48:25 +01:00
Egor Bogatov 8cf878ff50 advanced MemberData support 2019-03-21 07:46:56 +01:00
Bernhard Urban 4111910dd8 [llvm] dump bitcode file even if verifier fails (#13556)
[llvm] dump bitcode file even if verifier fails

This can be useful for debugging issues in the products.
2019-03-20 19:45:39 -04:00
Johan Lorensson d3a2841e93 Adjust genconst to changes in winsetup.bat. (#13554)
When logic moved from winsetup.bat into an msbuild task that changed the
console output of winsetup.bat causing problems for genconst to find
MONO_VERSION and MONO_CORLIB_VERSION. There was also a potential problem
where winsetup.bat couldn't find msbuild.exe if not included in PATH.

This fix makes sure winsetup.bat detect and setup a full msbuild environment
before running msbuild.exe. It also change genconsts to look at the generated
config.h for the correct values of MONO_VERSION and MONO_CORLIB_VERSION that
will be used by the runtime builds.
2019-03-20 18:48:20 -04:00
Bernhard Urban 00d871d103 [ssa] avoid code motion to try-blocks (#13555)
[ssa] avoid code motion to try-blocks

Consider
```
BB4:  // successor BB5, BB9
[...]
br [B9]

BB5: // catch handler block for BB4
[...]
br BB9

BB9:
aotconst R90
gc_safe_point R90
[...]
```

Previously, our invariant code motion pass would move `aotconst R90` to the end of BB4. Unfortunately, BB4 contains instructions that can cause an exception and thus control flow is broken and continues to BB5. `aotconst R90` wouldn't be loaded correctly in this scenario.

When lowered to LLVM IR this is more obvious, and the verification pass of LLVM catches this.

Fixes https://github.com/mono/mono/issues/13460
2019-03-20 18:45:47 -04:00
Thays Grazia 4e13c53451 [dim] System.MethodAccessException is thrown for a protected method declared in an interface (#13513)
* ```
interface I1<T>
{
    sealed protected void M1()
    {
        System.Console.WriteLine("M1");
    }
}

interface I3<T> : I1<T>
{}

interface I2<T> : I3<T>
{
    static void Test(I2<int> x)
    {
        x.M1();
    }
}

class A : I2<int>
{
    static void Main()
    {
        I2<byte>.Test(new A());
    }
}
```
When a interface implements another interface and they are generics, we don't need to check the datatypes of generics, we only need to check the inheritance.
Fixes 13467

* Adding test.

* Using the getter functions

* Initializing klass->interfaces/interfaces_count.

* Update mono/metadata/class.c

Co-Authored-By: thaystg <[email protected]>

* Fixing side effect on dim-simple.il
2019-03-20 18:08:51 -04:00
Aleksey Kliger (λgeek) 60221d88d5 [aot] Fix a few memory leaks (#13514)
1. aot-compiler: don't leak `MonoCustomAttrInfo`

2. aot-runtime: don't leak sigs when decoding wrapper references.  All of these cases we decode a sig (which uses malloc), and then call some method that immediately calls `mini_get_underlying_signature` which dups the sig, so the one from the decode isn't needed anymore.
2019-03-20 16:50:25 +01:00
Alexander Köplinger 242596b243 Bump corefx 2019-03-20 12:10:31 +01:00
Johan Lorensson a0e999549e Merge pull request #13529 from lateralusX/lateralusX/fix-mixup-global-cotask-alloc
Fix mixup of Global Free and CoTaskMem Alloc in Marshal's Secure String implementation.
2019-03-20 05:44:35 -04:00
Egor Bogatov b87bd4f6e4 [netcore] Allow all primitive types to be passed to Buffer.BlockCopy (#13544)
* Update Buffer.cs

* allow all primitive types to be passed to BlockCopy

* convert Len to bytes
2019-03-20 08:41:58 +01:00
Egor Bogatov 8b4eef9387 [netcore] Initial MemberDataAttribute support (#13543)
This PR adds ~2200 tests to System.Runtime.Tests and ~1000 to System.Collections.Tests
2019-03-20 08:40:46 +01:00
Thays Grazia b811e645a3 When it is a sealed method in Interface it's not Static nor Virtual and shouldn't add virtual.
Fixes #13508
2019-03-20 08:36:21 +01:00
Alexander Köplinger 8aaf420efe Fix Windows MSI build 2019-03-20 01:49:26 +01:00
Thays Grazia 86e7400525 [metadata][dim] Unexpected System.NotSupportedException in presence of default interface implementations (#13468)
* namespace Application
{
	public interface I1 { void M1() { System.Console.WriteLine("Unexpected!!!"); }}

	public interface I2 : I1 { void I1.M1() { System.Console.WriteLine("I2.I1.M1"); }}

	public interface I3 : I1 { void I1.M1() { System.Console.WriteLine("I3.I1.M1"); }}

	public interface I4 : I1 { void I1.M1() { System.Console.WriteLine("I4.I1.M1"); }}

	class Test10 : I1, I2, I3, I4 { public void M1() { System.Console.WriteLine("Test10.M1"); } }

	class MainClass {
		public static void Main(string[] args)
		{
			I1 var = new Test10();
			var.M1();
		}
	}
}

The interface method M1 is overridden at I1, at I2, at I3, at I4. The class Test10 overrides method M1 so regardless of having methods overriden in interface, the method of the class should be priority in this case. And then I remove the conflicts because there is not a conflict anymore.
2019-03-19 19:26:09 -03:00
Egor Bogatov 3a2d027e5e fix literals 2019-03-19 23:13:58 +01:00
Sung Yoon Whang dd6a9063c9 Remove timer in RuntimeEventSource (dotnet/coreclr#23311)
* Change RuntimeEventSource's counter types

* cleanup

* cleanup

Signed-off-by: dotnet-bot <[email protected]>
2019-03-19 23:02:11 +01:00
Grant 0584d63bf1 Trim/TrimStart/TrimEnd methods for Memory and Span (dotnet/coreclr#22798)
* Span.Trim

* Add another helper

* Remove redundant comments

* Optimize Trim(ReadOnlySpan<char>)

* Suggested overload for byte

* CR fixes

* CR fix

* Add Span overloads

* Add Memory overloads

* CR

* Rename method

* Optimization

* Tweaks

* Refactor

* Opt

* Use 2 helpers

* CR fixes

* CR fixes

* Nits

* CR fixes

* remove in params

* Bug

* Bug

* Move Trim methods to their own dedicated file

* Add char overloads

* Use Contains

* CR fixes

* Optmize ClampNull

* Nit

* Revert optimization

* Make existing implementations consistent with new

* Revert existing methods

* Move helpers

* Span, Memory and RoM should use consistent pattern

* POC for changing RoS

* Revert POC

* Use consistent idiom

* More inlining of explaining vars

* Use expression body for existing code

* CR fixes

* Nit

* Grammar

* CR fixes

* Fix perf bug in existing code

* Perf fix

* Force CI build

* Force CI

Signed-off-by: dotnet-bot <[email protected]>
2019-03-19 22:29:01 +01:00
Egor Bogatov 2785cdbd30 fix typo 2019-03-19 22:27:50 +01:00
Alexander Köplinger a0f593958b [ci] Fix wrong redirect which would overwrite Make.config 2019-03-19 21:53:40 +01:00
Alexander Köplinger dbc3c1a1cd [sdks] Build mac in Mono SDKs (#13535)
Enables building of the xammac runtime and BCL/tests into the SDKs archive.

Contributes to #11397
2019-03-19 20:44:42 +01:00
Bernhard Urban 4cd5068230 [aot] force v7 on arm when using LLVM on iOS (#13521)
[aot] force v7 on arm when using LLVM on iOS

In https://github.com/mono/mono/pull/11172 we added passing `-march=arm` to `llc`, so that newer LLVM would generate code correctly for the target arch. Unfortunately this seems to break older LLVM, that is still used for 32bit code on Xamarin.iOS. For iOS we need to force it to armv7, otherwise it will try to substitute certain locking primitives with builtins that aren't available as hardware instructions on armv5.


Before this change:

```console
$ nm ./obj/iPhone/Release/mtouch-cache/armv7/mscorlib.dll-llvm.o | grep sync_
         U ___sync_fetch_and_add_4
         U ___sync_lock_test_and_set_4
         U ___sync_synchronize
         U ___sync_val_compare_and_swap_4
00079e1c T _mscorlib_System_Runtime_CompilerServices_AsyncMethodBuilderCore_ThrowAsync_System_Exception_System_Threading_SynchronizationContext
00057f80 T _mscorlib_System_Threading_SemaphoreSlim_WaitAsync_int_System_Threading_CancellationToken
00058430 T _mscorlib_System_Threading_SemaphoreSlim_WaitUntilCountOrTimeoutAsync_System_Threading_SemaphoreSlim_TaskNode_int_System_Threading_CancellationToken
         U _p_1214_plt_mscorlib_System_Threading_SemaphoreSlim_WaitAsync_int_System_Threading_CancellationToken_llvm
         U _p_1217_plt_mscorlib_System_Threading_SemaphoreSlim_WaitUntilCountOrTimeoutAsync_System_Threading_SemaphoreSlim_TaskNode_int_System_Threading_CancellationToken_llvm
         U _p_1735_plt_mscorlib_System_Runtime_CompilerServices_AsyncMethodBuilderCore_ThrowAsync_System_Exception_System_Threading_SynchronizationContext_llvm
         U _p_1976_plt_mscorlib_System_Threading_SemaphoreSlim_WaitAsync_llvm
         U _p_37_plt_mscorlib__jit_icall_ves_icall_thread_finish_async_abort_llvm

```

After this change:

```console
$ nm ./obj/iPhone/Release/mtouch-cache/armv7/mscorlib.dll-llvm.o | grep sync_
0007008c T _mscorlib_System_Runtime_CompilerServices_AsyncMethodBuilderCore_ThrowAsync_System_Exception_System_Threading_SynchronizationContext
00050654 T _mscorlib_System_Threading_SemaphoreSlim_WaitAsync_int_System_Threading_CancellationToken
00050ab4 T _mscorlib_System_Threading_SemaphoreSlim_WaitUntilCountOrTimeoutAsync_System_Threading_SemaphoreSlim_TaskNode_int_System_Threading_CancellationToken
         U _p_1214_plt_mscorlib_System_Threading_SemaphoreSlim_WaitAsync_int_System_Threading_CancellationToken_llvm
         U _p_1217_plt_mscorlib_System_Threading_SemaphoreSlim_WaitUntilCountOrTimeoutAsync_System_Threading_SemaphoreSlim_TaskNode_int_System_Threading_CancellationToken_llvm
         U _p_1735_plt_mscorlib_System_Runtime_CompilerServices_AsyncMethodBuilderCore_ThrowAsync_System_Exception_System_Threading_SynchronizationContext_llvm
         U _p_1976_plt_mscorlib_System_Threading_SemaphoreSlim_WaitAsync_llvm
         U _p_37_plt_mscorlib__jit_icall_ves_icall_thread_finish_async_abort_llvm
```

Fixes https://github.com/mono/mono/issues/13478
2019-03-19 12:46:00 -04:00
Alexander Kyte 04d65f2986 [runtime] Default llvm to self-init+direct native calls (#13312)
* [runtime] Default llvm to self-init

Now the init code is behind llvm_plt_init. Setting
--aot=llvm-plt will bring back the legacy llvm+plt behavior

* [llvm] Mark managed methods no-inline by llvm

* [runtime] Clean up self-disabling machinery

* [llvm] Skip self-init on cctors

* [runtime] Always make ctors call their cctors

* [runtime] Improve mono_print_unwind_info, add cases

* [runtime] Fix too-early eager calling of cctors

We emitted all of the lazy checks and init around a specific static
method, but still were initializing it when we initialized methods
that access it. This made static cctors run before they were supposed
to.

The problem was that the call site here has method == NULL, because
we don't compute it. That's expected, as we don't compute the method
along this path.

This initial "&&" looks like it was supposed to avoid calling the method
on a null MonoMethod reference. This preserves that, while fixing the
control flow issues.

* [runtime] Associate init_method native code with MonoMethod

* [runtime] Future-proof against aot init wrapper subtype mixups

* [runtime] Fix goto in AOT-init change for c++

* [runtime] Move docs for llvm-disable-self-init into runtime

* [runtime] Fix bitcode, remove unneeded wrapper around init icall

* [llvm] Include global prefix in init name

* [comment] Describe debugging usage of llvm self-init disable flag

* [aot] Consolidate mangler string append lines

* [llvm] Make self-init documentation changes

* [llvm] Rename self-init funcs, mini_llvmonly_ to mini_llvm_

* [runtime] Enable inlining for methods without init
2019-03-19 11:13:11 -04:00
lateralusX d4e5d14569 Fix mixup of global and cotask mem alloc heaps in Marshal's Secure String. 2019-03-19 15:53:23 +01:00
Bernhard Urban 6cb5c7f9cf [llvm] fix field init for platforms where unbox_trampolines tables are not used (#13527)
Fixes https://github.com/mono/mono/issues/13522
2019-03-19 15:31:44 +01:00
Kenneth Pouncey d4dec33b84 Merge branch 'master' of https://github.com/mono/mono into wasm-websocket-tests 2019-03-19 14:38:15 +01:00
Zoltan Varga 7a5487b966 [netcore] Ongoing work. (#13509)
* [netcore] Avoid casting to generic parameters in gen-xunit-runner.

* [netcore] Make the build-/run- targets more generic, add support for more test suites.

* remove NIE from Exception

* [netcore] Convert gen-xunit-runner to use roslyn for code generation instead of codedom.

* [netcore] Add check target to run all test suites.
2019-03-19 12:19:33 +01:00
Vsevolod Kukol 8a292ff635 Bump bockbuild to fix Gtk NSView embedding on Mac (#13511)
This fixes mouse event handling for NSViews embedded in Gtk.

Fixes VSTS #802376
Fixes VSTS #821841
2019-03-19 10:23:59 +01:00
Alexander Köplinger 31516f0b3e Reduce number of classes in winaot mscorlib. (#13341)
* Reduce number of classes in winaot mscorlib.

Winaot profile should be a Windows AOT friendly profile close to mobile
and consoles. At some point it was set to include the full net_4_x that
cause problems on none desktop platforms. This fix reduce the set to only
include classes similar to mobile and console profiles.

* Reverting changes to TimeZoneInfo test when reducing classes in corlib winaot.

* Move SafePasswordHandle to win32_build_corlib profile.

* Excluded some additional none Windows sources from win32_build/winaot profile.
2019-03-19 10:07:13 +01:00
monojenkins cecd6b316f [csproj] Update project files 2019-03-19 09:06:36 +00:00
Levi Broderick 909cae3de9 Add Utf8String skeleton (dotnet/coreclr#23209)
Utf8String is an experimental type that is string-like (heap-allocated, immutable, variable-length, null-terminated) but whose inner representation is UTF-8, not UTF-16.

This is a skeleton implementation of the basic API shape. The ecosystem of APIs has not yet been built around it. All Utf8String-related code is currently surrounded by ifdefs to allow easy identification and removal from release branches.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-19 09:44:07 +01:00
Vincent Povirk d21d4764e8 [mono/tests] Fix out of tree build. 2019-03-19 09:40:06 +01:00
Levi Broderick e9e902b929 Add Rune.TryEncodeToUtf8 and related APIs (dotnet/coreclr#23250)
Also renames the existing Encode / Decode APIs per design review feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-03-19 09:33:25 +01:00
Thays Grazia 4fbdcf504d [dim] Interface with sealed method (#13501)
* '''
interface I1
{
   sealed void M1()
   {
       System.Console.WriteLine(“M1”);
   }
}

interface I2 : I1
{
   static void Test<T>(T x) where T : I2
   {
       x.M1();
   }
}

class A : I2
{
   static void Main()
   {
       I2.Test(new A());
   }
}
'''

When an interface implements a Sealed method, this method is not virtual, so it will not be available at vtable. But in the IL the call is a virtual call, but in this case we don't need to search at vtable.

Fixes #13466

* Change IL test.
2019-03-18 18:46:07 -03:00
Johan Lorensson a66f944ff7 Fix a couple of build warnings under MSVC. (#13475) 2019-03-18 14:38:27 -04:00
Alexander Köplinger 9bcad32ca5 Update csproj 2019-03-18 19:30:42 +01:00
Marek Safar b1a155979b Update codeowners (#13505) 2019-03-18 17:32:43 +01:00
Ludovic Henry 1965786397 Update CODEOWNERS 2019-03-18 08:50:19 -07:00
Alexander Kyte f7796b0da0 Merge pull request #13447 from alexanderkyte/fallback_merp_allocator
[crash] Fallback to MAP_ANONYMOUS for allocator
2019-03-18 11:49:52 -04:00
Zoltan Varga d5dfc5e76c [jit] Add RuntimeHelpers:IsBitwiseEquatable () intrinsic. (#13499)
* [jit] Add RuntimeHelpers:IsBitwiseEquatable () intrinsic.

* Update access modifier
2019-03-18 16:33:29 +01:00
Zoltan Varga 5232408f7a [runtime] Avoid putting non-virtual and non-static DIM methods into vtables, roslyn generates these for private property accessors. (#13449)
Fixes part of https://github.com/mono/mono/issues/13374.
2019-03-18 11:54:33 -03:00
Alexander Köplinger 12043bb6f5 [System.Drawing.Common] Enable debug symbols
The facade contains code now so we should build a .pdb.
2019-03-18 15:43:30 +01:00
Zoltan Varga 32b84339cb [netcore] Disable runtime cleanup on netcore, coreclr does not cleanup either. Also disable aborting background threads, its no longer needed. (#13469) 2019-03-18 10:40:22 -04:00
Jay Krell 23999ca43d Cleanup mono_array_new_1, mono_array_new_2, mono_array_new_3, mono_array_new_4.
Mainly to remove the dynamic alloca but also combine common code.
If there is a perf concern then we can forceinline mono_array_new_n.
2019-03-18 15:02:30 +01:00
Alexander Köplinger 5521ad349f [System.Net.Http] Port https://github.com/xamarin/xamarin-macios/pull/5769 to mono 2019-03-18 14:39:54 +01:00
Alexander Köplinger e0326df7c6 More Windows MSI fixes 2019-03-18 13:19:17 +01:00
Alexander Köplinger d431fd5619 Fix nunit-lite signing key 2019-03-18 12:40:38 +01:00
Alexander Köplinger 0ae04b8e80 Fix Windows MSI build, msbuild is now in Current instead of 15.0 2019-03-18 11:40:03 +01:00
Alexander Köplinger 362eface2c Remove more unnecessary nunit24 cruft 2019-03-18 11:31:06 +01:00
Johan Lorensson 273776c737 Merge pull request #13482 from lateralusX/lateralusX/windows-build-script-updates
Windows full AOT build scripts update.
2019-03-18 06:15:42 -04:00
Egor Bogatov 9f25f0f540 cache downloaded net core sdk 2019-03-18 11:15:09 +01:00
Marek Safar 4014060cca Reflect shared code changes 2019-03-18 11:12:40 +01:00
Levi Broderick 9ef79a5156 Make more types eligible for vectorized code paths in MemoryExtensions (#20855)
Types like sbyte, ushort, and other 8-bit / 16-bit elemental types are now directed down the fast vectorized code paths that previously only byte and char were eligible for.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-18 11:12:40 +01:00
monojenkins e52716f9a0 [bcl] Update BCL Linked Size 2019-03-18 11:08:16 +01:00
EgorBo 88acef1575 fix formatting 2019-03-18 10:49:06 +01:00
Egor Bogatov 253753bdb7 Add failing tests 2019-03-18 10:49:06 +01:00
Egor Bogatov 0801bfe4aa fix bug 2019-03-18 10:49:06 +01:00
Egor Bogatov 0d48237457 fix case when InlineData's type != ParameterType 2019-03-18 10:49:06 +01:00
Zoltan Varga 8b9d89b150 [netcore] Fix running tests. (#13493)
* [netcore] Fix running the tests.

* [netcore] Implement missing enum icalls.
2019-03-17 20:55:49 -04:00
Marek Safar fc7ab5076e Adapt shared Enum 2019-03-17 13:42:00 +01:00
Egor Bogatov 5df1bae25d Move Enum and CorElementType to shared (dotnet/coreclr#23177)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-17 13:42:00 +01:00
Sung Yoon Whang bc420a440e Fixing some payload serialization issue on new EventCounters (#23295)
* Fixing some payload serialization issue on new EventCounters

* Fix build error

Signed-off-by: dotnet-bot <[email protected]>
2019-03-17 08:09:21 +01:00
Nikita Potapenko cfa37ea29b Fix typo (dotnet/coreclr#23300)
.Net -> .NET

Signed-off-by: dotnet-bot <[email protected]>
2019-03-16 18:44:58 +01:00
sancheolz 1ca9fcc201 Fix local variable assign
Local variable must be assigned before use
2019-03-16 10:30:49 +01:00
[email protected] f278deee46 Fix Stackoverflow when SplitContainer`s SplitterDistance setted in SplitterMoved event subscription 2019-03-16 10:30:49 +01:00
monojenkins 9522ae42bb [bcl] Update BCL Linked Size 2019-03-16 10:22:50 +01:00
Zoltan Varga a0d0209fb1 [netcore] Add support for running tests.
* Move the sdk download from netcore/sample/Makefile to netcore/Makefile
* Add targets for running the System.Runtime.Tests test suite.
2019-03-16 10:20:51 +01:00
Jay Krell d34b6da0d8 [Coop] Convert ves_icall_System_Globalization_CultureData_fill_number_data. (#13477)
* [Coop] Convert ves_icall_System_Globalization_CultureData_fill_number_data.

Tested by running this program:
```
class A
{
	public static void Main()
	{
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.CompareInfo);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.AMDesignator);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.DateSeparator);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.DisplayName);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.EnglishName);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.IsNeutralCulture);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.IsReadOnly);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.LCID);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.Name);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.NativeName);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.NumberFormat.CurrencySymbol);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalDigits);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.Parent);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.TextInfo);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.ThreeLetterISOLanguageName);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.ThreeLetterWindowsLanguageName);
		System.Console.WriteLine(System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);
	}
}
```

which covers some but not all of the data.

*  - Use gint32 instead of int when interfacing directly with managed code.
   Indirectly would be passing the parameter off to additional native code; compiler
   can often silently convert.
   int will always be 32 bits.

 - Expand tedious error-prone code instead of using preprocessor to automate.

 - Add comments that the native and managed types must match.

 - Rename the managed type to match the native type (not necessary,
   but might as well have them grep perfectly coincidentally.).

 - Sort the fields and some of their uses for easier reading.
 It might be infinitesimally faster to line up the order
 with the native structure, to synchronize access order (i.e. sequential access to all).

 - Restore parameter name to number_index.

 - Validate, with assert, number_index maximum not just minimum.

* Restore the group_sizes logic.
group_sizes is an array of up to two integers, -1 terminated.

* restore const

* Add comment explaining the ordered -- sorted alphabetically.
2019-03-15 16:56:41 -04:00
Larry Ewing e61f00cd2d Merge pull request #12984 from kjpou1/wasm-typed-arrays
[wasm] Typed Array support for better memory usage
2019-03-15 15:36:17 -05:00
Jo Shields 0f457095e5 Don't produce nunit-console scripts in bin/ (#13480)
NUnit bundle is gone, these scripts are empty and useless

```
10:27:45  DEBUG: Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/mono-core-6.1.0.462-0.nightly.1.epel6.x86_64
10:27:45  DEBUG: BUILDSTDERR: error: Installed (but unpackaged) file(s) found:
10:27:45  DEBUG: BUILDSTDERR:    /usr/bin/nunit-console
10:27:45  DEBUG: BUILDSTDERR:    /usr/bin/nunit-console2
10:27:45  DEBUG: BUILDSTDERR:    /usr/bin/nunit-console4
10:27:45  DEBUG: RPM build errors:
10:27:45  DEBUG: BUILDSTDERR:     Installed (but unpackaged) file(s) found:
10:27:45  DEBUG: BUILDSTDERR:    /usr/bin/nunit-console
10:27:45  DEBUG: BUILDSTDERR:    /usr/bin/nunit-console2
10:27:45  DEBUG: BUILDSTDERR:    /usr/bin/nunit-console4
```
2019-03-15 19:16:15 +01:00
Johan Lorensson 36a2cabc7b Default to sgen on Windows x64. (#13473)
Since Boehm is not supported on Windows x64 we should set sgen as default
GC instead of forcing the use of --disable-bohem.
2019-03-15 12:12:10 -04:00
lateralusX 47ee8c8f46 Excluded some additional none Windows sources from win32_build/winaot profile. 2019-03-15 17:02:48 +01:00
Zoltan Varga db12fc8666 [wasm] Update to emscripten 1.38.29. 2019-03-15 10:33:37 -05:00
Justin Van Patten 202a217e15 Collection<T>: Validate parameters in the public methods (#23166)
I was looking over the new Range methods on `Collection<T>` and it occurred to me that for all existing methods, parameter validation is done in the *public* methods before calling the *protected virtual* methods. This changes the new Range methods to do the same.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-15 16:01:50 +01:00
lateralusX dab3cc35c0 Windows full AOT build scripts update.
* Only do clean/rebuild when an assembly changed.
* Add wrappers for different full AOT build configurations.
* Make scripts callable from different working directory.
2019-03-15 15:58:50 +01:00
Alexander Köplinger cfb3704940 [eglib] Remap g_utf16_len and g_utf16_len to monoeg_ prefix (#13476)
They fail a xamarin-macios public symbols check otherwise (monoeg_ is whitelisted).
2019-03-15 15:56:05 +01:00
Johan Lorensson f375ffd08c Merge pull request #13472 from lateralusX/lateralusX/enable-all-ci-tests-llvm-windows
Enable all CI test suites for Windows x64 full AOT + LLVM.
2019-03-15 10:27:13 -04:00
Zoltan Varga 9cdb5b4a12 [llvm] Fix receiving rgctx argument in DIM methods, they receive the mrgctx even if they are not generic. 2019-03-15 14:34:24 +01:00
Jo Shields 85ccf3ec02 Merge pull request #13437 from DavidKarlas/patch-1
Fix generating `.dSYM` for GTK assemblies
2019-03-15 09:15:15 -04:00
Bernhard Urban 4a2e7ce6f9 [mini] Remove public symbol helper_sig_llvmonly_imt_trampoline (#13462)
Fixes Xamarin.Tests.Misc.PublicSymbols test.
2019-03-15 12:34:43 +01:00
Marek Safar 2fa8290b7a Update for shared partition change 2019-03-15 11:20:43 +01:00
Egor Bogatov 6b2958e199 Move TypeLoadException to shared (dotnet/coreclr#23238)
* fix coding-style

* shorter form for TypeName property

* move coreclr-specific ctor to TypeLoadException

Signed-off-by: dotnet-bot <[email protected]>
2019-03-15 11:20:43 +01:00
Kenneth Pouncey b9bc111f01 Address review comments - Rename HostObjectInterface to IHostObject 2019-03-15 10:52:21 +01:00
Larry Ewingandkjpou1 e00dc00649 Update sdks/wasm/binding_support.js
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:34:16 +01:00
Larry Ewingandkjpou1 953acc3afd Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:32:57 +01:00
Larry Ewingandkjpou1 dd92015bbd Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:32:32 +01:00
Larry Ewingandkjpou1 caedcc8270 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:32:15 +01:00
Larry Ewingandkjpou1 e346211299 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:31:58 +01:00
Larry Ewingandkjpou1 e3a1b8714e Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:31:36 +01:00
Larry Ewingandkjpou1 b325eaacd1 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:31:10 +01:00
Larry Ewingandkjpou1 892b7ac039 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/ArrayBuffer.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:30:52 +01:00
Larry Ewingandkjpou1 4d17766a23 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:29:54 +01:00
Larry Ewingandkjpou1 e3ed42a492 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:29:37 +01:00
Larry Ewingandkjpou1 670b032653 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:29:22 +01:00
Larry Ewingandkjpou1 a4bb7611b8 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:29:11 +01:00
Larry Ewingandkjpou1 57aa52db5a Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:28:23 +01:00
Larry Ewingandkjpou1 6ff0679677 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/Array.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:28:06 +01:00
Larry Ewingandkjpou1 3e4706cf24 Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/ArrayBuffer.cs
Co-Authored-By: kjpou1 <[email protected]>
2019-03-15 10:27:51 +01:00
Kenneth Pouncey 7708f047d6 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays 2019-03-15 09:35:47 +01:00
Marek Safar 0bd836b2f2 [System.Private.CoreLib] Remove unused variables from TypeNameParser 2019-03-15 09:28:07 +01:00
Marek Safar 25abfa4a3f [System.Private.CoreLib] Small StackTrace cleanup 2019-03-15 09:27:41 +01:00
lateralusX d06927eecf Move SafePasswordHandle to win32_build_corlib profile. 2019-03-15 09:20:03 +01:00
lateralusX 8a77ff6c05 Reverting changes to TimeZoneInfo test when reducing classes in corlib winaot. 2019-03-15 09:20:03 +01:00
lateralusX e36be73ffb Reduce number of classes in winaot mscorlib.
Winaot profile should be a Windows AOT friendly profile close to mobile
and consoles. At some point it was set to include the full net_4_x that
cause problems on none desktop platforms. This fix reduce the set to only
include classes similar to mobile and console profiles.
2019-03-15 09:20:03 +01:00
lateralusX 3fabfccb73 Enable all CI test suites for Windows x64 full AOT + LLVM. 2019-03-15 08:50:43 +01:00
Egor Bogatov e8a66f38da bump netcore sdk version 2019-03-14 23:39:05 +01:00
lateralusX 8a6a8b7f88 Fix missing llc options for Windows x64 full AOT + LLVM mini regression tests. 2019-03-14 16:39:36 -04:00
Vlad Brezae 73ff4a7434 [interp] Make sure we call init before registering counters (#13457)
[interp] Make sure we call init before registering counters
2019-03-14 15:55:56 -04:00
Jo Shields cd8dc77a8e [win] Don't try to install NUnit 2.4, it's dead now 2019-03-14 15:01:34 -04:00
Alexander Kyte b20b86ff11 Merge pull request #13247 from lateralusX/lateralusX/fix-llvm-dwarf-cfi-windows-x64
Fix LLVM Dwarf CFI on Windows x64. Bump to corresponding LLVM commit.
2019-03-14 13:30:48 -04:00
Kenneth Pouncey 9f2dd3f554 [wasm][doc] Add Packager doc (#13411)
* Add Packager doc

* Fix numbering

* Address review comments

Packager.exe to packager.exe

* Move packager readme doc from getting started as per review comment.

* - Addresses review comment -- Fix emdash in `packager.exe -help` command line.

* Fix command line argument -- instead of single -
2019-03-14 17:45:56 +01:00
Vlad Brezae 620a46d8f2 [profiler] Fix vtune build (#13390)
[profiler] Fix vtune build
2019-03-14 11:19:47 -04:00
Marek Safar c194209317 [netcore] Generate full project setup in gen-xunit-runner 2019-03-14 14:35:29 +01:00
Jb Evain 959fbda60a [sdb] Add property AssemblyMirror.HasDebugInfo (#13353)
* [sdb] Add property AssemblyMirror.HasDebugInfo

* Fix mono_debug_image_has_debug_info to work with ppdb

* Bump API snapshot submodule
2019-03-14 09:44:17 +01:00
Aleksey Kliger (λgeek) c0b48793db Custom modifier equivalence, duplication, appending and inflation (#13320)
This all stems from ECMA 335, 7.1.1:

> The CLI itself shall treat required and optional modifiers in the same
> manner. Two signatures that differ only by the addition of a custom
> modifier (required or optional) shall not be considered to match. Custom
> modifiers have no other effect on the operation of the VES.

This rule means that when comparing signatures, we have to treat two types that
differ only in their custom modifiers as distinct. In particular, we have to do
this when comparing signatures in order to fill in the vtable for a class.  And
moreover, we have to concatenate custom modifiers when doing generic
instantiation.  If a method in a generic type has signature `T modopt(IsConst)
Method()` and we instantiate T with `int32 modopt(IsLong)`, we are expected to
produce the signature `int32 modopt(IsConst) modopt(IsLong) Method()` (with the
custom modifiers on `int32` in that order).

So this PR implements the following operations:
1. custom modifier appending during `mono_metadata_type_dup_with_cmods`
2. custom modifier-respecting comparison in `do_mono_metadata_type_equal`

To do this, we actually have to introduce a second representation of custom
modifiers: in the normal representation, all the cmod type specs come from a
single image.  Whereas now, due to inflation of signatures, we can have a mix
of modifiers from different images.  So in the MonoAggregateModContainer
representation, we pair each typespec token with the image in which it is to be
resolved.

We keep the old representation (a single image to resolve the entire set of
typespec tokens) because it's natural when you're just reading from a single
image.  Also this representation is part of the embedding API.

---

### But that's not all ###


It is possible for generic parameters of a generic class to appear in the
_custom modifiers_ of a type in a method signature.  For example:
```
    T modopt(Nullable`1<T>) Method ()
```

In this case, when we inflate this signature, we need to inflate not only the
return type, but also the modifiers on a return type.

That means our old aggregate representation (where each modifier is a pair of a
MonoImage and a typespec token) is inadequate: we can inflate a signature and
get a custom modifier that doesn't appear as a typespec in any table of any
existing image.

This is the same situation as generic instances: as a program runs, it creates
generic instances that are not part of the source code.  So we solve it the
same way as with generic instances.

Our new `MonoAggregateModContainer` representation is a pointer into memory owned
by a MonoImageSet that contains an entire MonoType for each custom modifier.

The invariant is that the aggregate modifier container is allocated from a
mempool of a `MonoImageSet` that includes the images of all the modifiers.

In general, when inflating, we first create a provisional candidate
MonoAggregateModContainer on the stack and then look it up the image set that
should own it and then look for a "canonical" mod container in the
`MonoImageSet:aggergate_modifiers_cache`

---

Also had to bump the AOT image format, which now always reads back in using the aggregate representation.

---

This should address #10564, #10565, #12422, #10945 (again), #6936, and the parts of #11350 that **don't** deal with arrays.

---

TODO:

- [x] Add some representative test cases to this PR.
- [ ] Modify our acceptance tests to run the various disabled Roslyn tests.
2019-03-14 09:16:42 +01:00
Johan Lorensson 557d8406f6 Merge pull request #13444 from lateralusX/lateralusX/fix-simd-llvm-issue
Fix error in SIMD test on Windows x64 LLVM due to changed llc defaults.
2019-03-14 03:43:12 -04:00
Maxim Lipnin 55fbd14763 Remove nunit24 from mono build and tree (#13415)
* Remove nunit24 from mono build and tree

* More cleanup

* Fix build

* [csproj] Update project files
2019-03-13 23:47:39 +01:00
Levi Broderick f62dfab807 Add OperationStatus-based UTF8 transcoding APIs (dotnet/coreclr#23219)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-13 23:46:08 +01:00
Alexander Kyte 1a574284ac [crash] Fallback to MAP_ANONYMOUS for allocator
This is helpful by allowing the crash reporter to work even while
unable to write to the working directory.
2019-03-13 14:30:57 -04:00
Zoltan Varga 8fed6666b0 Address review comments. 2019-03-13 17:52:11 +01:00
Zoltan Varga dfb3ebd706 [netcore] Improvements to gen-xunit-runner.
* Add support for response files.
* Fix encoding of small primitive types.
* Print number of run/failed/skipped tests.
2019-03-13 17:52:11 +01:00
Zoltan Varga 23fea25e80 [netcore] Define COMPlus_DebugWriteToStdErr=1 in make run to enable debug logging. 2019-03-13 17:52:11 +01:00
Zoltan Varga c3d77000a7 [netcore] Test fixes.
* EqualityComparer.cs: Add LastIndexOf ().
* RuntimeAssembly.cs: Implement	       CreateAssemblyName ().
* AssemblyLoadContext.cs: Handle windows paths.		  Add DoAssemblyResolve () method.
* Array.cs: Add/fix error handling. Implement LastIndexOf ()/GetRawArrayData ().
* Attribute.cs:	    Implement.
* Buffer.cs: Add/fix error handling.
* DefaultBinder.cs: Implement.
* RuntimeType.cs: Implement HasSameMetadataDefinitionAs ().
* RuntimeEventInfo.cs: Ditto.
* RuntimeFieldInfo.cs: Ditto.
* RuntimeMethodInfo.cs: Ditto.
* RuntimePropertyInfo.cs: Ditto.
* MonoCustomAttrs.cs: Add eror handling. Implement inheritance support for parameters.
* gc.cs: Fix error handling.
* rttype.cs: Fix handling of null namespaces.
2019-03-13 17:52:11 +01:00
Zoltan Varga aa949e2114 [runtime] Add more error checking and special cases to the Array get/set icalls. 2019-03-13 17:52:11 +01:00
Zoltan Varga 46ae93a23c [runtime] Add a few more m_class accessors. 2019-03-13 17:52:11 +01:00
Zoltan Varga d5feee9c71 [runtime] Fix the ordering of the Buffer icalls. 2019-03-13 17:52:11 +01:00
Zoltan Varga 3dcee3319e [runtime] Avoid asserting if AppDomainUnloadedException is not found. 2019-03-13 17:52:11 +01:00
Zoltan Varga 7f9cb785f2 [runtime] Fix the creation of argument exceptions in netcore, the layout of ArgumentException is no longer visible to the runtime. 2019-03-13 17:52:11 +01:00
Zoltan Varga d7ba254448 [jit] Fix a IL verification error which the netcore tests run into. 2019-03-13 17:52:11 +01:00
Ankit Jain 4cb9a914f0 [msbuild] Update to track upstream vs16.0 branch (#13053) 2019-03-13 16:40:05 +01:00
Michal Strehovsky 90bdd5da71 Fix missed RelocatedType annotation
[tfs-changeset: 1735855]

Signed-off-by: dotnet-bot <[email protected]>
2019-03-13 15:58:58 +01:00
Aleksey Kliger d28aab8d56 [class-init] Take loader lock around mono_class_setup_interface_id_internal
Writing to MonoClass:interface_id must be done with the loader lock held.

Fixes assertion:
```
* Assertion at class-init.c:1830, condition `i == 0 || interfaces_full [i]->interface_id >= interfaces_full [i - 1]->interface_id' not met
```
2019-03-13 10:54:07 -04:00
lateralusX 9b440da1f2 Fix error in SIMD test on Windows x64 LLVM due to changed llc defaults. 2019-03-13 15:52:48 +01:00
Johan Lorensson eaa5805af7 Merge pull request #13393 from lateralusX/lateralusX/fix-build-warning-local-global
Fix build warning, local variable hides global.
2019-03-13 08:39:02 -04:00
Rolf Bjarne Kvinge a72e7ffc0d Revert "[mini] Inline Selector.GetHandle for tvOS and watchOS assemblies as well. (#13246)" (#13418)
Revert "[mini] Inline Selector.GetHandle for tvOS and watchOS assemblies as well. (#13246)"

This reverts commit c99fe4b462.

It doesn't work when LLVM is enabled for tvOS: https://github.com/xamarin/xamarin-macios/pull/5742#issuecomment-471007078, it causes multiple compilation errors like this:

    Process exited with code 1, command:
    /Applications/Xcode101.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -isysroot /Applications/Xcode101.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -Qunused-arguments -mtvos-version-min=12.1 -fembed-bitcode-marker -arch arm64 -c -o /private/var/folders/nh/n1y9qj2n40d7wpmx1mg9blg80000gn/T/mtouch.cache/arpl1vgs.js6/arm64/Xamarin.TVOS.dll-llvm.o -x assembler /private/var/folders/nh/n1y9qj2n40d7wpmx1mg9blg80000gn/T/mtouch.cache/arpl1vgs.js6/arm64/Xamarin.TVOS.dll-llvm.s
    /private/var/folders/nh/n1y9qj2n40d7wpmx1mg9blg80000gn/T/mtouch.cache/arpl1vgs.js6/arm64/Xamarin.TVOS.dll-llvm.s:4665:14: error: invalid variant 'OBJC_SELECTOR_REFERENCES_.2@PAGE'
            adrp    x8, l_@OBJC_SELECTOR_REFERENCES_.2@PAGE
                           ^
    /private/var/folders/nh/n1y9qj2n40d7wpmx1mg9blg80000gn/T/mtouch.cache/arpl1vgs.js6/arm64/Xamarin.TVOS.dll-llvm.s:4673:18: error: invalid variant 'OBJC_SELECTOR_REFERENCES_.2@PAGEOFF'
            ldr     x1, [x8, l_@OBJC_SELECTOR_REFERENCES_.2@PAGEOFF]




<!--
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
-->
2019-03-13 08:05:48 -04:00
Alexis Christoforides f934b60854 [MacSDK] Bump Nuget to 4.8.2 2019-03-13 11:28:58 +01:00
Marek Safar fa7b007914 [System.Private.CoreLib] Remove duplicate checks 2019-03-13 10:35:25 +01:00
Sung Yoon Whang 6e85a0fb99 Add new counter APIs (dotnet/coreclr#23077)
* Refactor EventCounter and add PollingCounter

* Add PollingCounter

* Add IncrementingEventCounter and IncrementingPollingCounter

* Add MetaData API to Counters

* Some more refactoring

* removing commented out code

* some more cleanup

* build fix and addressing some PR comments

* Addressing PR feedback

* use StringBuilder to generate metadata string

Signed-off-by: dotnet-bot <[email protected]>
2019-03-13 10:03:41 +01:00
David Karlaš a716c9ad7b Fix generating .dSYM for GTK assemblies
Problem is that https://github.com/mono/bockbuild/blob/14535c270ea9f8d536efe6852700d8d1cb657c1f/packages/gtk%2B.py#L4 passes `gtk` for repository name to `GitHubPackage` which then uses this as package name. So when it's decided if `-g` should be added at https://github.com/mono/bockbuild/blob/5c2378112dc681cea0aa5c2447661fb13adbc46b/bockbuild/darwinprofile.py#L158-L159 it's false hence GTK assemblies don't get debug symbols.
2019-03-13 09:39:22 +01:00
Calvin Buckley 55d913c2d3 Bump corefx for System.Native posix_fadvise change (#13409) 2019-03-13 02:18:47 +01:00
Tanner Gooding cde76c1521 Fixing a couple of issues in the Utf8Parsing/Formatting code (#23134)
* Fixing NumberToSingle and NumberToDouble to handle DigitsCount == 0

* Fixing Utf8Formatter.Float to transcode non ASCII bytes

* Responding to PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-03-12 22:42:53 +01:00
Alexander Köplinger d884bd3e12 [corlib] Fix RuntimeFeatureTest.NoNewFeaturesAdded()
DefaultImplementationsOfInterfaces was enabled with https://github.com/mono/mono/pull/13417
2019-03-12 21:03:06 +01:00
Alexander Köplinger 92b435d6fe Move drawing types for XI/XM/wasm/orbis/unreal to System.Drawing.Common (#13414)
* Move drawing types for XI/XM/wasm/orbis/unreal to System.Drawing.Common

For XI/XM they were in Xamarin.iOS.dll/OpenTK-1.0.dll before.

For wasm/orbis/unreal we remove System.Drawing.dll from the profiles and
add the types to System.Drawing.Common.dll instead to align with the other
mobile profiles (only "net_4_x" and "build" still have System.Drawing.dll).

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-12 18:07:19 +01:00
Joshua Peterson 244c1aab8e Fix a possible crash while printing a warning (#13399)
The format string was incorrect in this case, which leads to a crash
in Unity. Simply remove the unused `%s` format specifier here.
2019-03-12 18:03:58 +01:00
monojenkins fb8554d76f [csproj] Update project files 2019-03-12 17:26:20 +01:00
monojenkins 0a85578bd0 Bump API snapshot submodule 2019-03-12 17:26:20 +01:00
Zoltan Varga 522a46dcac [corlib] Define FEATURE_DEFAULT_INTERFACES so RuntimeFeatures indicates DIMs are supported. 2019-03-12 17:26:20 +01:00
Kenneth Pouncey 205bb1666a [wasm][tests] Add WebSocket tests 2019-03-12 14:57:50 +01:00
Zoltan Varga 00c837d66a [netcore] Implement Type.GetType () overloads with assembly/type resolve delegates. (#13410)
Instead of extending the runtime gettype implementation, port the type parsing code
to C#.
2019-03-12 13:01:34 +01:00
Zoltan Varga ec7b9ec409 [jit] Implement Unsafe:ByteOffset<T> intrinsic. 2019-03-12 12:19:51 +01:00
Kenneth Pouncey 38ec3156f5 Address review by @Suchiman after conflict resolution. Thanks for the catch. 2019-03-12 11:02:28 +01:00
Kenneth Pouncey 9a73ea12b7 Confilct with Runtime.cs
Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays

# Conflicts:
#	sdks/wasm/framework/src/WebAssembly.Bindings/Runtime.cs
2019-03-12 10:11:04 +01:00
Larry Ewing 4ff1307e21 Remove all use of ContainsKey from js bindings (#13376) 2019-03-12 09:18:09 +01:00
Maxim Lipnin ad5fe197a3 Add reflected type to event methods (#13397)
Fixes https://github.com/mono/mono/issues/13350
Fixes https://github.com/mono/mono/issues/10277
2019-03-12 08:32:40 +01:00
Hugh Bellamy 030111234e Fix NRE in EqualStringArrays (dotnet/coreclr#23174)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-11 22:35:21 +01:00
Michal Strehovský 07c383b829 Replace Delegate.CreateDelegate (dotnet/corert#7147)
Replacing this with a pattern that is easier to statically analyze. We use the GetType/GetMethod/CreateDelegate pattern in several places already.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-11 22:20:53 +01:00
Alexander Köplinger b92a105992 [configure.ac] Fix configure checks for Mono.Native (#13395)
When the configure checks were ported from configure.cmake in corefx
a couple of mistakes happened:

- Using AC_TRY_COMPILE instead of AC_TRY_LINK:
  CMake's check_c_source_compiles() function compiles *and* links while
  AC_TRY_COMPILE only does the former. This hides potential linking issues
  which should fail the configure check.
- Using CFLAGS="-Werror -W....":
  This works in CMake but autoconf always appends the previously defined
  CFLAGS and since we set e.g. `-Wno-undefined` some configure checks
  would fail due to an unrelated warning being treated as an error.
  We need to only promot specific warnings to errors instead.

While looking at this I also found that we were setting CFLAGS after
we already AC_SUBST() it, we need to do this very close to the end of configure.ac.
Moved some code into that last block.

Finally, Android has special cases for sendfile and arc4random_buf where
they're defined in the header but aren't actually there for certain API profiles.
For now we disable arc4random_buf on Android and add a special check for sendfile.

* Fix sendfile with 6 parameters being misdetected

We need to make sure to actually prevent the implicit prototype since
in this case sendfile with different set of parameters actually exists
so the linker wouldn't fail.

Also fixed a few other cases of wrong configure checks due to missing headers.

* Move GSS checks into the Mono.Native checks section

This allows us to have a 1:1 mapping of the checks from configure.cmake
2019-03-11 20:36:40 +01:00
Thays Grazia 3537672955 [debugger] Fixing two crashes while debugging an Android app. (#13373)
* [debugger] Fixing two crashes while debugging an Android app.

-> Doing stepping into in VSM in some situation the frame saved in TLS is not synchronised with what is really been executed in the main thread. This makes the debugger-agent crashes because it tries to get variable info in some memory that is not available anymore.
	-> To fix it I forced the update of stack when CMD_THREAD_GET_FRAME_INFO is called.

-> Doing step over in Visual Studio for Windows, if you have the threads debugger window enabled, VSW calls frame_commands for each thread that is showed, and if the thread is not really_suspended it tries to get variable info from a memory that is not available anymore because the thread is not suspended yet.
	-> To fix it I don't send variable info of a frame if the thread is not really_suspended and doesn't have an async_state valid.

#Fixes 12843
2019-03-11 15:55:47 -03:00
Alexander Köplinger 0d7ce1f767 Fix build on Alpine Linux (#13394)
- sys/sysctl.h isn't available on Alpine and not needed by the code,
  guard it using HAVE_SYS_SYSCTL_H like elsewhere. Added by https://github.com/mono/mono/pull/11855

- pthread_mutexattr_setprotocol doesn't support PTHREAD_PRIO_INHERIT,
  check return value. Added by https://github.com/mono/mono/pull/13333
2019-03-11 16:59:44 +01:00
Kenneth Pouncey cbe835d0c1 Use new HostObject instead of NewJSObject. 2019-03-11 15:36:33 +01:00
Kenneth Pouncey 911b21dff4 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays
# Conflicts:
#	sdks/wasm/framework/src/WebAssembly.Net.Http/WasmHttpMessageHandler.cs
2019-03-11 15:24:26 +01:00
Egor Bogatov d0013e438c Add System.Drawing converters to netstandard facade (#13326)
This PR adds missing System.Drawing converters thus it completes NS2.1 support (as of today) for all profiles except macOS\IOS specific ones: monotouch, tv, watch, xammac, xammac_net_4_5.
2019-03-11 13:23:31 +01:00
Zoltan Varga db67d18d0d [netcore] Ongoing work. (#13391)
* [runtime] Add a few new m_class inline functions.

* [netcore] Implement Array.IndexOf ().

* [netcore] Implement RuntimeHelpers.PrepareMethod ().

* Add error checks to RuntimeHelpers.GetUninitializedObject ().
* Fix some type attributes.
* Fix some TypedReference special cases.
2019-03-11 08:16:21 -04:00
Zoltan Varga 38a2639fc1 [netcore] Fix build. (#13392)
* [netcore] Fix build.

* Update Buffer.cs
2019-03-11 12:57:44 +01:00
lateralusX ce3bbb011b Fix build warning, local variable hides global.
On Windows MSVC build this cause:

warning C4459: declaration of 'mono_cfg_dir' hides global declaration
2019-03-11 12:36:25 +01:00
Johan Lorensson ed3039b377 Merge pull request #13367 from lateralusX/lateralusX/fix-windows-build-warning
Fix build warning in mono-error.h.
2019-03-11 07:12:29 -04:00
Kenneth Pouncey b124b51066 Address review comments.
- Cleanup docs.
- Cleanup implicit conversions.
- Remove ToSpan()
2019-03-11 12:02:11 +01:00
Zoltan Varga ea761357f8 [jit] Reenable the EqualityComparer:Default devirt optimization. (#13321) 2019-03-11 06:09:59 -04:00
Calvin Buckley e9e52de223 Fix System.Decimal regression from .NET Core on big endian (#13348)
Upstream must have rewritten, because the runtime checks were
replaced with the (not good for Mono) ifdefs.

Not throughly tested, but unbreaks build locally; waiting for CI
to come back with more results.

If it works, could someone get this upstream?
2019-03-11 10:20:49 +01:00
Johan Lorensson a91e3f162a Merge pull request #13366 from lateralusX/lateralusX/add-missing-public-header-to-dist
Include mono-forward.h public header on Windows.
2019-03-11 04:29:42 -04:00
monojenkins 0e804950b5 [csproj] Update project files 2019-03-11 09:11:16 +01:00
monojenkins 0086403d54 Bump API snapshot submodule 2019-03-11 09:11:16 +01:00
Steve Pfister a49d5df03f These changes help prep for refsrc System.Web
* DynamicRoleClaimProvider to help with legacy role management in web forms
* Added AppDomainManagerAssembly, AppDomainManagerType, and PartialTrustVisibleAssemblies
  properties to AppDomainSetup. They don't do anything, but having  them there
  helps lessen the amount of change in refsrc System.Web.
2019-03-11 09:11:16 +01:00
Larry Ewing b5082160c3 Remove linq usage from WasmHttpMessageHandler 2019-03-11 09:10:59 +01:00
Levi Broderick 31b5a4554a Refactor Encoding to split fast-path and fallback logic (#23098)
This refactoring is limited to ASCIIEncoding at the moment, but it can easily be applied to UTF-8 / UTF-16 / UTF-32.

High-level changes:
- Fallback logic has been split from the fast-path, improving performance of GetBytes and similar routines.
- All of the plumbing of when to invoke the fallback logic and how to manage leftover data has been moved into the base class.
- Almost all of the logic except for the fast-path is now written in terms of verifiable code (Span and ReadOnlySpan).
- Minor bug fixes in EncoderNLS.Convert (see https://github.com/dotnet/coreclr/issues/23020).

Signed-off-by: dotnet-bot <[email protected]>
2019-03-11 09:05:29 +01:00
monojenkins db6ee0108b [bcl] Update BCL Linked Size 2019-03-11 09:01:51 +01:00
Bernhard Urban 2eeaf888c1 [AOT] add option to control arguments to llc and add fallback for x86 (#13323)
* [AOT] add option to control arguments to llc and add fallback for x86

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

* rename
2019-03-11 08:40:22 +01:00
Kenneth Pouncey 24a0e0d7f2 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays 2019-03-11 06:23:29 +01:00
monojenkins 3489679dc5 Bump API snapshot submodule 2019-03-10 13:11:12 +01:00
Steve Pfister 063f2a2b9a Added missing ToolLocationHelper methods that will be
used by refsrc System.Web.Compliation.AssemblyResolver.
2019-03-10 13:11:12 +01:00
Larry Ewing 5dbf642965 Add Blazor E2E test to wasm bcl-size-diff 2019-03-10 13:11:01 +01:00
Kurt Van Dijck 3e8108ea65 threads: set mutex PRIO_INHERIT in attribute (#13333)
threads: set mutex PRIO_INHERIT in attribute

When running multiple threads on a linux-rt kernel, with different priorities, the lack of priority-inheritance
makes the kernel make wrong scheduling choices.
This commit changes the system-wide mutex initializers.
This change protects our system against unexpected latencies in higher priority threads.

<!--
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
-->
2019-03-09 23:35:34 -05:00
Marek Safar 4259cfad8f Remove local Buffer copy 2019-03-10 00:56:08 +01:00
Egor Bogatov 8a3a41b81a Move Buffer to shared (dotnet/coreclr#23157)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-10 00:56:08 +01:00
Dan Moseley 73caa49efb Remove 2 suffix step 1 (dotnet/corefx#35904)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-10 00:56:08 +01:00
Stephen Toub d5b0333f37 Add stack depth check to all Task continuations (dotnet/coreclr#23152)
Currently Task has a stack depth check that avoids stack overflows on very deep stack continuation chains, but it only applies to Task.ContinueWith, not to other kinds of continuations.  This changes that to have it apply to all.

As part of this, this also deletes the current StackGuard type used to achieve the check.  The type was meant to avoid expensive calls to check where we are on the stack, but now that we're using TryEnsureSufficientExecutionStack, it's actually faster to just call that rather than access the current StackGuard from a ThreadLocal.  This then also cleans up the call sites nicely, as they no longer need finally blocks to undo the increment performed on the StackGuard.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-09 17:48:20 +01:00
Zoltan Varga 92dfcb120b [netcore] Use codedom for code emission in the xunit generator. Add support for Theories and inline data. 2019-03-09 11:52:49 +01:00
Zoltan Varga 0f798ae6cf [netcore] Ongoing work. (#13357)
* [netcore] Implement MethodBody using internal Runtime* classes. Use the mono version for ModuleHandle.

* [netcore] Reflection fixes.

* Address review comments.

* [netcore] Implement RuntimeHelpers:GetUninitializedObject ().

* [netcore] Implement the Type::GetMethod () overload which has a genericParameterCount parameter.

* [netcore] Implement Thread.OptimalMaxSpinWaitsPerSpinIteration.

* Revert a change to fix a test failure.

* [netcore] Implement Marshal:GetExceptionForHRInternal ().

* [netcore] Implement GC:GetSegmentSize ().

* [runtime] Allow pointer type members in typed references.
2019-03-09 05:26:40 -05:00
Marek Safar dd0e9a8aa3 Fix the build 2019-03-09 09:27:46 +01:00
Marek Safar 289eb40af4 Move part of RuntimeHelpers to shared partition (dotnet/coreclr#23130)
* Move part of RuntimeHelpers to shared partition

* Remove FormatterServices.cs

Signed-off-by: dotnet-bot <[email protected]>
2019-03-09 09:27:46 +01:00
Steve Pfister 0306c38fed Add refsrc DataProtector to System.Security (#13365)
* Added DataProtector abstract class to be used when refsrc
System.Web gets ported over.

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-09 01:07:53 +01:00
Zoltan Varga 4401acd172 [jit] Avoid an assert with default interface methods and gsharing.
Fixes https://github.com/mono/mono/issues/13319.
2019-03-09 00:55:39 +01:00
Dotnet-GitSync-Bot 8efb2906d2 Mirror changes from mono/coreclr,corert (#13375)
* Added new Range Manipulation APIs for Collection<T> which propogate up to ObservableCollection<T>. AddRange, InsertRange, RemoveRange and Replace Range

Signed-off-by: dotnet-bot <[email protected]>

* Updated index out of range exception check to be a single comparison

Signed-off-by: dotnet-bot <[email protected]>

* Updated foreach to use T instead of var

Signed-off-by: dotnet-bot <[email protected]>

* Adding braces on for loop

Signed-off-by: dotnet-bot <[email protected]>

* Added ReplaceItemsRange API and updated ReplaceRange to invoke the protected method

Signed-off-by: dotnet-bot <[email protected]>

* Remove ternary operator from invocation as it is the same as inputing items.Count

Signed-off-by: dotnet-bot <[email protected]>

* Updated RemoveItemsRange to prevent int.MaxValue overflow errors

Signed-off-by: dotnet-bot <[email protected]>

* Updated RemoveItemsRange to properly remove each item and not just the index items

Signed-off-by: dotnet-bot <[email protected]>

* Added ArgumentOutOfRangeException exception in RemoveRange if the count is less than 0

Signed-off-by: dotnet-bot <[email protected]>

* Updated RemoveRange invocation of RemoveAt to use index instead of i, because the array changes with each iteration of the for loop and will cause side-effects which may include index out of range exceptions. This needs to be index because as the array shrinks the index is always at the correct position.

Signed-off-by: dotnet-bot <[email protected]>

* Updated RemoveAt->RemoveItem. This change removes redundent validation checks that happen using the RemoveAt API. RemoveItem gives us direct access to invoke the command

Signed-off-by: dotnet-bot <[email protected]>

* Updated InsertItemsRange to simplify the expression and added performance improvements. If the underlying `items` is using List<T> we should use it's InsertRange method since it is optimized, othersie we use InsertItem

Signed-off-by: dotnet-bot <[email protected]>

* Added new RemoveRange validation check to see if the resulting range (index + count) > items.Count and if it is true throw ArgumentException

Signed-off-by: dotnet-bot <[email protected]>

* Removed (Int64) cast statements from RemoveItemsRange when checking for overflow errors

Signed-off-by: dotnet-bot <[email protected]>

* InsertItemsRange API now checks if the underlying items.IsReadOnly first then collection == null

Signed-off-by: dotnet-bot <[email protected]>

* Simplified the RemoveItem logic since we have more robust validation

Signed-off-by: dotnet-bot <[email protected]>

* Optimized RemoveItemsRange to call the list.RemoveRange if the items is of type List<T>

Signed-off-by: dotnet-bot <[email protected]>
2019-03-09 00:51:26 +01:00
Filip Navara 19258e1680 Allow deserialization for ResourceManager created with non-default resource set type (#23051)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-09 00:44:14 +01:00
Johan Lorensson 2e30dbab63 Correctly defined thread API support for different Windows platforms. (#13344) 2019-03-08 14:34:49 -05:00
Zoltan Varga 6c81f5dbd2 [sdb] Avoid stack overflows caused by recursive calls between suspend_current () and invoke_method (). (#13362)
Fixes https://github.com/mono/mono/issues/13261.
2019-03-08 14:20:36 -05:00
Johan Lorensson 4c57215ca9 Fix GetTokenName to fail with exception on none Windows desktop platforms. (#13343) 2019-03-08 12:38:56 -05:00
Johan Lorensson 526939e146 Better probing logic on Windows when Unicode Win32 symbols are used. (#13345)
Several of the corefx interop sources uses the Unicode names of Win32 symbols.
Our current probing implementation on Windows will test the given name last
when nomangle is not provided (default). On Windows that will be a large number
of probes due to old stdcall name mangling rules. Fix makes sure we first test
the symbol against its charset and the given symbol, before trying the stdcall
name mangling rules. Will reduce the probing a lot on Windows for corefx Win32
interop classes.
2019-03-08 12:35:56 -05:00
Larry Ewing 27197d3f15 Add System.Runtime.Serialization targets 2019-03-08 10:36:31 -06:00
Larry Ewing f2b8ec3b3d Move the disabled tests under INCLUDE_DISABLED 2019-03-08 10:36:31 -06:00
Larry Ewing ad4e0414cd Add DataContractSerializer test 2019-03-08 10:36:31 -06:00
Larry Ewing a7f4dea649 Add linker test for Queryable 2019-03-08 10:36:31 -06:00
Alexander Köplinger 566e4565f4 [corlib] Remove Interop.MountPoints.cs from .sources (#13363)
* [corlib] Remove Interop.MountPoints.cs from .sources

We no longer need it since https://github.com/mono/mono/pull/13125 and having
it included makes xamarin-macios still complain about the missing symbol.

* [csproj] Update project files
2019-03-08 17:19:09 +01:00
lateralusX 7014dc1f8c Fix LLVM Dwarf CFI on Windows x64. Bump to corresponding LLVM commit. 2019-03-08 16:33:17 +01:00
lateralusX 5d5cb61243 Fix build warning in mono-error.h.
Warning (at least on Windows) due to unamed struct:

C4201, nonstandard extension used : nameless struct/union

Since the header can be consumed by embedders this warning should be
disabled.
2019-03-08 16:11:14 +01:00
lateralusX e9183496fb Include mono-forward.h public header on Windows. 2019-03-08 15:35:10 +01:00
Kenneth Pouncey e0651ded29 Add exclude features option when linking to the sdk. (#13340) 2019-03-08 15:22:36 +01:00
Johan Lorensson f89fdf28a3 Fix build warning in full AOT build. (#13342) 2019-03-08 06:37:46 -05:00
Marek Safar 63a58325b5 Remove unused type 2019-03-08 09:50:42 +01:00
Marek Safar 841a1d49b7 Use platform specific implementation of GetCurrentProcessId (#23084)
* Use platform specific implementation of GetCurrentProcessId

directly in shared location instead of relying on runtime export

* Move GetCurrentProcessId to Interop class

* Update ES_BUILD_STANDALONE build

Signed-off-by: dotnet-bot <[email protected]>
2019-03-08 09:50:42 +01:00
Marek Safar 14b0f985de Merge pull request #13356 from monojenkins/bclsizediff
[bcl] Update BCL Linked Size
2019-03-08 09:38:42 +01:00
Jb Evain 297b6ba328 [sdb] Avoid double lookup of replay packets 2019-03-08 09:34:54 +01:00
Dávid Kaya 8fc751180c Added UserFlags field, unblocks #34560 (dotnet/corefx#35851)
* Added UserFlags field

* Added UserFlags

Signed-off-by: dotnet-bot <[email protected]>
2019-03-08 07:39:21 +01:00
monojenkins b5daa32188 [bcl] Update BCL Linked Size 2019-03-08 03:38:14 +00:00
Alexander Köplinger 8cd69e14e3 Update System.Net.Http.csproj
Change missed in https://github.com/mono/mono/commit/97adf2e53e20c127bc38cb4f64a43f55c77e5c7e
2019-03-07 23:41:22 +01:00
Stephen Toub ad819c8921 Add missing CopyToAsync override in FileStream.Unix.cs (#23101)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 23:38:17 +01:00
Zoltan Varga 11349df4e6 [netcore] Add a tool to convert corefx test assemblies into simple test runners. (#13346)
* [netcore] Add a tool to convert corefx test assemblies into simple test runners.

* Fix computation of traits.
2019-03-07 22:50:42 +01:00
Hugh Bellamy f6179a0e68 Cleanup Globalization info code (dotnet/coreclr#22591)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 22:24:52 +01:00
Martin Baulig 97adf2e53e HttpClient for Web Assembly. 2019-03-07 21:49:27 +01:00
Alexander Köplinger 2e4d4a040c [sqlmetal] Distribute DbLinq.snk in tarball 2019-03-07 19:05:05 +01:00
monojenkins dbcd755c86 Bump API snapshot submodule 2019-03-07 18:47:03 +01:00
monojenkins ebb8b6fff2 [csproj] Update project files 2019-03-07 18:47:03 +01:00
Martin Baulig 2d6f02a83c HttpClient for Android. 2019-03-07 18:47:03 +01:00
Vlad Brezae deebdd1489 [interp] Add a few starting stats (#13347)
* [runtime] Use same single convention for stats tracking time

Also avoid useless mallocs/frees

* [interp] Add counters for transform phase
2019-03-07 11:53:11 -05:00
Kenneth Pouncey cad455b393 Fix HttpMessageHandler request content as binary. 2019-03-07 11:50:09 +01:00
Alexander Köplinger f77193d306 [mono/tests] Add fullaot-mixed to SUBDIRS
Fixes tarball build break.
2019-03-07 11:43:56 +01:00
Kenneth Pouncey 8d12c53c0a Fix ClientWebSocket passing of ArraySegment. 2019-03-07 11:35:16 +01:00
Kenneth Pouncey bb5eb13967 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays
# Conflicts:
#	sdks/wasm/framework/src/WebAssembly.Bindings/WebAssembly.Bindings.csproj
2019-03-07 10:10:59 +01:00
monojenkins 7fe2472b34 [csproj] Update project files 2019-03-07 10:03:14 +01:00
monojenkins 530596db02 Bump API snapshot submodule 2019-03-07 10:03:14 +01:00
Steve Pfister 6a9950c5d2 * System.Data.Linq now points to reference source
* Created SR and Strings helpers as refsrc resources are
  missing / incomplete

* Moved existing tests into the Test folder

* Moved old DBLinq code into tools/sqlmetal as there are no other
  alternatives.
2019-03-07 10:03:14 +01:00
Marek Safar c96df417d1 Remove code moved to shared 2019-03-07 00:42:25 +01:00
Tanner Gooding 57c75cbb94 Fixing the float/double parsing logic to handle exponents that are too large/small (#23043)
* Fixing the float/double parsing logic to handle exponents that are too large/small

* Fixing the debug assert to use >= and <=

* Fixing the max exponents to be +1 to match what scale uses.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Stephen Toub 6d8df4e7f3 Clean up some string.Format usage (dotnet/coreclr#23025)
* Clean up some string.Format usage

Mainly changes some string.Format usage to be SR.Format when working with resource strings.  Also cleans up a few asserts that were using string.Format.

* Address PR feedback and clean up src

* Address more feedback

* Update src/System.Private.CoreLib/shared/System/Type.Enum.cs

Thanks.

Co-Authored-By: stephentoub <[email protected]>
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Maryam Ariyan d56e47721a Add Type Forward (dotnet/coreclr#23036)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Marek Safar 72406ff802 Move more Assembly methods to shared partition (dotnet/coreclr#22817)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Andrew Au a7963f4e51 Fix issue 23009
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Honza Rameš d1b1ce9dfa Fix ValueStringBuilder.EnsureCapacity to call Grow correctly (#35810)
* Fix ValueStringBuilder.EnsureCapacity to call Grow correctly (#35746)

Call to EnsureCapacity may result in invalid buffer size being
allocated.

* Update ValueStringBuilder.Grow to prevent misuse (#35746)

Updated name of the argument to make it clearer on the call-site also
added summary co clearly state the behavior of Grow.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
dotnet-maestro[bot] 60de375154 Update dependencies from dotnet/core-setup (dotnet/corefx#35713)
* Update dependencies from https://github.com/dotnet/core-setup build 20190301.13

This change updates the following dependencies
- Microsoft.NETCore.App - 3.0.0-preview4-27501-13
- Microsoft.NETCore.DotNetHost - 3.0.0-preview4-27501-13
- Microsoft.NETCore.DotNetHostPolicy - 3.0.0-preview4-27501-13

* Remove workaround for System.Runtime.CompilerServices.Unsafe

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

This change updates the following dependencies
- Microsoft.NETCore.App - 3.0.0-preview4-27502-8
- Microsoft.NETCore.DotNetHost - 3.0.0-preview4-27502-8
- Microsoft.NETCore.DotNetHostPolicy - 3.0.0-preview4-27502-8

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

This change updates the following dependencies
- Microsoft.NETCore.App - 3.0.0-preview4-27503-9
- Microsoft.NETCore.DotNetHost - 3.0.0-preview4-27503-9
- Microsoft.NETCore.DotNetHostPolicy - 3.0.0-preview4-27503-9

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

This change updates the following dependencies
- Microsoft.NETCore.App - 3.0.0-preview4-27504-10
- Microsoft.NETCore.DotNetHost - 3.0.0-preview4-27504-10
- Microsoft.NETCore.DotNetHostPolicy - 3.0.0-preview4-27504-10

* Don't include EventRegistrationToken on Unix

This type was accidentally duplicated between CoreLib and contracts.

Suppress that for now since we're detecting the duplication in the shared framework.

Make a fix in the shared items to restore the condition on this type.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Viktor Hofer af3965d9d2 Project msbuild syntax cleanup (dotnet/corefx#35686)
* Remove license header from non-shipping files

* Remove obsolete Project attributes

* Remove xml header and remove DefaultTargets

Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Michal Strehovský edf4941ec3 Fix ProjectN build breaks (dotnet/corert#7115)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Marek Safar 186ae08b0a Move fully managed TimerQueue implementation to shared partition (#7111)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Alexander Köplinger 97f2393f3e [mono/tests] Add common_mixed.mk to EXTRA_DIST 2019-03-06 23:58:48 +01:00
Alexander Köplinger 2f2881fc4b Add .gitignore for mono/tests/fullaot-mixed 2019-03-06 23:56:11 +01:00
Alexander Köplinger aabd3ab102 Bump bockbuild to get GTK fix
See https://github.com/mono/bockbuild/pull/90
2019-03-06 23:45:10 +01:00
Marek Safar fbffa8719a [System.Private.CoreLib] Fix the build 2019-03-06 23:05:20 +01:00
Martin Baulig 6034bc00c4 Introducing HttpClient.CreateDefaultHandler(). (#13305)
* The default `HttpClient` constructor now calls a static method `CreateDefaultHandler()`;
   we provide a platform-specific implementation of it.

* Replaced `HeaderUtils` with `PlatformHelper` and removed the `LEGACY_HTTPCLIENT` conditional.

* Added a new `socketshandler.sources` file to keep the sources in one place.

* Use a reflection check in the tests instead of the `LEGACY_HTTPCLIENT` conditional.

* This allows us to also get rid of the `SOCKETSHTTPHANDLER` define.
2019-03-06 20:56:42 +01:00
Zoltan Varga 835c8590ca [netcore] Implement DependentHandle using the existing ephemeron code. 2019-03-06 18:24:46 +01:00
Katelyn Gadd d02c43e23e Propagate type load errors out of IsAssignableFrom instead of erroneously returning false. Makes the underlying cause of #13113 discoverable. (#13324) 2019-03-06 11:41:55 -05:00
Ludovic Henry 6527e21bb4 [safepoint] Use LLVM pass to insert safepoint (#11789)
* [safepoint] Use LLVM pass to insert safepoint

This is to avoid safepoints to stop optimizations from happening.

* [safepoint] Use LLVM pass to insert safepoint

This is to avoid safepoints to stop optimizations from happening.

* fix error: emit_gc_safepoint_poll does not return anything

* Revert partial 4150f06f8621f2f2918e3bd747bf80a0f0f8c9c6

* Fix build

* [runtime] Add mono_threads_state_poll to preinited icalls

* [runtime] Adding back in safepoint icall skip code

* Revert mini.c to 100f422

* [runtime] Add missing deref to safepoint poll

* [runtime] Make safepoint functions have WeakODR linkage
2019-03-06 11:38:48 -05:00
Alexander Köplinger cacc9b7c4c [Facades] Add typeforwarders for DispatchProxy and TypeExtensions (#13325)
* [Facades] Add typeforwarders for DispatchProxy and TypeExtensions

DispatchProxy lives in System.Core for all profiles since https://github.com/mono/mono/pull/13198.

TypeExtensions live in corlib since https://github.com/mono/mono/pull/9746.

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-06 16:20:51 +01:00
Zoltan Varga 2b761f9ea5 [linker] Only preserve the m_value fields of the primitive types. 2019-03-06 11:34:34 +01:00
Egor Bogatov e42bf95d14 NS2.1 Sync new changes, mobile profiles (#13198)
* Add RuntimeHelpers.GetSubArray. Add missing types to NS's TypeForwarders.cs

* more NS2.1 changes

* ios changes

* Update Decimal (it's now readonly struct)

* fix mcs

* add ROMC.cs

* Fix tests, finish monodroid profile

* Make SRE-not-supported NS2.1 compatible

* Make monotouch_tv and watch NS2.1 compatible

* make some SRE types more NS21 compatible (non-abstract now)

* bump corefx

* More NS21 fixes

* bump coreclr acceptance tests

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-06 08:55:16 +01:00
Alexander Köplinger b31a445e85 [gitattributes] Do CRLF normalization on sln/proj files
They can be used with native line endings.

We now have a shared folder with the dotnet repos and they have CRLF normalization enabled.
This difference leads to conflicts while applying changes from the dotnet repos to mono.
2019-03-06 08:34:01 +01:00
justremotephone eb3f7312bd [System.ServiceModel] Fix a race condition in HttpRequestChannel. (#13304)
Concurrent request completions could cause following exception:

```
    FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException:
        Index was out of range. Must be non-negative and less than
        the size of the collection.
        Parameter name: index
       at System.Collections.Generic.List`1[T].RemoveAt (System.Int32 index) [0x00009] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Collections.Generic.List`1[T].Remove (T item) [0x0000c] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.Cleanup () [0x00011] in <28c4695205ef47378f5370502b066592>:0
       at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.set_IsCompleted (System.Boolean value) [0x00034] in <28c4695205ef47378f5370502b066592>:0
       at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.Complete (System.Exception ex) [0x0001a] in <28c4695205ef47378f5370502b066592>:0
       at System.ServiceModel.Channels.HttpRequestChannel+<>c__DisplayClass7_1.<BeginProcessRequest>b__0 (System.IAsyncResult r) [0x000bd] in <28c4695205ef47378f5370502b066592>:0

    This stack was captured after some changes in AwaitTaskContinuation.RunOrScheduleAction.
    Unfortunately the current implementation of AwaitTaskContinuation.RunOrScheduleAction re-throws the above
    exception with a wrong stack:

       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction (System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask) [0x00023] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishContinuations () [0x00052] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishStageThree () [0x0003c] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishStageTwo () [0x000a1] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.Finish (System.Boolean bUserDelegateExecuted) [0x00003] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.TrySetException (System.Object exceptionObject) [0x00023] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException (System.Exception exception) [0x00029] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Net.HttpWebRequest+<RunWithTimeoutWorker>d__241`1[T].MoveNext () [0x000e0] in <3e9b3e26c4694baab3f689687ad40612>:0
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext (System.Object stateMachine) [0x00000] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00024] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction (System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask) [0x00023] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishContinuations () [0x00052] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishStageThree () [0x0003c] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task`1[TResult].TrySetResult (TResult result) [0x0004f] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetResult (TResult result) [0x0003d] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Net.ServicePointScheduler+<WaitAsync>d__45.MoveNext () [0x000f7] in <3e9b3e26c4694baab3f689687ad40612>:0
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext (System.Object stateMachine) [0x00000] in <4a8a0
```

On an Android Xamarin installation this causes an app crash. Since no user code is active the exception cannot be caught.
2019-03-06 01:07:29 +01:00
Alexander Kyte 24c637dd26 Merge pull request #13262 from alexanderkyte/fixup_no_threads
[crash] Detect when 0 attached threads, fix hang/double-fault.
2019-03-05 17:38:16 -05:00
Maxim Lipnin 0e9495a034 Get fully qualified name of ModuleBuilder (#13308)
* Get fully qualified name of ModuleBuilder

* Use MethodBuilder.FileName to find main module
2019-03-05 16:20:47 -05:00
Kenneth Pouncey 9330096912 [wasm][ci]Update to latest JavaScript (engine) Version Updater (#13307)
- The purpose of this is to be able to respond to CI incidents faster for instance specific engine versions when JavaScript engines do not update/install correctly.
- This will install from a forked version of the jsvu repo: https://github.com/GoogleChromeLabs/jsvu
- Forked version rests here:  https://github.com/kjpou1/jsvu/tree/mono-wasm
   - The forked version removes the Node >= 10.0 dependency but brings in the newest 1.4.0 version modifications.
- This should be temporary until we get another solution i.e. a managed version of the engine updater.
2019-03-05 17:08:45 +01:00
Alexander Köplinger d99af881c3 [corlib] Disable ThreadPoolTest.GetAvailableThreads () on machines with many cores
It doesn't work well on the new 64 core ARM machines we have in CI.
2019-03-05 14:33:26 +01:00
Zoltan Varga af87454146 [jit] Avoid an assert when gsharedvt enums are boxed. (#13301)
Fixes https://github.com/mono/mono/issues/13297.
2019-03-05 01:21:02 -05:00
Alexander Köplinger c2a1eb5de6 [corlib] Improve ThreadPoolTest.GetAvailableThreads ()
Don't print console output in the loop and bump timeout.
2019-03-05 01:44:07 +01:00
Zoltan Varga 819660ef97 [netcore] Ongoing work.
* Implement all CustomAttributeExtensions methods.
* Add stubs for __ComObject which is needed by the runtime.
2019-03-04 19:33:46 +01:00
monojenkins 24d55fb184 [master] Fix mono conc hashtable lookup endless loop (#13292)
Fix mono conc hashtable lookup endless loop
2019-03-04 13:11:55 -05:00
monojenkins ef30f5589b [bcl] Update BCL Linked Size 2019-03-04 18:40:41 +01:00
Aaron Hill 290b537a73 Ensure that the module cctor is run before the entry point is executed (#13242)
* Ensure that the module cctor is run before the entry point is executed

We need to ensure that any module cctor for the 'main' image
is run *before* we invoke the entry point

This is required in order for tools like Costura
(https://github.com/Fody/Costura) to work properly. These tools inject
a module initializer which sets up event handlers (e.g. AssemblyResolve),
which allows the main method to run properly

For more information about module constructors,
see https://blogs.msdn.microsoft.com/junfeng/2005/11/19/module-initializer-a-k-a-module-constructor/

* Fix module-cctor-entrypoint.il
2019-03-04 12:31:17 -05:00
Alexander Köplinger e8fbaa5531 [linker] Fix monotouch tests which need Xamarin.iOS.dll (#13287)
The linker couldn't resolve Xamarin.iOS.dll which System.Net.Http references now.
2019-03-04 17:46:56 +01:00
Egor Bogatov af6d863e52 [corlib] Fix Directory.GetLogicalDrives () (#13125)
Fixes #13030
2019-03-04 16:43:46 +01:00
sancheolz 89f264ad86 [SWF] Method OnClosed should pass FormClosedEventArgs type, instead of EventArgs.Empty (#13283)
Fixes #13282
2019-03-04 15:31:59 +01:00
Bernhard Urban 1da9c0f9e7 [interp] mixed mode fixes for delegates (#13215)
* [interp] avoid multiple transformations

* [interp] remove delegate hack for method_ptr=imethod case

it isn't needed anymore

* [interp] ensure initialized fields of a class retrieved from wrapper data

* [fullaot mixed] add test for specific mixed mode scenario

* [interp] remove assertion, it does not take into account multiple threads transforming the same method

* [interp] avoid non-lazy compilation of delegate if interpreter is involved

* [fullaot-mixed] disable on i386

* [interp] propagate errors on delegate init

* fix c++ build

* [tests] improve return codes

* error only for dynamic methods

* [fullaot-mixed] disable test on coop
2019-03-04 15:06:35 +01:00
sancheolz bac5347996 [System.Runtime.Remoting] Implement CustomErrorsMode for RemotingConfiguration (#13251)
Implemented property RemotingConfiguration.CustomErrorsMode.

Fixes #13250
2019-03-04 15:01:40 +01:00
Marek Safar a08eff03f7 [System.Private.CoreLib] Implement more APIs 2019-03-04 12:58:03 +01:00
Zoltan Varga 85c8e85476 [netcore] Ongoing work. (#13278)
* Implement CustomAttributeExtensions methods.
* Add a AssemblyFileVersion attribute.
* Don't try AppDomain.TypeResolve.
2019-03-04 11:59:37 +01:00
Zoltan Varga f82ae71c90 [netcore] Fix threading. 2019-03-03 13:42:10 +01:00
Zoltan Varga 6b6b1ce35e [jit] Fix the RuntimeHelpers.ObjectHasComponentSize () intrinsics. (#13271) 2019-03-03 06:58:11 -05:00
Jan Kotas 9bdb423e5d Fix CoreCLR build break
Signed-off-by: dotnet-bot <[email protected]>
2019-03-03 12:12:26 +01:00
Jan Kotas 6578e93670 Update CoreRT for changes in shared partition
Signed-off-by: dotnet-bot <[email protected]>
2019-03-03 12:10:25 +01:00
Marek Safar 519139773f Fix the build 2019-03-03 12:01:00 +01:00
Marek Safar 243d669a2e Move Activator to shared partition (dotnet/coreclr#22894)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-03 12:01:00 +01:00
Grant d8e9e8fa6d Use BitOperations in more callsites (CoreCLR) (dotnet/coreclr#22630)
* Missed perf improvement in EventProvider

* Add missing methods to StubEnvironment

Signed-off-by: dotnet-bot <[email protected]>
2019-03-02 23:07:39 +01:00
Jan Kotas 84d6476152 Fix CoreFX build break
Signed-off-by: dotnet-bot <[email protected]>
2019-03-02 21:10:37 +01:00
Jan Kotas a31af4add7 Fix netfx build break
Signed-off-by: dotnet-bot <[email protected]>
2019-03-02 21:10:37 +01:00
Alexander Köplinger 64556b9bb9 [ci] Shorten timeout in SDKs tests
The tests normally complete in a few mins.
2019-03-02 12:46:27 +01:00
Calvin Buckley 2ecf08d265 More PPC/AIX regression fixes (#13264)
* Fix System.Math regressions brought on by PowerPC JIT optimizations

	* While frin[.] does do rounding, the semantics are slightly
	  different enough from the BCL that it subtly breaks, as
	  seen by some tests. Ceil/Floor/Trunc are fine, however.
	  Perhaps the sysmath.c version can be translated to asma.

	* Fix typo where signed long comparison for isel was using
	  an unsigned comparison.
	  Add a test for this in the JIT regression check.

* Link against (not fd.o) libbsd for System.Native on AIX

The way we link the library by default will allow some unresolved
symbols. These will get resolved to the runtime when loaded by it.
However, flock isn't in AIX libc, and the native library needs it.
This doesn't seem to be a problem on AIX, but on i libbsd doesn't
seem to be in the dependency chain, so it errors out when you use
it. The workaround is to link libbsd (not the freedesktop.org one)
into the library. According to dump, it seems it has its own copy
of ioctl and fnctl, but they seem benign according to objdump and
don't seem to affect System and corlib tests I've ran to check it.
2019-03-02 12:43:12 +01:00
Marek Safar 30d70e98e6 Fix the build 2019-03-02 11:05:00 +01:00
Morgan Brown 580f5ef53a Implement Serialization Guard
Add Serialization Guard API and consume it in CoreLib targets

Signed-off-by: dotnet-bot <[email protected]>
2019-03-02 11:05:00 +01:00
Maxim Lipnin ed0d055424 Throw InvalidOperationException if inner handler is not assigned 2019-03-02 02:31:54 +01:00
Alexander Kyte db5d8729b4 [crash] Detect when 0 attached threads, fix hang/double-fault. 2019-03-01 16:11:11 -05:00
Zoltan Varga 4970e055b3 [netcore] Implements threads. (#13245)
* [netcore] Implements threads.

There is only one thread object, since there are no domains.

* Make the start callback internal.
2019-03-01 15:15:31 -05:00
Ludovic Henry 234daf1cf3 [android] Fix Mono.Debugger.Soft tests with Android SDKs (#13218)
* [android] Fix Mono.Debugger.Soft tests with Android SDKs

* [android] Fix connecting with LLDB

* [android] Add scaffolding to run profiler tests

* [android] Fix some corlib tests

* [android] Fix Mono.DebuggerTests.ExceptionFilter2

* [csproj] Update project files
2019-03-01 21:03:26 +01:00
Rolf Bjarne Kvinge c99fe4b462 [mini] Inline Selector.GetHandle for tvOS and watchOS assemblies as well. (#13246) 2019-03-01 11:10:04 -05:00
monojenkins 83d5cf0c5c [android] Fix inaccurate detection of sendfile() (#13243)
[android] Fix inaccurate detection of sendfile()
2019-03-01 10:28:34 -05:00
Alexander Kyte 23c83a48cd [runtime] Optimize array_set_value_impl slow path (#13186)
* [runtime] Add unmanaged fast-path for mono_class_is_assignable_from

Our managed code has a fast path for this that checks if the two types
are the same. The unmanaged calls here always falls back on the slow path.

This leads to a latency that is pretty observable during
array_set_value_impl calls.

* [runtime] Make faster already-pinned nullable init path

* [runtime] Expose non-handle-allocating object_handle_isinst_mbyref

* [runtime] Use MONO_ENTER_NO_SAFEPOINTS for array_set_value_impl
2019-03-01 10:21:02 -05:00
Vlad Brezae e4b281825a [interp] Add fast paths for common cast checks (#13225)
* [interp] Remove some duplicated code

* [interp] Optimize type checking for interfaces

Mainly to avoiding handles for common scenarios. Makes type checking for common interfaces 10x faster.

* [interp] Optimize type checking for common classes

Mainly to avoiding handles for common scenarios. Makes type checking for common classes 10x faster.
2019-03-01 10:19:12 -05:00
Alexander Köplinger 98e0f2697d [sdks] Use throttle() instead of lock()
The former works in freestyle builds.
2019-03-01 14:45:16 +01:00
Alexander Köplinger f5b9af2505 Revert "[sdks] Make sure to run only one build per type per node"
This reverts commit b740313aa5.

We actually want to only run one build per product on a node,
e.g. so that android-debug and android-release can't run on
the same node and stomp on each other's toolchain.
2019-03-01 13:57:06 +01:00
Alexander Köplinger 793c3aa3aa [ci] Add node name to log of Jenkins pipeline builds
Makes it easier to figure out where a build ran.
2019-03-01 13:31:01 +01:00
Alexander Köplinger 5bf74a9954 [System.Net.Http] Move NSUrlSessionHandler from xamarin-macios to mono (#13229)
* [System.Net.Http] Move NSUrlSessionHandler from xamarin-macios to mono

This allows us to remove the need for a special custom System.Net.Http.dll
build in the xamarin-macios repository.

Part of #11397

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-01 12:20:27 +01:00
Katelyn Gadd 6c58376102 If a ClientIdentity has no ClientProxy then return null from the accessor instead of throwing. Experimental partial fix for issue #13113 2019-03-01 11:59:50 +01:00
Levi Broderick fcbc8c3792 Add Rune.DecodeUtf16 / DecodeUtf8 and friends (dotnet/coreclr#22725)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-01 09:57:09 +01:00
Aaron Robinson 3508069707 Move COM related attributes to the shared source location of Object class. (#22942)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-01 09:57:09 +01:00
Tanner Gooding 5b02347ae8 Removing the ExtractVector128 and InsertVector128 APIs that take an address. (#22886)
* Removing the InsertVector128 and ExtractVector128 overloads that take an address from S.P.Corelib

* Removing the ExtractStore and InsertLoad tests.

* Fixing the PacketTracer test to use the appropriate Extract/InsertVector128 overloads

* Removing the JIT support for the Extract/InsertVector128 overloads that take an address.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-01 09:54:21 +01:00
monojenkins 041e874182 [bcl] Update BCL Linked Size 2019-03-01 09:32:07 +01:00
Alexis Christoforides adc62b328e [monodroid] Use CoreFX to implement System.Drawing types that used to be in Mono.Android.dll (#13135)
* [monodroid] Use CoreFX to fill in reference stubs for System.Drawing types that are currently 'forked' from Mono into Mono.Android.dll

The list of localy implemented System.Drawing types: https://github.com/xamarin/xamarin-android/blob/e0da1f152de84c4cc39983f2fda775ec98c08250/src/Mono.Android/Mono.Android.csproj#L311-L325

* [netstandard] Update for Mono.Android change

* Bump reference assemblies to include Mono.Android update

* Use System.Drawing.Common to find moved types in monodroid case for netstandard facade

* Bump API snapshot submodule

* [csproj] Update project files
2019-03-01 01:50:44 +01:00
Alexander Köplinger 4ea57007fa [Mono.Debugger.Soft] Disable Attach() test that fails or hangs (#13239)
It was recently reenabled in #9091 but it fails/hangs frequently.
2019-03-01 01:43:19 +01:00
Aaron Robinson b5d6e5344f Set the MarshalByRefObject to be ComVisible and (dotnet/coreclr#22930)
a IDispatch class interface. this is being done
  to ensure WinForms consumers can interact with
  COM based controls.

Signed-off-by: dotnet-bot <[email protected]>
2019-03-01 00:28:08 +01:00
Stephen Toub b0935ae258 Fix DumpAsync to understand ContinuationWrapper (dotnet/coreclr#22913)
Continuations created while the debugger is attached or certain EventSource events are enabled end up getting wrapped in an extra ContinuationWrapper object that carries some additional information.  DumpAsync currently isn't unwrapping these but should.  This just teaches it to look for a known field name so that it can "see through" these wrappers while following async "stacks".

Signed-off-by: dotnet-bot <[email protected]>
2019-02-28 23:30:53 +01:00
Marek Safar a88ad66551 Build fixes 2019-02-28 23:05:24 +01:00
Jan Kotas 51a4aae4ff Fix CoreRT build break
Signed-off-by: dotnet-bot <[email protected]>
2019-02-28 23:05:24 +01:00
Stephen Toub ee67c17eb3 Address PR feedback (clean up style in Thread.CoreCLR.cs)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-28 23:05:24 +01:00
Stephen Toub 54d2a05d66 Fix Thread-related breaking changes
- Thread.ExecutionContext needs to return ExecutionContext.Capture() to public callers.
- Fix restoring of culture to be inside of the ExecutionContext callback where applicable

Signed-off-by: dotnet-bot <[email protected]>
2019-02-28 23:05:24 +01:00
Marek Safar 4c4421f30d Fix the build 2019-02-28 22:41:40 +01:00
Filip Navara d14b15f502 Move Thread to shared CoreLib (dotnet/coreclr#22744)
* Move Thread to shared CoreLib

* Remove all local variables from Thread in shared code

* Remove duplicate checks

* Port back CoreRT changes needed for shared code

* Fix missing culture initialization in ThreadStart()

* Adjust for shared WaitHandle

Signed-off-by: dotnet-bot <[email protected]>
2019-02-28 22:41:40 +01:00
Johan Lorensson 80e5e7ff62 Cancel sync IO on Windows when aborting thread. (#13173)
* Cancel sync IO on Windows when aborting thread.

Using CancelIO/CancelIOEx or CancelSynchronousIo on a thread that is moving
into a suspended state can cause these calls to hang (they shouldn’t but
have been observed to be the case). Fix does the cancel of sync IO after
the aborted thread has been resumed, but before releasing suspend locks
making sure thread won't be suspend again until after cancel IO call has
completed.

* Add tests aborting blocking socket and file IO on Windows.
2019-02-28 16:02:21 -05:00
Alexander Köplinger e3caf01677 [sdks] Use abspath instead of PWD on iOS app build (#13230)
PWD is the wrong directory when e.g. you're doing "make -C sdks/ios" from the repo root.

Fixes https://github.com/mono/mono/issues/13224
2019-02-28 21:47:21 +01:00
Mikhail Filippov f512a68edc [Mono.Debugger.Soft] Add new debugger tests and fix the Attach() test (#9091)
* Fixed the Attach() test which required a free port to attach.

* Added test for incorrect events behavior when VM is started with suspend

* Bump API snapshot submodule
2019-02-28 19:29:30 +01:00
Calvin Buckley a4eee02195 PPC JIT optimizations (System.Math instruction inlining) (#11964)
* [ppc] Optimize floating point performance in the JIT sqrt/sqrtf/abs

* [ppc] Integer Min/Max inlining wiht POWER5 isel instruction

Compresses a function call down to two instruction, for both signed
and unsigned, long and int. Needs to check for POWE5 though, and I
don't know the effects of this on ppc32. FP version using fsel is
also desirable, but not in the scope of this commit.

* [ppc] Check for POWER5 compatible CPU before using isel

* [ppc] Don't use long min/max inlining for ppc32

Other 64-bit operations are marked for ppc64 only.

* [ppc] also ifdef that out for ppc32 too

* [ppc] Rounding function optimizations
2019-02-28 09:31:12 -05:00
Johan Lorensson 3487962a82 Merge pull request #13210 from lateralusX/lateralusX/adjust-test-console-output
Update output from console-output test.
2019-02-28 06:40:33 -05:00
Johan Lorensson dd9ee189c6 Merge pull request #13212 from lateralusX/lateralusX/add-waitforkeypress-test-project
Add atexit-waitforkeypress handler in Visual Studio mono.sln test projects run args.
2019-02-28 05:06:38 -05:00
monojenkins ace38db535 [bcl] Update BCL Linked Size 2019-02-28 08:24:51 +01:00
Martin Baulig 3f43547cd6 [corlib]: Use Guid.NewGuid() implementation from CoreFx. (#13189)
* [corlib]: Use `Guid.NewGuid()` implementation from CoreFx.

The corefx implementation of `Guid.NewGuid()` uses the internal
`Interop.GetRandomBytes(byte*, int)`, which uses `RNGCryptoServiceProvider`
directly without using `CryptoConfig`.

* [csproj] Update project files

* Rename Guid.MonoTouch.cs -> CommonCrypto/Guid.cs.
2019-02-28 00:37:25 -05:00
Ludovic Henry 53b7b79f53 Initial support for Fuchsia (#13200)
* Initial support for Fuchsia

Compile like this:

if you have Zircon installed, with the prebuilts on "../zircon", use this to compile:

CC="`pwd`/../zircon/prebuilt/downloads/clang/bin/clang-9 -nostdlib -O2 -g -fdebug-prefix-map=/cvs/fuchsia/zircon=. -finline -fno-common -ffunction-sections -fdata-sections -no-canonical-prefixes -march=x86-64 -mcx16 --target=x86_64-fuchsia -fPIC -D_ALL_SOURCE=1 -DENABLE_DRIVER_TRACING=1 -fasynchronous-unwind-tables -fno-omit-frame-pointer  -std=c11 -I`pwd`/../zircon/build-x64-clang/sysroot/include/ -I`pwd`/../zircon/system/public" LDFLAGS="-L`pwd`/../zircon/build-x64-clang/sysroot/lib/ -L`pwd`/../zircon/build-x64-clang/sysroot/debug" ./configure --host=x86_64-google-fuchsia

* Use HOST_FUCHSIA rather than TARGET_FUCHSIA
2019-02-27 21:33:15 -05:00
Bernhard Urban 69cb9ad922 [interp] fix conflict of #13154 and #13177 (#13208)
See https://github.com/mono/mono/pull/13177#discussion_r259872514
2019-02-27 21:32:37 -05:00
Bernhard Urban 2030ebdc5e [interp] compute size of generic valuetype correctly (#13216)
[interp] compute size of generic valuetype correctly

Otherwise we smash the stack.


Contributes to https://github.com/xamarin/xamarin-macios/issues/5622
2019-02-27 18:25:40 -05:00
Calvin Buckley a3be248d3f [corlib] Simplify RuntimeInformation by getting OS name from the runtime (#13164)
We can get the the OS name similar to the architecture from the value that is used by the runtime for DllMaps.

Cached the values into static fields so we only need to do the runtime icall once.

Added all the existing OS names recognized by DllMap to RuntimeInformation.
This also allows us to mark some corlib/System tests that hang the runtime on AIX as non-working.
2019-02-27 23:21:34 +01:00
Miguel de Icaza fe92cea485 Use HOST_FUCHSIA rather than TARGET_FUCHSIA 2019-02-27 16:54:50 -05:00
Bernhard Urban a3dd8b3246 [lldb] fix helper for interpreter stacktraces (#13211)
Broke due to b6775765ed
2019-02-27 21:55:14 +01:00
Marek Safar 6f8ec5fdce Fixes build 2019-02-27 21:24:21 +01:00
Grant 448fd6ac62 Make BitOperations public (CoreCLR) (dotnet/coreclr#22864)
* Make BitOps public

* Update name to BitOperations

* Change namespace to System.Numerics

* Fix file name

* Alphabetical

Signed-off-by: dotnet-bot <[email protected]>
2019-02-27 21:24:21 +01:00
Maxim Lipnin 1ab0ffc964 [corlib] Update DriveInfo tests to use the newer RuntimeInformation APIs (#13205) 2019-02-27 19:23:19 +01:00
lateralusX 695743e3ab Add atexit-waitforkeypress handler in Visual Studio mono.sln test projects run args. 2019-02-27 17:45:57 +01:00
lateralusX ac906dd937 Update output from console-output test.
Current output from console-output test is just Error and Out (indicating)
the different console output streams. When seen in log files the error output
string can be misleading. Fix makes it clearer that the output is originating
from a test and not an “error”.
2019-02-27 17:19:30 +01:00
Zoltan Varga 8ca41f08a0 [jit] Fix the class of the stack entry for ldelema, it should be the class not its element class. (#13134)
Fixes https://github.com/mono/mono/issues/10101.
2019-02-27 16:31:54 +01:00
Martin Baulig 55a34261c9 [Mono.Security]: minor CryptoConvert changes to make it more linker-friendly. (#13204)
* Add new internal `CryptoConvert.TryImportCapiPrivateKeyBlob()` method that's using `RSAManaged` directly to make it more linker-friendly.

* Also add new internal `CryptoConvert.TryImportCapiPublicKeyBlob()`.

* Use it in `AssemblyName.IsPublicKeyValid`.
2019-02-27 12:56:06 +01:00
Zoltan Varga ce2259d009 [runtime] Default Interface method fixes. (#13154)
* [runtime] Inflate overridden methods properly during vtable construction when using default interface methods.

* [jit] Handle default interface methods in constrained calls, they need to box if the constrained type is a valuetype which doesn't override the default method.

* [runtime] Update Default Interface Methods tests from coreclr.

* [jit] Fix interp support.
2019-02-26 22:00:46 -05:00
Ankit Jain f7d053a0d6 nuget-hash-extractor: Improvements to reduce unnecessary diffs on update (#13197)
* [nuget-hash-extractor] Make the order for denied lists deterministic and

.. stable. We were not sorting the list of assemblies with the same
version, causing irrelevant changes in updates.

* Update denied assembly list to fix order

.. to be deterministic. Generated with the updated
nuget-hash-extractor.cs .

* [nuget-hash-extractor] Make the order of assemblies deterministic

The .nupkgs were being processed in arbitrary order, causing unncessary
diffs when updating them which required manual work to check and fix
them.
2019-02-27 00:41:11 +01:00
Martin Baulig 6a3b12b622 Revert "[Mono.Security]: minor CryptoConvert changes to make it more linker-friendly." (#13202)
This reverts commit ef7e64a5be.
2019-02-27 00:17:37 +01:00
Stephen Toub 48f65d5108 Special-case 1 module per assembly in Assembly.GetTypes/DefinedTypes (#22825)
It's very common for an assembly to have only one module, in which case we can avoid unnecessary allocations and copies in Assembly.GetTypes() and Assembly.DefinedTypes.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-27 00:03:26 +01:00
Dotnet-GitSync-Bot 2b4bff1956 Mirror changes from mono/coreclr (#13192)
This PR contains mirrored changes from mono/coreclr


**Please REBASE this PR when merging**

 cc @grant-d
2019-02-26 23:59:38 +01:00
Ludovic Henry a685cf26a4 [ci] Add new mode of execution for nunit tests on Android (#13098)
* [ci] Add new mode of execution for nunit tests on Android

This makes it possible to run the `nunit-lite-console.exe` on the host, while the tests still run on the device. This makes it transparent wherever the tests are running, giving us a seamless integration with the existing infrastructure based around nunit.

* [android] Fix System.Net.Http test suite

* [android] Fix System.ServiceModel.Web test suite

* [android] Fix Mono.Security test suite

* fixup! [ci] Add new mode of execution for nunit tests on Android

* [ci] Disable failing tests

* [csproj] Update project files
2019-02-26 22:08:01 +01:00
Miguel de Icaza a55e8496be Initial support for Fuchsia
Compile like this:

if you have Zircon installed, with the prebuilts on "../zircon", use this to compile:

CC="`pwd`/../zircon/prebuilt/downloads/clang/bin/clang-9 -nostdlib -O2 -g -fdebug-prefix-map=/cvs/fuchsia/zircon=. -finline -fno-common -ffunction-sections -fdata-sections -no-canonical-prefixes -march=x86-64 -mcx16 --target=x86_64-fuchsia -fPIC -D_ALL_SOURCE=1 -DENABLE_DRIVER_TRACING=1 -fasynchronous-unwind-tables -fno-omit-frame-pointer  -std=c11 -I`pwd`/../zircon/build-x64-clang/sysroot/include/ -I`pwd`/../zircon/system/public" LDFLAGS="-L`pwd`/../zircon/build-x64-clang/sysroot/lib/ -L`pwd`/../zircon/build-x64-clang/sysroot/debug" ./configure --host=x86_64-google-fuchsia
2019-02-26 15:55:41 -05:00
Zoltan Varga 5f5ef1efe5 [wasm] Disable chakra tests until its fixed. (#13199) 2019-02-26 21:41:46 +01:00
Vlad Brezae 88c560ad72 [interp] Avoid clearing the stack with each call (#13177)
* [interp] Move special case initialisation of frame->ip

* [interp] Properly init locals

When we have locals that need to be initialized.

* [interp] Load the entire enum value

When calling calling method on constrained type for enums with long storage.

* [interp] Avoid clearing the stack with each call

Reducing overhead for each call, this can give an overall performance improvement of 5%.
2019-02-26 12:01:29 -05:00
Alexander Kyte a0c6a15465 [runtime] Use FastCopy on multidimensional arrays (#13181) 2019-02-26 10:09:46 -05:00
Maxim Lipnin fc240aaa1c Consider unknown GB18030 characters as invalid to enforce use of replacement character instead of throwing SystemException. (#13188)
* Consider unknown GB18030 characters as invalid to enforce use of replacement character instead of throwing SystemException.

* Return negative result for unknown character instead of throwing SystemException in GB18030Source.FromUCS
2019-02-26 12:51:51 +01:00
Zoltan Varga 5225828263 [corlib] Add a RuntimeTypeHandle::GetCorElementType () icall, use it to remove a few other small icalls. 2019-02-26 12:51:14 +01:00
Alexander Köplinger 97f0a0f94c [ci] Use dl.internalx.com when building on private Jenkins
(cherry picked from commit 9d4aa950aa)
2019-02-26 11:25:45 +01:00
Martin Baulig ef7e64a5be [Mono.Security]: minor CryptoConvert changes to make it more linker-friendly.
* Add new internal `CryptoConvert.TryImportCapiPrivateKeyBlob()`
  method that's using `RSAManaged` directly to make it more
  linker-friendly.

* Use it in `AssemblyName.IsPublicKeyValid`.
2019-02-26 10:18:54 +01:00
Kenneth Pouncey 07287648b2 [wasm] Add browser test suite. (#13145)
* [wasm] Add browser test suite.

- Runs a series of tests against the HttpClientHandler and blob tests.

* Setup custom browser launcher to pass `--no-sandbox` to work on CI

* Remove auto client config that caused async errors on tests.
2019-02-26 10:07:21 +01:00
Marek Safar 7c975c18d8 AssemblyLoadContext from shared 2019-02-25 23:39:31 +01:00
Marek Safar 5ae98353a6 Move AssemblyLoadContext to shared partition (dotnet/coreclr#22685)
* Move AssemblyLoadContext to shared partition

* Move static initializer to DefaultAssemblyLoadContext

and remove stream copying from lock scope

Signed-off-by: dotnet-bot <[email protected]>
2019-02-25 23:39:31 +01:00
Martin Baulig 7f3a127b6d Remove unused (and broken) mono_btls_ssl_ctx_get_servername(). (#13184) 2019-02-25 20:15:17 +01:00
Bernhard Urban fc171a192a [aot] abort lookup early when a method isn't available in AOT image (#13138)
[aot] abort lookup early when a method isn't available in AOT image

Mixed mode depends on that.  Usually, compile_method of mini takes care
to request only existing methods from the AOT image, but in some cases,
e.g. from a trampoline, AOT runtime is quiered directly.

Contributes to https://github.com/xamarin/xamarin-macios/issues/5618
2019-02-25 10:56:15 -05:00
Jay Krell 2f3f58c7f1 [mkbundle] Fix mapping length (#13061)
* https://github.com/mono/mono/issues/11643 mkbundle problem - Illegal byte sequence

The size of the mapping is the maximum file offset to map.
See https://docs.microsoft.com/en-us/windows/desktop/Memory/creating-a-file-mapping-object.

When I tried it, I got a different error.

If in the debugger you simulate this fix, it gets further.

Here is a small program to exercise and see the behavior:

```
// include <windows.h>
// include <stdio.h>
// include <stdlib.h>
//
// int main()
// {
//  // Create a 128K file.
//
//  HANDLE file = CreateFile("1", GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);
//  printf("createfile %p %d\n", file, GetLastError());
//
//  HANDLE map = CreateFileMapping(file, 0, PAGE_READWRITE, 0, 1 << 17, 0);
//  printf("createmap %p %d\n", map, GetLastError());
//
//  CloseHandle(map);
//  CloseHandle(file);
//  system("dir");
//
//  // Attempt to map the second 64K of the 128K file, with a 64K mapping.
//
//  file = CreateFile("1", GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
//  printf("createfile %p %d\n", file, GetLastError());
//
//  map = CreateFileMapping(file, 0, PAGE_READWRITE, 0, 1 << 16, 0);
//  printf("createmap %p %d\n", map, GetLastError());
//
//   // This fails.
//
//  PVOID view = MapViewOfFile(map, FILE_MAP_WRITE, 0, 1 << 16, 1 << 16);
//  printf("view %p %d\n", view, GetLastError());
//
//  CloseHandle(map);
//
//  // Use a 128K mapping instead. It works.
//
//  map = CreateFileMapping(file, 0, PAGE_READWRITE, 0, 1 << 17, 0);
//  printf("createmap %p %d\n", map, GetLastError());
//
//  view = MapViewOfFile(map, FILE_MAP_WRITE, 0, 1 << 16, 1 << 16);
//  printf("view %p %d\n", view, GetLastError());
// }
```

Here is debugging mono and simulating the fix in the debugger (I did not build or test
the fix):

```

\bin\amd64\cdb C:\Users\jaykrell\Downloads\output\output.exe

0:000> bm kernel*!*createfilemap*
0:000> g

Breakpoint 2 hit
KERNELBASE!CreateFileMappingW:
00007ffd`0a449de0 4883ec48        sub     rsp,48h
0:000> dv
                  hFile = 0x00000000`00000200
lpFileMappingAttributes = 0x00000000`00000000
              flProtect = 2
      dwMaximumSizeHigh = 0
       dwMaximumSizeLow = 0x477000
                 lpName = 0x00000000`00000000 ""

0:000> bm kern*!*mapviewoffile*
0:000> g
Breakpoint 38 hit
KERNEL32!MapViewOfFileStub:
00007ffd`0b09bfa0 48ff2591c10500  jmp     qword ptr [KERNEL32!_imp_MapViewOfFile (00007ffd`0b0f8138)] ds:00007ffd`0b0f8138={KERNELBASE!MapViewOfFile (00007ffd`0a465ad0)}
0:000> dv
  hFileMappingObject = 0x00000000`00000204
     dwDesiredAccess = 4
    dwFileOffsetHigh = 0
     dwFileOffsetLow = 0x30000
dwNumberOfBytesToMap = 0x477000
0:000> gu
0:000> r rax
rax=0000000000000000
0:000> !gle
LastErrorValue: (Win32) 0x5 (5) - Access is denied.
LastStatusValue: (NTSTATUS) 0xc000001f - {Invalid Mapping}  An attempt was made to create a view for a section which is bigger than the section.

0:000> .restart
0:000> bm kernel*!*createfilemap*
0:000> g
0:000> dv
                  hFile = 0x00000000`00000220
lpFileMappingAttributes = 0x00000000`00000000
              flProtect = 2
      dwMaximumSizeHigh = 0
       dwMaximumSizeLow = 0x477000
                 lpName = 0x00000000`00000000 ""
0:000> ?? dwMaximumSizeLow += 0x30000
unsigned long 0x4a7000
0:000> bc *
0:000> g
Corlib not in sync with this runtime: The runtime did not find the mscorlib.dll it expected. Expected interface version CA4932AE-2294-4ECD-B863-BF98FDD84F33 but found 0CC970F6-6F25-4218-9427-3E4C3DC8DE33. Check that your runtime and class libraries are matching.
Loaded from: mscorlib.dll
Download a newer corlib or a newer runtime at http://www.mono-project.com/download.

```

* Restore useful part of comment.

* Restore dead code.

* Add to comment the other possibility that is being countered.

* Additional explanation.
2019-02-25 09:48:04 -05:00
Johan Lorensson e6d259b82c Fix multiple issues with response file option on Windows. (#13132)
* Fix multiple issues with --response file option on Windows.

* If file is UTF8 encoded and include BOM mark, implementation failed to
detect and remove BOM mark causing errors. Fix check for BOM mark and if
found, remove it before passed to parsing. NOTE, current implementation
only supports UTF8 (and ASCII) content in response file and won't detect
or handle any other codepages.

* Since the content in --response file should mimic what should have been
passed on command line, we should apply same parsing rules on Windows as done
by the shell when running the arguments on the command line. Current
implementation uses its own parsing that is not the same as used by the Windows
shell, meaning that arguments can't be identical in response file compared to
what's passed on command line. This commit fix parsing of the command
line in the response file so its first parsed by the shell before added
to internal argc, argv parameters (similar as done when passed to main function).

* Add support to handle new lines in response file on Windows.
2019-02-25 09:42:44 -05:00
Radek Doulik 4a96c5e715 [aot] Resolve profile against compiled assembly (#13148)
[aot] Resolve profile against compiled assembly

When trying to use AOT profile in XA for assembly AOT compilation, the
methods from the profile were not compiled.

Context: https://github.com/xamarin/xamarin-android/issues/2504

The problem was, the profile data were not resolved, as there was no
assembly loaded in the domain.

With this fix, the compiled assembly is used to resolve the profile as
well.
2019-02-25 08:35:48 -05:00
Marek Safar ecef8d334a [System.Private.CoreLib] Implement more APIs 2019-02-25 13:51:30 +01:00
monojenkins 8a417e9cb6 Bump API snapshot submodule 2019-02-25 13:30:32 +01:00
Martin Baulig aee90aca7c Make System.dll internals visible to Mono.Android. 2019-02-25 13:30:32 +01:00
Zoltan Varga c94af71bf0 [corlib] Hardcode IsRunningOnWindows as false on WASM too. (#13161) 2019-02-25 03:18:28 -05:00
Kenneth Pouncey fdbebe278e Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays 2019-02-25 04:54:45 +01:00
Zoltan Varga 6644136745 [wasm] Update to emscripten 1.38.28. (#13160)
* [wasm] Update to emscripten 1.38.28.

The emscripten patch is no longer needed.

* [wasm] Disable optimizations in SHA1Transform (), the normal version seems to cause stack overflows in binaryen's asm2wasm tool.
2019-02-24 22:50:31 -05:00
Zoltan Varga f52f874aae [wasm] Small fixes. (#13166)
* [wasm] Disable an unused icall which has an invalid signature under wasm.

* [aot] Make the dedup pass less verbose.
2019-02-24 22:42:55 -05:00
Eric StJohn b936c53101 Make System.Runtime.CompilerServices.Unsafe inbox (dotnet/corefx#35526)
* Make System.Runtime.CompilerServices.Unsafe inbox

Fix a couple places where we wanted to use it from other inbox assemblies but couldn't.

Unsafe remains as a package and newer versions of Unsafe will replace the inbox Version,
permitting us to add API over time.

* Update Rune tests to use TryEncodeToUtf8Bytes directly

* Add temporary suppression to package tests

Signed-off-by: dotnet-bot <[email protected]>
2019-02-23 08:52:41 +01:00
Ankit Jain 6df26e8287 [nuget] Add new versions of System.Net.Http
.. to the list of denied assemblies. Added `4.3.4`.

Prompted by issue #12603 .
2019-02-23 08:51:03 +01:00
Ankit Jain ae240f1f8e [nuget] Add new versions of System.Text.Encoding.CodePages ..
.. to the list of denied assemblies. Added:

- `4.5.0`
- `4.5.1`

Fixes issue #12603 .
2019-02-23 08:51:03 +01:00
Jan Kotas 6df88479c8 Change Environment.Version to return product version (dotnet/coreclr#22664)
* Change Environment.Version to return product version

- Contributes to https://github.com/dotnet/corefx/issues/31099
- Use AssemblyInformationalVersion attribute as fallback

* Add sanity test for Environment.Version

* Disable CodeDom tests

* Fix test assembly name

Signed-off-by: dotnet-bot <[email protected]>
2019-02-23 08:49:36 +01:00
Stephen Toub b0d3ead369 Ignore EINVAL/EBADF errors from FTruncate in FileStream.Init (#22788)
They indicate we're working with a special file, where failure to truncate is not a fatal condition.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-22 22:24:37 +01:00
Vincent Dondain 0525583d1e [System] Bump SocketTest.TestSelect1 socket timeout to 1ms (#13152)
- Previous test with 100 micro second timeout would fail on iOS device when running **all the socket tests** about 3 times out of 5.
- With a 1 millisecond timeout, it didn't fail the 10 times I tried locally, hopefully this is enough to fix the flakiness.
- Fixes #8360: [System.Net.Sockets] flakey failures of SocketTest.TestSelect1 on Darwin systems
  (https://github.com/mono/mono/issues/8360)
- Also partial fix for maccore issue https://github.com/xamarin/maccore/issues/1069
2019-02-22 21:28:06 +01:00
Kenneth Pouncey 80f8aa27b1 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays
# Conflicts:
#	sdks/wasm/Makefile
2019-02-22 14:24:14 +01:00
Ankit Jain a4fada3900 [fsharp] Fix a type inference error introduced by recent changes (#13109)
```
@/external/bockbuild/builds/fsharp-fsharp-6624925/src/scripts/fssrgen.fsx(334,28): error FS0041: A unique overload for method 'GetFileNameWithoutExtension' could not be determined based on type information prior to this program point.
A type annotation may be needed. Candidates: System.IO.Path.GetFileNameWithoutExtension(path: System.ReadOnlySpan<char>) : System.ReadOnlySpan<char>, System.IO.Path.GetFileNameWithoutExtension(path: string) : string
[@/external/bockbuild/builds/fsharp-fsharp-6624925/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj]
```
2019-02-22 08:00:41 -05:00
Bernhard Urban 3be2390665 [aot] add wrappers to "slim" mscorlib (i.e. --aot=interp) (#13137)
* [aot] add gc wrappers in interp scenario

* [aot] add icall wrappers in interp scenario
2019-02-22 07:59:53 -05:00
Zoltan Varga 55c998d282 [aot] Only emit the static interp trampolines/wrappers into the mscorlib AOT image. (#13117) 2019-02-22 07:58:57 -05:00
Ludovic Henry 49b6628370 [aot] use unbox arbitrary trampolines for "slim" mscorlib (#13139)
We need the recently introduced "unbox arbitrary" trampolines in one more
scenario: non-mscorlib AOT code calls a method from mscorlib with
interpreter. Before we just relied on the amodule not being available,
but mscorlib amodule is always present due to wrappers, trampolines,
etc.
2019-02-22 07:57:16 -05:00
Vlad Brezae b6775765ed [interp] Cleanup code a little (#13092)
* [interp] Cleanup code a little

* [interp] Rename rtm to imethod
2019-02-22 07:55:37 -05:00
Thays Grazia 1e1e0b6b01 [wasm] [debugger] Add test suite. (#13093)
* [wasm] [debugger] Add test suite.

* [wasm] [debugger] Add test suite.

* [wasm] [debugger] Add test suite.

* Changing what Larry suggested and removing some -debug that is not used.

* Adding the DebuggingTestSuite.

* indentation

* Update run-jenkins.sh
2019-02-22 07:52:59 -05:00
Zoltan Varga 50ce9ed8e5 [netcore] Implement AppContext. 2019-02-22 10:19:37 +01:00
monojenkins 66e88b1e6b [bcl] Update BCL Linked Size 2019-02-22 10:03:28 +01:00
Bernhard Urban af46af33a1 [jit/cprop] insert dummy insn if first insn of basic block got replaced (#13127)
[jit/cprop] insert dummy insn if first insn of basic block got replaced

Fixes https://github.com/mono/mono/issues/13056 & https://github.com/mono/mono/issues/13057
2019-02-21 21:05:34 -05:00
Bernhard Urban 8891a4b778 [aot] use unbox arbitrary trampolines for "slim" mscorlib
We need the recently introduced "unbox arbitrary" trampolines in one more
scenario: non-mscorlib AOT code calls a method from mscorlib with
interpreter. Before we just relied on the amodule not being available,
but mscorlib amodule is always present due to wrappers, trampolines,
etc.
2019-02-21 23:28:41 +01:00
Zoltan Varga 2124448a37 [runtime] Move mono_get_context_capture_method () from security-manager.c to object.c. (#13071) 2019-02-21 16:26:05 -05:00
Maxim Lipnin 506406df06 Try to extract valid drive name from DriveInfo ctor string argument (#13105)
It's possible to pass any string as an argument to DriveInfo ctor (e.g.  `new DriveInfo(Path.GetTempPath())`). Mono throws ArgumentException if there is no exactly the same drive name in the list of available drives.

I tried to handle this case by extracting any valid drive name from the array of available drives sorted by path in descending order.

Fixes https://github.com/mono/mono/issues/12157
2019-02-21 21:57:55 +01:00
Marek Safar 020ce70e30 [System.Private.CoreLib] Implement more APIs 2019-02-21 21:34:18 +01:00
Martin Baulig 7277e3bb5e SslStream improvements and tests
* Add server-side Server-Name-Indication (SNI) support (both AppleTls and BTLS).

* Support the new `SslServerAuthenticationOptions.ServerCertificateSelectionCallback`.

* Server certificate selection is now compatible with CoreFx behavior; first
  checking the new `ServerCertSelectionDelegate` then `LocalCertSelectionCallback`
  and finally using an explicitly provided certificate.

* Misc exception checks and fixes to make behavior consistent with CoreFx;
  any exception thrown by reading / writing the underlying stream will now be
  propagated verbatim (and not wrapped in an `AuthenticationException`);
  exceptions thrown by the handshake / TLS stack itself will still be wrapped.

* Added `System.Net.Security` xUnit tests from CoreFx.

* Misc test cleanups; moved certificate test files from `System.Net.Http` into
  `System` and embed them in the test assembly as resources, adjusting
  `test-helpers/Configuration.Certificates.cs` accordingly.
2019-02-21 20:43:25 +01:00
Zoltan Varga aa04713723 [llvmonly] Do null checks on interp transitions for virtual->non virtual calls. (#13118)
Fixes https://github.com/mono/mono/issues/12998.
2019-02-21 12:24:14 -05:00
Alexander Köplinger b740313aa5 [sdks] Make sure to run only one build per type per node
They could conflict while provisioning android toolchains etc. otherwise.
2019-02-21 17:33:41 +01:00
Ankit Jain bda914c9b5 [bockbuild] Bump to master HEAD to get new fixes (#13108) 2019-02-21 17:19:27 +01:00
Zoltan Varga 576b1a0827 [llvm] Mark the branch in OP_GC_SAFE_POINT as taken. (#13114) 2019-02-21 10:08:04 -05:00
Kenneth Pouncey 7038d1915a Small cleanup 2019-02-21 14:05:08 +01:00
Kenneth Pouncey 49b92c95d0 Modify public interface CopyTo and CopyFrom to use lightweight Span<U>.
- Modifications in response to review comments.
2019-02-21 14:03:24 +01:00
Johan Lorensson 6f786bc465 Disable Mono.CSharp on Windows x64 full AOT test. (#13124)
Not part (and should not be) part of the winaot profile and therefore not testable (even though they pass when manually AOT:ing the assembly).
2019-02-21 13:29:34 +01:00
Vlad Brezae ff84ee290e [runtime] Remove dead code (#13089)
[runtime] Remove dead code

Interface method calls on constrained types are resolved in get_method_constrained now (apparently since https://github.com/mono/mono/commit/3259e04ace67552fc8d63a8f1ddbb830e526f05f)
2019-02-21 06:55:48 -05:00
Tanner Gooding af1034a99c Enable the HWIntrinsic extension methods and remove the instance implementations (#22705)
* Removing various S.R.I.Vector instance method APIs, since they should now be exposed as extension methods

* Updating the JIT to recognize the S.R.I.Vector extension methods.

* Updating various S.R.I.Vector test templates

* Regenerating the S.R.I tests that are created from a template.

* Fixing the numArgs for Base_Vector256_GetLower

* Fixing the handling for `Base_VectorXXX_As` to normalize the struct type.

* Adding the Base_Vector128_As intrinsics back for arm64

Signed-off-by: dotnet-bot <[email protected]>
2019-02-21 12:26:09 +01:00
Nikolay Sivov ffd601eed4 Fix some compiler warnings (#13044)
Fix some compiler warnings

Compiled with gcc 8.2.0/x86_64-linux-gnu.
2019-02-21 06:05:47 -05:00
Vlad Brezae 809e40435f [tests] Fix function signature (#13090)
[tests] Fix function signature

To match pinvoke signature from pinvoke-2 test.
2019-02-21 04:15:53 -05:00
Johan Lorensson 3622703cbe Enable all CI test suites for Windows x64 full AOT. (#13102) 2019-02-21 10:04:20 +01:00
Ben Adams bcdc345b44 Reduce struct copy by 1 in ValueTask.GetAwaiter (dotnet/coreclr#22738)
* Reduce struct copy by 1 in ValueTask.GetAwaiter

* Bit more explicit

Signed-off-by: dotnet-bot <[email protected]>
2019-02-21 10:02:14 +01:00
Filip Navara 5d36e4b2a7 Move Thread to shared CoreLib (dotnet/corefx#35462)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-21 10:00:54 +01:00
Zoltan Varga b4943dec39 [jit] Fix the loaded llvm build. (#13110) 2019-02-21 03:45:36 -05:00
Zoltan Varga d48b84d67f [llvm] Fix a 'incoming phi sreg1' llvm failure which happens with valuetypes+phi nodes. (#13077)
[llvm] Fix a 'incoming phi sreg1' llvm failure which happens with valuetypes+phi nodes.

Fixes https://github.com/mono/mono/issues/12988.
2019-02-21 03:35:54 -05:00
Aleksey Kliger (λgeek) 72512cfbcb [loader] Fix off by 1 (netstandard is a framework facade) (#13111)
[loader] Fix off by 1 (netstandard is a framework facade)

Before 5e0d39a8a1, there used to be a handwritten binary search that traveersed `framework_assemblies` to determine if a given assembly was a framework assembly or not.  The binary search used `last = G_N_ELEMENTS (framework_assemblies) - 1` as the initial condition, but it used an inclusive `first <= last` as the loop count.

After we switched to a hashtable, we used the same final value initialize `assembly_remapping_table`.

We didn't notice because `mscorlib` used to be the last assembly in the table and `mscorlib` already has a ton of special handling in the loader.  But `netstandard` is not special.  So we added it to the table, but it still doesn't get special handling.

This should fix instances where code references netstandard 2.0.0.0, but we give it netstandard 2.1.0.0

https://github.com/mono/mono/blob/f8094319132d2d40f37e8cac6058e783b5648260/mono/metadata/assembly.c#L345
2019-02-21 01:45:50 -05:00
Stephen Toub f809431913 Use ThrowHelper in ManualResetValueTaskSourceCore (dotnet/coreclr#22714)
Just move the helper being used to ThrowHelper.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-20 22:47:35 +01:00
Stephen Toub a5e27b6316 Fix bug introduced during cleanup in JapaneseLunisolarCalendar (#22717)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-20 20:24:29 +01:00
Ben Adams bce27a80de Allow Task.WaitAny completion to run synchronously (dotnet/coreclr#21245)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-20 20:24:29 +01:00
Johan Lorensson 795dc5ebd2 Remaining fixes needed to pass rest of CI test suites for windows x64 full AOT. (#13084)
* Fix for runtime mcs-compileall test on Windows x64 full AOT.

Test picked up full AOT:ed libraries as well as managed libraries failing
the test. Full AOT:ed shared libraries on Windows has .dll.dll prefix and
full AOT:ed executables on Windows has .exe.dll prefix.

Fix makes sure to filter out any files ending with dll.dll or exe.dll.

* Fix build errors in System.Web.Services test under winaot profile.

* Fix errors in System.Core test under winaot profile.

* Fix build error in linker tests on Windows under winaot profile.

Build fails since profile build mscorlib is used as well as default
triggering build error. Fix is to build linker tests using -nostdlib flag.
2019-02-20 14:17:10 -05:00
Johan Lorensson 3bcebfb0a0 Don't install jay as part of make install. (#13086)
Should not be part of the package and cause issues on Windows 32-bit
cygwin build since it's not using makefile generated by autotools. When
make install is run it will build jay one more time, but picking up
cygwin default gcc compiler instead of the one used in configure step, mingw.
That cause link errors since the object files are not rebuild, only relinked
with different linker, causing errors.
2019-02-20 14:01:03 -05:00
Alexander Köplinger 78ef5a9722 [ci] Prefer gmake over make for SDKs build (#13091)
Apple's make doesn't support the --output-sync option and Homebrew's make is installed as gmake.

Also fixed a few places in the repo where we directly invoked make instead of $(MAKE).
2019-02-20 19:46:54 +01:00
Marek Safar 951803d082 [System.Private.CoreLib] Implement more APIs 2019-02-20 17:55:17 +01:00
Stephen Toub 5ec1def012 Fix race condition in ManualResetValueTaskSourceCore (dotnet/coreclr#22711)
* Fix race condition in ManualResetValueTaskSourceCore

ManualResetValueTaskSourceCore.GetStatus is used from ValueTaskAwaiter.IsCompleted.  If GetStatus returns Success too early, then IsCompleted will also return true too early, which will result in GetResult being called too early.  This doesn't happen today when an MRVTSC is used sequentially.  But if an instance is pooled by the object its stored on getting put back into a pool as part of a call to the wrapper's GetResult, then we can end up in the following situation:
- Thread 1 starts an await on an instance containing an MRVTSC.  It calls IsCompleted.
- Thread 2 starts to complete that instance, getting as far as calling SignalCompletion and setting _completed to true but not yet setting _continuation.
- Thread 1 sees _completed == true and returns true from IsCompleted.  It calls GetResult, and the wrapper extracts the result from the instance, resets it, and puts it back into the pool.
- Thread 3 takes the object out of the pool and starts using it.
- Thread 2 continues SignalCompletion on that instance, and sets _continuation to the sentinel.
- Now Thread 3's instance's _continuation is the sentinel when it should be null.  If it calls SignalCompletion, it'll erroneously find that _continuation is not null and will queue _continuation/_continuationState for execution, resulting in the sentinel getting executed.  If it calls OnCompleted, it'll find that the _continuation is not null, and will queue the supplied continuation/state to execute immediately even though the operation may not yet actually be done.

The fix is simply to check not just _completed but also _continuation.  The operation is considered pending if either _completed is false, meaning SignalCompletion has not yet been called, or if _continuation is still null, meaning it's neither been set to the supplied delegate nor to the sentinel.  We can't just rely on _completed for the above outlined reasons, and we can't just rely on _continuation because it can be non-null if OnCompleted was called to hook up a callback (if we only cared about the await pattern, then we could just check _continuation and wouldn't need _completed, but we also need to support non-await access).

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-02-20 13:02:45 +01:00
Alexander Köplinger 3ac43f72bb Update sdks-archive.groovy android packages 2019-02-20 11:46:36 +01:00
Egor Bogatov 3c41d74f1e NS2.1: System.Security.Cryptography changes (#13022)
* NS21: X509Store, rsa.cs

* More NS2.1 changes

* remove X509Stubs.cs

* Add corert/CancellationTokenRegistration.cs

* Implement Socket.ReceiveAsync

* Add X509Certificates stubs

* bump corefx and corert

* bump corefx

* remove corefx/tmp

* Bump API snapshot submodule

* [csproj] Update project files
2019-02-20 11:43:26 +01:00
monojenkins fceb9471e2 [bcl] Update BCL Linked Size 2019-02-20 09:16:55 +01:00
Jan Kotas ad4c22c4f4 Use out arguments in UmAlQuraCalendar (dotnet/coreclr#22704)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-20 09:13:30 +01:00
Kenneth Pouncey 16f1845a19 Fix spacing 2019-02-20 07:30:24 +01:00
Kenneth Pouncey 2e4713cb39 Fix spelling 2019-02-20 07:29:49 +01:00
Kenneth Pouncey d60440869c Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays 2019-02-20 06:40:15 +01:00
Ludovic Henry 7f017427ea Update CODEOWNERS 2019-02-19 19:41:45 -05:00
Radek Doulik 30799ff97f [profiler] Do not print that many new lines (#13060)
The `mono_profiler_printf` already adds `\n` char, so we don't need to
add them in most cases.

Before the fix the output of aot profiler with verbose enabled looked
like:

    02-19 10:50:02.877 22795 22815 I mono-prof: System.OutOfMemoryException:.ctor (string) 2
    02-19 10:50:02.877 22795 22815 I mono-prof:
    02-19 10:50:02.877 22795 22815 I mono-prof: System.SystemException:.ctor (string) 4
    02-19 10:50:02.877 22795 22815 I mono-prof:
    02-19 10:50:02.877 22795 22815 I mono-prof: System.Exception:.ctor (string) 6
    02-19 10:50:02.877 22795 22815 I mono-prof:
    02-19 10:50:02.877 22795 22815 I mono-prof: System.Exception:.cctor () 7
    02-19 10:50:02.877 22795 22815 I mono-prof:
    ...

The `usage ()`'s output should now look similar to other profilers
usage output.
2019-02-19 18:27:04 -05:00
Stephen Toub aff251e11c Move EventRegistrationToken to shared (dotnet/coreclr#22565)
* Move EventRegistrationToken to shared

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-02-20 00:18:55 +01:00
Stephen Toub e5f7fa3e67 Use RunContinuationsAsynchronously in SemaphoreSlim.WaitAsync (#22686)
SemaphoreSlim.Release shouldn't invoke arbitrary continuations as part of its invocation, so when it dequeues a task waiter and goes to complete it, rather than just calling TrySetResult, it queues the task to the thread pool to have TrySetResult invoked there.  Now that we have RunContinuationsAsynchronously, though, we can just use that functionality instead.  This has two main benefits:
1. We avoid queueing a work item entirely if there are no continuations from the task.  This might happen, for example, if the semaphore is released so quickly after waiting on it that the WaitAsync caller hasn't yet hooked up a continuation, in which case the await on the WaitAsync task will just see IsCompleted as true and continue running.
2. We avoid queueing a work item when the task represents a synchronous Wait, which happens if there's already a pending WaitAsync when Wait goes to block.  The main benefit here is avoiding potential thread pool starvation, if threads in the pool are blocked in such Waits, and previously another thread pool thread would have been needed to run the queued work item to complete the synchronous Wait.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-19 23:45:33 +01:00
Hugh Bellamy dc32ce591e Cleanup Calendars code (dotnet/coreclr#22582)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-19 23:45:33 +01:00
Martin Baulig 23762efca5 Add temporary workaround for internal StreamContent constructor. 2019-02-19 23:19:07 +01:00
Maxim Lipnin c890be00c9 use for loop to access item values and avoid InvalidCastException which occurs because VirtualDirectoryMappingCollection enumerator returns key and it's not expected 2019-02-19 21:08:02 +01:00
Fei Peng 1f33f3923a Optimize Vector128/256<T>.Get/WithElement (dotnet/coreclr#22353)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-19 17:08:46 +01:00
Johan Lorensson 187711df20 Enable runtime + corlib tests on CI for Windows x64 full AOT. (#13059) 2019-02-19 09:37:43 -05:00
Vlad Brezae c21c2df0af [interp] Kill stinarg opcodes (#13038)
* [interp] Extract some duplicated code

* [interp] Kill stinarg opcodes

Before we were reallocating the arguments in the current frame and had a stinarg opcode for copying each argument there. Access the arguments directly from the parent frame, to reduce call overhead. This can give up to 5-10% general speedup.
2019-02-19 08:40:00 -05:00
roozbehid af0bdab76d add missing typeforwardes in facades (#12694)
* add missing typeforwardes

* Bump API snapshot submodule
2019-02-19 13:38:17 +01:00
Zoltan Varga 9f9067094f [netcore] Fix GCHandles, the lowest bit is used by the GCHandle class to store information. 2019-02-19 10:51:51 +01:00
Marek Safar 2e88b48fde [mcs] Remove doc about CAS security 2019-02-19 10:14:48 +01:00
Zoltan Varga b8b2469380 [jit] Add a few more unsafe intrinsics. (#12971) 2019-02-19 02:27:40 -05:00
Katelyn Gadd 66092e0571 Update roslyn-binaries submodule to point to latest master revision (#12833)
This updates our roslyn submodule so that the new csc-dim is available.
2019-02-18 22:54:54 +01:00
Alexander Köplinger 1c26f21c0d Bump linker submodule to latest master (#13031)
* Bump linker submodule to latest master

* [csproj] Update project files
2019-02-18 14:02:34 +01:00
Phil Jaenke 8c185ed423 Remove leading . from script invocation (#13046)
The leading `.` in the script invocation causes the tests to fail on multiple platforms by causing the required argument to not be passed correctly resulting in bad output. Removal of the leading `.` ensures correct operation on all platforms.
2019-02-18 12:45:25 +01:00
Alexander Köplinger 602bdea385 Set executable bit for all .sh files in repo 2019-02-18 12:39:57 +01:00
bwadswor fe7c3d43e5 Correct access permissions to include "user execute" for run-msbuild.sh. (#13042)
Correct access permissions for run-msbuild.sh.  Adding "user execute" seems to fix the following build error.  With this change I'm able to build on windows in Cygwin.  without, I see the below error:

```
$ make -j4
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /cygdrive/c/mono/mono/missing autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
Git submodules updated successfully
make  all-recursive
make[1]: Entering directory '/cygdrive/c/mono/mono'
Making all in msvc
make[2]: Entering directory '/cygdrive/c/mono/mono/msvc'
Building Mono runtime using Visual Studio.
../msvc/run-msbuild.sh "build" "i686"
**/bin/sh: ../msvc/run-msbuild.sh: Permission denied**
make[2]: *** [Makefile:614: all-local] Error 126
make[2]: Leaving directory '/cygdrive/c/mono/mono/msvc'
make[1]: *** [Makefile:583: all-recursive] Error 1
make[1]: Leaving directory '/cygdrive/c/mono/mono'
make: *** [Makefile:513: all] Error 2
```
2019-02-18 12:34:29 +01:00
Zoltan Varga 77644b833e [netcore] EH work (#13041)
* [netcore] Switch to Debugger class from corlib.

* [netcore] Implement exception stack trace support.

* Address review comments.

* [netcore] Create a netcore specific version of Exception based on the refsource version.
2019-02-18 10:20:45 +01:00
Martin Baulig 099e003240 Add types supporting C# 8.0 Ranges. (#12841)
* Add types for C# 8.0 Ranges.

* Add workaround from @lewurm to fix the native crash.

* Fix compiler error test.

* [interp] guard span get_item intrinsic regarding its signature

* Cleanup sources and remove duplicates; thanks Egor!

* Bump API snapshot submodule

* [csproj] Update project files
2019-02-18 09:55:45 +01:00
Marek Safar ad62ab26b7 Merge pull request #13040 from marek-safar/build-fixes
[System.Private.CoreLib] Implement more APIs
2019-02-17 11:03:18 +01:00
Jan Kotas 003a626bba Avoid pulling in Lazy<T> during startup (dotnet/coreclr#22659)
Environment constructor runs on every startup path. Remove dependency on Lazy<T> from it.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-17 11:02:36 +01:00
Thays Grazia 194b82b8b0 If getter is not implemented in a property we don't want to show this property, in Vs the behaviour is the same. (#13033)
Fixes #12964
2019-02-16 11:48:00 -02:00
Marek Safar f0ca41c781 [System.Private.CoreLib] Implement more APIs 2019-02-16 00:47:18 +01:00
Tanner Gooding a12209bf52 Updating some local functions to be 'static' (captureless). (#22635)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-16 00:20:34 +01:00
Alexander Kyte 12b3dbcc38 [crash] Move dump_memory_around_ip after the native crash (#13021)
If someone jumps to a bogus address for some reason, this will
double-fault. On OSX, a double fault is often a hang.
2019-02-15 18:14:03 -05:00
Vlad Brezae b3839e4434 [interp] Fix unaligned crashes on arm (#12985)
* [interp] Fix unaligned access crashes on arm

strd instruction fails if the memory address is not word aligned.

Fixes corlib-xunit suite on arm.

* [interp] Fix warning
2019-02-16 00:06:00 +02:00
Alexander Köplinger d224a047e0 Revert "[Facades] Remove System.Drawing.Primitives from xammac_net_4_5_SUBDIRS"
This reverts commit 9c1fd50666.

This is wrong, net_4_x_SUBDIRS only includes common_deps_SUBDIRS, not common_SUBDIRS.
2019-02-15 20:39:33 +01:00
Ludovic Henry 42f7bff05b [ci] Fix Bitcode{+Interpter} on AArch64 (#13016) 2019-02-15 13:38:20 -05:00
Kenneth Pouncey ccfa653b48 [wasm][CI] Reactivate Chakra tests in CI (#13026)
- Chakra install fails: https://github.com/Microsoft/ChakraCore/issues/5945
2019-02-15 12:12:37 +01:00
Alexander Köplinger 9c1fd50666 [Facades] Remove System.Drawing.Primitives from xammac_net_4_5_SUBDIRS
It's already included in the common_SUBDIRS and confuses a build safeguard in xamarin-macios.
2019-02-15 12:03:40 +01:00
Marek Safar 34c3055a7c Move Interlocked 2019-02-15 09:25:26 +01:00
Tanner Gooding 884b4c2473 Fixing the number formatting code to only recognize 'R' for double/float. (#22613)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-15 09:25:26 +01:00
Marek Safar f2c8664ac1 Move Reflection.Emit Tokens to shared partition (dotnet/coreclr#22602)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-15 09:25:26 +01:00
monojenkins 4ee073da2a [bcl] Update BCL Linked Size 2019-02-15 08:34:51 +01:00
Grant 7e52c1973e Missed optimization from #22497
Signed-off-by: dotnet-bot <[email protected]>
2019-02-15 08:33:24 +01:00
Larry Ewing 7f0eaf39ca Add some blazor binaries to bcl-size-diff 2019-02-14 23:57:30 +01:00
Grant d91a227cba Consolidate implementation of Rotate and PopCount (dotnet/coreclr#22584)
* Perf: BitOps.LeadingZeroCount

* Remove redundant MSIL cast, conv.u8

* Use local functions for SoftwareFallback

* Target BIT32/64

Signed-off-by: dotnet-bot <[email protected]>
2019-02-14 23:00:36 +01:00
Marek Safar 8294fc0588 Remove local FrameworkEventSource 2019-02-14 22:47:06 +01:00
Marek Safar dbac2e4ffc Move FrameworkEventSource to shared partition (dotnet/coreclr#22507)
* Move FrameworkEventSource to shared partition

and remove unused code

* Remove more unused code

* Remove CA8001 suppress message

Signed-off-by: dotnet-bot <[email protected]>
2019-02-14 22:47:06 +01:00
Levi Broderick 776e2a84c3 Add Rune creation API from UTF-16 surrogate pair (dotnet/coreclr#22590)
Also brings in some perf improvements to existing char and UnicodeUtility APIs

Signed-off-by: dotnet-bot <[email protected]>
2019-02-14 22:47:06 +01:00
Egor Bogatov cf69b47259 NS2.1: System.IO, System.Reflection.Emit, etc (#12854)
* System.IO, System.Data

* lots of small ns21 improvements

* More changes (System.Reflection.Emit)

* Add IEquatable to S.R.Emit types

* bump corefx

* fix unix build

* more NS21 changes

* more changes

* bump corefx

* Fix failing tests (Sockets)

* bump corefx

* tmp workaround

* move DispatchProxyGenerator to net_4_x

* Bump API snapshot submodule

* [csproj] Update project files
2019-02-14 22:40:58 +01:00
Grant 572d9928c0 Perf: Consolidate implementation of LeadingZeroCount (dotnet/coreclr#22497)
* Perf: BitOps.LeadingZeroCount

* CR fix

* CR fixes

* Optimization

* Revert

* Confirmed fix

* Simplify

* Return int

* Fixes

* Simplify

* CR fixes

* CR fixes

* Fix unit failure on Linux-musl x64 Debug

* CR fixes

* CR fixes

* Cleanup

Signed-off-by: dotnet-bot <[email protected]>
2019-02-14 22:38:32 +01:00
Fei Peng 938477a7de Remove unnecessary ThrowIfUnsupportedType calls and definitions
Signed-off-by: dotnet-bot <[email protected]>
2019-02-14 22:38:32 +01:00
Ludovic Henry 1be2bbce16 [ci] Enable working Bitcode{+Interpreter} test suites (#12997) 2019-02-14 14:47:05 -05:00
Martin Baulig 5c754423f2 Pass X509Certificate2 to the certificate validator.
This makes us consistent with corefx; see also
https://github.com/dotnet/corefx/pull/35306.

Using `X509Certificate` has become a problem because the
`HttpClientHandler.ServerCertificateCustomValidationCallback`
callback takes an `X509Certificate2` parameter.
2019-02-14 18:27:13 +01:00
Maxim Lipnin 347af5d61f Bump ikdasm 2019-02-14 18:09:49 +01:00
Rolf Bjarne Kvinge 4fec79cc6a [tests] Add the BitcodeNotSupported category to tests exercising non-bitcode-compatible API. (#13007)
* [tests] Add the BitcodeNotSupported category to tests exercising non-bitcode-compatible API.

We have APIs that use exception filter clauses, and we don't support that when
compiling to bitcode.

So mark any tests exercising such API accordingly, so that we can skip those
tests when running tests on targets that use bitcode (watchOS).

* [tests] Use BitcodeNotSupported on applying profiles
2019-02-14 11:49:29 -05:00
Bernhard Urban 920a621367 [bitcode] round up value type size for slot calculation (#12992)
consider

```csharp
struct S3
{
    public ushort X;
    public ushort Y;
    public ushort Z;
}
```
this would be 3 * 2 = 6 bytes. Structs, however, are passed around as i32
arrays in LLVM IR between functions. Those, if such a struct is passed, are
split to int32 depending on the struct's size. The previous calulation was
wrongly reserving one such i32 slot instead of two for `S3` above.

Additionally increase slot size to i64 so that it aligns with a
slightly different ABI on arm64_32.
2019-02-14 14:56:45 +01:00
Alexander Köplinger 9e8317f877 [System.Net.Http] Improve HttpClientTest to use the retry http listener (#12994)
It was missed in https://github.com/mono/mono/pull/11829 so we were still manually
creating HttpListeners which are not hardened against "Address already in use".

Should fix/improve https://github.com/xamarin/maccore/issues/1407.
2019-02-14 11:32:12 +01:00
Zoltan Varga f1ccdc49a9 [runtime] Avoid depending on the layout of the ParameterInfo class in the runtime, netcore has a version with a different layout. (#12980) 2019-02-14 09:32:42 +01:00
Kenneth Pouncey f5084b594f Move the index accessors to TypedArray instead duplicating the logic. 2019-02-14 06:32:37 +01:00
Alexander Kyte 4b83678a4a [crash] Add more detailed reporting for exceptions (#12946)
* [crash] Add more detailed reporting for exceptions

This bumps the crash reporting file format to version 0.0.3.

* [crash] Fix exception stack walker to consider captured_traces

Previously we were missing these frames from the captured_traces fields
of MonoException and MonoStackTrace.
2019-02-13 23:27:17 -05:00
Ludovic Henry e0643e5ac7 [ci] Fix Linux x64 Bitcode job (#12970)
* [ci] Fix Linux x64 Bitcode job

* [ci] Add Bitcode+Interpreter job

* [ci] Improve output information when AOTting the BCL
2019-02-13 18:31:31 -05:00
Alexander Köplinger 1c2ef6a472 Mono.Native: Simplify checking for min-version
We don't need to do the replacement sed magic for the compat library,
it should just use whatever is passed in.
2019-02-13 23:36:07 +01:00
Alexander Köplinger ae507fc4c4 [corlib] Fix CustomAttributeDataTest.MethodIncludesDllImportAttributeData() on watch/tv
Bitcode requires that the native symbol exists.
Changed the pinvoke to something that exists in libc.
2019-02-13 23:35:52 +01:00
Marek Safar 689e9b2e03 Remove local SafeHandle version 2019-02-13 23:24:44 +01:00
Stephen Toub 85caf55c16 Move SafeHandle to managed code and shared (dotnet/coreclr#22564)
* Move SafeHandle to managed code and shared

This moves the implementation of SafeHandle from native code in the runtime to managed.  I used corert's implementation as a base, and reviewed it again against the existing native implementation, making a few tweaks to better match the existing semantics.

This should be a valid move because of the reduced goals around CERs, thread aborts, etc.

However, there are places in the runtime that access SafeHandle functionality via its native counterpart, so I kept the relevant pieces of the native code intact.  Most code will continue to use the managed APIs, but the runtime can continue calling into the native versions when needed.

* Address PR feedback

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-02-13 23:24:44 +01:00
Alexander Köplinger c81e675866 [wasm][ci] Disable ChakraCore tests"
Downloading ChakraCore is broken right now due to https://github.com/Microsoft/ChakraCore/issues/5945.
2019-02-13 23:06:12 +01:00
Michal Strehovský 268f9e41cc Annotate EventCounter as a relocated type (dotnet/corert#6990)
This moved to CoreLib and needs to be annotated as such for Project N.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-13 21:06:20 +01:00
Fei Peng 745499f724 Remove unnecessary ThrowIfUnsupportedType calls and definitions
Signed-off-by: dotnet-bot <[email protected]>
2019-02-13 20:57:02 +01:00
Ludovic Henry bbb71e04a0 [ci] Use testing_aot_full_interp for FullAOT+Interpreter+LLVM (#12976) 2019-02-13 09:56:32 -05:00
Kenneth Pouncey 49d1d1795b Add U : struct constraint on TypeArray. Addresses comment review. 2019-02-13 15:38:07 +01:00
Kenneth Pouncey 1f9533a777 Fix delegate call back. Causes memory access crash with AOT. 2019-02-13 14:45:04 +01:00
Aleksey Kliger (λgeek) 5f1a8e7764 [debug-helpers] Include custom modifiers in mono_type_get_desc (#12979)
* [debug-helpers] Include custom modifiers in mono_type_get_desc

* [mini] Print return type in MONO_METHOD_VERBOSE output
2019-02-13 08:38:16 -05:00
Zoltan Varga 2466c2fc79 [netcore] Implement Assembly/AssemblyName/Module.
For RuntimeAssembly, make a fork since the amount of changes is very big. For AssemblyName/RuntimeModule, use the corlib version with some
ifdefs.
2019-02-13 11:11:37 +01:00
Kenneth Pouncey d81f8c7370 Modification of sdk framework build to not include the initialisation of the Bindings as it is now automatic. 2019-02-13 10:46:46 +01:00
Kenneth Pouncey 6dc1f10af1 Add corebindings build module and inclusion AOT
- Conditional include of bindings depending on if  --nobindings is specified.
- Packager: AOT ninja build modifications.
   - Add corebindings build dependency
   - Add bindings_support.j build dependency
   - Remove dependency to add Bindings initialisation to build and mono_config.js
 - Modify runtime.js and runtime-tests.js to remove the bindings initialisation code.
2019-02-13 10:45:12 +01:00
Ludovic Henry a43f1d2909 [sdks] Add mac-{mac32,mac64} targets (#12959)
* [sdks] Add mac-{mac32,mac64} targets

* [sdks] Add configure-* and build-* for CI
2019-02-12 18:57:56 -05:00
Tarek Mahmoud Sayed 469b0a7a0f Index and Range updates (dotnet/coreclr#22331)
* Index and Range updates

* Address @mikedn  feedback

* Address Feedback

* more feedback

* Use Deconstruct in Range.GetOffsetAndLength

* Rename GetArrayRange to GetSubArray

* Temporary disable the old Corefx Range tests

* Return back the TimeSpan test disabling

* Fix Range jit test

* Exclude the jit test

* revert the changes in the jit Range test

* Address Suggested Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-02-13 00:01:05 +01:00
Jan Kotas 781bebfdcb Fix CoreRT build breaks - Adjust resource name - Workaround C# compiler/analyzer bug
Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 23:36:22 +01:00
Marek Safar 3f5471a602 Remove local version of GCHandle 2019-02-12 21:19:29 +01:00
Stephen Toub 64a626fa87 Move GCHandle to shared (dotnet/coreclr#22499)
* Move GCHandle to shared

* Cache the handle in a local to make it easier for JIT to generate good code

* Rename m_handle to _handle to match the coding conventions

* Delete isPinned argument for GCHandleInternalCompareExchange

* Add fast path to GCHandle.Alloc/Free FCalls

* Disable outdated test

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 21:19:29 +01:00
Sung Yoon Whang c005351c61 Renaming RuntimeEventSource to NativeRuntimeEventSource (#22533)
* Renaming RuntimeEventSource to NativeRuntimeEventSource

* missed a couple of comments and XPlatEventLogger

* rename DotNETRuntimeEventSource.cs to NativeRuntimeEventSource.cs

* use condition= instead of ifdef

* removing ifdef from NativeRuntimeEventSource.cs

* Fix case for 'eventing' directory in csproj

* Fix unix builds

* This should fix unix build...

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 20:57:00 +01:00
Tanner Gooding 39f83e1925 Add extensions methods for several of the VectorXXX<T> helper methods (#22336)
* Moving several of the Vector128<T> instance methods to be extension methods.

* Moving several of the Vector256<T> instance methods to be extension methods.

* Moving several of the Vector64<T> instance methods to be extension methods.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 19:18:32 +01:00
Marek Safar d0c5bcff23 Fix the build 2019-02-12 18:37:19 +01:00
Marek Safar 27ea466b0b [System.Private.CoreLib] Clean up EqualityComparer 2019-02-12 18:37:19 +01:00
Thays Grazia 5f65ce9f7d [debugger] Reverting part of https://github.com/mono/mono/pull/12114 (#12950)
* [debugger] Reverting part of this commit https://github.com/mono/mono/pull/12114, removing this part the test ShouldCorrectlyStepOverOnExitFromArgsAfterStepInMethodParameter continues working and solve the regressions of 12881.
Inserted a new test that reproduces the regression.
Fixes #12881
2019-02-12 14:20:38 -02:00
Larry Ewing 2b9e5db153 Remove the logic that prepends a line in source references
Remove the hack that injected an extra line with the source
location now that we reference local sources when we can and
fix the Match logic so that it corrects for the difference
between pdbs and chrome breakpoints
2019-02-12 10:06:31 -06:00
Larry Ewing 2dcbeb5548 Use file: urls when when the files exist locally
Unknown schemes (dotnet:) are not well supported by all the
tools that support the chrome DevTools protocol so if the
file exists locally use a file: url rather than a dotnet:
url to reference it.
2019-02-12 10:06:31 -06:00
Larry Ewing 36d26498d4 Handle urlRegex breakpoint requests.
VisualStudio debug agents use urlRegex rather than url
when looking for breakpoint locations so add support for those
requests.
2019-02-12 10:06:31 -06:00
Larry Ewing 419646c960 VSCode expects the decription field to be populated for the variables display 2019-02-12 09:37:01 -06:00
Larry Ewing ce751cbe55 Make sure we add callFrameId so that the debugger populates locals 2019-02-12 09:37:01 -06:00
Michal Strehovský 52d6e18ea6 Ifdef out code that triggers UTC bug (dotnet/corert#7003)
This results in bad codegen on AMD64. I filed a bug internally; hopefully we can get a fix soon.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 16:17:04 +01:00
hamish-rose 412f75a1c5 Add new rounding modes to System.Math, System.MathF (dotnet/coreclr#20815)
* add new rounding modes to MidpointRounding.cs

new modes added to enum
implemented ToZero for double in Math.cs

* ToZero implementation

* implement double and float rounding modes

* updating rounding implementation

now round inline with DecCalc internal round implementation

* small bug fix

also replace var to make things obvious

* update implementation - floor/ceil

code review feedback

* review feedback

add comments, update MathF with floor/ceil

* code review feedback

 - fix comments
 - replace ifelse with switch
 - remove RoundingMode enum from DecCalc

* exclude outdated corefx test

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 16:12:49 +01:00
Larry Ewing 80c10f6307 Merge pull request #12952 from lewing/debugger-proxy-discovery
[Wasm] Proxy More of the DevTools protocol
2019-02-12 08:32:59 -06:00
Kenneth Pouncey 56d77dcce9 Remove unused code 2019-02-12 14:14:12 +01:00
Maxim Lipnin b4370f6e76 Update System.Data.Entity to handle new String overloads (#12680)
* Add new String overloads

* Remove some overloads with non-primitive types

* Remove IndexOf overloads with more than 1 argument

* Remove Trim() from TrimTranslator because CanonicalFunctionDefaultTranslator already supports it.

* Trim/TrimStart/TrimEnd: remove Char parameter overloads; add condition to support parameterless overloads.

* Remove unsupported Char overloads of Contains, IndexOf, StartWith and EndWith methods
2019-02-12 13:59:39 +01:00
Kenneth Pouncey fbaa3db2e0 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays 2019-02-12 13:30:53 +01:00
Kenneth Pouncey 58fe50e028 Add support for CopyTo
- ArraySegment
- primitive array
- memory address CopyTo (IntPtr, offset, count)
2019-02-12 13:16:16 +01:00
Kenneth Pouncey b1f7a22a8b Add CopyFrom implementation and support for
- ArraySegment
- support CopyFrom IntPtr, offset, count to marshal memory pointer from Heap to TypedArray
2019-02-12 10:32:20 +01:00
monojenkins 5374e7ef46 [csproj] Update project files 2019-02-12 08:52:42 +01:00
monojenkins e4303ac76f Bump API snapshot submodule 2019-02-12 08:52:42 +01:00
Alexander Köplinger 6474cf7b61 Bump cecil submodule 2019-02-12 08:52:42 +01:00
Zoltan Varga 19d705c69d [bcl] Restructure the Module classes to simplify netcore integration.
* Move all icalls to RuntimeModule.
* Make all icalls static and receive the module as an IntPtr.
* Remove some duplicate code between the RuntimeModule and ModuleBuilder classes.
2019-02-12 08:46:09 +01:00
Dotnet-GitSync-Bot 374f44ebe8 Mirror changes from mono/corert,coreclr (#12951)
* Make Module partial to allow additional changed for Mono

Signed-off-by: dotnet-bot <[email protected]>

* Move ConditionalWeakTable to shared (dotnet/coreclr#22531)

Leaves DependentHandle as being the runtime PAL

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 01:45:39 -05:00
Larry Ewing 85bf22730b Proxy More of the DevTools protocol
Much of the tooling around DevTools expects
actions under /json to return useful data
this adds adds some simple logic to proxy those
so that you can point tooling directly at the
proxied port and get responses you expect
2019-02-11 21:18:15 -06:00
Larry Ewing a51b475173 Merge pull request #12809 from lewing/wasm-debug-documentation
[WASM] debug documentation and sample updates
2019-02-11 20:08:54 -06:00
Marek Safar ac5ab1a7ef Use shared Volatile 2019-02-12 00:32:45 +01:00
Stephen Toub 9d136f9446 Move Volatile to shared (dotnet/coreclr#22523)
* Move Volatile to shared

This largely takes corert's implementation, which uses Unsafe.As and volatile fields.

We could investigate also removing the JIT's replacements subsequently.

* Add [Intrinsic] attributes

Signed-off-by: dotnet-bot <[email protected]>
2019-02-12 00:32:45 +01:00
Alexander Köplinger 6ca20e92b6 [ci] Bump timeout for corlib-xunit tests
See https://github.com/mono/mono/issues/12945
2019-02-11 20:34:04 +01:00
Kenneth Pouncey 17134ec2b6 Add support for CopyFrom
- Array, offset, count
- ArraySegment
2019-02-11 17:13:45 +01:00
Bernhard Urban aac567ff66 [ios] add crosswatch64_32 target (#12893)
* [ios] add crosswatch64_32 target

* fix gnu triple for wasm
2019-02-11 11:08:02 -05:00
Alexander Köplinger ff7fc7e93a [ci] Bump bockbuild to get fontconfig download url fix 2019-02-11 16:56:46 +01:00
Aleksey Kliger (λgeek) 95f31d0259 [runtime] Refactor pinvoke probing, part 2 (#12850)
* [marshal] Add emit_exception_for_error callback

* [runtime] MonoError-ize mono_lookup_pinvoke_call_internal

Two complications:

1. Marshalling needs to turn a MonoError into MethodBuilder instructions to
   emit an exception.
2. The public API uses two string to signal an error.  So we have to use
   a custom status struct to return the error code.

* [loader] Factor out library path transformations

* [marshal] Copy error msg in mono_mb_emit_exception_for_error

Add new mono_mb_stdrup to make a copy of a given string into the memory that
will live with the MethodBuilder's method.

* [interp] Callvirt of an icall should call the wrapper.

See pinvoke2.cs test_0_missing_virtual_pinvoke_method ()

You can have an icall override a virtual method:

    	public class T2 : T {
    		[MethodImplAttribute(MethodImplOptions.InternalCall)]
    		public override extern object MyClone ();
    	}

When the interpret saw this, it was setting up a child frame with the frame
method being the MonoMethod of the icall itself, not the wrapper.  But it was
executing the wrapper.  As a result if the wrapper body had a LDSTR in it, we
would hit the assertion in the MINT_LDSTR_TOKEN case where
frame->imethod->method->wrapper_type == MONO_WRAPPER_NONE is not allowed.

With this change the frame method is now the wrapper which has a correct
wrapper type.

* [loader] remove pinvoke_probe_transform_path do{}while(0) construct

take the line damage; make the code easier to understand.
2019-02-11 10:49:56 -05:00
Jonathan Chambers 7176289621 Grow StackSlotInfo array rather than asserting (#12829) 2019-02-11 09:28:48 -05:00
Johan Lorensson dad67f4760 Incorrect call to MONO_HANDLE_SETRAW causes random crash in sgen. (#12851)
mono_string_utf16_to_builder_copy incorrectly uses MONO_HANDLE_SETRAW to
update the chunkLength field with a string length. Since MONO_HANDLE_SETRAW
assumes the argument is a MonoObject reference this could lead to a dereference
and since the value is a string length, that dereference will lead to a crash.

The problem happens in mono_gc_wbarrier_set_arrayref_internal where vtable
is retrieved from value. The crash happens randomly since it is depending
on the object being moved out of the nursery + sgen_binary_protocol_wbarrier
not being eliminated.

Fix is to use MONO_HANDLE_SETVAL since the value is not a reference so no need
to trigger a write barrier.
2019-02-11 09:12:20 -05:00
Johan Lorensson 4ba6733438 Fix OP_GET_LAST_ERROR codegen on Windows x64 full AOT. (#12853)
Current codegen incorrectly read back last error when doing p/invoke for
full AOT. This caused many failed corlib tests ~600. It also
turns out that the test for set/get last error related to p/invoke that we
have in pinvoke2.exe, is not run for the full AOT profile, due to other tests
depending on none full AOT features. In order to make sure we run the test
and not regress, test has been moved into its own runtime tests, running as
part of full AOT testing.
2019-02-11 09:11:50 -05:00
Alexander Kyte 9531662837 [crash] Use safer invalid-free test (#12864)
When using the previous test, some memory unsafety was
observed. It's rather unrecoverable memory unsafety, as
it corrupts heap memory used by the sequence points, registered MERP
paths, jit info internals, and output string.

Crashes seen here: https://github.com/mono/mono/pull/12387 reproduce
with less than 100 iterations of this malloc test run as the stress
test.

```
(MonoJitInfoTable) $2 = {
  domain = 0x5050505050505050
  num_chunks = 1347440720
  num_valid = 1347440720
  chunks = {}
}
```

with

```
(lldb) p/x 1347440720
(int) $0 = 0x50505050
```

And sometimes the mono crash

```
(lldb) p *it
(SeqPointIterator) $3 = {
  seq_point = (il_offset = 0, native_offset = 0, flags = 0, next_offset = 0, next_len = 0)
  ptr = 0x5050505050505050 <no value available>
  begin = 0x5050505050505050 <no value available>
  end = 0x5050505050505064 <no value available>
  has_debug_data = 0
}
```

===

These do not reproduce when doing a double free of legally allocated
memory.

I think that the crash reporting tests aren't the place to check if the
OS allows for wild heap corruption when doing these things. I don't
think it's currently in scope for the runtime to do crash reporting
after it's internal metadata tables have been corrupted. They're the
source of truth for symbolication. We don't have many options to
validate and reparse them, unless we want to make this all very
heavyweight.
2019-02-11 09:11:11 -05:00
Johan Lorensson 1a3813e899 Fix errors in TimeZoneInfoTest on Windows full AOT using winaot profile. (#12852)
Fix errors in TimeZoneInfoTest on Windows full AOT using winaot profile.
2019-02-11 08:35:54 -05:00
Kenneth Pouncey 949f3f7125 Add implicit conversion to and from primitive array. 2019-02-11 13:49:30 +01:00
Kenneth Pouncey 0e1a202bbb Add Type Array CopyFrom support.
- This will copy a managed array from heap to the typed array memory.
2019-02-11 10:29:02 +01:00
Marek Safar d5147e88bb [System.Private.CoreLib] Add more APIs 2019-02-11 09:50:36 +01:00
Kenneth Pouncey 56021009aa Misspellings 2019-02-11 07:37:03 +01:00
Kenneth Pouncey 07bb573833 Merge branch 'master' of https://github.com/mono/mono into wasm-typed-arrays 2019-02-11 06:09:05 +01:00
Vlad Brezae 846eca0dbd [interp] Fix ldelema (#12903)
The ldelema IL instruction provided the element class while the Address intrinsic provided the array class.

Fixes https://github.com/xamarin/xamarin-macios/issues/5363
2019-02-11 01:09:06 +02:00
Calvin Buckley b2f590b599 Fix build and use System.Native on FreeBSD (#12921)
* Required includes for system headers to behave on FreeBSD

* System.Native on FreeBSD
2019-02-10 10:27:54 +01:00
Jan Kotas b98780c71b Fix casing of interop directories (dotnet/corert#6982)
Match convention introduced by https://github.com/dotnet/corefx/pull/35085

Signed-off-by: dotnet-bot <[email protected]>
2019-02-10 09:37:18 +01:00
Sung Yoon Whang 544c43d0d6 set up CoreLib to include EventCounter in build project (#22501)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-10 09:32:05 +01:00
Marek Safar ca418e412b [netcore] Update to the latest version 2019-02-09 17:31:41 +01:00
Alexander Köplinger 67f1926803 [ci] Fix windows job name in osx-package.groovy 2019-02-09 14:32:27 +01:00
Marek Safar 903b264c4f Move Array's SZGenericArrayEnumerator to shared partition (#22480)
* Move Array's SZGenericArrayEnumerator to shared partition

* Remove legacy comment

* Move all array enumerators to a new file

Signed-off-by: dotnet-bot <[email protected]>
2019-02-09 08:30:10 +01:00
monojenkins 1f330171a8 [bcl] Update BCL Linked Size 2019-02-09 08:27:25 +01:00
Sung Yoon Whang 3fa2c0511f move EventCounter to shared CoreLib (dotnet/corefx#35183)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-09 08:25:51 +01:00
Marek Safar 5f9b66db43 [System.Private.CoreLib] Add missing Array APIs 2019-02-09 08:23:04 +01:00
Grant 29942cfd80 BitOps.TrailingZeroCount has inconsistent software fallback (#22333)
Fix #22326

Signed-off-by: dotnet-bot <[email protected]>
2019-02-09 00:58:07 +01:00
Marek Safar 38550e117e [System.Private.CoreLib] Implement part of GCSettings 2019-02-09 00:08:20 +01:00
Marek Safar 54f35f6198 Clean up GCSettings temp version 2019-02-08 23:15:15 +01:00
Stephen Toub 4bb7d23683 Move GCSettings to shared (dotnet/coreclr#22483)
Mainly just type definitions and error handling that gets shared.

Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 23:15:15 +01:00
Ludovic Henry f804ffdd2c Merge pull request #12810 from lateralusX/lateralusX/fix-win-fullaot-runtime-tests
Fix Windows x64 full AOT runtime test failures.
2019-02-08 15:50:03 -05:00
Ludovic Henry 719668fda1 Merge pull request #12856 from migueldeicaza/registry-finalizer-fixed
[Registry] Prevent crash due to background thread facing problems in the file system
2019-02-08 15:44:23 -05:00
Ludovic Henry 2355e592dc [arm/bitcode] mark valuetype returns as such when dealing with pinvokes (#12894)
On armv7 our calling convention happens to be the same as the platform
one. However, when using a armv7 cross compiler to generate bitcode that
targets a different platform (e.g. arm64_32) the calling convention can
be different (e.g. on arm64_32, a return buffer must be passed via r8).
Thus, mark it properly for LLVM so it can generate correct code.
2019-02-08 15:38:00 -05:00
Bernhard Urban 8ad82bbfc1 [ios] link mono-native correctly (#12895)
Fixes this app startup issue

```
dyld: Library not loaded: /Users/lewurm/work/mono-watch4-ios-sdk/sdks/out/ios-target64-release/lib/libmono-native-unified.0.dylib
  Referenced from: /var/containers/Bundle/Application/9697C8F3-811C-4BF3-B1BC-1E6385673984/PublicStaging.app/test-Mono.Runtime.Tests
  Reason: image not found
Process 2269 exited with status = 0 (0x00000000) Terminated due to signal 6
```
2019-02-08 15:36:53 -05:00
Vlad Brezae b62cca8974 [interp] Remove some cknull uses (#12849)
* [interp] Avoid using MINT_CKNULL

Unnecessary overhead for this tiny instruction.

* [interp] Do null check for this before inlining

Otherwise we miss it.
2019-02-08 15:32:07 -05:00
Vlad Brezae edccda13d3 [interp] Add method to seq_points table after we finish registering it (#12902)
* [interp] Add method to seq_points table after we finish registering it

When adding a breakpoint (mono_de_set_breakpoint) we search in this table for seq_point information for the method. If we find the information we expect that the method is already compiled and has the metadata initialized when actually adding the breakpoint (set_bp_in_method). We were crashing if the jinfo field of the interp method was not yet initialized.

Fixes https://github.com/xamarin/xamarin-macios/issues/5381

* [interp] Move profiler callback when we are actually done

Just in case.
2019-02-08 15:29:07 -05:00
Jan Kotas b8ee1ca51f Update CoreRT with shared array implementation
Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 19:58:21 +01:00
Zoltan Varga f1dfd9c413 [llvmonly] Add a mini_llvmonly_throw_nullref_exception () jit icall to throw nullref exceptions, it occurs very frequently when explicit null checks are enabled. (#12883) 2019-02-08 13:06:11 -05:00
Zoltan Varga e14ef8a658 [corlib] Move the implementations of virtual methods from Assembly to RuntimeAssembly to ease netcore integration. (#12805)
* [corlib] Move the implementations of virtual methods from Assembly to RuntimeAssembly to ease netcore integration.

* [corlib] Move more code to RuntimeAssembly.

* [corlib] Move fields from Assembly to RuntimeAssembly/AssemblyBuilder.cs. Reduce the amount of fields visible to runtime code.

* Update serialization tests.

* Fix the MOBILE build.

* Bump API snapshot submodule
2019-02-08 13:05:54 -05:00
Zoltan Varga 83fc1456db [wasm] Add mixed tests to CI. (#12882)
* [wasm] Only dedup the assemblies which are actually AOTed in mixed mode.

* [wasm] Add mixed mode test targets.

* [wasm] Add mixed tests to CI.
2019-02-08 13:05:35 -05:00
Alexander Köplinger b01cfed2a4 [ci] Support building the OSX .pkg on private Jenkins 2019-02-08 17:18:41 +01:00
Alex Thibodeau d5dfaf6006 FIxing crash where a generic enum is passed into get_shared_type. Also added automated test to catch this scenario. (#12622) 2019-02-08 09:27:54 -05:00
Bernhard Urban b9c611e93c [arm64] encode offset within stack slot for r4 in gsharedvt descriptor (#12867)
Follow up fix for https://github.com/mono/mono/pull/11741

Fixes https://github.com/mono/mono/issues/12831
2019-02-08 12:28:29 +01:00
Bernhard Urban 63f4ee5540 [arm/bitcode] mark valuetype returns as such when dealing with pinvokes
On armv7 our calling convention happens to be the same as the platform
one. However, when using a armv7 cross compiler to generate bitcode that
targets a different platform (e.g. arm64_32) the calling convention can
be different (e.g. on arm64_32, a return buffer must be passed via r8).
Thus, mark it properly for LLVM so it can generate correct code.
2019-02-08 11:17:06 +01:00
Aleksey Kliger 972f29179d [sre] Handle null values in MarshalAsAttribute CustomAttributeBuilder
Normally strings are encoded as length-then-utf8 in ECMA-335.  But a null
String is encoded as just the byte 0xFF.

When we make a CustomAttributeBuilder for a MarshalAsAttribute and attach it to
some parameter we first encode the CAB as a byte blob and then decode it in
CAB.get_umarshal into a UnmanagedMarshal attribute.  But the decoding didn't
account for the possibility of null strings.

Fixes https://github.com/mono/mono/issues/12747
2019-02-08 10:56:08 +01:00
Marek Safar 49c0a9c2de Remove local DateTime 2019-02-08 10:37:29 +01:00
Marek Safar 9636096e3b Move DateTime for Unix to shared partition (dotnet/coreclr#22383)
* Move DateTime for Unix to shared partition

* Keep CoreCLR specific implementation

Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 10:37:29 +01:00
Marek Safar f4c9b79905 Use local Array version 2019-02-08 10:27:04 +01:00
Stephen Toub a4681c14d9 Fix CoreLib to include PasteArguments.Unix.cs correctly (#22453)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 10:27:04 +01:00
Marek Safar 2e267dfa80 Move Array to shared partition (dotnet/coreclr#22321)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 10:27:04 +01:00
Marek Safar 8608d281c6 Implement ManifestBasedResourceGroveler::GetNeutralResourcesLanguageAttribute (#22372)
* Implement ManifestBasedResourceGroveler::GetNeutralResourcesLanguageAttribute in shared managed code

* Remove native ::GetNeutralResourcesLanguage

Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 10:27:04 +01:00
Tarek Mahmoud Sayed ab717125aa Index and Range updates (dotnet/coreclr#22331)
* Index and Range updates

* Address @mikedn  feedback

* Address Feedback

* more feedback

* Use Deconstruct in Range.GetOffsetAndLength

* Rename GetArrayRange to GetSubArray

* Temporary disable the old Corefx Range tests

* Return back the TimeSpan test disabling

* Fix Range jit test

* Exclude the jit test

* revert the changes in the jit Range test

* Address Suggested Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-02-08 10:27:04 +01:00
Bernhard Urban 33d6380103 [aot] interp flag on AOT images only on mscorlib required (#12838)
[aot] interp flag on AOT images only on mscorlib required

/cc @spouliot. This fixes `--interpreter=-all` on Xamarin.iOS.
2019-02-07 17:15:50 -05:00
Bernhard Urban 21c65aafc8 [ios] pass --enable-monotouch to cross compilers so icall defintions are visible to it (#12834)
This fixes a regression introduced by https://github.com/mono/mono/commit/5187b0bdaaff56936d697b0753dad51e7498991d

The AOT compiler wasn't aware of the icalls since they are guarded by `ENABLE_MONOTOUCH`. Passing `--enable-monotouch` to configure of the AOT compiler enables that define, so it can properly resolve those icalls. However, to avoid `zlib` dependency for the cross compilers, we stub
them out.
2019-02-07 20:26:42 +01:00
Alexander Kyte 0e65799c8e [runtime] Use temp folders for merp tests (#12830)
The 2018-10 lane seemed to be failing some tests because the merp-json-valid.exe test left behind the crash log file. I fixed that in this PR, but also move the tests into their separate folders so they can run at the same time safely.
2019-02-07 19:32:06 +01:00
Tanner Gooding 321e0b511f Fixing Utf8Formatter.Float to support all the same format specifiers as the utf16 formatter. (#22434)
* Fixing Utf8Formatter.Float to support all the same format specifiers as the utf16 formatter.

* Disabling some outdated CoreFX tests.

* Fixing TryFormatFloatingPoint to special-case format.IsDefault

Signed-off-by: dotnet-bot <[email protected]>
2019-02-07 18:47:19 +01:00
Stephen Toub 75a7b9601f Finish removing Environment from corefx
Signed-off-by: dotnet-bot <[email protected]>
2019-02-07 18:30:59 +01:00
Miguel de Icaza 39397b5e92 [Registry] Prevent crash due to background thread facing problems in the file system 2019-02-07 11:52:59 -05:00
Zoltan Varga b019ca4d5a [wasm] Fix icall table linking, generate one table per assembly. (#12840) 2019-02-07 11:44:11 -05:00
Vlad Brezae 33189ef31f [tests] Enable test suites on interpreter (#12806)
Seem to pass locally
2019-02-07 16:13:24 +02:00
Johan Lorensson bbe84c03fa Merge pull request #12811 from lateralusX/lateralusX/fix-win-fullaot-runtime-tests-toggleref
Fix issue where togglerefs might be incorrectly pinned by GC.
2019-02-07 02:59:45 -05:00
Kenneth Pouncey dedbbbf401 Fix error with bindings. 2019-02-07 07:09:08 +01:00
Aleksey Kliger (λgeek) d36f437f60 [runtime] Refactor pinvoke probing (#12795)
* [runtime] Mark mono_lookup_pinvoke_call external only

Runtime should use mono_lookup_pinvoke_call_internal

* [loader] Factor out helper functions from mono_lookup_pinvoke_call

Separate the logic for probing for a dynamic library module from the logic for
looking for a symbol inside the module.

* [loader] Factor out relative directory probing in pinvoke lookup
2019-02-06 20:50:32 -05:00
Zoltan Varga 9453281f0c [ci] Enable llvmonly+mixed tests on CI. (#12777) 2019-02-06 20:46:06 -05:00
Alexander Köplinger 004deafa3a [tests] Disable flaky block_guard_restore_aligment_on_exit.exe on Windows PRs
See https://github.com/mono/mono/issues/12839
2019-02-07 01:25:13 +01:00
Thays Grazia ada7c1b821 [wasm][debugger] Bug on attributes with value type string and content NULL (#12827)
* An attribute with a content that was a string null was creating two items in result json and it was throwing an exception in client side because it is expected a name and a value and not a name and two values.
2019-02-06 21:19:01 -02:00
Alexander Köplinger ea3d9b80b5 [corlib] Remove reflection-based Mono.Native test (#12828)
The managed linker removes the type embedded inside mscorlib and we don't want to whitelist it in linker xml since then it'd be kept for everyone.

Instead move the type to the test assembly and remove the reflection-based tests.
2019-02-06 22:47:19 +01:00
Miguel de Icaza b3eeb1667a [man] mono.1 - describe how to get the list of options 2019-02-06 15:52:19 -05:00
Alexander Köplinger b4c66a1d59 [mono-native] Remove accidentally added brotli.c file
It broke the iOS SDK build because of duplicated main().

See https://github.com/mono/mono/pull/12189
2019-02-06 20:50:50 +01:00
Alexander Köplinger 04c71af56a Extend mono-native minimum version magic to CPPFLAGS/CXXFLAGS (#12801)
We were only doing the -mmacosx-min-version replacement magic on
CFLAGS and LDFLAGS for mono-native-compat and -unified,
but we need to do the same for CPPFLAGS/CXXFLAGS too.

Fixes an issue where the libraries were targeting the wrong minimum OSX
version when built from xamarin-macios since they pass the minimum version
in CPPFLAGS instead of CFLAGS for OSX.
2019-02-06 19:07:58 +01:00
Martin Baulig 5c17c4cf31 Add support for async-streams (C# 8.0). (#12674)
Bring some new APIs from corefx master for async-streams (C# 8.0):

- `IAsyncDisposable`
- `IAsyncEnumerable`
- `IAsyncEnumerator`
- `AsyncIteratorMethodBuilder`
- `AsyncIteratorStateMachineAttribute`
- `ConfiguredAsyncDisposable`
- `ConfiguredCancelableAsyncEnumerable`
- `ManualResetValueTaskSourceCore`
- `TaskExtensions` (replacing our reference source version).

Minor changes to existing code:

- Add `ExecutionContext.ContextCallback<TState>(ref TState state)` delegate.
- Add `ExecutionContext.RunInternal<TState>` method.
- Uncomment `AsyncMethodBuilderCore.Start<TStateMachine>`.
- Add new `ThreadPool.QueueUserWorkItem<T>(Action<T>,T,bool)` and `UnsafeQueueUserWorkItem<T>(Action<T>,T,bool)` overloads.

New xUnit tests from CoreFX:

- `System.Threading.Tasks/tests/System.Runtime.CompilerServices/ConfiguredCancelableAsyncEnumerableTests.netcoreapp.cs`
- `System.Threading.Tasks.Extensions/tests/ManualResetValueTaskSourceTests.cs`
- `System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs`
- `Common/tests/System/Threading/Tasks/Sources/ManualResetValueTaskSource.cs`
- `Common/tests/System/Threading/Tasks/Sources/ManualResetValueTaskSourceFactory.cs`
- `System.Threading.Tasks.Extensions/tests/AsyncValueTaskMethodBuilderTests.cs`
- `System.Threading.ThreadPool/tests/ThreadPoolTests.cs`
- `System.Threading.ThreadPool/tests/ThreadPoolTests.netcoreapp.cs` (partial due to missing `IThreadPoolWorkItem`)
2019-02-06 15:01:45 +01:00
Kenneth Pouncey fdc3d56c9b Typed Array Support - Initial commit
- Contains breaking changes
  - Remove NewArrayJS which is replaced with Array bidning.
- Add support for working with Typed Arrays, ArrayBuffer and Array.
-  Typed arrays supported

   - Int8Array 		| int8_t	| byte or SByte (signed byte)
   - Uint8Array		| uint8_t	| byte or Byte (unsigned byte)
   - Uint8ClampedArray| uint8_t	| byte or Byte (unsigned byte)
   - Int16Array		| int16_t	| short (signed short)
   - Uint16Array		| uint16_t	| ushort (unsigned short)
   - Int32Array		| int32_t	| int (signed integer)
   - Uint32Array		| uint32_t	| uint (unsigned integer)
   - Float32Array		| float		| float
   - Float64Array		| double	| double

- Split the bindings into separate file for easier support and to keep the driver program size down.
2019-02-06 14:52:30 +01:00
Thays Grazia e1602576d3 [wasm][debugger] Evaluate properties and generics. (#12782)
* [wasm][debugger] Evaluate properties and generics.
2019-02-06 09:39:00 -02:00
Alexander Köplinger aedc1ca38f [ci] Support Mono version 6.x in Windows .msi build 2019-02-06 11:47:02 +01:00
Vlad Brezae 7869333c52 [metadata] Fix dynamic delegate (#12762)
* [metadata] Decouple dynamic method signature from its delegate invoke wrapper

The invoke wrapper should not be referencing the signature because it will be freed once with the dynamic method. The wrapper can outlive the dynamic method, it is cached based on the signature.

Fixes crash on old IronJS benchmark with interpreter (which uses a lot of delegate wrappers, compared to jit)

* [interp] Add debug method for printing transformed code
2019-02-06 11:19:26 +01:00
Larry Ewing 5b44b5cbb8 Update README.md debugger instructions to match the current layout 2019-02-05 19:42:17 -06:00
Larry Ewing 1ea56466e4 Include mono-config.js produced by packager in debug.html 2019-02-05 19:41:37 -06:00
Larry Ewing d4251f42f4 Remove shell prompt from README.md to be consistent and improve cut and paste 2019-02-05 19:39:04 -06:00
Larry Ewing 879afec442 Merge pull request #12540 from jeromelaban/dev/jela/wasm-debugger-update
[WASM] Improve debugging support
2019-02-05 19:01:30 -06:00
Egor Bogatov 2f6104f163 [System.IO.Compression] Brotli from CoreFX (#12189)
Resolves https://github.com/mono/mono/issues/11431

I put the native impl to Mono.Native, but probably it should be in a separate lib (`libmono-native.0.dylib` before: **81kb**, after: **898kb**) if Linker is not able to trim it if it's not used.
Compiles and works on Windows (however, we don't build Mono.Native for Windows, but we can borrow `clrcompression.dll` from .net core) and macOS but requires changes in mono/corefx,

I disabled xunit tests as those need 50mb of test data.

PS: Brotli could be fully managed 😢 https://github.com/dotnet/corefxlab/issues/1673

C# ports:

- https://github.com/master131/BrotliSharpLib 
A quick benchmark (Compressing a 5mb file with max compression level=11)
Mono JIT: 25sec
Mono LLVM-AOT: 7.8sec
.NET Core 2.2: 6.8sec
.NET Core 3.0: 5.8sec
.NET Core's BrotliStream (with native lib): 3.5sec


- https://github.com/google/brotli/tree/master/csharp - official C# port. Based on Java sources, slow, outdated (2 years ago).
2019-02-06 00:25:19 +01:00
Martin Baulig 94f00fe796 Fix HttpClient on AIX (#12744). (#12771)
Define `PLATFORM_UNIX` in `mcs/build/platforms/unix.make` and make
`mcs/build/profiles/net_4_x.make` define `SOCKETSHTTPHANDLER=1` when set.
2019-02-05 22:41:43 +01:00
Alexander Köplinger fd71ea2fd3 [corlib] Disable GetFrames_AsyncCalls on mobile
See https://github.com/mono/mono/pull/12790
2019-02-05 21:33:56 +01:00
Michal Strehovský 399d14104a Fix ProjectN build breaks (dotnet/corert#6954)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-05 19:13:59 +01:00
lateralusX c432251142 Fix issue where togglerefs might be incorrectly pinned.
Due to current order, process togglerefs and then take current threads
stack could cause a problem where toogleref references might be left
in registers after native code process the list and those reference
would then be put into current thread context, incorrectly pinning the
toggleref, preventing it from being GC:ed. The problem was observed on
Windows (in debug build) running sgen-toggleref.exe runtime test since
the native compile of sgen_process_togglerefs used a register when
walking the list of togglerefs that was then not re-used until the
current threads stack was taken, causing incorrect pinning. This problem
could in theory happen on any platform depending on how sgen_process_togglerefs
would been compiled and what register will be used.

Fix is to take current threads context before walking the togglerefs to make
sure we are not getting managed references into registers as part of managing
the toggleref list in native code.
2019-02-05 18:37:05 +01:00
lateralusX ecc42a8410 Fix failure in catchfault_tail.exe due to stack overwrite in final handler.
Combination of Windows x64 ABI and the lack of not checking for fault handlers
in OP_START_HANDLER cause a hard to track stack corruption when combined with
tail calls. Fix is to make sure we also handle fault regions in handlers to
handle cases like the one exposed by catchfault_tail.exe test.
2019-02-05 18:34:20 +01:00
lateralusX dfa2fe6d2b Add better support to dynamically setup content of config.h in Windows MSVC builds.
When running tests on CI the runtime is configured from autogen.sh script.
When running fullaot there are a couple of features not supported so they are
disabled. The problem is that the MSVC Windows builds have its own winconfig.h
template, losing all the disabled features from configures config.h.

This commit adds support to detect the disable defines from configures config.h
if one exists. Since the complexity of this step increases the work previously
done in winsetup.bat has been moved into a msbuild target that is used from
both within VS build as well as winsetup.bat (there are a couple of other builds
using that bat file, so won't remove it).

The winconfig.h template we had is quite outdated compared to what’s generated
by configure. This commit also updates the winconfig.h to closer match what generated
for corresponding mingw build but keep all the Windows specific configurations
included in current version.
2019-02-05 18:34:20 +01:00
lateralusX c39e3e1200 Fix failing test under debug mode due to incorrect marshal alloc. 2019-02-05 18:34:20 +01:00
lateralusX 46e65d2a09 Fix process stress tests to not popup thousands of Windows.
Fix runtime test run to pickup working wrapper when running
with --enable-msvc but not setting MONO_EXECUTABLE.
2019-02-05 18:34:20 +01:00
Jo Shields 667925b987 Merge pull request #12794 from directhex/master
Bump version to 6.1.0
2019-02-05 11:26:56 -05:00
Jo Shields 1f77041f92 Bump version to 6.1.0 2019-02-05 09:42:19 -05:00
Marek Safar 29594b984c [corlib] Fix GetFrames_AsyncCalls test not to block 2019-02-05 13:09:36 +01:00
monojenkins ae99e720cd [csproj] Update project files 2019-02-05 13:08:33 +01:00
monojenkins b7fe8104e6 Bump API snapshot submodule 2019-02-05 13:08:33 +01:00
Egor Bogatov 4285787ece improve test 2019-02-05 13:08:33 +01:00
Egor Bogatov 5946cd6cb5 use CoreRT's CancellationToken and CancellationTokenSource 2019-02-05 13:08:33 +01:00
Egor Bogatov 56aab1437d add #if MONO to ref-source file 2019-02-05 13:08:33 +01:00
Egor Bogatov 3c9035442b Do not clone SyncronizationContext in EE 2019-02-05 13:08:33 +01:00
Martin Baulig afd4971208 "Ice Blue": Adding some "Connection Info" properties to SslStream. 2019-02-05 10:49:47 +01:00
Zoltan Varga 51287431af [netcore] Ongoing work. (#12750) 2019-02-05 10:34:31 +01:00
Ben Adams 45b6b640a4 Fix string.strlen (dotnet/coreclr#22397)
* Add explanation comment

Fixes #22393

Signed-off-by: dotnet-bot <[email protected]>
2019-02-05 10:29:49 +01:00
Marek Safar dc323ae290 Remove local SynchronizationContext 2019-02-05 10:20:12 +01:00
Marek Safar d2ee660406 Move SynchronizationContext to shared partition (dotnet/coreclr#22389)
* Move SynchronizationContext to shared partition

* Move WaitHelperNative to WaitHandle

Signed-off-by: dotnet-bot <[email protected]>
2019-02-05 10:20:12 +01:00
Vlad Brezae 63fc0ebdfa [interp] Add missing write barrier (#12772) 2019-02-05 09:30:33 +02:00
Jan Kotas 88a621524e More compact implementation of Marshal.GenerateProgIdForType (#22395)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-04 22:53:05 +01:00
Martin Baulig 721a437310 Remove internal WebRequest.RequestCallback to fix a compiler warning. 2019-02-04 22:52:38 +01:00
Jérôme Laban a95bbcb8e7 Fix lookup for all SourceLink mappings, prefer local file over SourceLink 2019-01-23 21:09:44 -05:00
Jérôme Laban 133088a437 Update GetScriptSource more async, show exception message. 2019-01-23 15:50:55 -05:00
Jérôme Laban 920074b55f Fix invalid csharp_space_between_method_declaration_name_and_open_parenthesis 2019-01-21 17:52:12 -05:00
Jérôme Laban 90234bd386 Reformat additions based on editor config file 2019-01-21 17:47:55 -05:00
Jérôme Laban bba2b18202 Adjust editor config based on https://www.mono-project.com/community/contributing/coding-guidelines/#style-guidelines 2019-01-21 17:47:09 -05:00
Jérôme Laban 4461e1e6a1 Adjust formatting, add .editorconfig 2019-01-21 12:50:50 -05:00
Jérôme Laban 78ef51b90a Add support for full document path
- Show the full file name in chrome source browser
- Fix support for duplicate file names in different paths
2019-01-21 11:26:12 -05:00
Jérôme Laban 4d4dc12932 Fix "Collection was modified" for pending operations 2019-01-21 11:26:12 -05:00
Jérôme Laban 91909b2b24 Fix NRE for unknown method token for some generated methods 2019-01-21 11:26:12 -05:00
Jérôme Laban 6160337c0f Fixed support for local urls 2019-01-21 11:26:12 -05:00
Jérôme Laban 49fddf283f Add support for mono pdbs, sourcelink 2019-01-21 11:26:12 -05:00
3986 changed files with 215011 additions and 171847 deletions

No files matched your search

+4 -4
View File
@@ -13,11 +13,11 @@ mkinstalldirs crlf=input
*.h crlf
*.cs crlf
*.il crlf
*.sln crlf
*.*proj* crlf
# don't do anything to line-endings. Let CRLFs go into the repo, and CRLF on checkout
*.bat -crlf
*.sln -crlf
*.*proj* -crlf
# don't do anything to line-endings. Let CRLFs/LFs go into the repo, and CRLF/LFs on checkout
*.bat -crlf
*.xml -crlf
# CRLF Handling
+47 -50
View File
@@ -10,18 +10,18 @@
# These owners will be the default owners for everything in the repo.
* @luhenry @marek-safar
* @marek-safar
# Order is important. The last matching pattern has the most precedence.
/acceptance-tests @akoeplinger @kg
/acceptance-tests/profiler-stress* @alexrp @akoeplinger
/data @marek-safar @akoeplinger @luhenry
/data/gdb @vargaz @luhenry
/data @directhex @akoeplinger
/data/gdb @lewurm @vargaz
/data/lldb @lewurm @vargaz
/docs @luhenry @marek-safar @akoeplinger
/docs @marek-safar @akoeplinger
/docs/riscv.md @alexrp @lewurm
/docs/sources/mono-api-profiler.html @alexrp
@@ -34,18 +34,18 @@
/external/corefx @akoeplinger @marek-safar @egorbo @alexischr
/external/corert @akoeplinger @marek-safar @egorbo @alexischr
/external/linker @marek-safar
/external/llvm @luhenry @vargaz
/external/llvm @alexanderkyte @vargaz
/external/nuget-buildtasks @radical @akoeplinger
/external/roslyn-binaries @kg @marek-safar @akoeplinger
/libgc @BrzVlad @vargaz @luhenry
/libgc @BrzVlad @vargaz
/llvm @vargaz @luhenry
/llvm @vargaz @alexanderkyte
/man @marek-safar @miguel @luhenry
/man @marek-safar @miguel
/man/*prof* @alexrp
/mcs @marek-safar @luhenry
/mcs @marek-safar @akoeplinger @egorbo
/mcs/build @marek-safar @akoeplinger
@@ -56,7 +56,7 @@
/mcs/class/Mono.Data.Tds @egorbo
/mcs/class/Mono.Debugger.Soft @vargaz @thaystg
/mcs/class/Mono.Options @jonpryor @marek-safar
/mcs/class/Mono.Profiler.Log @alexrp @luhenry
/mcs/class/Mono.Profiler.Log @lambdageek
/mcs/class/Mono.Security/Mono.Security/Interface @baulig @marek-safar
/mcs/class/System/Mono.AppleTls @baulig @rolf
/mcs/class/System/Mono.Btls @baulig @marek-safar
@@ -78,78 +78,75 @@
/mono/arch @vargaz @lewurm
/mono/btls @baulig @luhenry @marek-safar
/mono/btls @baulig @marek-safar
/mono/dis @lambdageek @vargaz
/mono/eglib @vargaz @luhenry
/mono/eglib @vargaz @lambdageek
/mono/benchmark @alexanderkyte @luhenry
/mono/benchmark @alexanderkyte @lewurm
/mono/metadata @vargaz @lambdageek
/mono/metadata/*verify* @lambdageek @luhenry
/mono/metadata/*profiler* @alexrp @luhenry
/mono/metadata/handle* @luhenry @lambdageek
/mono/metadata @vargaz @lambdageek @thaystg
/mono/metadata/*profiler* @lambdageek
/mono/metadata/handle* @lambdageek @vargaz
/mono/metadata/monitor* @brzvlad @vargaz
/mono/metadata/sgen* @brzvlad @vargaz
/mono/metadata/thread* @luhenry @lateralusX
/mono/metadata/w32* @luhenry @lateralusX
/mono/metadata/*-win* @lateralusX @luhenry @luhenry
/mono/metadata/thread* @lateralusX @lambdageek
/mono/metadata/w32* @lateralusX @lambdageek
/mono/metadata/*-win* @lateralusX @lambdageek
/mono/mini @vargaz @lewurm
/mono/mini/*cfgdump* @lewurm @luhenry
/mono/mini/*exceptions* @lewurm @luhenry
/mono/mini @vargaz @lewurm @lambdageek
/mono/mini/*cfgdump* @lewurm @vargaz
/mono/mini/*exceptions* @lewurm @vargaz
/mono/mini/*ppc* @lewurm @vargaz
/mono/mini/*riscv* @alexrp @lewurm
/mono/mini/*type-check* @lewurm @lambdageek
/mono/mini/interp/* @lewurm @BrzVlad
/mono/mini/*profiler* @alexrp @luhenry
/mono/mini/*profiler* @alexrp @lambdageek
/mono/mini/debugger-agent.c @vargaz @thaystg @DavidKarlas
/mono/native @baulig @luhenry @marek-safar
/mono/native @baulig @egorbo @alexischr @marek-safar
/mono/profiler @alexrp @luhenry
/mono/profiler @alexrp @lambdageek
/mono/sgen @BrzVlad @luhenry
/mono/sgen @BrzVlad @lambdageek
/mono/utils @vargaz @lewurm
/mono/utils/atomic* @lewurm @luhenry
/mono/utils/mono-hwcap* @lewurm @luhenry
/mono/utils/mono-mem* @lewurm @luhenry
/mono/utils/mono-threads* @luhenry @vargaz
/mono/utils/*-win* @lateralusX @luhenry
/mono/utils @vargaz @lewurm @lambdageek
/mono/utils/atomic* @lewurm @vargaz
/mono/utils/mono-hwcap* @lewurm @vargaz
/mono/utils/mono-mem* @lewurm @vargaz
/mono/utils/mono-threads* @lambdageek @vargaz
/mono/utils/*-win* @lateralusX @lambdageek
/msvc @lateralusX @luhenry
/msvc/*profiler* @alexrp @luhenry
/msvc @lateralusX @kg @akoeplinger
/msvc/scripts @akoeplinger @kg
/netcore @marek-safar @akoeplinger @egorbo
/packaging @alexischr @akoeplinger @luhenry @directhex
/packaging @alexischr @akoeplinger @directhex
/packaging/MacSDK/msbuild.py @radical @akoeplinger
/runtime @akoeplinger @marek-safar @luhenry
/runtime @akoeplinger @marek-safar
/samples @luhenry @lewurm
/samples/profiler @alexrp @luhenry
/samples/size @alexrp @luhenry
/samples @lambdageek @lewurm
/samples/profiler @alexrp @lambdageek
/samples/size @alexrp @lambdageek
/scripts @akoeplinger @luhenry
/scripts/ci @akoeplinger @alexischr
/scripts @akoeplinger @directhex
/scripts/ci @akoeplinger @directhex
/sdks @marek-safar @luhenry @vargaz
/sdks/builds/android* @luhenry @jonpryor
/sdks/builds/mxe* @luhenry @jonpryor
/sdks @marek-safar @lewurm @vargaz
/sdks/builds/android* @alexischr @jonpryor
/sdks/builds/mxe* @alexischr @jonpryor
/sdks/builds/ios* @vargaz @rolfbjarne
/sdks/builds/wasm* @vargaz @kjpou1 @lewing
/sdks/wasm @vargaz @kjpou1 @kg @lewing
/sdks/ios @vargaz @rolfbjarne
/sdks/android @luhenry @jonpryor
/sdks/android @alexischr @jonpryor
/support @luhenry @vargaz
/support @lambdageek @vargaz
/tools @luhenry @vargaz
/tools @lambdageek @vargaz
/tools/locale-builder @marek-safar @egorbo
/tools/monograph @vargaz @vargaz
/tools/nuget-hash-extractor @marek-safar @radical
/tools/nuget-hash-extractor @marek-safar @radical @akoeplinger
/tools/offsets-tool @lewurm @rolfbjarne
/tools/pedump @lambdageek @lewurm
/tools/sgen @brzvlad @vargaz
+13 -1
View File
@@ -24,7 +24,6 @@
*.tlh
*.bak
*.ilk
*.log
*.lib
*.sbr
*.sdf
@@ -129,9 +128,22 @@ docs/perlmod*
compile
mono.h
mono-*.tar.*
mono_crash*
tmpinst-dir.stamp
msvc/scripts/inputs/
extensions-config.h
*.dylib.dSYM
*.mlpd
llvm/build/
llvm/usr/
sdks/builds/llvm-*/
sdks/builds/android-*/
##############################################################################
# Arcade output directories
##############################################################################
.packages
artifacts
.dotnet
+7 -8
View File
@@ -3,11 +3,8 @@
{
"name": "Mac",
"includePath": [
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"${default}",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/usr/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
@@ -17,11 +14,8 @@
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"${default}",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/usr/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
@@ -31,6 +25,7 @@
"databaseFilename": ""
},
"macFrameworkPath": [
"${default}",
"/System/Library/Frameworks",
"/Library/Frameworks"
]
@@ -38,6 +33,7 @@
{
"name": "Linux",
"includePath": [
"${default}",
"/usr/include",
"/usr/local/include",
"${workspaceRoot}",
@@ -49,6 +45,7 @@
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"${default}",
"/usr/include",
"/usr/local/include",
"${workspaceRoot}",
@@ -63,6 +60,7 @@
{
"name": "Win32",
"includePath": [
"${default}",
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
@@ -76,6 +74,7 @@
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"${default}",
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
"${workspaceRoot}",
"${workspaceRoot}/mono",
-2
View File
@@ -28,8 +28,6 @@ Mono itself, and does not end up in the redistributable part of Mono:
* mcs/jay: 4-clause BSD licensed
* mcs/nunit24: MS-PL
* mcs/class/I18N/mklist.sh, tools/cvt.sh: GNU GPLv2
Runtime Code
+10 -5
View File
@@ -19,15 +19,20 @@ build_with_msvc =
build_without_msvc = msvc
endif
if ENABLE_NETCORE
update_submodules =
else
update_submodules = update_submodules
endif
SUBDIRS = $(build_with_msvc) mk po $(libgc_dir) llvm mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) $(build_without_msvc) $(docs_dir) acceptance-tests
# Keep in sync with SUBDIRS
DIST_SUBDIRS = $(build_with_msvc) m4 mk po $(libgc_dir) llvm mono ikvm-native support data runtime scripts man samples tools $(build_without_msvc) docs acceptance-tests
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
all: update_submodules
all: $(update_submodules)
SUBMODULE_ERROR='Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date'
update_submodules:
@$(srcdir)/scripts/update_submodules.sh
@cd $(srcdir) && scripts/update_submodules.sh
.PHONY: update_submodules
@@ -59,7 +64,7 @@ dist-hook:
rm -f `find $(top_distdir)/external -name '\.dirstamp'`
rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*' -not -path '*/helix-binaries/*'`
rm -rf "$(top_distdir)/external/linker/linker/Tests"
rm -rf "$(top_distdir)/external/linker/test"
pkgconfigdir = $(libdir)/pkgconfig
noinst_DATA = mono-uninstalled.pc
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
+3
View File
@@ -306,6 +306,9 @@ faster under the Xen virtualization system.
* `--with-large-heap=yes,no` - Enable support for GC heaps larger than 3GB.
* This only applies only to the Boehm garbage collector, the SGen garbage
collector does not use this configuration option.
* This defaults to `no`.
* `--enable-small-config=yes,no` - Enable some tweaks to reduce memory usage
+60
View File
@@ -0,0 +1,60 @@
Mono uses third-party libraries or other resources that may be
distributed under licenses different than the Mono software.
Attributions and license notices for test cases originally authored by
third parties can be found in the respective test directories.
In the event that we accidentally failed to list a required notice, please
bring it to our attention. Post an issue or email us:
[email protected]
The attached notices are provided for information only.
License notice for Mono
-----------------------
Note: multiple license notices are provided that occure in source code.
They are equivalent forms of the the MIT license from various copyright holders.
// Dual licensed under the terms of the MIT X11 or GNU GPL
// Copyright 2003-2011 Novell, Inc.
// Copyright 2011 Xamarin Inc
/**
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
* Copyright (C) 2012 Xamarin Inc
*
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
/******************************************************************************
* The MIT License
* Copyright (c) 2003 Novell Inc. www.novell.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the Software), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*******************************************************************************/
License notice for Apple
-------------------------
Content: https://github.com/mono/mono/blob/435f968102d0820ca65d63e1e741e4130b4d1303/support/ios/net/route.h
License: https://opensource.apple.com/apsl/
+1 -1
View File
@@ -10,7 +10,7 @@
{
"name": "coreclr",
"url": "git://github.com/mono/coreclr.git",
"rev": "1e8d7a94155a04a6556a7ae9ef8dc5841b3ab206",
"rev": "90f7060935732bb624e1f325d23f63072433725f",
"remote-branch": "origin/mono",
"branch": "mono",
"directory": "coreclr"
+2
View File
@@ -1,4 +1,6 @@
check-roslyn:
@echo "Runnning roslyn tests using mono from PATH:"
mono --version
@$(MAKE) validate-roslyn RESET_VERSIONS=1
cd $(ROSLYN_PATH); \
./build.sh --restore --build --test --mono || exit; \
+1 -1
View File
@@ -120,7 +120,7 @@ for PARAM; do
done
if test x$has_ext_mod = xtrue; then
pushd ../mono-extensions/scripts
pushd $top_srcdir../mono-extensions/scripts
sh ./prepare-repo.sh $ext_mod_args || exit 1
popd
else
+10 -234
View File
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
MinimumVisualStudioVersion = 15.0.0.0
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jay", "mcs/jay/jay.vcxproj", "{5d485d32-3b9f-4287-ab24-c8da5b89f537}"
EndProject
@@ -570,24 +570,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Drawing.Prim
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Net.Http.Rtc", "mcs/class/Facades/System.Net.Http.Rtc/Facades_System.Net.Http.Rtc.csproj", "{786AAD60-DBEA-4F9B-BF1B-C3486CE000D0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUnit.Framework", "mcs/nunit24/NUnitFramework/framework/NUnit.Framework.csproj", "{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.core.interfaces", "mcs/nunit24/NUnitCore/interfaces/nunit.core.interfaces.csproj", "{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.core", "mcs/nunit24/NUnitCore/core/nunit.core.csproj", "{559F5BCC-3235-494A-9D86-4F26F67F9E40}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.util", "mcs/nunit24/ClientUtilities/util/nunit.util.csproj", "{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.mocks", "mcs/nunit24/NUnitMocks/mocks/nunit.mocks.csproj", "{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.extensions", "mcs/nunit24/NUnitExtensions/framework/nunit.framework.extensions.csproj", "{DFE253AA-843E-4374-B862-9F0B7414CB8C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.core.extensions", "mcs/nunit24/NUnitExtensions/core/nunit.core.extensions.csproj", "{6464D30A-2B8E-458D-B96A-2ECDE947B58B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit-console-runner", "mcs/nunit24/ConsoleRunner/nunit-console/nunit-console-runner.csproj", "{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit-console", "mcs/nunit24/ConsoleRunner/nunit-console-exe/nunit-console.csproj", "{2D845BF5-42C7-41D3-AC01-F63980F76B22}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ilasm", "mcs/ilasm/ilasm.csproj", "{C02B3C37-DB98-40A5-84F0-F98633DA7EE4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "al", "mcs/tools/al/al.csproj", "{0A20671F-CCA9-457D-886C-0828C7D64128}"
@@ -1126,22 +1108,14 @@ Global
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|orbis.ActiveCfg = Debug|orbis
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|orbis.Build.0 = Debug|orbis
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|orbis.ActiveCfg = Release|orbis
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|orbis.Build.0 = Release|orbis
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|unreal.ActiveCfg = Debug|unreal
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|unreal.Build.0 = Debug|unreal
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|unreal.ActiveCfg = Release|unreal
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|unreal.Build.0 = Release|unreal
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|wasm.ActiveCfg = Debug|wasm
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|wasm.Build.0 = Debug|wasm
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|wasm.ActiveCfg = Release|wasm
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|wasm.Build.0 = Release|wasm
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|winaot.ActiveCfg = Debug|winaot
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|winaot.Build.0 = Debug|winaot
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|winaot.ActiveCfg = Release|winaot
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|winaot.Build.0 = Release|winaot
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|orbis.ActiveCfg = Debug|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|orbis.ActiveCfg = Release|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|unreal.ActiveCfg = Debug|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|unreal.ActiveCfg = Release|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|wasm.ActiveCfg = Debug|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|wasm.ActiveCfg = Release|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|winaot.ActiveCfg = Debug|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|winaot.ActiveCfg = Release|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Debug|xammac.ActiveCfg = Debug|net_4_x
{DCB27742-5382-4CB3-B7D8-A6DF92B8B68C}.Release|xammac.ActiveCfg = Release|net_4_x
{4900DA48-CB1B-4520-98EE-F6B0F3054341}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
@@ -10116,204 +10090,6 @@ Global
{786AAD60-DBEA-4F9B-BF1B-C3486CE000D0}.Release|winaot.ActiveCfg = Release|net_4_x
{786AAD60-DBEA-4F9B-BF1B-C3486CE000D0}.Debug|xammac.ActiveCfg = Debug|net_4_x
{786AAD60-DBEA-4F9B-BF1B-C3486CE000D0}.Release|xammac.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|net_4_x.Build.0 = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|net_4_x.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|net_4_x.Build.0 = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|monodroid.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|monotouch.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|orbis.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|orbis.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|unreal.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|unreal.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|wasm.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|wasm.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|winaot.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|winaot.ActiveCfg = Release|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Debug|xammac.ActiveCfg = Debug|net_4_x
{5A1007E5-0FDA-42F5-98AC-D61E11C4B3AB}.Release|xammac.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|net_4_x.Build.0 = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|net_4_x.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|net_4_x.Build.0 = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|monodroid.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|monotouch.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|orbis.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|orbis.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|unreal.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|unreal.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|wasm.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|wasm.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|winaot.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|winaot.ActiveCfg = Release|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Debug|xammac.ActiveCfg = Debug|net_4_x
{9B6CBD42-1AA3-40FA-A8B3-80C63EA47A02}.Release|xammac.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|net_4_x.Build.0 = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|net_4_x.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|net_4_x.Build.0 = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|monodroid.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|monotouch.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|orbis.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|orbis.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|unreal.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|unreal.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|wasm.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|wasm.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|winaot.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|winaot.ActiveCfg = Release|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Debug|xammac.ActiveCfg = Debug|net_4_x
{559F5BCC-3235-494A-9D86-4F26F67F9E40}.Release|xammac.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|net_4_x.Build.0 = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|net_4_x.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|net_4_x.Build.0 = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|monodroid.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|monotouch.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|orbis.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|orbis.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|unreal.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|unreal.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|wasm.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|wasm.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|winaot.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|winaot.ActiveCfg = Release|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Debug|xammac.ActiveCfg = Debug|net_4_x
{8F75DF82-CC9B-44A0-97CC-8ED180AFF6EF}.Release|xammac.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|net_4_x.Build.0 = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|net_4_x.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|net_4_x.Build.0 = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|monodroid.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|monotouch.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|orbis.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|orbis.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|unreal.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|unreal.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|wasm.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|wasm.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|winaot.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|winaot.ActiveCfg = Release|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Debug|xammac.ActiveCfg = Debug|net_4_x
{94A88112-9E7E-45FA-A3FF-ACF8E1DF0FCB}.Release|xammac.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|net_4_x.Build.0 = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|net_4_x.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|net_4_x.Build.0 = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|monodroid.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|monotouch.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|orbis.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|orbis.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|unreal.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|unreal.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|wasm.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|wasm.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|winaot.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|winaot.ActiveCfg = Release|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Debug|xammac.ActiveCfg = Debug|net_4_x
{DFE253AA-843E-4374-B862-9F0B7414CB8C}.Release|xammac.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|net_4_x.Build.0 = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|net_4_x.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|net_4_x.Build.0 = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|monodroid.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|monotouch.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|orbis.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|orbis.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|unreal.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|unreal.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|wasm.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|wasm.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|winaot.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|winaot.ActiveCfg = Release|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Debug|xammac.ActiveCfg = Debug|net_4_x
{6464D30A-2B8E-458D-B96A-2ECDE947B58B}.Release|xammac.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|net_4_x.Build.0 = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|net_4_x.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|net_4_x.Build.0 = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|monodroid.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|monotouch.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|orbis.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|orbis.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|unreal.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|unreal.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|wasm.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|wasm.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|winaot.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|winaot.ActiveCfg = Release|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Debug|xammac.ActiveCfg = Debug|net_4_x
{F0B8A9C7-8D0D-4629-B730-CFCB17C4BB2D}.Release|xammac.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|net_4_x.Build.0 = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|net_4_x.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|net_4_x.Build.0 = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|monodroid.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|monodroid.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|monotouch.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|monotouch.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|monotouch_tv.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|monotouch_tv.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|monotouch_watch.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|monotouch_watch.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|orbis.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|orbis.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|unreal.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|unreal.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|wasm.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|wasm.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|winaot.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|winaot.ActiveCfg = Release|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Debug|xammac.ActiveCfg = Debug|net_4_x
{2D845BF5-42C7-41D3-AC01-F63980F76B22}.Release|xammac.ActiveCfg = Release|net_4_x
{C02B3C37-DB98-40A5-84F0-F98633DA7EE4}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{C02B3C37-DB98-40A5-84F0-F98633DA7EE4}.Debug|net_4_x.Build.0 = Debug|net_4_x
{C02B3C37-DB98-40A5-84F0-F98633DA7EE4}.Release|net_4_x.ActiveCfg = Release|net_4_x
+437 -206
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -7,7 +7,7 @@ EXTRA_DIST = \
config.in \
browscap.ini mono.supp mono.d README \
mono.pc.in mono-2.pc.in monosgen-2.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in \
mono-cairo.pc.in mono-options.pc.in cecil.pc.in \
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
dtrace-prelink.sh system.web.mvc.pc.in system.web.mvc2.pc.in system.web.mvc3.pc.in aspnetwebstack.pc.in \
reactive.pc.in xbuild12.pc \
@@ -25,10 +25,10 @@ else
SGENPCFILE=
endif
pkgconfig_DATA= mono.pc mono-2.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
pkgconfig_DATA= mono.pc mono-2.pc dotnet.pc dotnet35.pc wcf.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc xbuild12.pc $(SGENPCFILE)
DISTCLEANFILES= mono-2.pc mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
DISTCLEANFILES= mono-2.pc mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc $(SGENPCFILE) mono-sgen-gdb.py
mono_DATA = config \
Regular → Executable
View File
File mode changed.
+1 -1
View File
@@ -20,7 +20,7 @@ def print_frames(thread, num_frames, current_thread):
ipoffset = frame.EvaluateExpression('ip').GetValueAsUnsigned()
insn = ''
if ipoffset != 0:
ipoffset -= frame.EvaluateExpression('rtm->code').GetValueAsUnsigned()
ipoffset -= frame.EvaluateExpression('imethod->code').GetValueAsUnsigned()
insn = "\"" + frame.EvaluateExpression('mono_interp_opname [*ip]').summary[1:-1] + "\""
var = '%s::%s @ %d %s || %s' % (klassname, methodname, ipoffset, insn, frame)
except Exception as e:
-9
View File
@@ -1,9 +0,0 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
Name: Mono NUnit
Description: Mono's version of NUnit
Version: @VERSION@
Libs: -r:${libdir}/mono/4.5/nunit.core.dll -r:${libdir}/mono/4.5/nunit.core.interfaces.dll -r:${libdir}/mono/4.5/nunit.core.extensions.dll -r:${libdir}/mono/4.5/nunit.framework.dll -r:${libdir}/mono/4.5/nunit.framework.extensions.dll -r:${libdir}/mono/4.5/nunit.mocks.dll -r:${libdir}/mono/4.5/nunit.util.dll -r:${libdir}/mono/4.5/nunit-console-runner.dll
-2
View File
@@ -237,8 +237,6 @@
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Silverlight 2.0 key -->
<map Token="7cec85d7bea7798e" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- NUnit broken key -->
<map Token="96d09a1eb7f44a77" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- XNA Framework key -->
<map Token="6d5c3888ef60e27d" PublicKey="0024000004800000940000000602000000240000525341310004000001000100f9a2641bac9847900d92a33d652ccc4e8b529360f908e7af53e57008b2a9a1938c32a160d47f795a23590557608d2c8d0c0e8846a052d070f9298281b8185343dbe5b479bd52de256f73c2a943e1a8a42065b5c918622dc14b1c0151dbd94d9a4543e7cd03e536b1b1d2d6d99af535d227ab9bdac76af9312a21d457bdf817e6" />
</pubTokenMapping>
-2
View File
@@ -220,8 +220,6 @@
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Silverlight 2.0 key -->
<map Token="7cec85d7bea7798e" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- NUnit broken key -->
<map Token="96d09a1eb7f44a77" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- XNA Framework key -->
<map Token="6d5c3888ef60e27d" PublicKey="0024000004800000940000000602000000240000525341310004000001000100f9a2641bac9847900d92a33d652ccc4e8b529360f908e7af53e57008b2a9a1938c32a160d47f795a23590557608d2c8d0c0e8846a052d070f9298281b8185343dbe5b479bd52de256f73c2a943e1a8a42065b5c918622dc14b1c0151dbd94d9a4543e7cd03e536b1b1d2d6d99af535d227ab9bdac76af9312a21d457bdf817e6" />
</pubTokenMapping>
-2
View File
@@ -237,8 +237,6 @@
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Silverlight 2.0 key -->
<map Token="7cec85d7bea7798e" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- NUnit broken key -->
<map Token="96d09a1eb7f44a77" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- XNA Framework key -->
<map Token="6d5c3888ef60e27d" PublicKey="0024000004800000940000000602000000240000525341310004000001000100f9a2641bac9847900d92a33d652ccc4e8b529360f908e7af53e57008b2a9a1938c32a160d47f795a23590557608d2c8d0c0e8846a052d070f9298281b8185343dbe5b479bd52de256f73c2a943e1a8a42065b5c918622dc14b1c0151dbd94d9a4543e7cd03e536b1b1d2d6d99af535d227ab9bdac76af9312a21d457bdf817e6" />
</pubTokenMapping>
-2
View File
@@ -240,8 +240,6 @@
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Silverlight 2.0 key -->
<map Token="7cec85d7bea7798e" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- NUnit broken key -->
<map Token="96d09a1eb7f44a77" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- XNA Framework key -->
<map Token="6d5c3888ef60e27d" PublicKey="0024000004800000940000000602000000240000525341310004000001000100f9a2641bac9847900d92a33d652ccc4e8b529360f908e7af53e57008b2a9a1938c32a160d47f795a23590557608d2c8d0c0e8846a052d070f9298281b8185343dbe5b479bd52de256f73c2a943e1a8a42065b5c918622dc14b1c0151dbd94d9a4543e7cd03e536b1b1d2d6d99af535d227ab9bdac76af9312a21d457bdf817e6" />
</pubTokenMapping>
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19302.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e6a5d5f970bb872451c6310ae34eda31041fb552</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.19302.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e6a5d5f970bb872451c6310ae34eda31041fb552</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<PreReleaseVersionLabel>prerelease</PreReleaseVersionLabel>
</PropertyGroup>
</Project>
+2
View File
@@ -0,0 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*"
+158
View File
@@ -0,0 +1,158 @@
param(
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored
[Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
[Parameter(Mandatory=$true)][string] $SymbolToolPath # Full path to directory where dotnet symbol-tool was installed
)
Add-Type -AssemblyName System.IO.Compression.FileSystem
function FirstMatchingSymbolDescriptionOrDefault {
param(
[string] $FullPath, # Full path to the module that has to be checked
[string] $TargetServerParam, # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols
[string] $SymbolsPath
)
$FileName = [System.IO.Path]::GetFileName($FullPath)
$Extension = [System.IO.Path]::GetExtension($FullPath)
# Those below are potential symbol files that the `dotnet symbol` might
# return. Which one will be returned depend on the type of file we are
# checking and which type of file was uploaded.
# The file itself is returned
$SymbolPath = $SymbolsPath + "\" + $FileName
# PDB file for the module
$PdbPath = $SymbolPath.Replace($Extension, ".pdb")
# PDB file for R2R module (created by crossgen)
$NGenPdb = $SymbolPath.Replace($Extension, ".ni.pdb")
# DBG file for a .so library
$SODbg = $SymbolPath.Replace($Extension, ".so.dbg")
# DWARF file for a .dylib
$DylibDwarf = $SymbolPath.Replace($Extension, ".dylib.dwarf")
.\dotnet-symbol.exe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath | Out-Null
if (Test-Path $PdbPath) {
return "PDB"
}
elseif (Test-Path $NGenPdb) {
return "NGen PDB"
}
elseif (Test-Path $SODbg) {
return "DBG for SO"
}
elseif (Test-Path $DylibDwarf) {
return "Dwarf for Dylib"
}
elseif (Test-Path $SymbolPath) {
return "Module"
}
else {
return $null
}
}
function CountMissingSymbols {
param(
[string] $PackagePath # Path to a NuGet package
)
# Ensure input file exist
if (!(Test-Path $PackagePath)) {
throw "Input file does not exist: $PackagePath"
}
# Extensions for which we'll look for symbols
$RelevantExtensions = @(".dll", ".exe", ".so", ".dylib")
# How many files are missing symbol information
$MissingSymbols = 0
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$PackageGuid = New-Guid
$ExtractPath = Join-Path -Path $ExtractPath -ChildPath $PackageGuid
$SymbolsPath = Join-Path -Path $ExtractPath -ChildPath "Symbols"
[System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath)
# Makes easier to reference `symbol tool`
Push-Location $SymbolToolPath
Get-ChildItem -Recurse $ExtractPath |
Where-Object {$RelevantExtensions -contains $_.Extension} |
ForEach-Object {
if ($_.FullName -Match "\\ref\\") {
Write-Host "`t Ignoring reference assembly file" $_.FullName
return
}
$SymbolsOnMSDL = FirstMatchingSymbolDescriptionOrDefault $_.FullName "--microsoft-symbol-server" $SymbolsPath
$SymbolsOnSymWeb = FirstMatchingSymbolDescriptionOrDefault $_.FullName "--internal-server" $SymbolsPath
Write-Host -NoNewLine "`t Checking file" $_.FullName "... "
if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) {
Write-Host "Symbols found on MSDL (" $SymbolsOnMSDL ") and SymWeb (" $SymbolsOnSymWeb ")"
}
else {
$MissingSymbols++
if ($SymbolsOnMSDL -eq $null -and $SymbolsOnSymWeb -eq $null) {
Write-Host "No symbols found on MSDL or SymWeb!"
}
else {
if ($SymbolsOnMSDL -eq $null) {
Write-Host "No symbols found on MSDL!"
}
else {
Write-Host "No symbols found on SymWeb!"
}
}
}
}
Pop-Location
return $MissingSymbols
}
function CheckSymbolsAvailable {
if (Test-Path $ExtractPath) {
Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue
}
Get-ChildItem "$InputPath\*.nupkg" |
ForEach-Object {
$FileName = $_.Name
# These packages from Arcade-Services include some native libraries that
# our current symbol uploader can't handle. Below is a workaround until
# we get issue: https://github.com/dotnet/arcade/issues/2457 sorted.
if ($FileName -Match "Microsoft\.DotNet\.Darc\.") {
Write-Host "Ignoring Arcade-services file: $FileName"
Write-Host
return
}
elseif ($FileName -Match "Microsoft\.DotNet\.Maestro\.Tasks\.") {
Write-Host "Ignoring Arcade-services file: $FileName"
Write-Host
return
}
Write-Host "Validating $FileName "
$Status = CountMissingSymbols "$InputPath\$FileName"
if ($Status -ne 0) {
Write-Error "Missing symbols for $Status modules in the package $FileName"
}
Write-Host
}
}
CheckSymbolsAvailable
+146
View File
@@ -0,0 +1,146 @@
# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1
# NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1
$script:loggingCommandPrefix = '##vso['
$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"?
New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' }
New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' }
New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' }
New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' }
)
# TODO: BUG: Escape % ???
# TODO: Add test to verify don't need to escape "=".
<########################################
# Private functions.
########################################>
function Format-LoggingCommandData {
[CmdletBinding()]
param([string]$Value, [switch]$Reverse)
if (!$Value) {
return ''
}
if (!$Reverse) {
foreach ($mapping in $script:loggingCommandEscapeMappings) {
$Value = $Value.Replace($mapping.Token, $mapping.Replacement)
}
} else {
for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) {
$mapping = $script:loggingCommandEscapeMappings[$i]
$Value = $Value.Replace($mapping.Replacement, $mapping.Token)
}
}
return $Value
}
function Format-LoggingCommand {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Area,
[Parameter(Mandatory = $true)]
[string]$Event,
[string]$Data,
[hashtable]$Properties)
# Append the preamble.
[System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder
$null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event)
# Append the properties.
if ($Properties) {
$first = $true
foreach ($key in $Properties.Keys) {
[string]$value = Format-LoggingCommandData $Properties[$key]
if ($value) {
if ($first) {
$null = $sb.Append(' ')
$first = $false
} else {
$null = $sb.Append(';')
}
$null = $sb.Append("$key=$value")
}
}
}
# Append the tail and output the value.
$Data = Format-LoggingCommandData $Data
$sb.Append(']').Append($Data).ToString()
}
function Write-LoggingCommand {
[CmdletBinding(DefaultParameterSetName = 'Parameters')]
param(
[Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
[string]$Area,
[Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
[string]$Event,
[Parameter(ParameterSetName = 'Parameters')]
[string]$Data,
[Parameter(ParameterSetName = 'Parameters')]
[hashtable]$Properties,
[Parameter(Mandatory = $true, ParameterSetName = 'Object')]
$Command,
[switch]$AsOutput)
if ($PSCmdlet.ParameterSetName -eq 'Object') {
Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput
return
}
$command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties
if ($AsOutput) {
$command
} else {
Write-Host $command
}
}
function Write-LogIssue {
[CmdletBinding()]
param(
[ValidateSet('warning', 'error')]
[Parameter(Mandatory = $true)]
[string]$Type,
[string]$Message,
[string]$ErrCode,
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput)
$command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{
'type' = $Type
'code' = $ErrCode
'sourcepath' = $SourcePath
'linenumber' = $LineNumber
'columnnumber' = $ColumnNumber
}
if ($AsOutput) {
return $command
}
if ($Type -eq 'error') {
$foregroundColor = $host.PrivateData.ErrorForegroundColor
$backgroundColor = $host.PrivateData.ErrorBackgroundColor
if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
$foregroundColor = [System.ConsoleColor]::Red
$backgroundColor = [System.ConsoleColor]::Black
}
} else {
$foregroundColor = $host.PrivateData.WarningForegroundColor
$backgroundColor = $host.PrivateData.WarningBackgroundColor
if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
$foregroundColor = [System.ConsoleColor]::Yellow
$backgroundColor = [System.ConsoleColor]::Black
}
}
Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor
}
+83
View File
@@ -0,0 +1,83 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<Project Sdk="Microsoft.NET.Sdk">
<!--
This MSBuild file is intended to be used as the body of the default
publishing release pipeline. The release pipeline will use this file
to invoke the PushToStaticFeed task that will read the build asset
manifest and publish the assets described in the manifest to
informed target feeds.
-->
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)DefaultVersions.props" Condition="Exists('$(MSBuildThisFileDirectory)DefaultVersions.props')" />
<!--
This won't be necessary once we solve this issue:
https://github.com/dotnet/arcade/issues/2266
-->
<Import Project="$(MSBuildThisFileDirectory)ArtifactsCategory.props" Condition="Exists('$(MSBuildThisFileDirectory)ArtifactsCategory.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.dotnet.build.tasks.feed\$(MicrosoftDotNetBuildTasksFeedVersion)\build\Microsoft.DotNet.Build.Tasks.Feed.targets" />
<Target Name="PublishToFeed">
<Error Condition="'$(ArtifactsCategory)' == ''" Text="ArtifactsCategory: The artifacts' category produced by the build wasn't provided." />
<Error Condition="'$(AccountKeyToStaticFeed)' == ''" Text="AccountKeyToStaticFeed: Account key for target feed wasn't provided." />
<Error Condition="'$(ManifestsBasePath)' == ''" Text="Full path to asset manifests directory wasn't provided." />
<Error Condition="'$(BlobBasePath)' == '' AND '$(PackageBasePath)' == ''" Text="A valid full path to BlobBasePath of PackageBasePath is required." />
<ItemGroup>
<!-- Include all manifests found in the manifest folder. -->
<ManifestFiles Include="$(ManifestsBasePath)*.xml" />
</ItemGroup>
<Error Condition="'@(ManifestFiles)' == ''" Text="No manifest file was found in the provided path: $(ManifestsBasePath)" />
<!--
For now the type of packages being published will be informed for the whole build.
Eventually this will be specified on a per package basis:
TODO: https://github.com/dotnet/arcade/issues/2266
-->
<PropertyGroup>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == '.NETCORE'">https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == '.NETCOREVALIDATION'">https://dotnetfeed.blob.core.windows.net/arcade-validation/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ASPNETCORE'">https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ASPNETCORETOOLING'">https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ENTITYFRAMEWORKCORE'">https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ASPNETEXTENSIONS'">https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'CORECLR'">https://dotnetfeed.blob.core.windows.net/dotnet-coreclr/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'CORESDK'">https://dotnetfeed.blob.core.windows.net/dotnet-sdk/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'TOOLSINTERNAL'">https://dotnetfeed.blob.core.windows.net/dotnet-tools-internal/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'TOOLSET'">https://dotnetfeed.blob.core.windows.net/dotnet-toolset/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'WINDOWSDESKTOP'">https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'NUGETCLIENT'">https://dotnetfeed.blob.core.windows.net/nuget-nugetclient/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ASPNETENTITYFRAMEWORK6'">https://dotnetfeed.blob.core.windows.net/aspnet-entityframework6/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ASPNETBLAZOR'">https://dotnetfeed.blob.core.windows.net/aspnet-blazor/index.json</TargetStaticFeed>
</PropertyGroup>
<Error
Condition="'$(TargetStaticFeed)' == ''"
Text="'$(ArtifactsCategory)' wasn't recognized as a valid artifact category. Valid categories are: '.NetCore' and '.NetCoreValidation'" />
<!-- Iterate publishing assets from each manifest file. -->
<PushArtifactsInManifestToFeed
ExpectedFeedUrl="$(TargetStaticFeed)"
AccountKey="$(AccountKeyToStaticFeed)"
BARBuildId="$(BARBuildId)"
MaestroApiEndpoint="$(MaestroApiEndpoint)"
BuildAssetRegistryToken="$(BuildAssetRegistryToken)"
Overwrite="$(OverrideAssetsWithSameName)"
PassIfExistingItemIdentical="$(PassIfExistingItemIdentical)"
MaxClients="$(MaxParallelUploads)"
UploadTimeoutInMinutes="$(MaxUploadTimeoutInMinutes)"
AssetManifestPath="%(ManifestFiles.Identity)"
BlobAssetsBasePath="$(BlobBasePath)"
PackageAssetsBasePath="$(PackageBasePath)"/>
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="$(MicrosoftDotNetBuildTasksFeedVersion)" />
</ItemGroup>
</Project>
+82
View File
@@ -0,0 +1,82 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<Project Sdk="Microsoft.NET.Sdk">
<!--
This MSBuild file is intended to be used as the body of the default
publishing release pipeline. The release pipeline will use this file
to invoke the PublishSymbols tasks to publish symbols to MSDL and SymWeb.
Parameters:
- PDBArtifactsDirectory : Full path to directory containing PDB files to be published.
- BlobBasePath : Full path containing *.symbols.nupkg packages to be published.
- DotNetSymbolServerTokenMsdl : PAT to access MSDL.
- DotNetSymbolServerTokenSymWeb : PAT to access SymWeb.
- DotNetSymbolExpirationInDays : Expiration days for published packages. Default is 3650.
-->
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<Import Project="$(NuGetPackageRoot)microsoft.symboluploader.build.task\$(SymbolUploaderVersion)\build\PublishSymbols.targets" />
<Target Name="PublishSymbols">
<ItemGroup>
<FilesToPublishToSymbolServer Include="$(PDBArtifactsDirectory)\*.pdb"/>
<PackagesToPublishToSymbolServer Include="$(BlobBasePath)\*.symbols.nupkg"/>
<!--
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.
-->
<PackagesToPublishToSymbolServer Remove="$(BlobBasePath)\Microsoft.DotNet.Darc.*" />
<PackagesToPublishToSymbolServer Remove="$(BlobBasePath)\Microsoft.DotNet.Maestro.Tasks.*" />
</ItemGroup>
<PropertyGroup>
<DotNetSymbolExpirationInDays Condition="'$(DotNetSymbolExpirationInDays)' == ''">3650</DotNetSymbolExpirationInDays>
<PublishToSymbolServer>true</PublishToSymbolServer>
<PublishToSymbolServer Condition="'@(FilesToPublishToSymbolServer)' == '' and '@(PackagesToPublishToSymbolServer)' == ''">false</PublishToSymbolServer>
</PropertyGroup>
<Message
Importance="High"
Text="No symbol package(s) were found to publish."
Condition="$(PublishToSymbolServer) == false" />
<!-- Symbol Uploader: MSDL -->
<Message Importance="High" Text="Publishing symbol packages to MSDL ..." Condition="$(PublishToSymbolServer)" />
<PublishSymbols PackagesToPublish="@(PackagesToPublishToSymbolServer)"
FilesToPublish="@(FilesToPublishToSymbolServer)"
PersonalAccessToken="$(DotNetSymbolServerTokenMsdl)"
SymbolServerPath="https://microsoftpublicsymbols.artifacts.visualstudio.com/DefaultCollection"
ExpirationInDays="$(DotNetSymbolExpirationInDays)"
VerboseLogging="true"
DryRun="false"
ConvertPortablePdbsToWindowsPdbs="false"
PdbConversionTreatAsWarning=""
Condition="$(PublishToSymbolServer)"/>
<!--
Symbol Uploader: SymWeb
Watson, VS insertion testings and the typical internal dev usage require SymWeb.
Currently we need to call the task twice (https://github.com/dotnet/core-eng/issues/3489).
-->
<Message Importance="High" Text="Publishing symbol packages to SymWeb ..." Condition="$(PublishToSymbolServer)" />
<PublishSymbols PackagesToPublish="@(PackagesToPublishToSymbolServer)"
FilesToPublish="@(FilesToPublishToSymbolServer)"
PersonalAccessToken="$(DotNetSymbolServerTokenSymWeb)"
SymbolServerPath="https://microsoft.artifacts.visualstudio.com/DefaultCollection"
ExpirationInDays="$(DotNetSymbolExpirationInDays)"
VerboseLogging="true"
DryRun="false"
ConvertPortablePdbsToWindowsPdbs="false"
PdbConversionTreatAsWarning=""
Condition="$(PublishToSymbolServer)"/>
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.SymbolUploader.Build.Task" Version="$(SymbolUploaderVersion)" />
</ItemGroup>
</Project>
+28
View File
@@ -0,0 +1,28 @@
# Don't touch this folder
uuuuuuuuuuuuuuuuuuuu
u" uuuuuuuuuuuuuuuuuu "u
u" u$$$$$$$$$$$$$$$$$$$$u "u
u" u$$$$$$$$$$$$$$$$$$$$$$$$u "u
u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u
u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u
u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $
$ $$$" ... "$... ...$" ... "$$$ ... "$$$ $
$ $$$u `"$$$$$$$ $$$ $$$$$ $$ $$$ $$$ $
$ $$$$$$uu "$$$$ $$$ $$$$$ $$ """ u$$$ $
$ $$$""$$$ $$$$ $$$u "$$$" u$$ $$$$$$$$ $
$ $$$$....,$$$$$..$$$$$....,$$$$..$$$$$$$$ $
$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $
"u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u"
"u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u"
"u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u"
"u "$$$$$$$$$$$$$$$$$$$$$$$$" u"
"u "$$$$$$$$$$$$$$$$$$$$" u"
"u """""""""""""""""" u"
""""""""""""""""""""
!!! Changes made in this directory are subject to being overwritten by automation !!!
The files in this directory are shared by all Arcade repos and managed by automation. If you need to make changes to these files, open an issue or submit a pull request to https://github.com/dotnet/arcade first.
+83
View File
@@ -0,0 +1,83 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<Project Sdk="Microsoft.NET.Sdk">
<!--
This MSBuild file is intended to be used as the body of the default
publishing release pipeline. The release pipeline will use this file
to invoke the the SignCheck tool to validate that packages about to
be published are correctly signed.
Parameters:
- PackageBasePath : Directory containing all files that need to be validated.
- SignCheckVersion : Version of SignCheck package to be used.
- SignValidationExclusionList : ItemGroup containing exclusion list to be forwarded to SignCheck.
- EnableJarSigningCheck : Whether .jar files should be validated.
- EnableStrongNameCheck : Whether strong name check should be performed.
-->
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<!--
From 'Signing.props' we import $(SignValidationExclusionList)
-->
<Import Project="$(MSBuildThisFileDirectory)Signing.props" Condition="Exists('$(MSBuildThisFileDirectory)Signing.props')" />
<Target Name="ValidateSigning">
<PropertyGroup>
<SignCheckToolPath>$(NuGetPackageRoot)Microsoft.DotNet.SignCheck\$(SignCheckVersion)\tools\Microsoft.DotNet.SignCheck.exe</SignCheckToolPath>
<SignCheckInputDir>$(PackageBasePath)</SignCheckInputDir>
<SignCheckLog>signcheck.log</SignCheckLog>
<SignCheckErrorLog>signcheck.errors.log</SignCheckErrorLog>
<SignCheckExclusionsFile>signcheck.exclusions.txt</SignCheckExclusionsFile>
</PropertyGroup>
<ItemGroup>
<!--
Documentation for these arguments is available here:
https://github.com/dotnet/arcade/tree/master/src/SignCheck
-->
<SignCheckArgs Include="--recursive" />
<SignCheckArgs Include="--traverse-subfolders" />
<SignCheckArgs Include="--file-status AllFiles" />
<SignCheckArgs Include="--log-file $(SignCheckLog)" />
<SignCheckArgs Include="--error-log-file $(SignCheckErrorLog)" />
<SignCheckArgs Include="--input-files $(SignCheckInputDir)" />
<SignCheckArgs Include="--exclusions-file $(SignCheckExclusionsFile)" Condition="'@(SignValidationExclusionList)' != ''" />
<SignCheckArgs Include="--verify-jar" Condition="'$(EnableJarSigningCheck)' == 'true'" />
<SignCheckArgs Include="--verify-strongname" Condition="'$(EnableStrongNameCheck)' == 'true'" />
</ItemGroup>
<WriteLinesToFile
File="$(SignCheckExclusionsFile)"
Lines="@(SignValidationExclusionList)"
Condition="'@(SignValidationExclusionList)' != ''"
Overwrite="true"
Encoding="Unicode"/>
<!--
IgnoreExitCode='true' because the tool doesn't return '0' on success.
-->
<Exec
Command="&quot;$(SignCheckToolPath)&quot; @(SignCheckArgs, ' ')"
IgnoreExitCode='true'
ConsoleToMsBuild="false"
StandardErrorImportance="high" />
<Error
Text="Signing validation failed. Check $(SignCheckErrorLog) for more information."
Condition="Exists($(SignCheckErrorLog)) and '$([System.IO.File]::ReadAllText($(SignCheckErrorLog)))' != ''" />
<Message
Text="##vso[artifact.upload containerfolder=LogFiles;artifactname=LogFiles]{SignCheckErrorLog}"
Condition="Exists($(SignCheckErrorLog)) and '$([System.IO.File]::ReadAllText($(SignCheckErrorLog)))' != ''" />
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.SignCheck" Version="$(SignCheckVersion)" />
</ItemGroup>
</Project>
+184
View File
@@ -0,0 +1,184 @@
param(
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where Symbols.NuGet packages to be checked are stored
[Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
[Parameter(Mandatory=$true)][string] $SourceLinkToolPath, # Full path to directory where dotnet SourceLink CLI was installed
[Parameter(Mandatory=$true)][string] $GHRepoName, # GitHub name of the repo including the Org. E.g., dotnet/arcade
[Parameter(Mandatory=$true)][string] $GHCommit # GitHub commit SHA used to build the packages
)
# 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>"
$global:LASTEXITCODE = 1
return
}
if (!($GHCommit -Match "^[0-9a-fA-F]{40}$")) {
Write-Host "GHCommit should be a 40 chars hexadecimal string"
$global:LASTEXITCODE = 1
return
}
$RepoTreeURL = -Join("https://api.github.com/repos/", $GHRepoName, "/git/trees/", $GHCommit, "?recursive=1")
$CodeExtensions = @(".cs", ".vb", ".fs", ".fsi", ".fsx", ".fsscript")
try {
# Retrieve the list of files in the repo at that particular commit point and store them in the RepoFiles hash
$Data = Invoke-WebRequest $RepoTreeURL | ConvertFrom-Json | Select-Object -ExpandProperty tree
foreach ($file in $Data) {
$Extension = [System.IO.Path]::GetExtension($file.path)
if ($CodeExtensions.Contains($Extension)) {
$RepoFiles[$file.path] = 1
}
}
}
catch {
Write-Host "Problems downloading the list of files from the repo. Url used: $RepoTreeURL"
$global:LASTEXITCODE = 1
return
}
if (Test-Path $ExtractPath) {
Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue
}
# Process each NuGet package in parallel
$Jobs = @()
Get-ChildItem "$InputPath\*.symbols.nupkg" |
ForEach-Object {
$Jobs += Start-Job -ScriptBlock $ValidatePackage -ArgumentList $_.FullName
}
foreach ($Job in $Jobs) {
Wait-Job -Id $Job.Id | Receive-Job
}
}
Measure-Command { ValidateSourceLinkLinks }
+141
View File
@@ -0,0 +1,141 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string][Alias('c')]$configuration = "Debug",
[string]$platform = $null,
[string] $projects,
[string][Alias('v')]$verbosity = "minimal",
[string] $msbuildEngine = $null,
[bool] $warnAsError = $true,
[bool] $nodeReuse = $true,
[switch][Alias('r')]$restore,
[switch] $deployDeps,
[switch][Alias('b')]$build,
[switch] $rebuild,
[switch] $deploy,
[switch][Alias('t')]$test,
[switch] $integrationTest,
[switch] $performanceTest,
[switch] $sign,
[switch] $pack,
[switch] $publish,
[switch][Alias('bl')]$binaryLog,
[switch] $ci,
[switch] $prepareMachine,
[switch] $help,
[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 "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 ""
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.)."
}
function InitializeCustomToolset {
if (-not $restore) {
return
}
$script = Join-Path $EngRoot "restore-toolset.ps1"
if (Test-Path $script) {
. $script
}
}
function Build {
$toolsetBuildProj = InitializeToolset
InitializeCustomToolset
$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.
# Explicitly set the type as string[] because otherwise PowerShell would make this char[] if $properties is empty.
[string[]] $msbuildArgs = $properties
$msbuildArgs += "/p:Projects=$projects"
$properties = $msbuildArgs
}
MSBuild $toolsetBuildProj `
$bl `
$platformArg `
/p:Configuration=$configuration `
/p:RepoRoot=$RepoRoot `
/p:Restore=$restore `
/p:DeployDeps=$deployDeps `
/p:Build=$build `
/p:Rebuild=$rebuild `
/p:Deploy=$deploy `
/p:Test=$test `
/p:Pack=$pack `
/p:IntegrationTest=$integrationTest `
/p:PerformanceTest=$performanceTest `
/p:Sign=$sign `
/p:Publish=$publish `
@properties
}
try {
if ($help -or (($null -ne $properties) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) {
Print-Usage
exit 0
}
if ($ci) {
$binaryLog = $true
$nodeReuse = $false
}
# Import custom tools configuration, if present in the repo.
# Note: Import in global scope so that the script set top-level variables without qualification.
$configureToolsetScript = Join-Path $EngRoot "configure-toolset.ps1"
if (Test-Path $configureToolsetScript) {
. $configureToolsetScript
}
if (($restore) -and ($null -eq $env:DisableNativeToolsetInstalls)) {
InitializeNativeTools
}
Build
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTaskError -Message $_
ExitWithExitCode 1
}
ExitWithExitCode 0
+216
View File
@@ -0,0 +1,216 @@
#!/usr/bin/env bash
# Stop script if unbound variable found (use ${var:-} if intentional)
set -u
# Stop script if command returns non-zero exit code.
# Prevents hidden errors caused by missing error code propagation.
set -e
usage()
{
echo "Common settings:"
echo " --configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
echo " --verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
echo " --binaryLog Create MSBuild binary log (short: -bl)"
echo " --help Print help and exit (short: -h)"
echo ""
echo "Actions:"
echo " --restore Restore dependencies (short: -r)"
echo " --build Build solution (short: -b)"
echo " --rebuild Rebuild solution"
echo " --test Run all unit tests in the solution (short: -t)"
echo " --integrationTest Run all integration tests in the solution"
echo " --performanceTest Run all performance tests in the solution"
echo " --pack Package build outputs into NuGet packages and Willow components"
echo " --sign Sign build outputs"
echo " --publish Publish artifacts (e.g. symbols)"
echo ""
echo "Advanced settings:"
echo " --projects <value> Project or solution file(s) to build"
echo " --ci Set when running on CI server"
echo " --prepareMachine Prepare machine for CI run, clean up processes after build"
echo " --nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')"
echo " --warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
echo ""
echo "Command line arguments not listed above are passed thru to msbuild."
echo "Arguments can also be passed in with a single hyphen."
}
source="${BASH_SOURCE[0]}"
# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
restore=false
build=false
rebuild=false
test=false
integration_test=false
performance_test=false
pack=false
publish=false
sign=false
public=false
ci=false
warn_as_error=true
node_reuse=true
binary_log=false
pipelines_log=false
projects=''
configuration='Debug'
prepare_machine=false
verbosity='minimal'
properties=''
while [[ $# > 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-help|-h)
usage
exit 0
;;
-configuration|-c)
configuration=$2
shift
;;
-verbosity|-v)
verbosity=$2
shift
;;
-binarylog|-bl)
binary_log=true
;;
-pipelineslog|-pl)
pipelines_log=true
;;
-restore|-r)
restore=true
;;
-build|-b)
build=true
;;
-rebuild)
rebuild=true
;;
-pack)
pack=true
;;
-test|-t)
test=true
;;
-integrationtest)
integration_test=true
;;
-performancetest)
performance_test=true
;;
-sign)
sign=true
;;
-publish)
publish=true
;;
-preparemachine)
prepare_machine=true
;;
-projects)
projects=$2
shift
;;
-ci)
ci=true
;;
-warnaserror)
warn_as_error=$2
shift
;;
-nodereuse)
node_reuse=$2
shift
;;
*)
properties="$properties $1"
;;
esac
shift
done
if [[ "$ci" == true ]]; then
pipelines_log=true
binary_log=true
node_reuse=false
fi
. "$scriptroot/tools.sh"
function InitializeCustomToolset {
local script="$eng_root/restore-toolset.sh"
if [[ -a "$script" ]]; then
. "$script"
fi
}
function Build {
InitializeToolset
InitializeCustomToolset
if [[ ! -z "$projects" ]]; then
properties="$properties /p:Projects=$projects"
fi
local bl=""
if [[ "$binary_log" == true ]]; then
bl="/bl:\"$log_dir/Build.binlog\""
fi
MSBuild $_InitializeToolset \
$bl \
/p:Configuration=$configuration \
/p:RepoRoot="$repo_root" \
/p:Restore=$restore \
/p:Build=$build \
/p:Rebuild=$rebuild \
/p:Test=$test \
/p:Pack=$pack \
/p:IntegrationTest=$integration_test \
/p:PerformanceTest=$performance_test \
/p:Sign=$sign \
/p:Publish=$publish \
$properties
ExitWithExitCode 0
}
# Import custom tools configuration, if present in the repo.
configure_toolset_script="$eng_root/configure-toolset.sh"
if [[ -a "$configure_toolset_script" ]]; then
. "$configure_toolset_script"
fi
# TODO: https://github.com/dotnet/arcade/issues/1468
# Temporary workaround to avoid breaking change.
# Remove once repos are updated.
if [[ -n "${useInstalledDotNetCli:-}" ]]; then
use_installed_dotnet_cli="$useInstalledDotNetCli"
fi
if [[ "$restore" == true && -z ${DisableNativeToolsetInstalls:-} ]]; then
InitializeNativeTools
fi
Build
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
# resolve $SOURCE until the file is no longer a symlink
while [[ -h $source ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where
# the symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. "$scriptroot/build.sh" --restore --build --test --pack --publish --ci $@
@@ -0,0 +1,41 @@
set(CROSS_NDK_TOOLCHAIN $ENV{ROOTFS_DIR}/../)
set(CROSS_ROOTFS ${CROSS_NDK_TOOLCHAIN}/sysroot)
set(CLR_CMAKE_PLATFORM_ANDROID "Android")
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR arm)
## Specify the toolchain
set(TOOLCHAIN "arm-linux-androideabi")
set(CMAKE_PREFIX_PATH ${CROSS_NDK_TOOLCHAIN})
set(TOOLCHAIN_PREFIX ${TOOLCHAIN}-)
find_program(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}clang)
find_program(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}clang++)
find_program(CMAKE_ASM_COMPILER ${TOOLCHAIN_PREFIX}clang)
find_program(CMAKE_AR ${TOOLCHAIN_PREFIX}ar)
find_program(CMAKE_LD ${TOOLCHAIN_PREFIX}ar)
find_program(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
find_program(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump)
add_compile_options(--sysroot=${CROSS_ROOTFS})
add_compile_options(-fPIE)
add_compile_options(-mfloat-abi=soft)
include_directories(SYSTEM ${CROSS_NDK_TOOLCHAIN}/include/c++/4.9.x/)
include_directories(SYSTEM ${CROSS_NDK_TOOLCHAIN}/include/c++/4.9.x/arm-linux-androideabi/)
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B ${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -fPIE -pie")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
@@ -0,0 +1,42 @@
set(CROSS_NDK_TOOLCHAIN $ENV{ROOTFS_DIR}/../)
set(CROSS_ROOTFS ${CROSS_NDK_TOOLCHAIN}/sysroot)
set(CLR_CMAKE_PLATFORM_ANDROID "Android")
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
## Specify the toolchain
set(TOOLCHAIN "aarch64-linux-android")
set(CMAKE_PREFIX_PATH ${CROSS_NDK_TOOLCHAIN})
set(TOOLCHAIN_PREFIX ${TOOLCHAIN}-)
find_program(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}clang)
find_program(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}clang++)
find_program(CMAKE_ASM_COMPILER ${TOOLCHAIN_PREFIX}clang)
find_program(CMAKE_AR ${TOOLCHAIN_PREFIX}ar)
find_program(CMAKE_LD ${TOOLCHAIN_PREFIX}ar)
find_program(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
find_program(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump)
add_compile_options(--sysroot=${CROSS_ROOTFS})
add_compile_options(-fPIE)
## Needed for Android or bionic specific conditionals
add_compile_options(-D__ANDROID__)
add_compile_options(-D__BIONIC__)
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B ${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -fPIE -pie")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
+11
View File
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
+3
View File
@@ -0,0 +1,3 @@
# Debian (sid) # UNSTABLE
deb http://ftp.debian.org/debian/ sid main contrib non-free
deb-src http://ftp.debian.org/debian/ sid main contrib non-free
+11
View File
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse
+11
View File
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
+11
View File
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
@@ -0,0 +1,71 @@
From e72c9d7ead60e3317bd6d1fade995c07021c947b Mon Sep 17 00:00:00 2001
From: Mathieu Desnoyers <[email protected]>
Date: Thu, 7 May 2015 13:25:04 -0400
Subject: [PATCH] Fix: building probe providers with C++ compiler
Robert Daniels wrote:
> > I'm attempting to use lttng userspace tracing with a C++ application
> > on an ARM platform. I'm using GCC 4.8.4 on Linux 3.14 with the 2.6
> > release of lttng. I've compiled lttng-modules, lttng-ust, and
> > lttng-tools and have been able to get a simple test working with C
> > code. When I attempt to run the hello.cxx test on my target it will
> > segfault.
>
>
> I spent a little time digging into this issue and finally discovered the
> cause of my segfault with ARM C++ tracepoints.
>
> There is a struct called 'lttng_event' in ust-events.h which contains an
> empty union 'u'. This was the cause of my issue. Under C, this empty union
> compiles to a zero byte member while under C++ it compiles to a one byte
> member, and in my case was four-byte aligned which caused my C++ code to
> have the 'cds_list_head node' offset incorrectly by four bytes. This lead
> to an incorrect linked list structure which caused my issue.
>
> Since this union is empty, I simply removed it from the struct and everything
> worked correctly.
>
> I don't know the history or purpose behind this empty union so I'd like to
> know if this is a safe fix. If it is I can submit a patch with the union
> removed.
That's a very nice catch!
We do not support building tracepoint probe provider with
g++ yet, as stated in lttng-ust(3):
"- Note for C++ support: although an application instrumented with
tracepoints can be compiled with g++, tracepoint probes should be
compiled with gcc (only tested with gcc so far)."
However, if it works fine with this fix, then I'm tempted to take it,
especially because removing the empty union does not appear to affect
the layout of struct lttng_event as seen from liblttng-ust, which must
be compiled with a C compiler, and from probe providers compiled with
a C compiler. So all we are changing is the layout of a probe provider
compiled with a C++ compiler, which is anyway buggy at the moment,
because it is not compatible with the layout expected by liblttng-ust
compiled with a C compiler.
Reported-by: Robert Daniels <[email protected]>
Signed-off-by: Mathieu Desnoyers <[email protected]>
---
include/lttng/ust-events.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/usr/include/lttng/ust-events.h b/usr/include/lttng/ust-events.h
index 328a875..3d7a274 100644
--- a/usr/include/lttng/ust-events.h
+++ b/usr/include/lttng/ust-events.h
@@ -407,8 +407,6 @@ struct lttng_event {
void *_deprecated1;
struct lttng_ctx *ctx;
enum lttng_ust_instrumentation instrumentation;
- union {
- } u;
struct cds_list_head node; /* Event list in session */
struct cds_list_head _deprecated2;
void *_deprecated3;
--
2.7.4
+97
View File
@@ -0,0 +1,97 @@
diff -u -r a/usr/include/urcu/uatomic/generic.h b/usr/include/urcu/uatomic/generic.h
--- a/usr/include/urcu/uatomic/generic.h 2014-03-28 06:04:42.000000000 +0900
+++ b/usr/include/urcu/uatomic/generic.h 2017-02-13 10:35:21.189927116 +0900
@@ -65,17 +65,17 @@
switch (len) {
#ifdef UATOMIC_HAS_ATOMIC_BYTE
case 1:
- return __sync_val_compare_and_swap_1(addr, old, _new);
+ return __sync_val_compare_and_swap_1((uint8_t *) addr, old, _new);
#endif
#ifdef UATOMIC_HAS_ATOMIC_SHORT
case 2:
- return __sync_val_compare_and_swap_2(addr, old, _new);
+ return __sync_val_compare_and_swap_2((uint16_t *) addr, old, _new);
#endif
case 4:
- return __sync_val_compare_and_swap_4(addr, old, _new);
+ return __sync_val_compare_and_swap_4((uint32_t *) addr, old, _new);
#if (CAA_BITS_PER_LONG == 64)
case 8:
- return __sync_val_compare_and_swap_8(addr, old, _new);
+ return __sync_val_compare_and_swap_8((uint64_t *) addr, old, _new);
#endif
}
_uatomic_link_error();
@@ -100,20 +100,20 @@
switch (len) {
#ifdef UATOMIC_HAS_ATOMIC_BYTE
case 1:
- __sync_and_and_fetch_1(addr, val);
+ __sync_and_and_fetch_1((uint8_t *) addr, val);
return;
#endif
#ifdef UATOMIC_HAS_ATOMIC_SHORT
case 2:
- __sync_and_and_fetch_2(addr, val);
+ __sync_and_and_fetch_2((uint16_t *) addr, val);
return;
#endif
case 4:
- __sync_and_and_fetch_4(addr, val);
+ __sync_and_and_fetch_4((uint32_t *) addr, val);
return;
#if (CAA_BITS_PER_LONG == 64)
case 8:
- __sync_and_and_fetch_8(addr, val);
+ __sync_and_and_fetch_8((uint64_t *) addr, val);
return;
#endif
}
@@ -139,20 +139,20 @@
switch (len) {
#ifdef UATOMIC_HAS_ATOMIC_BYTE
case 1:
- __sync_or_and_fetch_1(addr, val);
+ __sync_or_and_fetch_1((uint8_t *) addr, val);
return;
#endif
#ifdef UATOMIC_HAS_ATOMIC_SHORT
case 2:
- __sync_or_and_fetch_2(addr, val);
+ __sync_or_and_fetch_2((uint16_t *) addr, val);
return;
#endif
case 4:
- __sync_or_and_fetch_4(addr, val);
+ __sync_or_and_fetch_4((uint32_t *) addr, val);
return;
#if (CAA_BITS_PER_LONG == 64)
case 8:
- __sync_or_and_fetch_8(addr, val);
+ __sync_or_and_fetch_8((uint64_t *) addr, val);
return;
#endif
}
@@ -180,17 +180,17 @@
switch (len) {
#ifdef UATOMIC_HAS_ATOMIC_BYTE
case 1:
- return __sync_add_and_fetch_1(addr, val);
+ return __sync_add_and_fetch_1((uint8_t *) addr, val);
#endif
#ifdef UATOMIC_HAS_ATOMIC_SHORT
case 2:
- return __sync_add_and_fetch_2(addr, val);
+ return __sync_add_and_fetch_2((uint16_t *) addr, val);
#endif
case 4:
- return __sync_add_and_fetch_4(addr, val);
+ return __sync_add_and_fetch_4((uint32_t *) addr, val);
#if (CAA_BITS_PER_LONG == 64)
case 8:
- return __sync_add_and_fetch_8(addr, val);
+ return __sync_add_and_fetch_8((uint64_t *) addr, val);
#endif
}
_uatomic_link_error();
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
@@ -0,0 +1,11 @@
deb http://deb.debian.org/debian buster main
deb-src http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian-security/ buster/updates main
deb-src http://deb.debian.org/debian-security/ buster/updates main
deb http://deb.debian.org/debian buster-updates main
deb-src http://deb.debian.org/debian buster-updates main
deb http://deb.debian.org/debian buster-backports main contrib non-free
deb-src http://deb.debian.org/debian buster-backports main contrib non-free
@@ -0,0 +1,12 @@
deb http://deb.debian.org/debian stretch main
deb-src http://deb.debian.org/debian stretch main
deb http://deb.debian.org/debian-security/ stretch/updates main
deb-src http://deb.debian.org/debian-security/ stretch/updates main
deb http://deb.debian.org/debian stretch-updates main
deb-src http://deb.debian.org/debian stretch-updates main
deb http://deb.debian.org/debian stretch-backports main contrib non-free
deb-src http://deb.debian.org/debian stretch-backports main contrib non-free
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
+11
View File
@@ -0,0 +1,11 @@
deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
@@ -0,0 +1,3 @@
# Debian (jessie) # Stable
deb http://ftp.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.debian.org/debian/ jessie main contrib non-free
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -e
__ARM_SOFTFP_CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
__TIZEN_CROSSDIR="$__ARM_SOFTFP_CrossDir/tizen"
if [[ -z "$ROOTFS_DIR" ]]; then
echo "ROOTFS_DIR is not defined."
exit 1;
fi
# Clean-up (TODO-Cleanup: We may already delete $ROOTFS_DIR at ./cross/build-rootfs.sh.)
# hk0110
if [ -d "$ROOTFS_DIR" ]; then
umount $ROOTFS_DIR/*
rm -rf $ROOTFS_DIR
fi
TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp
mkdir -p $TIZEN_TMP_DIR
# Download files
echo ">>Start downloading files"
VERBOSE=1 $__ARM_SOFTFP_CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR
echo "<<Finish downloading files"
echo ">>Start constructing Tizen rootfs"
TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm`
cd $ROOTFS_DIR
for f in $TIZEN_RPM_FILES; do
rpm2cpio $f | cpio -idm --quiet
done
echo "<<Finish constructing Tizen rootfs"
# Cleanup tmp
rm -rf $TIZEN_TMP_DIR
# Configure Tizen rootfs
echo ">>Start configuring Tizen rootfs"
rm ./usr/lib/libunwind.so
ln -s libunwind.so.8 ./usr/lib/libunwind.so
ln -sfn asm-arm ./usr/include/asm
patch -p1 < $__TIZEN_CROSSDIR/tizen.patch
echo "<<Finish configuring Tizen rootfs"
+171
View File
@@ -0,0 +1,171 @@
#!/usr/bin/env bash
set -e
if [[ -z "${VERBOSE// }" ]] || [ "$VERBOSE" -ne "$VERBOSE" ] 2>/dev/null; then
VERBOSE=0
fi
Log()
{
if [ $VERBOSE -ge $1 ]; then
echo ${@:2}
fi
}
Inform()
{
Log 1 -e "\x1B[0;34m$@\x1B[m"
}
Debug()
{
Log 2 -e "\x1B[0;32m$@\x1B[m"
}
Error()
{
>&2 Log 0 -e "\x1B[0;31m$@\x1B[m"
}
Fetch()
{
URL=$1
FILE=$2
PROGRESS=$3
if [ $VERBOSE -ge 1 ] && [ $PROGRESS ]; then
CURL_OPT="--progress-bar"
else
CURL_OPT="--silent"
fi
curl $CURL_OPT $URL > $FILE
}
hash curl 2> /dev/null || { Error "Require 'curl' Aborting."; exit 1; }
hash xmllint 2> /dev/null || { Error "Require 'xmllint' Aborting."; exit 1; }
hash sha256sum 2> /dev/null || { Error "Require 'sha256sum' Aborting."; exit 1; }
TMPDIR=$1
if [ ! -d $TMPDIR ]; then
TMPDIR=./tizen_tmp
Debug "Create temporary directory : $TMPDIR"
mkdir -p $TMPDIR
fi
TIZEN_URL=http://download.tizen.org/releases/milestone/tizen
BUILD_XML=build.xml
REPOMD_XML=repomd.xml
PRIMARY_XML=primary.xml
TARGET_URL="http://__not_initialized"
Xpath_get()
{
XPATH_RESULT=''
XPATH=$1
XML_FILE=$2
RESULT=$(xmllint --xpath $XPATH $XML_FILE)
if [[ -z ${RESULT// } ]]; then
Error "Can not find target from $XML_FILE"
Debug "Xpath = $XPATH"
exit 1
fi
XPATH_RESULT=$RESULT
}
fetch_tizen_pkgs_init()
{
TARGET=$1
PROFILE=$2
Debug "Initialize TARGET=$TARGET, PROFILE=$PROFILE"
TMP_PKG_DIR=$TMPDIR/tizen_${PROFILE}_pkgs
if [ -d $TMP_PKG_DIR ]; then rm -rf $TMP_PKG_DIR; fi
mkdir -p $TMP_PKG_DIR
PKG_URL=$TIZEN_URL/$PROFILE/latest
BUILD_XML_URL=$PKG_URL/$BUILD_XML
TMP_BUILD=$TMP_PKG_DIR/$BUILD_XML
TMP_REPOMD=$TMP_PKG_DIR/$REPOMD_XML
TMP_PRIMARY=$TMP_PKG_DIR/$PRIMARY_XML
TMP_PRIMARYGZ=${TMP_PRIMARY}.gz
Fetch $BUILD_XML_URL $TMP_BUILD
Debug "fetch $BUILD_XML_URL to $TMP_BUILD"
TARGET_XPATH="//build/buildtargets/buildtarget[@name=\"$TARGET\"]/repo[@type=\"binary\"]/text()"
Xpath_get $TARGET_XPATH $TMP_BUILD
TARGET_PATH=$XPATH_RESULT
TARGET_URL=$PKG_URL/$TARGET_PATH
REPOMD_URL=$TARGET_URL/repodata/repomd.xml
PRIMARY_XPATH='string(//*[local-name()="data"][@type="primary"]/*[local-name()="location"]/@href)'
Fetch $REPOMD_URL $TMP_REPOMD
Debug "fetch $REPOMD_URL to $TMP_REPOMD"
Xpath_get $PRIMARY_XPATH $TMP_REPOMD
PRIMARY_XML_PATH=$XPATH_RESULT
PRIMARY_URL=$TARGET_URL/$PRIMARY_XML_PATH
Fetch $PRIMARY_URL $TMP_PRIMARYGZ
Debug "fetch $PRIMARY_URL to $TMP_PRIMARYGZ"
gunzip $TMP_PRIMARYGZ
Debug "unzip $TMP_PRIMARYGZ to $TMP_PRIMARY"
}
fetch_tizen_pkgs()
{
ARCH=$1
PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="location"]/@href)'
PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="checksum"]/text())'
for pkg in ${@:2}
do
Inform "Fetching... $pkg"
XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg}
XPATH=${XPATH/_ARCH_/$ARCH}
Xpath_get $XPATH $TMP_PRIMARY
PKG_PATH=$XPATH_RESULT
XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg}
XPATH=${XPATH/_ARCH_/$ARCH}
Xpath_get $XPATH $TMP_PRIMARY
CHECKSUM=$XPATH_RESULT
PKG_URL=$TARGET_URL/$PKG_PATH
PKG_FILE=$(basename $PKG_PATH)
PKG_PATH=$TMPDIR/$PKG_FILE
Debug "Download $PKG_URL to $PKG_PATH"
Fetch $PKG_URL $PKG_PATH true
echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null
if [ $? -ne 0 ]; then
Error "Fail to fetch $PKG_URL to $PKG_PATH"
Debug "Checksum = $CHECKSUM"
exit 1
fi
done
}
Inform "Initialize arm base"
fetch_tizen_pkgs_init standard base
Inform "fetch common packages"
fetch_tizen_pkgs armv7l gcc glibc glibc-devel libicu libicu-devel
fetch_tizen_pkgs noarch linux-glibc-devel
Inform "fetch coreclr packages"
fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel tizen-release lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
Inform "fetch corefx packages"
fetch_tizen_pkgs armv7l libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel krb5 krb5-devel libcurl libcurl-devel
Inform "Initialize standard unified"
fetch_tizen_pkgs_init standard unified
Inform "fetch corefx packages"
fetch_tizen_pkgs armv7l gssdp gssdp-devel
@@ -0,0 +1,50 @@
lang en_US.UTF-8
keyboard us
timezone --utc Asia/Seoul
part / --fstype="ext4" --size=3500 --ondisk=mmcblk0 --label rootfs --fsoptions=defaults,noatime
rootpw tizen
desktop --autologinuser=root
user --name root --groups audio,video --password 'tizen'
repo --name=standard --baseurl=http://download.tizen.org/releases/milestone/tizen/unified/latest/repos/standard/packages/ --ssl_verify=no
repo --name=base --baseurl=http://download.tizen.org/releases/milestone/tizen/base/latest/repos/standard/packages/ --ssl_verify=no
%packages
tar
gzip
sed
grep
gawk
perl
binutils
findutils
util-linux
lttng-ust
userspace-rcu
procps-ng
tzdata
ca-certificates
### Core FX
libicu
libunwind
iputils
zlib
krb5
libcurl
libopenssl
%end
%post
### Update /tmp privilege
chmod 777 /tmp
####################################
%end
+18
View File
@@ -0,0 +1,18 @@
diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so
--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900
+++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900
@@ -2,4 +2,4 @@
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.3 ) )
+GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.3 ) )
diff -u -r a/usr/lib/libpthread.so b/usr/lib/libpthread.so
--- a/usr/lib/libpthread.so 2016-12-30 23:00:19.408951841 +0900
+++ b/usr/lib/libpthread.so 2016-12-30 23:00:39.068951801 +0900
@@ -2,4 +2,4 @@
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
-GROUP ( /lib/libpthread.so.0 /usr/lib/libpthread_nonshared.a )
+GROUP ( libpthread.so.0 libpthread_nonshared.a )
+137
View File
@@ -0,0 +1,137 @@
#!/usr/bin/env bash
set -e
__NDK_Version=r14
usage()
{
echo "Creates a toolchain and sysroot used for cross-compiling for Android."
echo.
echo "Usage: $0 [BuildArch] [ApiLevel]"
echo.
echo "BuildArch is the target architecture of Android. Currently only arm64 is supported."
echo "ApiLevel is the target Android API level. API levels usually match to Android releases. See https://source.android.com/source/build-numbers.html"
echo.
echo "By default, the toolchain and sysroot will be generated in cross/android-rootfs/toolchain/[BuildArch]. You can change this behavior"
echo "by setting the TOOLCHAIN_DIR environment variable"
echo.
echo "By default, the NDK will be downloaded into the cross/android-rootfs/android-ndk-$__NDK_Version directory. If you already have an NDK installation,"
echo "you can set the NDK_DIR environment variable to have this script use that installation of the NDK."
echo "By default, this script will generate a file, android_platform, in the root of the ROOTFS_DIR directory that contains the RID for the supported and tested Android build: android.21-arm64. This file is to replace '/etc/os-release', which is not available for Android."
exit 1
}
__ApiLevel=21 # The minimum platform for arm64 is API level 21
__BuildArch=arm64
__AndroidArch=aarch64
__AndroidToolchain=aarch64-linux-android
for i in "$@"
do
lowerI="$(echo $i | awk '{print tolower($0)}')"
case $lowerI in
-?|-h|--help)
usage
exit 1
;;
arm64)
__BuildArch=arm64
__AndroidArch=aarch64
__AndroidToolchain=aarch64-linux-android
;;
arm)
__BuildArch=arm
__AndroidArch=arm
__AndroidToolchain=arm-linux-androideabi
;;
*[0-9])
__ApiLevel=$i
;;
*)
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $i"
;;
esac
done
# Obtain the location of the bash script to figure out where the root of the repo is.
__CrossDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
__Android_Cross_Dir="$__CrossDir/android-rootfs"
__NDK_Dir="$__Android_Cross_Dir/android-ndk-$__NDK_Version"
__libunwind_Dir="$__Android_Cross_Dir/libunwind"
__lldb_Dir="$__Android_Cross_Dir/lldb"
__ToolchainDir="$__Android_Cross_Dir/toolchain/$__BuildArch"
if [[ -n "$TOOLCHAIN_DIR" ]]; then
__ToolchainDir=$TOOLCHAIN_DIR
fi
if [[ -n "$NDK_DIR" ]]; then
__NDK_Dir=$NDK_DIR
fi
echo "Target API level: $__ApiLevel"
echo "Target architecture: $__BuildArch"
echo "NDK location: $__NDK_Dir"
echo "Target Toolchain location: $__ToolchainDir"
# Download the NDK if required
if [ ! -d $__NDK_Dir ]; then
echo Downloading the NDK into $__NDK_Dir
mkdir -p $__NDK_Dir
wget -nv -nc --show-progress https://dl.google.com/android/repository/android-ndk-$__NDK_Version-linux-x86_64.zip -O $__Android_Cross_Dir/android-ndk-$__NDK_Version-linux-x86_64.zip
unzip -q $__Android_Cross_Dir/android-ndk-$__NDK_Version-linux-x86_64.zip -d $__Android_Cross_Dir
fi
if [ ! -d $__lldb_Dir ]; then
mkdir -p $__lldb_Dir
echo Downloading LLDB into $__lldb_Dir
wget -nv -nc --show-progress https://dl.google.com/android/repository/lldb-2.3.3614996-linux-x86_64.zip -O $__Android_Cross_Dir/lldb-2.3.3614996-linux-x86_64.zip
unzip -q $__Android_Cross_Dir/lldb-2.3.3614996-linux-x86_64.zip -d $__lldb_Dir
fi
# Create the RootFS for both arm64 as well as aarch
rm -rf $__Android_Cross_Dir/toolchain
echo Generating the $__BuildArch toolchain
$__NDK_Dir/build/tools/make_standalone_toolchain.py --arch $__BuildArch --api $__ApiLevel --install-dir $__ToolchainDir
# Install the required packages into the toolchain
# TODO: Add logic to get latest pkg version instead of specific version number
rm -rf $__Android_Cross_Dir/deb/
rm -rf $__Android_Cross_Dir/tmp
mkdir -p $__Android_Cross_Dir/deb/
mkdir -p $__Android_Cross_Dir/tmp/$arch/
wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libicu_60.2_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libicu_60.2_$__AndroidArch.deb
wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libicu-dev_60.2_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libicu-dev_60.2_$__AndroidArch.deb
wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libandroid-glob-dev_0.4_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libandroid-glob-dev_0.4_$__AndroidArch.deb
wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libandroid-glob_0.4_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libandroid-glob_0.4_$__AndroidArch.deb
wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libandroid-support-dev_22_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libandroid-support-dev_22_$__AndroidArch.deb
wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libandroid-support_22_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libandroid-support_22_$__AndroidArch.deb
wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/liblzma-dev_5.2.3_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/liblzma-dev_5.2.3_$__AndroidArch.deb
wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/liblzma_5.2.3_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/liblzma_5.2.3_$__AndroidArch.deb
wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libunwind-dev_1.2.20170304_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libunwind-dev_1.2.20170304_$__AndroidArch.deb
wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libunwind_1.2.20170304_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libunwind_1.2.20170304_$__AndroidArch.deb
echo Unpacking Termux packages
dpkg -x $__Android_Cross_Dir/deb/libicu_60.2_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/
dpkg -x $__Android_Cross_Dir/deb/libicu-dev_60.2_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/
dpkg -x $__Android_Cross_Dir/deb/libandroid-glob-dev_0.4_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/
dpkg -x $__Android_Cross_Dir/deb/libandroid-glob_0.4_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/
dpkg -x $__Android_Cross_Dir/deb/libandroid-support-dev_22_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/
dpkg -x $__Android_Cross_Dir/deb/libandroid-support_22_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/
dpkg -x $__Android_Cross_Dir/deb/liblzma-dev_5.2.3_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/
dpkg -x $__Android_Cross_Dir/deb/liblzma_5.2.3_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/
dpkg -x $__Android_Cross_Dir/deb/libunwind-dev_1.2.20170304_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/
dpkg -x $__Android_Cross_Dir/deb/libunwind_1.2.20170304_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/
cp -R $__Android_Cross_Dir/tmp/$__AndroidArch/data/data/com.termux/files/usr/* $__ToolchainDir/sysroot/usr/
# Generate platform file for build.sh script to assign to __DistroRid
echo "Generating platform file..."
echo "RID=android.21-arm64" > $__ToolchainDir/sysroot/android_platform
echo Now run:
echo CONFIG_DIR=\`realpath cross/android/$__BuildArch\` ROOTFS_DIR=\`realpath $__ToolchainDir/sysroot\` ./build.sh cross $__BuildArch skipgenerateversion skipnuget cmakeargs -DENABLE_LLDBPLUGIN=0
+233
View File
@@ -0,0 +1,233 @@
#!/usr/bin/env bash
usage()
{
echo "Usage: $0 [BuildArch] [LinuxCodeName] [lldbx.y] [--skipunmount] --rootfsdir <directory>]"
echo "BuildArch can be: arm(default), armel, arm64, x86"
echo "LinuxCodeName - optional, Code name for Linux, can be: trusty, xenial(default), zesty, bionic, alpine. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen."
echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine"
echo "--skipunmount - optional, will skip the unmount of rootfs folder."
exit 1
}
__LinuxCodeName=xenial
__CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
__InitialDir=$PWD
__BuildArch=arm
__UbuntuArch=armhf
__UbuntuRepo="http://ports.ubuntu.com/"
__LLDB_Package="liblldb-3.9-dev"
__SkipUnmount=0
# base development support
__UbuntuPackages="build-essential"
__AlpinePackages="alpine-base"
__AlpinePackages+=" build-base"
__AlpinePackages+=" linux-headers"
__AlpinePackages+=" lldb-dev"
__AlpinePackages+=" llvm-dev"
# symlinks fixer
__UbuntuPackages+=" symlinks"
# CoreCLR and CoreFX dependencies
__UbuntuPackages+=" libicu-dev"
__UbuntuPackages+=" liblttng-ust-dev"
__UbuntuPackages+=" libunwind8-dev"
__AlpinePackages+=" gettext-dev"
__AlpinePackages+=" icu-dev"
__AlpinePackages+=" libunwind-dev"
__AlpinePackages+=" lttng-ust-dev"
# CoreFX dependencies
__UbuntuPackages+=" libcurl4-openssl-dev"
__UbuntuPackages+=" libkrb5-dev"
__UbuntuPackages+=" libssl-dev"
__UbuntuPackages+=" zlib1g-dev"
__AlpinePackages+=" curl-dev"
__AlpinePackages+=" krb5-dev"
__AlpinePackages+=" openssl-dev"
__AlpinePackages+=" zlib-dev"
__UnprocessedBuildArgs=
while :; do
if [ $# -le 0 ]; then
break
fi
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
-?|-h|--help)
usage
exit 1
;;
arm)
__BuildArch=arm
__UbuntuArch=armhf
__AlpineArch=armhf
__QEMUArch=arm
;;
arm64)
__BuildArch=arm64
__UbuntuArch=arm64
__AlpineArch=aarch64
__QEMUArch=aarch64
;;
armel)
__BuildArch=armel
__UbuntuArch=armel
__UbuntuRepo="http://ftp.debian.org/debian/"
__LinuxCodeName=jessie
;;
x86)
__BuildArch=x86
__UbuntuArch=i386
__UbuntuRepo="http://archive.ubuntu.com/ubuntu/"
;;
lldb3.6)
__LLDB_Package="lldb-3.6-dev"
;;
lldb3.8)
__LLDB_Package="lldb-3.8-dev"
;;
lldb3.9)
__LLDB_Package="liblldb-3.9-dev"
;;
lldb4.0)
__LLDB_Package="liblldb-4.0-dev"
;;
lldb5.0)
__LLDB_Package="liblldb-5.0-dev"
;;
lldb6.0)
__LLDB_Package="liblldb-6.0-dev"
;;
no-lldb)
unset __LLDB_Package
;;
trusty) # Ubuntu 14.04
if [ "$__LinuxCodeName" != "jessie" ]; then
__LinuxCodeName=trusty
fi
;;
xenial) # Ubuntu 16.04
if [ "$__LinuxCodeName" != "jessie" ]; then
__LinuxCodeName=xenial
fi
;;
zesty) # Ubuntu 17.04
if [ "$__LinuxCodeName" != "jessie" ]; then
__LinuxCodeName=zesty
fi
;;
bionic) # Ubuntu 18.04
if [ "$__LinuxCodeName" != "jessie" ]; then
__LinuxCodeName=bionic
fi
;;
jessie) # Debian 8
__LinuxCodeName=jessie
__UbuntuRepo="http://ftp.debian.org/debian/"
;;
stretch) # Debian 9
__LinuxCodeName=stretch
__UbuntuRepo="http://ftp.debian.org/debian/"
__LLDB_Package="liblldb-6.0-dev"
;;
buster) # Debian 10
__LinuxCodeName=buster
__UbuntuRepo="http://ftp.debian.org/debian/"
__LLDB_Package="liblldb-6.0-dev"
;;
tizen)
if [ "$__BuildArch" != "armel" ]; then
echo "Tizen is available only for armel."
usage;
exit 1;
fi
__LinuxCodeName=
__UbuntuRepo=
__Tizen=tizen
;;
alpine)
__LinuxCodeName=alpine
__UbuntuRepo=
;;
--skipunmount)
__SkipUnmount=1
;;
--rootfsdir|-rootfsdir)
shift
__RootfsDir=$1
;;
*)
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $1"
;;
esac
shift
done
if [ "$__BuildArch" == "armel" ]; then
__LLDB_Package="lldb-3.5-dev"
fi
__UbuntuPackages+=" ${__LLDB_Package:-}"
if [ -z "$__RootfsDir" ] && [ ! -z "$ROOTFS_DIR" ]; then
__RootfsDir=$ROOTFS_DIR
fi
if [ -z "$__RootfsDir" ]; then
__RootfsDir="$__CrossDir/rootfs/$__BuildArch"
fi
if [ -d "$__RootfsDir" ]; then
if [ $__SkipUnmount == 0 ]; then
umount $__RootfsDir/*
fi
rm -rf $__RootfsDir
fi
if [[ "$__LinuxCodeName" == "alpine" ]]; then
__ApkToolsVersion=2.9.1
__AlpineVersion=3.7
__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
mkdir -p $__RootfsDir/usr/bin
cp -v /usr/bin/qemu-$__QEMUArch-static $__RootfsDir/usr/bin
$__ApkToolsDir/apk-tools-$__ApkToolsVersion/apk \
-X http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/main \
-X http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/community \
-X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
-U --allow-untrusted --root $__RootfsDir --arch $__AlpineArch --initdb \
add $__AlpinePackages
rm -r $__ApkToolsDir
elif [[ -n $__LinuxCodeName ]]; then
qemu-debootstrap --arch $__UbuntuArch $__LinuxCodeName $__RootfsDir $__UbuntuRepo
cp $__CrossDir/$__BuildArch/sources.list.$__LinuxCodeName $__RootfsDir/etc/apt/sources.list
chroot $__RootfsDir apt-get update
chroot $__RootfsDir apt-get -f -y install
chroot $__RootfsDir apt-get -y install $__UbuntuPackages
chroot $__RootfsDir symlinks -cr /usr
if [ $__SkipUnmount == 0 ]; then
umount $__RootfsDir/*
fi
if [[ "$__BuildArch" == "arm" && "$__LinuxCodeName" == "trusty" ]]; then
pushd $__RootfsDir
patch -p1 < $__CrossDir/$__BuildArch/trusty.patch
patch -p1 < $__CrossDir/$__BuildArch/trusty-lttng-2.4.patch
popd
fi
elif [ "$__Tizen" == "tizen" ]; then
ROOTFS_DIR=$__RootfsDir $__CrossDir/$__BuildArch/tizen-build-rootfs.sh
else
echo "Unsupported target platform."
usage;
exit 1
fi
+138
View File
@@ -0,0 +1,138 @@
set(CROSS_ROOTFS $ENV{ROOTFS_DIR})
set(TARGET_ARCH_NAME $ENV{TARGET_BUILD_ARCH})
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
if(TARGET_ARCH_NAME STREQUAL "armel")
set(CMAKE_SYSTEM_PROCESSOR armv7l)
set(TOOLCHAIN "arm-linux-gnueabi")
if("$ENV{__DistroRid}" MATCHES "tizen.*")
set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi/6.2.1")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "arm")
set(CMAKE_SYSTEM_PROCESSOR armv7l)
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf)
set(TOOLCHAIN "armv6-alpine-linux-musleabihf")
else()
set(TOOLCHAIN "arm-linux-gnueabihf")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "arm64")
set(CMAKE_SYSTEM_PROCESSOR aarch64)
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl)
set(TOOLCHAIN "aarch64-alpine-linux-musl")
else()
set(TOOLCHAIN "aarch64-linux-gnu")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "x86")
set(CMAKE_SYSTEM_PROCESSOR i686)
set(TOOLCHAIN "i686-linux-gnu")
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64 and x86 are supported!")
endif()
# Specify include paths
if(TARGET_ARCH_NAME STREQUAL "armel")
if(DEFINED TIZEN_TOOLCHAIN)
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi)
endif()
endif()
# add_compile_param - adds only new options without duplicates.
# arg0 - list with result options, arg1 - list with new options.
# arg2 - optional argument, quick summary string for optional using CACHE FORCE mode.
macro(add_compile_param)
if(NOT ${ARGC} MATCHES "^(2|3)$")
message(FATAL_ERROR "Wrong using add_compile_param! Two or three parameters must be given! See add_compile_param description.")
endif()
foreach(OPTION ${ARGV1})
if(NOT ${ARGV0} MATCHES "${OPTION}($| )")
set(${ARGV0} "${${ARGV0}} ${OPTION}")
if(${ARGC} EQUAL "3") # CACHE FORCE mode
set(${ARGV0} "${${ARGV0}}" CACHE STRING "${ARGV2}" FORCE)
endif()
endif()
endforeach()
endmacro()
# Specify link flags
add_compile_param(CROSS_LINK_FLAGS "--sysroot=${CROSS_ROOTFS}")
add_compile_param(CROSS_LINK_FLAGS "--gcc-toolchain=${CROSS_ROOTFS}/usr")
add_compile_param(CROSS_LINK_FLAGS "--target=${TOOLCHAIN}")
add_compile_param(CROSS_LINK_FLAGS "-fuse-ld=gold")
if(TARGET_ARCH_NAME STREQUAL "armel")
if(DEFINED TIZEN_TOOLCHAIN) # For Tizen only
add_compile_param(CROSS_LINK_FLAGS "-B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
add_compile_param(CROSS_LINK_FLAGS "-L${CROSS_ROOTFS}/lib")
add_compile_param(CROSS_LINK_FLAGS "-L${CROSS_ROOTFS}/usr/lib")
add_compile_param(CROSS_LINK_FLAGS "-L${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "x86")
add_compile_param(CROSS_LINK_FLAGS "-m32")
endif()
add_compile_param(CMAKE_EXE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" "TOOLCHAIN_EXE_LINKER_FLAGS")
add_compile_param(CMAKE_SHARED_LINKER_FLAGS "${CROSS_LINK_FLAGS}" "TOOLCHAIN_EXE_LINKER_FLAGS")
add_compile_param(CMAKE_MODULE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" "TOOLCHAIN_EXE_LINKER_FLAGS")
# Specify compile options
add_compile_options("--sysroot=${CROSS_ROOTFS}")
add_compile_options("--target=${TOOLCHAIN}")
add_compile_options("--gcc-toolchain=${CROSS_ROOTFS}/usr")
if(TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$")
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN})
endif()
if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$")
add_compile_options(-mthumb)
add_compile_options(-mfpu=vfpv3)
if(TARGET_ARCH_NAME STREQUAL "armel")
add_compile_options(-mfloat-abi=softfp)
if(DEFINED TIZEN_TOOLCHAIN)
add_compile_options(-Wno-deprecated-declarations) # compile-time option
add_compile_options(-D__extern_always_inline=inline) # compile-time option
endif()
endif()
elseif(TARGET_ARCH_NAME STREQUAL "x86")
add_compile_options(-m32)
add_compile_options(-Wno-error=unused-command-line-argument)
endif()
# Set LLDB include and library paths
if(TARGET_ARCH_NAME MATCHES "^(arm|armel|x86)$")
if(TARGET_ARCH_NAME STREQUAL "x86")
set(LLVM_CROSS_DIR "$ENV{LLVM_CROSS_HOME}")
else() # arm/armel case
set(LLVM_CROSS_DIR "$ENV{LLVM_ARM_HOME}")
endif()
if(LLVM_CROSS_DIR)
set(WITH_LLDB_LIBS "${LLVM_CROSS_DIR}/lib/" CACHE STRING "")
set(WITH_LLDB_INCLUDES "${LLVM_CROSS_DIR}/include" CACHE STRING "")
set(LLDB_H "${WITH_LLDB_INCLUDES}" CACHE STRING "")
set(LLDB "${LLVM_CROSS_DIR}/lib/liblldb.so" CACHE STRING "")
else()
if(TARGET_ARCH_NAME STREQUAL "x86")
set(WITH_LLDB_LIBS "${CROSS_ROOTFS}/usr/lib/i386-linux-gnu" CACHE STRING "")
set(CHECK_LLVM_DIR "${CROSS_ROOTFS}/usr/lib/llvm-3.8/include")
if(EXISTS "${CHECK_LLVM_DIR}" AND IS_DIRECTORY "${CHECK_LLVM_DIR}")
set(WITH_LLDB_INCLUDES "${CHECK_LLVM_DIR}")
else()
set(WITH_LLDB_INCLUDES "${CROSS_ROOTFS}/usr/lib/llvm-3.6/include")
endif()
else() # arm/armel case
set(WITH_LLDB_LIBS "${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}" CACHE STRING "")
set(WITH_LLDB_INCLUDES "${CROSS_ROOTFS}/usr/lib/llvm-3.6/include" CACHE STRING "")
endif()
endif()
endif()
set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
+11
View File
@@ -0,0 +1,11 @@
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted universe
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted
deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted
deb http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
+11
View File
@@ -0,0 +1,11 @@
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted
deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
+11
View File
@@ -0,0 +1,11 @@
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe
deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted
deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted
deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
+33
View File
@@ -0,0 +1,33 @@
param (
$darcVersion = $null,
$versionEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16"
)
$verbosity = "m"
. $PSScriptRoot\tools.ps1
function InstallDarcCli ($darcVersion) {
$darcCliPackageName = "microsoft.dotnet.darc"
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
$toolList = Invoke-Expression "& `"$dotnet`" tool list -g"
if ($toolList -like "*$darcCliPackageName*") {
Invoke-Expression "& `"$dotnet`" tool uninstall $darcCliPackageName -g"
}
# If the user didn't explicitly specify the darc version,
# query the Maestro API for the correct version of darc to install.
if (-not $darcVersion) {
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
}
$arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json'
Write-Host "Installing Darc CLI version $darcVersion..."
Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed."
Invoke-Expression "& `"$dotnet`" tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g"
}
InstallDarcCli $darcVersion
+64
View File
@@ -0,0 +1,64 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
darcVersion=''
versionEndpoint="https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16"
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
case "$opt" in
--darcversion)
darcVersion=$2
shift
;;
--versionendpoint)
versionEndpoint=$2
shift
;;
*)
echo "Invalid argument: $1"
usage
exit 1
;;
esac
shift
done
# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
verbosity=m
. "$scriptroot/tools.sh"
if [ -z "$darcVersion" ]; then
darcVersion=$(curl -X GET "$versionEndpoint" -H "accept: text/plain")
fi
function InstallDarcCli {
local darc_cli_package_name="microsoft.dotnet.darc"
InitializeDotNetCli
local dotnet_root=$_InitializeDotNetCli
local uninstall_command=`$dotnet_root/dotnet tool uninstall $darc_cli_package_name -g`
local tool_list=$($dotnet_root/dotnet tool list -g)
if [[ $tool_list = *$darc_cli_package_name* ]]; then
echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g)
fi
local arcadeServicesSource="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json"
echo "Installing Darc CLI version $darcVersion..."
echo "You may need to restart your command shell if this is the first dotnet tool you have installed."
echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g)
}
InstallDarcCli
+2
View File
@@ -0,0 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0dotnet-install.ps1""" %*"
+27
View File
@@ -0,0 +1,27 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $verbosity = "minimal",
[string] $architecture = "",
[string] $version = "Latest",
[string] $runtime = "dotnet"
)
. $PSScriptRoot\tools.ps1
$dotnetRoot = Join-Path $RepoRoot ".dotnet"
$installdir = $dotnetRoot
try {
if ($architecture -and $architecture.Trim() -eq "x86") {
$installdir = Join-Path $installdir "x86"
}
InstallDotNet $installdir $version $architecture $runtime $true
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}
ExitWithExitCode 0
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
version='Latest'
architecture=''
runtime='dotnet'
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
case "$opt" in
-version|-v)
shift
version="$1"
;;
-architecture|-a)
shift
architecture="$1"
;;
-runtime|-r)
shift
runtime="$1"
;;
*)
echo "Invalid argument: $1"
usage
exit 1
;;
esac
shift
done
. "$scriptroot/tools.sh"
dotnetRoot="$repo_root/.dotnet"
InstallDotNet $dotnetRoot $version "$architecture" $runtime true || {
local exit_code=$?
echo "dotnet-install.sh failed (exit code '$exit_code')." >&2
ExitWithExitCode $exit_code
}
ExitWithExitCode 0
+87
View File
@@ -0,0 +1,87 @@
Param(
[Parameter(Mandatory=$true)][string] $barToken, # Token generated at https://maestro-prod.westus2.cloudapp.azure.com/Account/Tokens
[Parameter(Mandatory=$true)][string] $gitHubPat, # GitHub personal access token from https://github.com/settings/tokens (no auth scopes needed)
[Parameter(Mandatory=$true)][string] $azdoPat, # Azure Dev Ops tokens from https://dev.azure.com/dnceng/_details/security/tokens (code read scope needed)
[Parameter(Mandatory=$true)][string] $outputFolder, # Where the graphviz.txt file will be created
[string] $darcVersion = '1.1.0-beta.19175.6', # darc's version
[string] $graphvizVersion = '2.38', # GraphViz version
[switch] $includeToolset # Whether the graph should include toolset dependencies or not. i.e. arcade, optimization. For more about
# 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..."
ExitWithExitCode $exitCode
}
}
try {
Push-Location $PSScriptRoot
Write-Host "Installing darc..."
. .\darc-init.ps1 -darcVersion $darcVersion
CheckExitCode "Running darc-init"
$engCommonBaseDir = Join-Path $PSScriptRoot "native\"
$graphvizInstallDir = CommonLibrary\Get-NativeInstallDirectory
$nativeToolBaseUri = "https://netcorenativeassets.blob.core.windows.net/resource-packages/external"
$installBin = Join-Path $graphvizInstallDir "bin"
Write-Host "Installing dot..."
.\native\install-tool.ps1 -ToolName graphviz -InstallPath $installBin -BaseUri $nativeToolBaseUri -CommonLibraryDirectory $engCommonBaseDir -Version $graphvizVersion -Verbose
$darcExe = "$env:USERPROFILE\.dotnet\tools"
$darcExe = Resolve-Path "$darcExe\darc.exe"
Create-Directory $outputFolder
# Generate 3 graph descriptions:
# 1. Flat with coherency information
# 2. Graphviz (dot) file
# 3. Standard dependency graph
$graphVizFilePath = "$outputFolder\graphviz.txt"
$graphVizImageFilePath = "$outputFolder\graph.png"
$normalGraphFilePath = "$outputFolder\graph-full.txt"
$flatGraphFilePath = "$outputFolder\graph-flat.txt"
$baseOptions = "get-dependency-graph --github-pat $gitHubPat --azdev-pat $azdoPat --password $barToken"
if ($includeToolset) {
Write-Host "Toolsets will be included in the graph..."
$baseOptions += " --include-toolset"
}
Write-Host "Generating standard dependency graph..."
Invoke-Expression "& `"$darcExe`" $baseOptions --output-file $normalGraphFilePath"
CheckExitCode "Generating normal dependency graph"
Write-Host "Generating flat dependency graph and graphviz file..."
Invoke-Expression "& `"$darcExe`" $baseOptions --flat --coherency --graphviz $graphVizFilePath --output-file $flatGraphFilePath"
CheckExitCode "Generating flat and graphviz dependency graph"
Write-Host "Generating graph image $graphVizFilePath"
$dotFilePath = Join-Path $installBin "graphviz\$graphvizVersion\release\bin\dot.exe"
Invoke-Expression "& `"$dotFilePath`" -Tpng -o'$graphVizImageFilePath' `"$graphVizFilePath`""
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 $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
} finally {
Pop-Location
}
+26
View File
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">
<PropertyGroup>
<Language>msbuild</Language>
</PropertyGroup>
<ItemGroup>
<HelixCorrelationPayload Include="$(CorrelationPayloadDirectory)">
<PayloadDirectory>%(Identity)</PayloadDirectory>
</HelixCorrelationPayload>
</ItemGroup>
<ItemGroup>
<HelixWorkItem Include="WorkItem" Condition="'$(WorkItemDirectory)' != ''">
<PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
<Command>$(WorkItemCommand)</Command>
<Timeout Condition="'$(WorkItemTimeout)' != ''">$(WorkItemTimeout)</Timeout>
</HelixWorkItem>
</ItemGroup>
<ItemGroup>
<XUnitProject Include="$(XUnitProjects.Split(';'))">
<Arguments />
</XUnitProject>
</ItemGroup>
</Project>
+3
View File
@@ -0,0 +1,3 @@
@echo off
powershell -NoProfile -NoLogo -ExecutionPolicy ByPass -command "& """%~dp0init-tools-native.ps1""" %*"
exit /b %ErrorLevel%
+142
View File
@@ -0,0 +1,142 @@
<#
.SYNOPSIS
Entry point script for installing native tools
.DESCRIPTION
Reads $RepoRoot\global.json file to determine native assets to install
and executes installers for those tools
.PARAMETER BaseUri
Base file directory or Url from which to acquire tool archives
.PARAMETER InstallDirectory
Directory to install native toolset. This is a command-line override for the default
Install directory precedence order:
- InstallDirectory command-line override
- NETCOREENG_INSTALL_DIRECTORY environment variable
- (default) %USERPROFILE%/.netcoreeng/native
.PARAMETER Clean
Switch specifying to not install anything, but cleanup native asset folders
.PARAMETER Force
Clean and then install tools
.PARAMETER DownloadRetries
Total number of retry attempts
.PARAMETER RetryWaitTimeInSeconds
Wait time between retry attempts in seconds
.PARAMETER GlobalJsonFile
File path to global.json file
.NOTES
#>
[CmdletBinding(PositionalBinding=$false)]
Param (
[string] $BaseUri = "https://netcorenativeassets.blob.core.windows.net/resource-packages/external",
[string] $InstallDirectory,
[switch] $Clean = $False,
[switch] $Force = $False,
[int] $DownloadRetries = 5,
[int] $RetryWaitTimeInSeconds = 30,
[string] $GlobalJsonFile
)
if (!$GlobalJsonFile) {
$GlobalJsonFile = Join-Path (Get-Item $PSScriptRoot).Parent.Parent.FullName "global.json"
}
Set-StrictMode -version 2.0
$ErrorActionPreference="Stop"
Import-Module -Name (Join-Path $PSScriptRoot "native\CommonLibrary.psm1")
try {
# Define verbose switch if undefined
$Verbose = $VerbosePreference -Eq "Continue"
$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"
# Process tools list
Write-Host "Processing $GlobalJsonFile"
If (-Not (Test-Path $GlobalJsonFile)) {
Write-Host "Unable to find '$GlobalJsonFile'"
exit 0
}
$NativeTools = Get-Content($GlobalJsonFile) -Raw |
ConvertFrom-Json |
Select-Object -Expand "native-tools" -ErrorAction SilentlyContinue
if ($NativeTools) {
$NativeTools.PSObject.Properties | ForEach-Object {
$ToolName = $_.Name
$ToolVersion = $_.Value
$LocalInstallerCommand = $InstallerPath
$LocalInstallerCommand += " -ToolName $ToolName"
$LocalInstallerCommand += " -InstallPath $InstallBin"
$LocalInstallerCommand += " -BaseUri $BaseUri"
$LocalInstallerCommand += " -CommonLibraryDirectory $EngCommonBaseDir"
$LocalInstallerCommand += " -Version $ToolVersion"
if ($Verbose) {
$LocalInstallerCommand += " -Verbose"
}
if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') {
if($Force) {
$LocalInstallerCommand += " -Force"
}
}
if ($Clean) {
$LocalInstallerCommand += " -Clean"
}
Write-Verbose "Installing $ToolName version $ToolVersion"
Write-Verbose "Executing '$LocalInstallerCommand'"
Invoke-Expression "$LocalInstallerCommand"
if ($LASTEXITCODE -Ne "0") {
$errMsg = "$ToolName installation failed"
if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) {
Write-Warning $errMsg
$toolInstallationFailure = $true
} else {
Write-Error $errMsg
exit 1
}
}
}
if ((Get-Variable 'toolInstallationFailure' -ErrorAction 'SilentlyContinue') -and $toolInstallationFailure) {
exit 1
}
}
else {
Write-Host "No native tools defined in global.json"
exit 0
}
if ($Clean) {
exit 0
}
if (Test-Path $InstallBin) {
Write-Host "Native tools are available from" (Convert-Path -Path $InstallBin)
Write-Host "##vso[task.prependpath]$(Convert-Path -Path $InstallBin)"
}
else {
Write-Error "Native tools install directory does not exist, installation failed"
exit 1
}
exit 0
}
catch {
Write-Host $_
Write-Host $_.Exception
exit 1
}
+141
View File
@@ -0,0 +1,141 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
base_uri='https://netcorenativeassets.blob.core.windows.net/resource-packages/external'
install_directory=''
clean=false
force=false
download_retries=5
retry_wait_time_seconds=30
global_json_file="$(dirname "$(dirname "${scriptroot}")")/global.json"
declare -A native_assets
. $scriptroot/native/common-library.sh
while (($# > 0)); do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
--baseuri)
base_uri=$2
shift 2
;;
--installdirectory)
install_directory=$2
shift 2
;;
--clean)
clean=true
shift 1
;;
--force)
force=true
shift 1
;;
--downloadretries)
download_retries=$2
shift 2
;;
--retrywaittimeseconds)
retry_wait_time_seconds=$2
shift 2
;;
--help)
echo "Common settings:"
echo " --installdirectory Directory to install native toolset."
echo " This is a command-line override for the default"
echo " Install directory precedence order:"
echo " - InstallDirectory command-line override"
echo " - NETCOREENG_INSTALL_DIRECTORY environment variable"
echo " - (default) %USERPROFILE%/.netcoreeng/native"
echo ""
echo " --clean Switch specifying not to install anything, but cleanup native asset folders"
echo " --force Clean and then install tools"
echo " --help Print help and exit"
echo ""
echo "Advanced settings:"
echo " --baseuri <value> Base URI for where to download native tools from"
echo " --downloadretries <value> Number of times a download should be attempted"
echo " --retrywaittimeseconds <value> Wait time between download attempts"
echo ""
exit 0
;;
esac
done
function ReadGlobalJsonNativeTools {
# Get the native-tools section from the global.json.
local native_tools_section=$(cat $global_json_file | awk '/"native-tools"/,/}/')
# Only extract the contents of the object.
local native_tools_list=$(echo $native_tools_section | awk -F"[{}]" '{print $2}')
native_tools_list=${native_tools_list//[\" ]/}
native_tools_list=${native_tools_list//,/$'\n'}
native_tools_list="$(echo -e "${native_tools_list}" | tr -d '[:space:]')"
local old_IFS=$IFS
while read -r line; do
# Lines are of the form: 'tool:version'
IFS=:
while read -r key value; do
native_assets[$key]=$value
done <<< "$line"
done <<< "$native_tools_list"
IFS=$old_IFS
return 0;
}
native_base_dir=$install_directory
if [[ -z $install_directory ]]; then
native_base_dir=$(GetNativeInstallDirectory)
fi
install_bin="${native_base_dir}/bin"
ReadGlobalJsonNativeTools
if [[ ${#native_assets[@]} -eq 0 ]]; then
echo "No native tools defined in global.json"
exit 0;
else
native_installer_dir="$scriptroot/native"
for tool in "${!native_assets[@]}"
do
tool_version=${native_assets[$tool]}
installer_name="install-$tool.sh"
installer_command="$native_installer_dir/$installer_name"
installer_command+=" --baseuri $base_uri"
installer_command+=" --installpath $install_bin"
installer_command+=" --version $tool_version"
if [[ $force = true ]]; then
installer_command+=" --force"
fi
if [[ $clean = true ]]; then
installer_command+=" --clean"
fi
$installer_command
if [[ $? != 0 ]]; then
echo "Execution Failed" >&2
exit 1
fi
done
fi
if [[ $clean = true ]]; then
exit 0
fi
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
exit 1
fi
exit 0
@@ -0,0 +1,4 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
</Project>
+27
View File
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
</PropertyGroup>
<ItemGroup>
<!-- Clear references, the SDK may add some depending on UsuingToolXxx settings, but we only want to restore the following -->
<PackageReference Remove="@(PackageReference)"/>
<PackageReference Include="Microsoft.DotNet.IBCMerge" Version="$(MicrosoftDotNetIBCMergeVersion)" Condition="'$(UsingToolIbcOptimization)' == 'true'" />
<PackageReference Include="Drop.App" Version="$(DropAppVersion)" ExcludeAssets="all" Condition="'$(UsingToolVisualStudioIbcTraining)' == 'true'"/>
</ItemGroup>
<PropertyGroup>
<RestoreSources></RestoreSources>
<RestoreSources Condition="'$(UsingToolIbcOptimization)' == 'true'">
https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json;
</RestoreSources>
<RestoreSources Condition="'$(UsingToolVisualStudioIbcTraining)' == 'true'">
$(RestoreSources);
https://devdiv.pkgs.visualstudio.com/_packaging/VS/nuget/v3/index.json;
</RestoreSources>
</PropertyGroup>
<!-- Repository extensibility point -->
<Import Project="$(RepositoryEngineeringDir)InternalTools.props" Condition="Exists('$(RepositoryEngineeringDir)InternalTools.props')" />
</Project>
+27
View File
@@ -0,0 +1,27 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $verbosity = "minimal",
[bool] $warnAsError = $true,
[bool] $nodeReuse = $true,
[switch] $ci,
[switch] $prepareMachine,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$extraArgs
)
. $PSScriptRoot\tools.ps1
try {
if ($ci) {
$nodeReuse = $false
}
MSBuild @extraArgs
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}
ExitWithExitCode 0
+58
View File
@@ -0,0 +1,58 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
verbosity='minimal'
warn_as_error=true
node_reuse=true
prepare_machine=false
extra_args=''
while (($# > 0)); do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
--verbosity)
verbosity=$2
shift 2
;;
--warnaserror)
warn_as_error=$2
shift 2
;;
--nodereuse)
node_reuse=$2
shift 2
;;
--ci)
ci=true
shift 1
;;
--preparemachine)
prepare_machine=true
shift 1
;;
*)
extra_args="$extra_args $1"
shift 1
;;
esac
done
. "$scriptroot/tools.sh"
if [[ "$ci" == true ]]; then
node_reuse=false
fi
MSBuild $extra_args
ExitWithExitCode 0
+358
View File
@@ -0,0 +1,358 @@
<#
.SYNOPSIS
Helper module to install an archive to a directory
.DESCRIPTION
Helper module to download and extract an archive to a specified directory
.PARAMETER Uri
Uri of artifact to download
.PARAMETER InstallDirectory
Directory to extract artifact contents to
.PARAMETER Force
Force download / extraction if file or contents already exist. Default = False
.PARAMETER DownloadRetries
Total number of retry attempts. Default = 5
.PARAMETER RetryWaitTimeInSeconds
Wait time between retry attempts in seconds. Default = 30
.NOTES
Returns False if download or extraction fail, True otherwise
#>
function DownloadAndExtract {
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $Uri,
[Parameter(Mandatory=$True)]
[string] $InstallDirectory,
[switch] $Force = $False,
[int] $DownloadRetries = 5,
[int] $RetryWaitTimeInSeconds = 30
)
# Define verbose switch if undefined
$Verbose = $VerbosePreference -Eq "Continue"
$TempToolPath = CommonLibrary\Get-TempPathFilename -Path $Uri
# Download native tool
$DownloadStatus = CommonLibrary\Get-File -Uri $Uri `
-Path $TempToolPath `
-DownloadRetries $DownloadRetries `
-RetryWaitTimeInSeconds $RetryWaitTimeInSeconds `
-Force:$Force `
-Verbose:$Verbose
if ($DownloadStatus -Eq $False) {
Write-Error "Download failed"
return $False
}
# Extract native tool
$UnzipStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath `
-OutputDirectory $InstallDirectory `
-Force:$Force `
-Verbose:$Verbose
if ($UnzipStatus -Eq $False) {
Write-Error "Unzip failed"
return $False
}
return $True
}
<#
.SYNOPSIS
Download a file, retry on failure
.DESCRIPTION
Download specified file and retry if attempt fails
.PARAMETER Uri
Uri of file to download. If Uri is a local path, the file will be copied instead of downloaded
.PARAMETER Path
Path to download or copy uri file to
.PARAMETER Force
Overwrite existing file if present. Default = False
.PARAMETER DownloadRetries
Total number of retry attempts. Default = 5
.PARAMETER RetryWaitTimeInSeconds
Wait time between retry attempts in seconds Default = 30
#>
function Get-File {
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $Uri,
[Parameter(Mandatory=$True)]
[string] $Path,
[int] $DownloadRetries = 5,
[int] $RetryWaitTimeInSeconds = 30,
[switch] $Force = $False
)
$Attempt = 0
if ($Force) {
if (Test-Path $Path) {
Remove-Item $Path -Force
}
}
if (Test-Path $Path) {
Write-Host "File '$Path' already exists, skipping download"
return $True
}
$DownloadDirectory = Split-Path -ErrorAction Ignore -Path "$Path" -Parent
if (-Not (Test-Path $DownloadDirectory)) {
New-Item -path $DownloadDirectory -force -itemType "Directory" | Out-Null
}
if (Test-Path -IsValid -Path $Uri) {
Write-Verbose "'$Uri' is a file path, copying file to '$Path'"
Copy-Item -Path $Uri -Destination $Path
return $?
}
else {
Write-Verbose "Downloading $Uri"
while($Attempt -Lt $DownloadRetries)
{
try {
Invoke-WebRequest -UseBasicParsing -Uri $Uri -OutFile $Path
Write-Verbose "Downloaded to '$Path'"
return $True
}
catch {
$Attempt++
if ($Attempt -Lt $DownloadRetries) {
$AttemptsLeft = $DownloadRetries - $Attempt
Write-Warning "Download failed, $AttemptsLeft attempts remaining, will retry in $RetryWaitTimeInSeconds seconds"
Start-Sleep -Seconds $RetryWaitTimeInSeconds
}
else {
Write-Error $_
Write-Error $_.Exception
}
}
}
}
return $False
}
<#
.SYNOPSIS
Generate a shim for a native tool
.DESCRIPTION
Creates a wrapper script (shim) that passes arguments forward to native tool assembly
.PARAMETER ShimName
The name of the shim
.PARAMETER ShimDirectory
The directory where shims are stored
.PARAMETER ToolFilePath
Path to file that shim forwards to
.PARAMETER Force
Replace shim if already present. Default = False
.NOTES
Returns $True if generating shim succeeds, $False otherwise
#>
function New-ScriptShim {
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $ShimName,
[Parameter(Mandatory=$True)]
[string] $ShimDirectory,
[Parameter(Mandatory=$True)]
[string] $ToolFilePath,
[Parameter(Mandatory=$True)]
[string] $BaseUri,
[switch] $Force
)
try {
Write-Verbose "Generating '$ShimName' shim"
if (-Not (Test-Path $ToolFilePath)){
Write-Error "Specified tool file path '$ToolFilePath' does not exist"
return $False
}
# WinShimmer is a small .NET Framework program that creates .exe shims to bootstrapped programs
# Many of the checks for installed programs expect a .exe extension for Windows tools, rather
# than a .bat or .cmd file.
# Source: https://github.com/dotnet/arcade/tree/master/src/WinShimmer
if (-Not (Test-Path "$ShimDirectory\WinShimmer\winshimmer.exe")) {
$InstallStatus = DownloadAndExtract -Uri "$BaseUri/windows/winshimmer/WinShimmer.zip" `
-InstallDirectory $ShimDirectory\WinShimmer `
-Force:$Force `
-DownloadRetries 2 `
-RetryWaitTimeInSeconds 5 `
-Verbose:$Verbose
}
if ((Test-Path (Join-Path $ShimDirectory "$ShimName.exe"))) {
Write-Host "$ShimName.exe already exists; replacing..."
Remove-Item (Join-Path $ShimDirectory "$ShimName.exe")
}
Invoke-Expression "$ShimDirectory\WinShimmer\winshimmer.exe $ShimName $ToolFilePath $ShimDirectory"
return $True
}
catch {
Write-Host $_
Write-Host $_.Exception
return $False
}
}
<#
.SYNOPSIS
Returns the machine architecture of the host machine
.NOTES
Returns 'x64' on 64 bit machines
Returns 'x86' on 32 bit machines
#>
function Get-MachineArchitecture {
$ProcessorArchitecture = $Env:PROCESSOR_ARCHITECTURE
$ProcessorArchitectureW6432 = $Env:PROCESSOR_ARCHITEW6432
if($ProcessorArchitecture -Eq "X86")
{
if(($ProcessorArchitectureW6432 -Eq "") -Or
($ProcessorArchitectureW6432 -Eq "X86")) {
return "x86"
}
$ProcessorArchitecture = $ProcessorArchitectureW6432
}
if (($ProcessorArchitecture -Eq "AMD64") -Or
($ProcessorArchitecture -Eq "IA64") -Or
($ProcessorArchitecture -Eq "ARM64")) {
return "x64"
}
return "x86"
}
<#
.SYNOPSIS
Get the name of a temporary folder under the native install directory
#>
function Get-TempDirectory {
return Join-Path (Get-NativeInstallDirectory) "temp/"
}
function Get-TempPathFilename {
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $Path
)
$TempDir = CommonLibrary\Get-TempDirectory
$TempFilename = Split-Path $Path -leaf
$TempPath = Join-Path $TempDir $TempFilename
return $TempPath
}
<#
.SYNOPSIS
Returns the base directory to use for native tool installation
.NOTES
Returns the value of the NETCOREENG_INSTALL_DIRECTORY if that environment variable
is set, or otherwise returns an install directory under the %USERPROFILE%
#>
function Get-NativeInstallDirectory {
$InstallDir = $Env:NETCOREENG_INSTALL_DIRECTORY
if (!$InstallDir) {
$InstallDir = Join-Path $Env:USERPROFILE ".netcoreeng/native/"
}
return $InstallDir
}
<#
.SYNOPSIS
Unzip an archive
.DESCRIPTION
Powershell module to unzip an archive to a specified directory
.PARAMETER ZipPath (Required)
Path to archive to unzip
.PARAMETER OutputDirectory (Required)
Output directory for archive contents
.PARAMETER Force
Overwrite output directory contents if they already exist
.NOTES
- Returns True and does not perform an extraction if output directory already exists but Overwrite is not True.
- Returns True if unzip operation is successful
- Returns False if Overwrite is True and it is unable to remove contents of OutputDirectory
- Returns False if unable to extract zip archive
#>
function Expand-Zip {
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $ZipPath,
[Parameter(Mandatory=$True)]
[string] $OutputDirectory,
[switch] $Force
)
Write-Verbose "Extracting '$ZipPath' to '$OutputDirectory'"
try {
if ((Test-Path $OutputDirectory) -And (-Not $Force)) {
Write-Host "Directory '$OutputDirectory' already exists, skipping extract"
return $True
}
if (Test-Path $OutputDirectory) {
Write-Verbose "'Force' is 'True', but '$OutputDirectory' exists, removing directory"
Remove-Item $OutputDirectory -Force -Recurse
if ($? -Eq $False) {
Write-Error "Unable to remove '$OutputDirectory'"
return $False
}
}
if (-Not (Test-Path $OutputDirectory)) {
New-Item -path $OutputDirectory -Force -itemType "Directory" | Out-Null
}
Add-Type -assembly "system.io.compression.filesystem"
[io.compression.zipfile]::ExtractToDirectory("$ZipPath", "$OutputDirectory")
if ($? -Eq $False) {
Write-Error "Unable to extract '$ZipPath'"
return $False
}
}
catch {
Write-Host $_
Write-Host $_.Exception
return $False
}
return $True
}
export-modulemember -function DownloadAndExtract
export-modulemember -function Expand-Zip
export-modulemember -function Get-File
export-modulemember -function Get-MachineArchitecture
export-modulemember -function Get-NativeInstallDirectory
export-modulemember -function Get-TempDirectory
export-modulemember -function Get-TempPathFilename
export-modulemember -function New-ScriptShim
+168
View File
@@ -0,0 +1,168 @@
#!/usr/bin/env bash
function GetNativeInstallDirectory {
local install_dir
if [[ -z $NETCOREENG_INSTALL_DIRECTORY ]]; then
install_dir=$HOME/.netcoreeng/native/
else
install_dir=$NETCOREENG_INSTALL_DIRECTORY
fi
echo $install_dir
return 0
}
function GetTempDirectory {
echo $(GetNativeInstallDirectory)temp/
return 0
}
function ExpandZip {
local zip_path=$1
local output_directory=$2
local force=${3:-false}
echo "Extracting $zip_path to $output_directory"
if [[ -d $output_directory ]] && [[ $force = false ]]; then
echo "Directory '$output_directory' already exists, skipping extract"
return 0
fi
if [[ -d $output_directory ]]; then
echo "'Force flag enabled, but '$output_directory' exists. Removing directory"
rm -rf $output_directory
if [[ $? != 0 ]]; then
echo Unable to remove '$output_directory'>&2
return 1
fi
fi
echo "Creating directory: '$output_directory'"
mkdir -p $output_directory
echo "Extracting archive"
tar -xf $zip_path -C $output_directory
if [[ $? != 0 ]]; then
echo "Unable to extract '$zip_path'" >&2
return 1
fi
return 0
}
function GetCurrentOS {
local unameOut="$(uname -s)"
case $unameOut in
Linux*) echo "Linux";;
Darwin*) echo "MacOS";;
esac
return 0
}
function GetFile {
local uri=$1
local path=$2
local force=${3:-false}
local download_retries=${4:-5}
local retry_wait_time_seconds=${5:-30}
if [[ -f $path ]]; then
if [[ $force = false ]]; then
echo "File '$path' already exists. Skipping download"
return 0
else
rm -rf $path
fi
fi
if [[ -f $uri ]]; then
echo "'$uri' is a file path, copying file to '$path'"
cp $uri $path
return $?
fi
echo "Downloading $uri"
# Use curl if available, otherwise use wget
if command -v curl > /dev/null; then
curl "$uri" -sSL --retry $download_retries --retry-delay $retry_wait_time_seconds --create-dirs -o "$path" --fail
else
wget -q -O "$path" "$uri" --tries="$download_retries"
fi
return $?
}
function GetTempPathFileName {
local path=$1
local temp_dir=$(GetTempDirectory)
local temp_file_name=$(basename $path)
echo $temp_dir$temp_file_name
return 0
}
function DownloadAndExtract {
local uri=$1
local installDir=$2
local force=${3:-false}
local download_retries=${4:-5}
local retry_wait_time_seconds=${5:-30}
local temp_tool_path=$(GetTempPathFileName $uri)
echo "downloading to: $temp_tool_path"
# 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
return 1
fi
# Extract File
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
return 1
fi
return 0
}
function NewScriptShim {
local shimpath=$1
local tool_file_path=$2
local force=${3:-false}
echo "Generating '$shimpath' shim"
if [[ -f $shimpath ]]; then
if [[ $force = false ]]; then
echo "File '$shimpath' already exists." >&2
return 1
else
rm -rf $shimpath
fi
fi
if [[ ! -f $tool_file_path ]]; then
echo "Specified tool file path:'$tool_file_path' does not exist" >&2
return 1
fi
local shim_contents=$'#!/usr/bin/env bash\n'
shim_contents+="SHIMARGS="$'$1\n'
shim_contents+="$tool_file_path"$' $SHIMARGS\n'
# Write shim file
echo "$shim_contents" > $shimpath
chmod +x $shimpath
echo "Finished generating shim '$shimpath'"
return $?
}
+117
View File
@@ -0,0 +1,117 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. $scriptroot/common-library.sh
base_uri=
install_path=
version=
clean=false
force=false
download_retries=5
retry_wait_time_seconds=30
while (($# > 0)); do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
--baseuri)
base_uri=$2
shift 2
;;
--installpath)
install_path=$2
shift 2
;;
--version)
version=$2
shift 2
;;
--clean)
clean=true
shift 1
;;
--force)
force=true
shift 1
;;
--downloadretries)
download_retries=$2
shift 2
;;
--retrywaittimeseconds)
retry_wait_time_seconds=$2
shift 2
;;
--help)
echo "Common settings:"
echo " --baseuri <value> Base file directory or Url wrom which to acquire tool archives"
echo " --installpath <value> Base directory to install native tool to"
echo " --clean Don't install the tool, just clean up the current install of the tool"
echo " --force Force install of tools even if they previously exist"
echo " --help Print help and exit"
echo ""
echo "Advanced settings:"
echo " --downloadretries Total number of retry attempts"
echo " --retrywaittimeseconds Wait time between retry attempts in seconds"
echo ""
exit 0
;;
esac
done
tool_name="cmake"
tool_os=$(GetCurrentOS)
tool_folder=$(echo $tool_os | awk '{print tolower($0)}')
tool_arch="x86_64"
tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch"
tool_install_directory="$install_path/$tool_name/$version"
tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name"
shim_path="$install_path/$tool_name.sh"
uri="${base_uri}/$tool_folder/cmake/$tool_name_moniker.tar.gz"
# Clean up tool and installers
if [[ $clean = true ]]; then
echo "Cleaning $tool_install_directory"
if [[ -d $tool_install_directory ]]; then
rm -rf $tool_install_directory
fi
echo "Cleaning $shim_path"
if [[ -f $shim_path ]]; then
rm -rf $shim_path
fi
tool_temp_path=$(GetTempPathFileName $uri)
echo "Cleaning $tool_temp_path"
if [[ -f $tool_temp_path ]]; then
rm -rf $tool_temp_path
fi
exit 0
fi
# Install tool
if [[ -f $tool_file_path ]] && [[ $force = false ]]; then
echo "$tool_name ($version) already exists, skipping install"
exit 0
fi
DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds
if [[ $? != 0 ]]; then
echo "Installation failed" >&2
exit 1
fi
# Generate Shim
# Always rewrite shims so that we are referencing the expected version
NewScriptShim $shim_path $tool_file_path true
if [[ $? != 0 ]]; then
echo "Shim generation failed" >&2
exit 1
fi
exit 0
+130
View File
@@ -0,0 +1,130 @@
<#
.SYNOPSIS
Install native tool
.DESCRIPTION
Install cmake native tool from Azure blob storage
.PARAMETER InstallPath
Base directory to install native tool to
.PARAMETER BaseUri
Base file directory or Url from which to acquire tool archives
.PARAMETER CommonLibraryDirectory
Path to folder containing common library modules
.PARAMETER Force
Force install of tools even if they previously exist
.PARAMETER Clean
Don't install the tool, just clean up the current install of the tool
.PARAMETER DownloadRetries
Total number of retry attempts
.PARAMETER RetryWaitTimeInSeconds
Wait time between retry attempts in seconds
.NOTES
Returns 0 if install succeeds, 1 otherwise
#>
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $ToolName,
[Parameter(Mandatory=$True)]
[string] $InstallPath,
[Parameter(Mandatory=$True)]
[string] $BaseUri,
[Parameter(Mandatory=$True)]
[string] $Version,
[string] $CommonLibraryDirectory = $PSScriptRoot,
[switch] $Force = $False,
[switch] $Clean = $False,
[int] $DownloadRetries = 5,
[int] $RetryWaitTimeInSeconds = 30
)
# Import common library modules
Import-Module -Name (Join-Path $CommonLibraryDirectory "CommonLibrary.psm1")
try {
# Define verbose switch if undefined
$Verbose = $VerbosePreference -Eq "Continue"
$Arch = CommonLibrary\Get-MachineArchitecture
$ToolOs = "win64"
if($Arch -Eq "x32") {
$ToolOs = "win32"
}
$ToolNameMoniker = "$ToolName-$Version-$ToolOs-$Arch"
$ToolInstallDirectory = Join-Path $InstallPath "$ToolName\$Version\"
$Uri = "$BaseUri/windows/$ToolName/$ToolNameMoniker.zip"
$ShimPath = Join-Path $InstallPath "$ToolName.exe"
if ($Clean) {
Write-Host "Cleaning $ToolInstallDirectory"
if (Test-Path $ToolInstallDirectory) {
Remove-Item $ToolInstallDirectory -Force -Recurse
}
Write-Host "Cleaning $ShimPath"
if (Test-Path $ShimPath) {
Remove-Item $ShimPath -Force
}
$ToolTempPath = CommonLibrary\Get-TempPathFilename -Path $Uri
Write-Host "Cleaning $ToolTempPath"
if (Test-Path $ToolTempPath) {
Remove-Item $ToolTempPath -Force
}
exit 0
}
# Install tool
if ((Test-Path $ToolInstallDirectory) -And (-Not $Force)) {
Write-Verbose "$ToolName ($Version) already exists, skipping install"
}
else {
$InstallStatus = CommonLibrary\DownloadAndExtract -Uri $Uri `
-InstallDirectory $ToolInstallDirectory `
-Force:$Force `
-DownloadRetries $DownloadRetries `
-RetryWaitTimeInSeconds $RetryWaitTimeInSeconds `
-Verbose:$Verbose
if ($InstallStatus -Eq $False) {
Write-Error "Installation failed"
exit 1
}
}
$ToolFilePath = Get-ChildItem $ToolInstallDirectory -Recurse -Filter "$ToolName.exe" | % { $_.FullName }
if (@($ToolFilePath).Length -Gt 1) {
Write-Error "There are multiple copies of $ToolName in $($ToolInstallDirectory): `n$(@($ToolFilePath | out-string))"
exit 1
} elseif (@($ToolFilePath).Length -Lt 1) {
Write-Error "$ToolName was not found in $ToolFilePath."
exit 1
}
# Generate shim
# Always rewrite shims so that we are referencing the expected version
$GenerateShimStatus = CommonLibrary\New-ScriptShim -ShimName $ToolName `
-ShimDirectory $InstallPath `
-ToolFilePath "$ToolFilePath" `
-BaseUri $BaseUri `
-Force:$Force `
-Verbose:$Verbose
if ($GenerateShimStatus -Eq $False) {
Write-Error "Generate shim failed"
return 1
}
exit 0
}
catch {
Write-Host $_
Write-Host $_.Exception
exit 1
}
+79
View File
@@ -0,0 +1,79 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $configuration = "Debug",
[string] $task,
[string] $verbosity = "minimal",
[string] $msbuildEngine = $null,
[switch] $restore,
[switch] $prepareMachine,
[switch] $help,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)
$ci = $true
$binaryLog = $true
$warnAsError = $true
. $PSScriptRoot\tools.ps1
function Print-Usage() {
Write-Host "Common settings:"
Write-Host " -task <value> Name of Arcade task (name of a project in SdkTasks directory of the Arcade SDK package)"
Write-Host " -restore Restore dependencies"
Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]"
Write-Host " -help Print help and exit"
Write-Host ""
Write-Host "Advanced settings:"
Write-Host " -prepareMachine Prepare machine for CI run"
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."
}
function Build([string]$target) {
$logSuffix = if ($target -eq "Execute") { "" } else { ".$target" }
$log = Join-Path $LogDir "$task$logSuffix.binlog"
$outputPath = Join-Path $ToolsetDir "$task\\"
MSBuild $taskProject `
/bl:$log `
/t:$target `
/p:Configuration=$configuration `
/p:RepoRoot=$RepoRoot `
/p:BaseIntermediateOutputPath=$outputPath `
@properties
}
try {
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
Print-Usage
ExitWithExitCode 1
}
$taskProject = GetSdkTaskProject $task
if (!(Test-Path $taskProject)) {
Write-Host "Unknown task: $task" -ForegroundColor Red
ExitWithExitCode 1
}
if ($restore) {
Build "Restore"
}
Build "Execute"
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}
ExitWithExitCode 0
@@ -0,0 +1,48 @@
parameters:
# Optional: dependencies of the job
dependsOn: ''
# Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool
pool: {}
# Optional: Include toolset dependencies in the generated graph files
includeToolset: false
jobs:
- job: Generate_Graph_Files
dependsOn: ${{ parameters.dependsOn }}
displayName: Generate Graph Files
pool: ${{ parameters.pool }}
variables:
# Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
# DotNet-AllOrgs-Darc-Pats provides: dn-bot-devdiv-dnceng-rw-code-pat
- group: Publish-Build-Assets
- group: DotNet-AllOrgs-Darc-Pats
- name: _GraphArguments
value: -gitHubPat $(BotAccount-dotnet-maestro-bot-PAT)
-azdoPat $(dn-bot-devdiv-dnceng-rw-code-pat)
-barToken $(MaestroAccessToken)
-outputFolder '$(Build.StagingDirectory)/GraphFiles/'
- ${{ if ne(parameters.includeToolset, 'false') }}:
- name: _GraphArguments
value: ${{ variables._GraphArguments }} -includeToolset
steps:
- task: PowerShell@2
displayName: Generate Graph Files
inputs:
filePath: eng\common\generate-graph-files.ps1
arguments: $(_GraphArguments)
continueOnError: true
- task: PublishBuildArtifacts@1
displayName: Publish Graph to Artifacts
inputs:
PathtoPublish: '$(Build.StagingDirectory)/GraphFiles'
PublishLocation: Container
ArtifactName: GraphFiles
continueOnError: true
condition: always()
+205
View File
@@ -0,0 +1,205 @@
parameters:
# Job schema parameters - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#job
cancelTimeoutInMinutes: ''
condition: ''
continueOnError: false
container: ''
dependsOn: ''
displayName: ''
steps: []
pool: ''
strategy: ''
timeoutInMinutes: ''
variables: []
workspace: ''
# Job base template specific parameters
# Optional: Enable installing Microbuild plugin
# if 'true', these "variables" must be specified in the variables object or as part of the queue matrix
# _TeamName - the name of your team
# _SignType - 'test' or 'real'
enableMicrobuild: false
# Optional: Include PublishBuildArtifacts task
enablePublishBuildArtifacts: false
# Optional: Enable publishing to the build asset registry
enablePublishBuildAssets: false
# Optional: Include PublishTestResults task
enablePublishTestResults: false
# Optional: enable sending telemetry
enableTelemetry: false
# Optional: define the helix repo for telemetry (example: 'dotnet/arcade')
helixRepo: ''
# Optional: define the helix type for telemetry (example: 'build/product/')
helixType: ''
# Required: name of the job
name: ''
# Optional: should run as a public build even in the internal project
# if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects.
runAsPublic: false
# Internal resources (telemetry, microbuild) can only be accessed from non-public projects,
# and some (Microbuild) should only be applied to non-PR cases for internal builds.
jobs:
- job: ${{ parameters.name }}
${{ if ne(parameters.cancelTimeoutInMinutes, '') }}:
cancelTimeoutInMinutes: ${{ parameters.cancelTimeoutInMinutes }}
${{ if ne(parameters.condition, '') }}:
condition: ${{ parameters.condition }}
${{ if ne(parameters.container, '') }}:
container: ${{ parameters.container }}
${{ if ne(parameters.continueOnError, '') }}:
continueOnError: ${{ parameters.continueOnError }}
${{ if ne(parameters.dependsOn, '') }}:
dependsOn: ${{ parameters.dependsOn }}
${{ if ne(parameters.displayName, '') }}:
displayName: ${{ parameters.displayName }}
${{ if ne(parameters.pool, '') }}:
pool: ${{ parameters.pool }}
${{ if ne(parameters.strategy, '') }}:
strategy: ${{ parameters.strategy }}
${{ if ne(parameters.timeoutInMinutes, '') }}:
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
variables:
- ${{ if eq(parameters.enableTelemetry, 'true') }}:
- name: DOTNET_CLI_TELEMETRY_PROFILE
value: '$(Build.Repository.Uri)'
- ${{ each variable in parameters.variables }}:
# handle name-value variable syntax
# example:
# - name: [key]
# value: [value]
- ${{ if ne(variable.name, '') }}:
- name: ${{ variable.name }}
value: ${{ variable.value }}
# handle variable groups
- ${{ if ne(variable.group, '') }}:
- group: ${{ variable.group }}
# handle key-value variable syntax.
# example:
# - [key]: [value]
- ${{ if and(eq(variable.name, ''), eq(variable.group, '')) }}:
- ${{ each pair in variable }}:
- name: ${{ pair.key }}
value: ${{ pair.value }}
# DotNet-HelixApi-Access provides 'HelixApiAccessToken' for internal builds
- ${{ if and(eq(parameters.enableTelemetry, 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-HelixApi-Access
${{ if ne(parameters.workspace, '') }}:
workspace: ${{ parameters.workspace }}
steps:
- ${{ if eq(parameters.enableTelemetry, 'true') }}:
# Telemetry tasks are built from https://github.com/dotnet/arcade-extensions
- task: sendStartTelemetry@0
displayName: 'Send Helix Start Telemetry'
inputs:
helixRepo: ${{ parameters.helixRepo }}
${{ if ne(parameters.helixType, '') }}:
helixType: ${{ parameters.helixType }}
buildConfig: $(_BuildConfig)
runAsPublic: ${{ parameters.runAsPublic }}
continueOnError: ${{ parameters.continueOnError }}
condition: always()
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: MicroBuildSigningPlugin@2
displayName: Install MicroBuild plugin
inputs:
signType: $(_SignType)
zipSources: false
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
env:
TeamName: $(_TeamName)
continueOnError: ${{ parameters.continueOnError }}
condition: and(succeeded(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT'))
- ${{ each step in parameters.steps }}:
- ${{ step }}
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: MicroBuildCleanup@1
displayName: Execute Microbuild cleanup tasks
condition: and(always(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT'))
continueOnError: ${{ parameters.continueOnError }}
env:
TeamName: $(_TeamName)
- ${{ if eq(parameters.enableTelemetry, 'true') }}:
# Telemetry tasks are built from https://github.com/dotnet/arcade-extensions
- task: sendEndTelemetry@0
displayName: 'Send Helix End Telemetry'
continueOnError: ${{ parameters.continueOnError }}
condition: always()
- ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}:
- task: PublishBuildArtifacts@1
displayName: Publish Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)'
PublishLocation: Container
ArtifactName: $(Agent.Os)_$(Agent.JobName)
continueOnError: true
condition: always()
- ${{ if eq(parameters.enablePublishTestResults, 'true') }}:
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'xUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
condition: always()
- ${{ if and(eq(parameters.enablePublishBuildAssets, true), ne(variables['_PublishUsingPipelines'], 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: CopyFiles@2
displayName: Gather Asset Manifests
inputs:
SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/AssetManifest'
TargetFolder: '$(Build.StagingDirectory)/AssetManifests'
continueOnError: ${{ parameters.continueOnError }}
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
- task: PublishBuildArtifacts@1
displayName: Push Asset Manifests
inputs:
PathtoPublish: '$(Build.StagingDirectory)/AssetManifests'
PublishLocation: Container
ArtifactName: AssetManifests
continueOnError: ${{ parameters.continueOnError }}
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
@@ -0,0 +1,70 @@
parameters:
configuration: 'Debug'
# Optional: condition for the job to run
condition: ''
# Optional: 'true' if future jobs should run even if this job fails
continueOnError: false
# Optional: dependencies of the job
dependsOn: ''
# Optional: Include PublishBuildArtifacts task
enablePublishBuildArtifacts: false
# Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool
pool: {}
# Optional: should run as a public build even in the internal project
# if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects.
runAsPublic: false
# Optional: whether the build's artifacts will be published using release pipelines or direct feed publishing
publishUsingPipelines: false
jobs:
- job: Asset_Registry_Publish
dependsOn: ${{ parameters.dependsOn }}
displayName: Publish to Build Asset Registry
pool: ${{ parameters.pool }}
variables:
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- name: _BuildConfig
value: ${{ parameters.configuration }}
- group: Publish-Build-Assets
steps:
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: DownloadBuildArtifacts@0
displayName: Download artifact
inputs:
artifactName: AssetManifests
downloadPath: '$(Build.StagingDirectory)/Download'
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
- task: PowerShell@2
displayName: Publish Build Assets
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet
/p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests'
/p:BuildAssetRegistryToken=$(MaestroAccessToken)
/p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com
/p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }}
/p:Configuration=$(_BuildConfig)
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
- ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}:
- task: PublishBuildArtifacts@1
displayName: Publish Logs to VSTS
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)'
PublishLocation: Container
ArtifactName: $(Agent.Os)_PublishBuildAssets
continueOnError: true
condition: always()
+90
View File
@@ -0,0 +1,90 @@
parameters:
# Optional: 'true' if failures in job.yml job should not fail the job
continueOnError: false
# Optional: Enable installing Microbuild plugin
# if 'true', these "variables" must be specified in the variables object or as part of the queue matrix
# _TeamName - the name of your team
# _SignType - 'test' or 'real'
enableMicrobuild: false
# Optional: Include PublishBuildArtifacts task
enablePublishBuildArtifacts: false
# Optional: Enable publishing to the build asset registry
enablePublishBuildAssets: false
# Optional: Enable publishing using release pipelines
enablePublishUsingPipelines: false
graphFileGeneration:
# Optional: Enable generating the graph files at the end of the build
enabled: false
# Optional: Include toolset dependencies in the generated graph files
includeToolset: false
# Optional: Include PublishTestResults task
enablePublishTestResults: false
# Optional: enable sending telemetry
# if enabled then the 'helixRepo' parameter should also be specified
enableTelemetry: false
# Required: A collection of jobs to run - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#job
jobs: []
# Optional: define the helix repo for telemetry (example: 'dotnet/arcade')
helixRepo: ''
# Optional: Override automatically derived dependsOn value for "publish build assets" job
publishBuildAssetsDependsOn: ''
# Optional: should run as a public build even in the internal project
# if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects.
runAsPublic: false
# Internal resources (telemetry, microbuild) can only be accessed from non-public projects,
# and some (Microbuild) should only be applied to non-PR cases for internal builds.
jobs:
- ${{ each job in parameters.jobs }}:
- template: ../job/job.yml
parameters:
# pass along parameters
${{ each parameter in parameters }}:
${{ if ne(parameter.key, 'jobs') }}:
${{ parameter.key }}: ${{ parameter.value }}
# pass along job properties
${{ each property in job }}:
${{ if ne(property.key, 'job') }}:
${{ property.key }}: ${{ property.value }}
name: ${{ job.job }}
- ${{ if and(eq(parameters.enablePublishBuildAssets, true), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: ../job/publish-build-assets.yml
parameters:
continueOnError: ${{ parameters.continueOnError }}
dependsOn:
- ${{ if ne(parameters.publishBuildAssetsDependsOn, '') }}:
- ${{ each job in parameters.publishBuildAssetsDependsOn }}:
- ${{ job.job }}
- ${{ if eq(parameters.publishBuildAssetsDependsOn, '') }}:
- ${{ each job in parameters.jobs }}:
- ${{ job.job }}
pool:
vmImage: vs2017-win2016
runAsPublic: ${{ parameters.runAsPublic }}
publishUsingPipelines: ${{ parameters.enablePublishUsingPipelines }}
enablePublishBuildArtifacts: ${{ parameters.enablePublishBuildArtifacts }}
- ${{ if and(eq(parameters.graphFileGeneration.enabled, true), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: ../job/generate-graph-files.yml
parameters:
continueOnError: ${{ parameters.continueOnError }}
includeToolset: ${{ parameters.graphFileGeneration.includeToolset }}
dependsOn:
- Asset_Registry_Publish
pool:
vmImage: vs2017-win2016
+130
View File
@@ -0,0 +1,130 @@
parameters:
# Optional: Clean sources before building
clean: true
# Optional: Git fetch depth
fetchDepth: ''
# Optional: name of the phase (not specifying phase name may cause name collisions)
name: ''
# Optional: display name of the phase
displayName: ''
# Optional: condition for the job to run
condition: ''
# Optional: dependencies of the phase
dependsOn: ''
# Required: A defined YAML queue
queue: {}
# Required: build steps
steps: []
# Optional: variables
variables: {}
# Optional: should run as a public build even in the internal project
# if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects.
runAsPublic: false
## Telemetry variables
# Optional: enable sending telemetry
# if 'true', these "variables" must be specified in the variables object or as part of the queue matrix
# _HelixBuildConfig - differentiate between Debug, Release, other
# _HelixSource - Example: build/product
# _HelixType - Example: official/dotnet/arcade/$(Build.SourceBranch)
enableTelemetry: false
# Optional: Enable installing Microbuild plugin
# if 'true', these "variables" must be specified in the variables object or as part of the queue matrix
# _TeamName - the name of your team
# _SignType - 'test' or 'real'
enableMicrobuild: false
# Internal resources (telemetry, microbuild) can only be accessed from non-public projects,
# and some (Microbuild) should only be applied to non-PR cases for internal builds.
phases:
- phase: ${{ parameters.name }}
${{ if ne(parameters.displayName, '') }}:
displayName: ${{ parameters.displayName }}
${{ if ne(parameters.condition, '') }}:
condition: ${{ parameters.condition }}
${{ if ne(parameters.dependsOn, '') }}:
dependsOn: ${{ parameters.dependsOn }}
queue: ${{ parameters.queue }}
${{ if ne(parameters.variables, '') }}:
variables:
${{ insert }}: ${{ parameters.variables }}
steps:
- checkout: self
clean: ${{ parameters.clean }}
${{ if ne(parameters.fetchDepth, '') }}:
fetchDepth: ${{ parameters.fetchDepth }}
- ${{ if eq(parameters.enableTelemetry, 'true') }}:
- template: /eng/common/templates/steps/telemetry-start.yml
parameters:
buildConfig: $(_HelixBuildConfig)
helixSource: $(_HelixSource)
helixType: $(_HelixType)
runAsPublic: ${{ parameters.runAsPublic }}
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
# Internal only resource, and Microbuild signing shouldn't be applied to PRs.
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: MicroBuildSigningPlugin@2
displayName: Install MicroBuild plugin
inputs:
signType: $(_SignType)
zipSources: false
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
env:
TeamName: $(_TeamName)
continueOnError: false
condition: and(succeeded(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT'))
# Run provided build steps
- ${{ parameters.steps }}
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
# Internal only resources
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: MicroBuildCleanup@1
displayName: Execute Microbuild cleanup tasks
condition: and(always(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT'))
env:
TeamName: $(_TeamName)
- ${{ if eq(parameters.enableTelemetry, 'true') }}:
- template: /eng/common/templates/steps/telemetry-end.yml
parameters:
helixSource: $(_HelixSource)
helixType: $(_HelixType)
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: CopyFiles@2
displayName: Gather Asset Manifests
inputs:
SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/AssetManifest'
TargetFolder: '$(Build.StagingDirectory)/AssetManifests'
continueOnError: false
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
- task: PublishBuildArtifacts@1
displayName: Push Asset Manifests
inputs:
PathtoPublish: '$(Build.StagingDirectory)/AssetManifests'
PublishLocation: Container
ArtifactName: AssetManifests
continueOnError: false
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
@@ -0,0 +1,51 @@
parameters:
dependsOn: ''
queue: {}
configuration: 'Debug'
condition: succeeded()
continueOnError: false
runAsPublic: false
publishUsingPipelines: false
phases:
- phase: Asset_Registry_Publish
displayName: Publish to Build Asset Registry
dependsOn: ${{ parameters.dependsOn }}
queue: ${{ parameters.queue }}
variables:
_BuildConfig: ${{ parameters.configuration }}
steps:
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: DownloadBuildArtifacts@0
displayName: Download artifact
inputs:
artifactName: AssetManifests
downloadPath: '$(Build.StagingDirectory)/Download'
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
- task: AzureKeyVault@1
inputs:
azureSubscription: 'DotNet-Engineering-Services_KeyVault'
KeyVaultName: EngKeyVault
SecretsFilter: 'MaestroAccessToken'
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
- task: PowerShell@2
displayName: Publish Build Assets
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet
/p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests'
/p:BuildAssetRegistryToken=$(MaestroAccessToken)
/p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com
/p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }}
/p:Configuration=$(_BuildConfig)
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
- task: PublishBuildArtifacts@1
displayName: Publish Logs to VSTS
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)'
PublishLocation: Container
ArtifactName: $(Agent.Os)_Asset_Registry_Publish
continueOnError: true
condition: always()
@@ -0,0 +1,12 @@
# build-reason.yml
# Description: runs steps if build.reason condition is valid. conditions is a string of valid build reasons
# to include steps (',' separated).
parameters:
conditions: ''
steps: []
steps:
- ${{ if and( not(startsWith(parameters.conditions, 'not')), contains(parameters.conditions, variables['build.reason'])) }}:
- ${{ parameters.steps }}
- ${{ if and( startsWith(parameters.conditions, 'not'), not(contains(parameters.conditions, variables['build.reason']))) }}:
- ${{ parameters.steps }}
@@ -0,0 +1,7 @@
parameters:
agentOs: ''
steps: []
steps:
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
- ${{ parameters.steps }}
@@ -0,0 +1,7 @@
parameters:
agentOs: ''
steps: []
steps:
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- ${{ parameters.steps }}
@@ -0,0 +1,33 @@
parameters:
# if parameter1 equals parameter 2, run 'ifScript' command, else run 'elsescript' command
parameter1: ''
parameter2: ''
ifScript: ''
elseScript: ''
# name of script step
name: Script
# display name of script step
displayName: If-Equal-Else Script
# environment
env: {}
# conditional expression for step execution
condition: ''
steps:
- ${{ if and(ne(parameters.ifScript, ''), eq(parameters.parameter1, parameters.parameter2)) }}:
- script: ${{ parameters.ifScript }}
name: ${{ parameters.name }}
displayName: ${{ parameters.displayName }}
env: ${{ parameters.env }}
condition: ${{ parameters.condition }}
- ${{ if and(ne(parameters.elseScript, ''), ne(parameters.parameter1, parameters.parameter2)) }}:
- script: ${{ parameters.elseScript }}
name: ${{ parameters.name }}
displayName: ${{ parameters.displayName }}
env: ${{ parameters.env }}
condition: ${{ parameters.condition }}
@@ -0,0 +1,91 @@
# Please remember to update the documentation if you make changes to these parameters!
parameters:
HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/
HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/'
HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number
HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/ for a list of queues
HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group
HelixConfiguration: '' # optional -- additional property attached to a job
HelixPreCommands: '' # optional -- commands to run before Helix work item execution
HelixPostCommands: '' # optional -- commands to run after Helix work item execution
WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects
WorkItemCommand: '' # optional -- a command to execute on the payload; requires WorkItemDirectory; incompatible with XUnitProjects
WorkItemTimeout: '' # optional -- a timeout in seconds for the work item command; requires WorkItemDirectory; incompatible with XUnitProjects
CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload
XUnitProjects: '' # optional -- semicolon delimited list of XUnitProjects to parse and send to Helix; requires XUnitRuntimeTargetFramework, XUnitPublishTargetFramework, XUnitRunnerVersion, and IncludeDotNetCli=true
XUnitWorkItemTimeout: '' # optional -- the workitem timeout in seconds for all workitems created from the xUnit projects specified by XUnitProjects
XUnitPublishTargetFramework: '' # optional -- framework to use to publish your xUnit projects
XUnitRuntimeTargetFramework: '' # optional -- framework to use for the xUnit console runner
XUnitRunnerVersion: '' # optional -- version of the xUnit nuget package you wish to use on Helix; required for XUnitProjects
IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion
DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json
DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json
EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control
WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget."
IsExternal: false # [DEPRECATED] -- doesn't do anything, jobs are external if HelixAccessToken is empty and Creator is set
Creator: '' # optional -- if the build is external, use this to specify who is sending the job
DisplayNamePrefix: 'Run Tests' # optional -- rename the beginning of the displayName of the steps in AzDO
condition: succeeded() # optional -- condition for step to execute; defaults to succeeded()
continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false
steps:
- powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj /restore /t:Test /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"'
displayName: ${{ parameters.DisplayNamePrefix }} (Windows)
env:
BuildConfig: $(_BuildConfig)
HelixSource: ${{ parameters.HelixSource }}
HelixType: ${{ parameters.HelixType }}
HelixBuild: ${{ parameters.HelixBuild }}
HelixConfiguration: ${{ parameters.HelixConfiguration }}
HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
HelixAccessToken: ${{ parameters.HelixAccessToken }}
HelixPreCommands: ${{ parameters.HelixPreCommands }}
HelixPostCommands: ${{ parameters.HelixPostCommands }}
WorkItemDirectory: ${{ parameters.WorkItemDirectory }}
WorkItemCommand: ${{ parameters.WorkItemCommand }}
WorkItemTimeout: ${{ parameters.WorkItemTimeout }}
CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }}
XUnitProjects: ${{ parameters.XUnitProjects }}
XUnitWorkItemTimeout: ${{ parameters.XUnitWorkItemTimeout }}
XUnitPublishTargetFramework: ${{ parameters.XUnitPublishTargetFramework }}
XUnitRuntimeTargetFramework: ${{ parameters.XUnitRuntimeTargetFramework }}
XUnitRunnerVersion: ${{ parameters.XUnitRunnerVersion }}
IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }}
DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }}
DotNetCliVersion: ${{ parameters.DotNetCliVersion }}
EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }}
WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }}
Creator: ${{ parameters.Creator }}
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT'))
continueOnError: ${{ parameters.continueOnError }}
- script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/helixpublish.proj /restore /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog
displayName: ${{ parameters.DisplayNamePrefix }} (Unix)
env:
BuildConfig: $(_BuildConfig)
HelixSource: ${{ parameters.HelixSource }}
HelixType: ${{ parameters.HelixType }}
HelixBuild: ${{ parameters.HelixBuild }}
HelixConfiguration: ${{ parameters.HelixConfiguration }}
HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
HelixAccessToken: ${{ parameters.HelixAccessToken }}
HelixPreCommands: ${{ parameters.HelixPreCommands }}
HelixPostCommands: ${{ parameters.HelixPostCommands }}
WorkItemDirectory: ${{ parameters.WorkItemDirectory }}
WorkItemCommand: ${{ parameters.WorkItemCommand }}
WorkItemTimeout: ${{ parameters.WorkItemTimeout }}
CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }}
XUnitProjects: ${{ parameters.XUnitProjects }}
XUnitWorkItemTimeout: ${{ parameters.XUnitWorkItemTimeout }}
XUnitPublishTargetFramework: ${{ parameters.XUnitPublishTargetFramework }}
XUnitRuntimeTargetFramework: ${{ parameters.XUnitRuntimeTargetFramework }}
XUnitRunnerVersion: ${{ parameters.XUnitRunnerVersion }}
IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }}
DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }}
DotNetCliVersion: ${{ parameters.DotNetCliVersion }}
EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }}
WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }}
Creator: ${{ parameters.Creator }}
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
condition: and(${{ parameters.condition }}, ne(variables['Agent.Os'], 'Windows_NT'))
continueOnError: ${{ parameters.continueOnError }}
@@ -0,0 +1,102 @@
parameters:
maxRetries: 5
retryDelay: 10 # in seconds
steps:
- bash: |
if [ "$AGENT_JOBSTATUS" = "Succeeded" ] || [ "$AGENT_JOBSTATUS" = "PartiallySucceeded" ]; then
errorCount=0
else
errorCount=1
fi
warningCount=0
curlStatus=1
retryCount=0
# retry loop to harden against spotty telemetry connections
# we don't retry successes and 4xx client errors
until [[ $curlStatus -eq 0 || ( $curlStatus -ge 400 && $curlStatus -le 499 ) || $retryCount -ge $MaxRetries ]]
do
if [ $retryCount -gt 0 ]; then
echo "Failed to send telemetry to Helix; waiting $RetryDelay seconds before retrying..."
sleep $RetryDelay
fi
# create a temporary file for curl output
res=`mktemp`
curlResult=`
curl --verbose --output $res --write-out "%{http_code}"\
-H 'Content-Type: application/json' \
-H "X-Helix-Job-Token: $Helix_JobToken" \
-H 'Content-Length: 0' \
-X POST -G "https://helix.dot.net/api/2018-03-14/telemetry/job/build/$Helix_WorkItemId/finish" \
--data-urlencode "errorCount=$errorCount" \
--data-urlencode "warningCount=$warningCount"`
curlStatus=$?
if [ $curlStatus -eq 0 ]; then
if [ $curlResult -gt 299 ] || [ $curlResult -lt 200 ]; then
curlStatus=$curlResult
fi
fi
let retryCount++
done
if [ $curlStatus -ne 0 ]; then
echo "Failed to Send Build Finish information after $retryCount retries"
vstsLogOutput="vso[task.logissue type=error;sourcepath=templates/steps/telemetry-end.yml;code=1;]Failed to Send Build Finish information: $curlStatus"
echo "##$vstsLogOutput"
exit 1
fi
displayName: Send Unix Build End Telemetry
env:
# defined via VSTS variables in start-job.sh
Helix_JobToken: $(Helix_JobToken)
Helix_WorkItemId: $(Helix_WorkItemId)
MaxRetries: ${{ parameters.maxRetries }}
RetryDelay: ${{ parameters.retryDelay }}
condition: and(always(), ne(variables['Agent.Os'], 'Windows_NT'))
- powershell: |
if (($env:Agent_JobStatus -eq 'Succeeded') -or ($env:Agent_JobStatus -eq 'PartiallySucceeded')) {
$ErrorCount = 0
} else {
$ErrorCount = 1
}
$WarningCount = 0
# Basic retry loop to harden against server flakiness
$retryCount = 0
while ($retryCount -lt $env:MaxRetries) {
try {
Invoke-RestMethod -Uri "https://helix.dot.net/api/2018-03-14/telemetry/job/build/$env:Helix_WorkItemId/finish?errorCount=$ErrorCount&warningCount=$WarningCount" -Method Post -ContentType "application/json" -Body "" `
-Headers @{ 'X-Helix-Job-Token'=$env:Helix_JobToken }
break
}
catch {
$statusCode = $_.Exception.Response.StatusCode.value__
if ($statusCode -ge 400 -and $statusCode -le 499) {
Write-Host "##vso[task.logissue]error Failed to send telemetry to Helix (status code $statusCode); not retrying (4xx client error)"
Write-Host "##vso[task.logissue]error ", $_.Exception.GetType().FullName, $_.Exception.Message
exit 1
}
Write-Host "Failed to send telemetry to Helix (status code $statusCode); waiting $env:RetryDelay seconds before retrying..."
$retryCount++
sleep $env:RetryDelay
continue
}
}
if ($retryCount -ge $env:MaxRetries) {
Write-Host "##vso[task.logissue]error Failed to send telemetry to Helix after $retryCount retries."
exit 1
}
displayName: Send Windows Build End Telemetry
env:
# defined via VSTS variables in start-job.ps1
Helix_JobToken: $(Helix_JobToken)
Helix_WorkItemId: $(Helix_WorkItemId)
MaxRetries: ${{ parameters.maxRetries }}
RetryDelay: ${{ parameters.retryDelay }}
condition: and(always(),eq(variables['Agent.Os'], 'Windows_NT'))
@@ -0,0 +1,241 @@
parameters:
helixSource: 'undefined_defaulted_in_telemetry.yml'
helixType: 'undefined_defaulted_in_telemetry.yml'
buildConfig: ''
runAsPublic: false
maxRetries: 5
retryDelay: 10 # in seconds
steps:
- ${{ if and(eq(parameters.runAsPublic, 'false'), not(eq(variables['System.TeamProject'], 'public'))) }}:
- task: AzureKeyVault@1
inputs:
azureSubscription: 'HelixProd_KeyVault'
KeyVaultName: HelixProdKV
SecretsFilter: 'HelixApiAccessToken'
condition: always()
- bash: |
# create a temporary file
jobInfo=`mktemp`
# write job info content to temporary file
cat > $jobInfo <<JobListStuff
{
"QueueId": "$QueueId",
"Source": "$Source",
"Type": "$Type",
"Build": "$Build",
"Attempt": "$Attempt",
"Properties": {
"operatingSystem": "$OperatingSystem",
"configuration": "$Configuration"
}
}
JobListStuff
cat $jobInfo
# create a temporary file for curl output
res=`mktemp`
accessTokenParameter="?access_token=$HelixApiAccessToken"
curlStatus=1
retryCount=0
# retry loop to harden against spotty telemetry connections
# we don't retry successes and 4xx client errors
until [[ $curlStatus -eq 0 || ( $curlStatus -ge 400 && $curlStatus -le 499 ) || $retryCount -ge $MaxRetries ]]
do
if [ $retryCount -gt 0 ]; then
echo "Failed to send telemetry to Helix; waiting $RetryDelay seconds before retrying..."
sleep $RetryDelay
fi
curlResult=`
cat $jobInfo |\
curl --trace - --verbose --output $res --write-out "%{http_code}" \
-H 'Content-Type: application/json' \
-X POST "https://helix.dot.net/api/2018-03-14/telemetry/job$accessTokenParameter" -d @-`
curlStatus=$?
if [ $curlStatus -eq 0 ]; then
if [ $curlResult -gt 299 ] || [ $curlResult -lt 200 ]; then
curlStatus=$curlResult
fi
fi
let retryCount++
done
curlResult=`cat $res`
# validate status of curl command
if [ $curlStatus -ne 0 ]; then
echo "Failed To Send Job Start information after $retryCount retries"
# We have to append the ## vso prefix or vso will pick up the command when it dumps the inline script into the shell
vstsLogOutput="vso[task.logissue type=error;sourcepath=telemetry/start-job.sh;code=1;]Failed to Send Job Start information: $curlStatus"
echo "##$vstsLogOutput"
exit 1
fi
# Set the Helix_JobToken variable
export Helix_JobToken=`echo $curlResult | xargs echo` # Strip Quotes
echo "##vso[task.setvariable variable=Helix_JobToken;issecret=true;]$Helix_JobToken"
displayName: Send Unix Job Start Telemetry
env:
HelixApiAccessToken: $(HelixApiAccessToken)
Source: ${{ parameters.helixSource }}
Type: ${{ parameters.helixType }}
Build: $(Build.BuildNumber)
QueueId: $(Agent.Os)
Attempt: 1
OperatingSystem: $(Agent.Os)
Configuration: ${{ parameters.buildConfig }}
MaxRetries: ${{ parameters.maxRetries }}
RetryDelay: ${{ parameters.retryDelay }}
condition: and(always(), ne(variables['Agent.Os'], 'Windows_NT'))
- bash: |
curlStatus=1
retryCount=0
# retry loop to harden against spotty telemetry connections
# we don't retry successes and 4xx client errors
until [[ $curlStatus -eq 0 || ( $curlStatus -ge 400 && $curlStatus -le 499 ) || $retryCount -ge $MaxRetries ]]
do
if [ $retryCount -gt 0 ]; then
echo "Failed to send telemetry to Helix; waiting $RetryDelay seconds before retrying..."
sleep $RetryDelay
fi
res=`mktemp`
curlResult=`
curl --verbose --output $res --write-out "%{http_code}"\
-H 'Content-Type: application/json' \
-H "X-Helix-Job-Token: $Helix_JobToken" \
-H 'Content-Length: 0' \
-X POST -G "https://helix.dot.net/api/2018-03-14/telemetry/job/build" \
--data-urlencode "buildUri=$BuildUri"`
curlStatus=$?
if [ $curlStatus -eq 0 ]; then
if [ $curlResult -gt 299 ] || [ $curlResult -lt 200 ]; then
curlStatus=$curlResult
fi
fi
curlResult=`cat $res`
let retryCount++
done
# validate status of curl command
if [ $curlStatus -ne 0 ]; then
echo "Failed to Send Build Start information after $retryCount retries"
vstsLogOutput="vso[task.logissue type=error;sourcepath=telemetry/build/start.sh;code=1;]Failed to Send Build Start information: $curlStatus"
echo "##$vstsLogOutput"
exit 1
fi
export Helix_WorkItemId=`echo $curlResult | xargs echo` # Strip Quotes
echo "##vso[task.setvariable variable=Helix_WorkItemId]$Helix_WorkItemId"
displayName: Send Unix Build Start Telemetry
env:
BuildUri: $(System.TaskDefinitionsUri)$(System.TeamProject)/_build/index?buildId=$(Build.BuildId)&_a=summary
Helix_JobToken: $(Helix_JobToken)
MaxRetries: ${{ parameters.maxRetries }}
RetryDelay: ${{ parameters.retryDelay }}
condition: and(always(), ne(variables['Agent.Os'], 'Windows_NT'))
- powershell: |
$jobInfo = [pscustomobject]@{
QueueId=$env:QueueId;
Source=$env:Source;
Type=$env:Type;
Build=$env:Build;
Attempt=$env:Attempt;
Properties=[pscustomobject]@{ operatingSystem=$env:OperatingSystem; configuration=$env:Configuration };
}
$jobInfoJson = $jobInfo | ConvertTo-Json
if ($env:HelixApiAccessToken) {
$accessTokenParameter="?access_token=$($env:HelixApiAccessToken)"
}
Write-Host "Job Info: $jobInfoJson"
# Basic retry loop to harden against server flakiness
$retryCount = 0
while ($retryCount -lt $env:MaxRetries) {
try {
$jobToken = Invoke-RestMethod -Uri "https://helix.dot.net/api/2018-03-14/telemetry/job$($accessTokenParameter)" -Method Post -ContentType "application/json" -Body $jobInfoJson
break
}
catch {
$statusCode = $_.Exception.Response.StatusCode.value__
if ($statusCode -ge 400 -and $statusCode -le 499) {
Write-Host "##vso[task.logissue]error Failed to send telemetry to Helix (status code $statusCode); not retrying (4xx client error)"
Write-Host "##vso[task.logissue]error ", $_.Exception.GetType().FullName, $_.Exception.Message
exit 1
}
Write-Host "Failed to send telemetry to Helix (status code $statusCode); waiting $env:RetryDelay seconds before retrying..."
$retryCount++
sleep $env:RetryDelay
continue
}
}
if ($retryCount -ge $env:MaxRetries) {
Write-Host "##vso[task.logissue]error Failed to send telemetry to Helix after $retryCount retries."
exit 1
}
$env:Helix_JobToken = $jobToken
Write-Host "##vso[task.setvariable variable=Helix_JobToken;issecret=true;]$env:Helix_JobToken"
env:
HelixApiAccessToken: $(HelixApiAccessToken)
Source: ${{ parameters.helixSource }}
Type: ${{ parameters.helixType }}
Build: $(Build.BuildNumber)
QueueId: $(Agent.Os)
Attempt: 1
OperatingSystem: $(Agent.Os)
Configuration: ${{ parameters.buildConfig }}
MaxRetries: ${{ parameters.maxRetries }}
RetryDelay: ${{ parameters.retryDelay }}
condition: and(always(), eq(variables['Agent.Os'], 'Windows_NT'))
displayName: Send Windows Job Start Telemetry
- powershell: |
# Basic retry loop to harden against server flakiness
$retryCount = 0
while ($retryCount -lt $env:MaxRetries) {
try {
$workItemId = Invoke-RestMethod -Uri "https://helix.dot.net/api/2018-03-14/telemetry/job/build?buildUri=$([Net.WebUtility]::UrlEncode($env:BuildUri))" -Method Post -ContentType "application/json" -Body "" `
-Headers @{ 'X-Helix-Job-Token'=$env:Helix_JobToken }
break
}
catch {
$statusCode = $_.Exception.Response.StatusCode.value__
if ($statusCode -ge 400 -and $statusCode -le 499) {
Write-Host "##vso[task.logissue]error Failed to send telemetry to Helix (status code $statusCode); not retrying (4xx client error)"
Write-Host "##vso[task.logissue]error ", $_.Exception.GetType().FullName, $_.Exception.Message
exit 1
}
Write-Host "Failed to send telemetry to Helix (status code $statusCode); waiting $env:RetryDelay seconds before retrying..."
$retryCount++
sleep $env:RetryDelay
continue
}
}
if ($retryCount -ge $env:MaxRetries) {
Write-Host "##vso[task.logissue]error Failed to send telemetry to Helix after $retryCount retries."
exit 1
}
$env:Helix_WorkItemId = $workItemId
Write-Host "##vso[task.setvariable variable=Helix_WorkItemId]$env:Helix_WorkItemId"
displayName: Send Windows Build Start Telemetry
env:
BuildUri: $(System.TaskDefinitionsUri)$(System.TeamProject)/_build/index?buildId=$(Build.BuildId)&_a=summary
Helix_JobToken: $(Helix_JobToken)
MaxRetries: ${{ parameters.maxRetries }}
RetryDelay: ${{ parameters.retryDelay }}
condition: and(always(), eq(variables['Agent.Os'], 'Windows_NT'))
+638
View File
@@ -0,0 +1,638 @@
# Initialize variables if they aren't already defined.
# These may be defined as parameters of the importing script, or set after importing this script.
# CI mode - set to true on CI server for PR validation build or official build.
[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" }
# 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.
[bool]$binaryLog = if (Test-Path variable:binaryLog) { $binaryLog } else { $ci }
# 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
# This flag is meant as a temporary opt-opt for the feature while validate it across
# our consumers. It will be deleted in the future.
[bool]$pipelinesLog = if (Test-Path variable:pipelinesLog) { $pipelinesLog } else { $ci }
# Turns on machine preparation/clean up code that changes the machine state (e.g. kills build processes).
[bool]$prepareMachine = if (Test-Path variable:prepareMachine) { $prepareMachine } else { $false }
# True to restore toolsets and dependencies.
[bool]$restore = if (Test-Path variable:restore) { $restore } else { $true }
# Adjusts msbuild verbosity level.
[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 }
# Configures warning treatment in msbuild.
[bool]$warnAsError = if (Test-Path variable:warnAsError) { $warnAsError } else { $true }
# Specifies which msbuild engine to use for build: 'vs', 'dotnet' or unspecified (determined based on presence of tools.vs in global.json).
[string]$msbuildEngine = if (Test-Path variable:msbuildEngine) { $msbuildEngine } else { $null }
# True to attempt using .NET Core already that meets requirements specified in global.json
# installed on the machine instead of downloading one.
[bool]$useInstalledDotNetCli = if (Test-Path variable:useInstalledDotNetCli) { $useInstalledDotNetCli } else { $true }
# 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") }
set-strictmode -version 2.0
$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
}
}
function Unzip([string]$zipfile, [string]$outpath) {
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
}
# This will exec a process using the console and return it's exit code.
# This will not throw when the process fails.
# Returns process exit code.
function Exec-Process([string]$command, [string]$commandArgs) {
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = $command
$startInfo.Arguments = $commandArgs
$startInfo.UseShellExecute = $false
$startInfo.WorkingDirectory = Get-Location
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $startInfo
$process.Start() | Out-Null
$finished = $false
try {
while (-not $process.WaitForExit(100)) {
# Non-blocking loop done to allow ctr-c interrupts
}
$finished = $true
return $global:LASTEXITCODE = $process.ExitCode
}
finally {
# If we didn't finish then an error occured or the user hit ctrl-c. Either
# way kill the process
if (-not $finished) {
$process.Kill()
}
}
}
function Write-PipelineTaskError {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Message,
[Parameter(Mandatory = $false)]
[string]$Type = 'error',
[string]$ErrCode,
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput)
if(!$ci) {
if($Type -eq 'error') {
Write-Error $Message
return
}
elseif ($Type -eq 'warning') {
Write-Warning $Message
return
}
}
if(($Type -ne 'error') -and ($Type -ne 'warning')) {
Write-Host $Message
return
}
if(-not $PSBoundParameters.ContainsKey('Type')) {
$PSBoundParameters.Add('Type', 'error')
}
Write-LogIssue @PSBoundParameters
}
function Write-PipelineSetVariable {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Name,
[string]$Value,
[switch]$Secret,
[switch]$AsOutput)
if($ci) {
Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{
'variable' = $Name
'issecret' = $Secret
} -AsOutput:$AsOutput
}
}
function Write-PipelinePrependPath {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$Path,
[switch]$AsOutput)
if($ci) {
Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput
}
}
function InitializeDotNetCli([bool]$install) {
if (Test-Path variable:global:_DotNetInstallDir) {
return $global:_DotNetInstallDir
}
# Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism
$env:DOTNET_MULTILEVEL_LOOKUP=0
# Disable first run since we do not need all ASP.NET packages restored.
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
# Disable telemetry on CI.
if ($ci) {
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
}
# Source Build uses DotNetCoreSdkDir variable
if ($env:DotNetCoreSdkDir -ne $null) {
$env:DOTNET_INSTALL_DIR = $env:DotNetCoreSdkDir
}
# 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
if ($dotnetCmd -ne $null) {
$env:DOTNET_INSTALL_DIR = Split-Path $dotnetCmd.Path -Parent
}
}
$dotnetSdkVersion = $GlobalJson.tools.dotnet
# Use dotnet installation specified in DOTNET_INSTALL_DIR if it contains the required SDK version,
# otherwise install the dotnet CLI and SDK to repo local .dotnet directory to avoid potential permission issues.
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"
if (-not (Test-Path(Join-Path $dotnetRoot "sdk\$dotnetSdkVersion"))) {
if ($install) {
InstallDotNetSdk $dotnetRoot $dotnetSdkVersion
} else {
Write-PipelineTaskError "Unable to find dotnet with SDK version '$dotnetSdkVersion'"
ExitWithExitCode 1
}
}
$env:DOTNET_INSTALL_DIR = $dotnetRoot
}
# Add dotnet to PATH. This prevents any bare invocation of dotnet in custom
# build steps from using anything other than what we've downloaded.
# It also ensures that VS msbuild will use the downloaded sdk targets.
$env:PATH = "$dotnetRoot;$env:PATH"
# Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build
Write-PipelinePrependPath -Path $dotnetRoot
Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0'
Write-PipelineSetVariable -Name 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE' -Value '1'
return $global:_DotNetInstallDir = $dotnetRoot
}
function GetDotNetInstallScript([string] $dotnetRoot) {
$installScript = Join-Path $dotnetRoot "dotnet-install.ps1"
if (!(Test-Path $installScript)) {
Create-Directory $dotnetRoot
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile $installScript
}
return $installScript
}
function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $architecture = "") {
InstallDotNet $dotnetRoot $version $architecture
}
function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $architecture = "", [string] $runtime = "", [bool] $skipNonVersionedFiles = $false) { $installScript = GetDotNetInstallScript $dotnetRoot
$installScript = GetDotNetInstallScript $dotnetRoot
$installParameters = @{
Version = $version
InstallDir = $dotnetRoot
}
if ($architecture) { $installParameters.Architecture = $architecture }
if ($runtime) { $installParameters.Runtime = $runtime }
if ($skipNonVersionedFiles) { $installParameters.SkipNonVersionedFiles = $skipNonVersionedFiles }
& $installScript @installParameters
if ($lastExitCode -ne 0) {
Write-PipelineTaskError -Message "Failed to install dotnet cli (exit code '$lastExitCode')."
ExitWithExitCode $lastExitCode
}
}
#
# Locates Visual Studio MSBuild installation.
# The preference order for MSBuild to use is as follows:
#
# 1. MSBuild from an active VS command prompt
# 2. MSBuild from a compatible VS installation
# 3. MSBuild from the xcopy tool package
#
# Returns full path to msbuild.exe.
# Throws on failure.
#
function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = $null) {
if (Test-Path variable:global:_MSBuildExe) {
return $global:_MSBuildExe
}
if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs }
$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
if ($msbuildCmd -ne $null) {
# Workaround for https://github.com/dotnet/roslyn/issues/35793
# Due to this issue $msbuildCmd.Version returns 0.0.0.0 for msbuild.exe 16.2+
$msbuildVersion = [Version]::new((Get-Item $msbuildCmd.Path).VersionInfo.ProductVersion.Split(@('-', '+'))[0])
if ($msbuildVersion -ge $vsMinVersion) {
return $global:_MSBuildExe = $msbuildCmd.Path
}
# Report error - the developer environment is initialized with incompatible VS version.
throw "Developer Command Prompt for VS $($env:VisualStudioVersion) is not recent enough. Please upgrade to $vsMinVersionStr or build from a plain CMD window"
}
}
# Locate Visual Studio installation or download x-copy msbuild.
$vsInfo = LocateVisualStudio $vsRequirements
if ($vsInfo -ne $null) {
$vsInstallDir = $vsInfo.installationPath
$vsMajorVersion = $vsInfo.installationVersion.Split('.')[0]
InitializeVisualStudioEnvironmentVariables $vsInstallDir $vsMajorVersion
} else {
if (Get-Member -InputObject $GlobalJson.tools -Name "xcopy-msbuild") {
$xcopyMSBuildVersion = $GlobalJson.tools.'xcopy-msbuild'
$vsMajorVersion = $xcopyMSBuildVersion.Split('.')[0]
} else {
$vsMajorVersion = $vsMinVersion.Major
$xcopyMSBuildVersion = "$vsMajorVersion.$($vsMinVersion.Minor).0-alpha"
}
$vsInstallDir = InitializeXCopyMSBuild $xcopyMSBuildVersion $install
if ($vsInstallDir -eq $null) {
throw "Unable to find Visual Studio that has required version and components installed"
}
}
$msbuildVersionDir = if ([int]$vsMajorVersion -lt 16) { "$vsMajorVersion.0" } else { "Current" }
return $global:_MSBuildExe = Join-Path $vsInstallDir "MSBuild\$msbuildVersionDir\Bin\msbuild.exe"
}
function InitializeVisualStudioEnvironmentVariables([string] $vsInstallDir, [string] $vsMajorVersion) {
$env:VSINSTALLDIR = $vsInstallDir
Set-Item "env:VS$($vsMajorVersion)0COMNTOOLS" (Join-Path $vsInstallDir "Common7\Tools\")
$vsSdkInstallDir = Join-Path $vsInstallDir "VSSDK\"
if (Test-Path $vsSdkInstallDir) {
Set-Item "env:VSSDK$($vsMajorVersion)0Install" $vsSdkInstallDir
$env:VSSDKInstall = $vsSdkInstallDir
}
}
function InstallXCopyMSBuild([string]$packageVersion) {
return InitializeXCopyMSBuild $packageVersion -install $true
}
function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) {
$packageName = "RoslynTools.MSBuild"
$packageDir = Join-Path $ToolsDir "msbuild\$packageVersion"
$packagePath = Join-Path $packageDir "$packageName.$packageVersion.nupkg"
if (!(Test-Path $packageDir)) {
if (!$install) {
return $null
}
Create-Directory $packageDir
Write-Host "Downloading $packageName $packageVersion"
Invoke-WebRequest "https://dotnet.myget.org/F/roslyn-tools/api/v2/package/$packageName/$packageVersion/" -OutFile $packagePath
Unzip $packagePath $packageDir
}
return Join-Path $packageDir "tools"
}
#
# Locates Visual Studio instance that meets the minimal requirements specified by tools.vs object in global.json.
#
# The following properties of tools.vs are recognized:
# "version": "{major}.{minor}"
# Two part minimal VS version, e.g. "15.9", "16.0", etc.
# "components": ["componentId1", "componentId2", ...]
# Array of ids of workload components that must be available in the VS instance.
# See e.g. https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-enterprise?view=vs-2017
#
# Returns JSON describing the located VS instance (same format as returned by vswhere),
# 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") {
$vswhereVersion = $GlobalJson.tools.vswhere
} else {
$vswhereVersion = "2.5.2"
}
$vsWhereDir = Join-Path $ToolsDir "vswhere\$vswhereVersion"
$vsWhereExe = Join-Path $vsWhereDir "vswhere.exe"
if (!(Test-Path $vsWhereExe)) {
Create-Directory $vsWhereDir
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")
if (Get-Member -InputObject $vsRequirements -Name "version") {
$args += "-version"
$args += $vsRequirements.version
}
if (Get-Member -InputObject $vsRequirements -Name "components") {
foreach ($component in $vsRequirements.components) {
$args += "-requires"
$args += $component
}
}
$vsInfo =& $vsWhereExe $args | ConvertFrom-Json
if ($lastExitCode -ne 0) {
return $null
}
# use first matching instance
return $vsInfo[0]
}
function InitializeBuildTool() {
if (Test-Path variable:global:_BuildTool) {
return $global:_BuildTool
}
if (-not $msbuildEngine) {
$msbuildEngine = GetDefaultMSBuildEngine
}
# Initialize dotnet cli if listed in 'tools'
$dotnetRoot = $null
if (Get-Member -InputObject $GlobalJson.tools -Name "dotnet") {
$dotnetRoot = InitializeDotNetCli -install:$restore
}
if ($msbuildEngine -eq "dotnet") {
if (!$dotnetRoot) {
Write-PipelineTaskError "/global.json must specify 'tools.dotnet'."
ExitWithExitCode 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-PipelineTaskError $_
ExitWithExitCode 1
}
$buildTool = @{ Path = $msbuildPath; Command = ""; Tool = "vs"; Framework = "net472" }
} else {
Write-PipelineTaskError "Unexpected value of -msbuildEngine: '$msbuildEngine'."
ExitWithExitCode 1
}
return $global:_BuildTool = $buildTool
}
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 "dotnet") {
return "dotnet"
}
Write-PipelineTaskError "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'."
ExitWithExitCode 1
}
function GetNuGetPackageCachePath() {
if ($env:NUGET_PACKAGES -eq $null) {
# 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"
} else {
$env:NUGET_PACKAGES = Join-Path $RepoRoot ".packages"
}
}
return $env:NUGET_PACKAGES
}
# Returns a full path to an Arcade SDK task project file.
function GetSdkTaskProject([string]$taskName) {
return Join-Path (Split-Path (InitializeToolset) -Parent) "SdkTasks\$taskName.proj"
}
function InitializeNativeTools() {
if (Get-Member -InputObject $GlobalJson -Name "native-tools") {
$nativeArgs=""
if ($ci) {
$nativeArgs = "-InstallDirectory $ToolsDir"
}
Invoke-Expression "& `"$PSScriptRoot/init-tools-native.ps1`" $nativeArgs"
}
}
function InitializeToolset() {
if (Test-Path variable:global:_ToolsetBuildProj) {
return $global:_ToolsetBuildProj
}
$nugetCache = GetNuGetPackageCachePath
$toolsetVersion = $GlobalJson.'msbuild-sdks'.'Microsoft.DotNet.Arcade.Sdk'
$toolsetLocationFile = Join-Path $ToolsetDir "$toolsetVersion.txt"
if (Test-Path $toolsetLocationFile) {
$path = Get-Content $toolsetLocationFile -TotalCount 1
if (Test-Path $path) {
return $global:_ToolsetBuildProj = $path
}
}
if (-not $restore) {
Write-PipelineTaskError "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 { "" }
'<Project Sdk="Microsoft.DotNet.Arcade.Sdk"/>' | Set-Content $proj
MSBuild-Core $proj $bl /t:__WriteToolsetLocation /clp:ErrorsOnly`;NoSummary /p:__ToolsetLocationOutputFile=$toolsetLocationFile
$path = Get-Content $toolsetLocationFile -TotalCount 1
if (!(Test-Path $path)) {
throw "Invalid toolset path: $path"
}
return $global:_ToolsetBuildProj = $path
}
function ExitWithExitCode([int] $exitCode) {
if ($ci -and $prepareMachine) {
Stop-Processes
}
exit $exitCode
}
function Stop-Processes() {
Write-Host "Killing running build processes..."
foreach ($processName in $processesToStopOnExit) {
Get-Process -Name $processName -ErrorAction SilentlyContinue | Stop-Process
}
}
#
# Executes msbuild (or 'dotnet msbuild') with arguments passed to the function.
# The arguments are automatically quoted.
# Terminates the script if the build fails.
#
function MSBuild() {
if ($pipelinesLog) {
$buildTool = InitializeBuildTool
$toolsetBuildProject = InitializeToolset
$path = Split-Path -parent $toolsetBuildProject
$path = Join-Path $path (Join-Path $buildTool.Framework "Microsoft.DotNet.Arcade.Sdk.dll")
$args += "/logger:$path"
}
MSBuild-Core @args
}
#
# Executes msbuild (or 'dotnet msbuild') with arguments passed to the function.
# The arguments are automatically quoted.
# Terminates the script if the build fails.
#
function MSBuild-Core() {
if ($ci) {
if (!$binaryLog) {
throw "Binary log must be enabled in CI build."
}
if ($nodeReuse) {
throw "Node reuse must be disabled in CI build."
}
}
$buildTool = InitializeBuildTool
$cmdArgs = "$($buildTool.Command) /m /nologo /clp:Summary /v:$verbosity /nr:$nodeReuse /p:ContinuousIntegrationBuild=$ci"
if ($warnAsError) {
$cmdArgs += " /warnaserror /p:TreatWarningsAsErrors=true"
}
foreach ($arg in $args) {
if ($arg -ne $null -and $arg.Trim() -ne "") {
$cmdArgs += " `"$arg`""
}
}
$exitCode = Exec-Process $buildTool.Path $cmdArgs
if ($exitCode -ne 0) {
Write-PipelineTaskError "Build failed."
$buildLog = GetMSBuildBinaryLogCommandLineArgument $args
if ($buildLog -ne $null) {
Write-Host "See log: $buildLog" -ForegroundColor DarkGray
}
ExitWithExitCode $exitCode
}
}
function GetMSBuildBinaryLogCommandLineArgument($arguments) {
foreach ($argument in $arguments) {
if ($argument -ne $null) {
$arg = $argument.Trim()
if ($arg.StartsWith("/bl:", "OrdinalIgnoreCase")) {
return $arg.Substring("/bl:".Length)
}
if ($arg.StartsWith("/binaryLogger:", "OrdinalIgnoreCase")) {
return $arg.Substring("/binaryLogger:".Length)
}
}
}
return $null
}
. $PSScriptRoot\LoggingCommandFunctions.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
# true if global.json contains a "runtimes" section
$globalJsonHasRuntimes = if ($GlobalJson.tools.PSObject.Properties.Name -Match 'runtimes') { $true } else { $false }
Create-Directory $ToolsetDir
Create-Directory $TempDir
Create-Directory $LogDir
Write-PipelineSetVariable -Name 'Artifacts' -Value $ArtifactsDir
Write-PipelineSetVariable -Name 'Artifacts.Toolset' -Value $ToolsetDir
Write-PipelineSetVariable -Name 'Artifacts.Log' -Value $LogDir
Write-PipelineSetVariable -Name 'TEMP' -Value $TempDir
Write-PipelineSetVariable -Name 'TMP' -Value $TempDir
+463
View File
@@ -0,0 +1,463 @@
#!/usr/bin/env bash
# Initialize variables if they aren't already defined.
# CI mode - set to true on CI server for PR validation build or official build.
ci=${ci:-false}
# 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
# This flag is meant as a temporary opt-opt for the feature while validate it across
# our consumers. It will be deleted in the future.
if [[ "$ci" == true ]]; then
pipelines_log=${pipelines_log:-true}
else
pipelines_log=${pipelines_log:-false}
fi
# Build configuration. Common values include 'Debug' and 'Release', but the repository may use other names.
configuration=${configuration:-'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.
binary_log=${binary_log:-$ci}
# Turns on machine preparation/clean up code that changes the machine state (e.g. kills build processes).
prepare_machine=${prepare_machine:-false}
# True to restore toolsets and dependencies.
restore=${restore:-true}
# Adjusts msbuild verbosity level.
verbosity=${verbosity:-'minimal'}
# Set to true to reuse msbuild nodes. Recommended to not reuse on CI.
if [[ "$ci" == true ]]; then
node_reuse=${node_reuse:-false}
else
node_reuse=${node_reuse:-true}
fi
# Configures warning treatment in msbuild.
warn_as_error=${warn_as_error:-true}
# True to attempt using .NET Core already that meets requirements specified in global.json
# installed on the machine instead of downloading one.
use_installed_dotnet_cli=${use_installed_dotnet_cli:-true}
# True to use global NuGet cache instead of restoring packages to repository-local directory.
if [[ "$ci" == true ]]; then
use_global_nuget_cache=${use_global_nuget_cache:-false}
else
use_global_nuget_cache=${use_global_nuget_cache:-true}
fi
function EmitError {
if [[ "$ci" != true ]]; then
echo "$@" >&2
return
fi
message_type="error"
sourcepath=''
linenumber=''
columnnumber=''
error_code=''
while [[ $# -gt 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
case "$opt" in
-type|-t)
message_type=$2
shift
;;
-sourcepath|-s)
sourcepath=$2
shift
;;
-linenumber|-l)
linenumber=$2
shift
;;
-columnnumber|-col)
columnnumber=$2
shift
;;
-code|-c)
error_code=$2
shift
;;
*)
break
;;
esac
shift
done
message='##vso[task.logissue'
message="$message type=$message_type"
if [ -n "$sourcepath" ]; then
message="$message;sourcepath=$sourcepath"
else
message="$message;sourcepath=${BASH_SOURCE[1]}"
fi
if [ -n "$linenumber" ]; then
message="$message;linenumber=$linenumber"
else
message="$message;linenumber=${BASH_LINENO[0]}"
fi
if [ -n "$columnnumber" ]; then
message="$message;columnnumber=$columnnumber"
fi
if [ -n "$error_code" ]; then
message="$message;code=$error_code"
fi
message="$message]$*"
echo "$message"
}
# Resolve any symlinks in the given path.
function ResolvePath {
local path=$1
while [[ -h $path ]]; do
local dir="$( cd -P "$( dirname "$path" )" && pwd )"
path="$(readlink "$path")"
# if $path was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $path != /* ]] && path="$dir/$path"
done
# return value
_ResolvePath="$path"
}
# ReadVersionFromJson [json key]
function ReadGlobalVersion {
local key=$1
local line=`grep -m 1 "$key" "$global_json_file"`
local pattern="\"$key\" *: *\"(.*)\""
if [[ ! $line =~ $pattern ]]; then
EmitError "Error: Cannot find \"$key\" in $global_json_file"
ExitWithExitCode 1
fi
# return value
_ReadGlobalVersion=${BASH_REMATCH[1]}
}
function InitializeDotNetCli {
if [[ -n "${_InitializeDotNetCli:-}" ]]; then
return
fi
local install=$1
# Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism
export DOTNET_MULTILEVEL_LOOKUP=0
# Disable first run since we want to control all package sources
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
# Disable telemetry on CI
if [[ $ci == true ]]; then
export DOTNET_CLI_TELEMETRY_OPTOUT=1
fi
# LTTNG is the logging infrastructure used by Core CLR. Need this variable set
# so it doesn't output warnings to the console.
export LTTNG_HOME="$HOME"
# Source Build uses DotNetCoreSdkDir variable
if [[ -n "${DotNetCoreSdkDir:-}" ]]; then
export DOTNET_INSTALL_DIR="$DotNetCoreSdkDir"
fi
# Find the first path on $PATH that contains the dotnet.exe
if [[ "$use_installed_dotnet_cli" == true && $global_json_has_runtimes == false && -z "${DOTNET_INSTALL_DIR:-}" ]]; then
local dotnet_path=`command -v dotnet`
if [[ -n "$dotnet_path" ]]; then
ResolvePath "$dotnet_path"
export DOTNET_INSTALL_DIR=`dirname "$_ResolvePath"`
fi
fi
ReadGlobalVersion "dotnet"
local dotnet_sdk_version=$_ReadGlobalVersion
local dotnet_root=""
# Use dotnet installation specified in DOTNET_INSTALL_DIR if it contains the required SDK version,
# otherwise install the dotnet CLI and SDK to repo local .dotnet directory to avoid potential permission issues.
if [[ $global_json_has_runtimes == false && -n "${DOTNET_INSTALL_DIR:-}" && -d "$DOTNET_INSTALL_DIR/sdk/$dotnet_sdk_version" ]]; then
dotnet_root="$DOTNET_INSTALL_DIR"
else
dotnet_root="$repo_root/.dotnet"
export DOTNET_INSTALL_DIR="$dotnet_root"
if [[ ! -d "$DOTNET_INSTALL_DIR/sdk/$dotnet_sdk_version" ]]; then
if [[ "$install" == true ]]; then
InstallDotNetSdk "$dotnet_root" "$dotnet_sdk_version"
else
EmitError "Unable to find dotnet with SDK version '$dotnet_sdk_version'"
ExitWithExitCode 1
fi
fi
fi
# Add dotnet to PATH. This prevents any bare invocation of dotnet in custom
# build steps from using anything other than what we've downloaded.
export PATH="$dotnet_root:$PATH"
if [[ $ci == true ]]; then
# Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build
echo "##vso[task.prependpath]$dotnet_root"
echo "##vso[task.setvariable variable=DOTNET_MULTILEVEL_LOOKUP]0"
echo "##vso[task.setvariable variable=DOTNET_SKIP_FIRST_TIME_EXPERIENCE]1"
fi
# return value
_InitializeDotNetCli="$dotnet_root"
}
function InstallDotNetSdk {
local root=$1
local version=$2
local architecture=""
if [[ $# == 3 ]]; then
architecture=$3
fi
InstallDotNet "$root" "$version" $architecture
}
function InstallDotNet {
local root=$1
local version=$2
GetDotNetInstallScript "$root"
local install_script=$_GetDotNetInstallScript
local archArg=''
if [[ -n "${3:-}" ]]; then
archArg="--architecture $3"
fi
local runtimeArg=''
if [[ -n "${4:-}" ]]; then
runtimeArg="--runtime $4"
fi
local skipNonVersionedFilesArg=""
if [[ "$#" -ge "5" ]]; then
skipNonVersionedFilesArg="--skip-non-versioned-files"
fi
bash "$install_script" --version $version --install-dir "$root" $archArg $runtimeArg $skipNonVersionedFilesArg || {
local exit_code=$?
EmitError "Failed to install dotnet SDK (exit code '$exit_code')."
ExitWithExitCode $exit_code
}
}
function GetDotNetInstallScript {
local root=$1
local install_script="$root/dotnet-install.sh"
local install_script_url="https://dot.net/v1/dotnet-install.sh"
if [[ ! -a "$install_script" ]]; then
mkdir -p "$root"
echo "Downloading '$install_script_url'"
# Use curl if available, otherwise use wget
if command -v curl > /dev/null; then
curl "$install_script_url" -sSL --retry 10 --create-dirs -o "$install_script"
else
wget -q -O "$install_script" "$install_script_url"
fi
fi
# return value
_GetDotNetInstallScript="$install_script"
}
function InitializeBuildTool {
if [[ -n "${_InitializeBuildTool:-}" ]]; then
return
fi
InitializeDotNetCli $restore
# return values
_InitializeBuildTool="$_InitializeDotNetCli/dotnet"
_InitializeBuildToolCommand="msbuild"
_InitializeBuildToolFramework="netcoreapp2.1"
}
function GetNuGetPackageCachePath {
if [[ -z ${NUGET_PACKAGES:-} ]]; then
if [[ "$use_global_nuget_cache" == true ]]; then
export NUGET_PACKAGES="$HOME/.nuget/packages"
else
export NUGET_PACKAGES="$repo_root/.packages"
fi
fi
# return value
_GetNuGetPackageCachePath=$NUGET_PACKAGES
}
function InitializeNativeTools() {
if grep -Fq "native-tools" $global_json_file
then
local nativeArgs=""
if [[ "$ci" == true ]]; then
nativeArgs="-InstallDirectory $tools_dir"
fi
"$_script_dir/init-tools-native.sh" $nativeArgs
fi
}
function InitializeToolset {
if [[ -n "${_InitializeToolset:-}" ]]; then
return
fi
GetNuGetPackageCachePath
ReadGlobalVersion "Microsoft.DotNet.Arcade.Sdk"
local toolset_version=$_ReadGlobalVersion
local toolset_location_file="$toolset_dir/$toolset_version.txt"
if [[ -a "$toolset_location_file" ]]; then
local path=`cat "$toolset_location_file"`
if [[ -a "$path" ]]; then
# return value
_InitializeToolset="$path"
return
fi
fi
if [[ "$restore" != true ]]; then
EmitError "Toolset version $toolsetVersion has not been restored."
ExitWithExitCode 2
fi
local proj="$toolset_dir/restore.proj"
local bl=""
if [[ "$binary_log" == true ]]; then
bl="/bl:$log_dir/ToolsetRestore.binlog"
fi
echo '<Project Sdk="Microsoft.DotNet.Arcade.Sdk"/>' > "$proj"
MSBuild-Core "$proj" $bl /t:__WriteToolsetLocation /clp:ErrorsOnly\;NoSummary /p:__ToolsetLocationOutputFile="$toolset_location_file"
local toolset_build_proj=`cat "$toolset_location_file"`
if [[ ! -a "$toolset_build_proj" ]]; then
EmitError "Invalid toolset path: $toolset_build_proj"
ExitWithExitCode 3
fi
# return value
_InitializeToolset="$toolset_build_proj"
}
function ExitWithExitCode {
if [[ "$ci" == true && "$prepare_machine" == true ]]; then
StopProcesses
fi
exit $1
}
function StopProcesses {
echo "Killing running build processes..."
pkill -9 "dotnet" || true
pkill -9 "vbcscompiler" || true
return 0
}
function MSBuild {
local args=$@
if [[ "$pipelines_log" == true ]]; then
InitializeBuildTool
InitializeToolset
local toolset_dir="${_InitializeToolset%/*}"
local logger_path="$toolset_dir/$_InitializeBuildToolFramework/Microsoft.DotNet.Arcade.Sdk.dll"
args=( "${args[@]}" "-logger:$logger_path" )
fi
MSBuild-Core ${args[@]}
}
function MSBuild-Core {
if [[ "$ci" == true ]]; then
if [[ "$binary_log" != true ]]; then
EmitError "Binary log must be enabled in CI build."
ExitWithExitCode 1
fi
if [[ "$node_reuse" == true ]]; then
EmitError "Node reuse must be disabled in CI build."
ExitWithExitCode 1
fi
fi
InitializeBuildTool
local warnaserror_switch=""
if [[ $warn_as_error == true ]]; then
warnaserror_switch="/warnaserror"
fi
"$_InitializeBuildTool" "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@" || {
local exit_code=$?
EmitError "Build failed (exit code '$exit_code')."
ExitWithExitCode $exit_code
}
}
ResolvePath "${BASH_SOURCE[0]}"
_script_dir=`dirname "$_ResolvePath"`
eng_root=`cd -P "$_script_dir/.." && pwd`
repo_root=`cd -P "$_script_dir/../.." && pwd`
artifacts_dir="$repo_root/artifacts"
toolset_dir="$artifacts_dir/toolset"
tools_dir="$repo_root/.tools"
log_dir="$artifacts_dir/log/$configuration"
temp_dir="$artifacts_dir/tmp/$configuration"
global_json_file="$repo_root/global.json"
# determine if global.json contains a "runtimes" entry
global_json_has_runtimes=false
dotnetlocal_key=`grep -m 1 "runtimes" "$global_json_file"` || true
if [[ -n "$dotnetlocal_key" ]]; then
global_json_has_runtimes=true
fi
# HOME may not be defined in some scenarios, but it is required by NuGet
if [[ -z $HOME ]]; then
export HOME="$repo_root/artifacts/.home/"
mkdir -p "$HOME"
fi
mkdir -p "$toolset_dir"
mkdir -p "$temp_dir"
mkdir -p "$log_dir"
if [[ $ci == true ]]; then
export TEMP="$temp_dir"
export TMP="$temp_dir"
fi
+15
View File
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- This project exists purely to work around Arcade
behavior. Arcade knows how to restore tasks needed for
publishing to blob feeds, but it requires a project file that
imports nuget restore targets to be specified for this to
work. See details in
https://github.com/dotnet/arcade/commit/f657be5cb7cd4920334dd9162173b131211a1e17#r31728598.
-->
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
</Project>
+51
View File
@@ -0,0 +1,51 @@
<Project DefaultTargets="PublishPackages">
<!-- TODO: move properties imported from here into a common props file -->
<!-- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> -->
<!-- Use an explicit SDK import so that arcade uses the build
configuration computed in dir.common.props. -->
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="$(MSBuildThisFileDirectory)\..\.packages\microsoft.dotnet.build.tasks.feed\$(MicrosoftDotNetBuildTasksFeedVersion)\build\Microsoft.DotNet.Build.Tasks.Feed.targets" />
<PropertyGroup>
<!-- Set the TargetFramework just to make the SDK happy -->
<TargetFramework>net462</TargetFramework>
</PropertyGroup>
<Target Name="PublishPackages">
<ItemGroup>
<PackagesToPublish Include="$(MSBuildThisFileDirectory)\..\artifacts\*.nupkg" />
</ItemGroup>
<ItemGroup>
<ItemsToPushToBlobFeed Include="@(PackagesToPublish)" />
</ItemGroup>
<Error Condition=" '$(AzureFeedUrl)' == '' " Text="AzureFeedUrl must be set" />
<Error Condition=" '$(AzureAccountKey)' == '' " Text="AzureAccountKey must be set" />
<Error Condition=" '$(BUILD_REPOSITORY_URI)' == '' " Text="BUILD_REPOSITORY_URI must be set" />
<Error Condition=" '$(BUILD_SOURCEBRANCH)' == '' " Text="BUILD_SOURCEBRANCH must be set" />
<Error Condition=" '$(BUILD_BUILDNUMBER)' == '' " Text="BUILD_BUILDNUMBER must be set" />
<Error Condition=" '$(BUILD_SOURCEVERSION)' == '' " Text="BUILD_SOURCEVERSION must be set" />
<PropertyGroup>
<AssetManifestFilePath>$(ArtifactsLogDir)AssetManifest\$(AssetManifest)</AssetManifestFilePath>
</PropertyGroup>
<Message Importance="Low" Text="BUILD_REPOSITORY_URI: $(BUILD_REPOSITORY_URI)" />
<PushToBlobFeed ExpectedFeedUrl="$(AzureFeedUrl)"
AccountKey="$(AzureAccountKey)"
ItemsToPush="@(ItemsToPushToBlobFeed)"
ManifestBuildData="Location=$(AzureFeedUrl)"
ManifestRepoUri="$(BUILD_REPOSITORY_URI)"
ManifestBranch="$(BUILD_SOURCEBRANCH)"
ManifestBuildId="$(BUILD_BUILDNUMBER)"
ManifestCommit="$(BUILD_SOURCEVERSION)"
AssetManifestPath="$(AssetManifestFilePath)" />
</Target>
</Project>
Loaded 100 of 3986 files, more files were not shown because too many files have changed in this diff. Show more