Compare commits

..
Author SHA1 Message Date
Ankit Jain 86b78b7d19 [3.2-wasm][wasm][debugger] Relocate tests (#19787)
* [wasm][debugger][tests] Move the test files to `tests/debugger`

- Also, rename `class Math` to `class SampleMath` in `sample.cs`,
to allow building sample.dll, with all the tests added.

* [wasm][debugger][tests] Add back missing dependency

* [wasm][debugger][tests] move *datetime-test.cs to `tests/debugger`

* [wasm][debugger][tests] Move CFO test to debugger-cfo-test.cs
2020-05-15 14:48:26 -04:00
Tammy Qiu d46a972c3b Merge pull request #19734 from tqiu8/locale-test
[wasm][debugger][tests] Add locale tests for datetime
2020-05-11 15:29:50 -04:00
monojenkinsandLarry Ewing 57dcba253c [3.2-wasm] [wasm][debugger] Only send resolved events on load (#19739)
* [wasm][debugger] Only send resolved events on load

* Add the request to the context after potentially loading the store

* improve the resolution logic

Co-authored-by: Larry Ewing <[email protected]>
2020-05-11 10:44:31 -05:00
tqiu8 e4acd81888 incorporate PR feedback & reference issue number for disabled locales 2020-05-08 12:00:47 -04:00
tqiu8 c6bd1ac7fa [wasm][debugger][tests] Add locale tests for datetime 2020-05-07 14:16:06 -04:00
Tammy Qiu 1a6e64a938 Merge pull request #19718 from tqiu8/breakpoint-tests
[wasm][debugger][tests] Add tests for multiple breakpoints inline
2020-05-05 18:14:54 -04:00
tqiu8 feb9163b26 [wasm][debugger][tests] Combine two tests in one using [Theory] 2020-05-05 18:14:25 -04:00
tqiu8 1b697209f5 [wasm][debugger][tests] More descriptive test name 2020-05-05 17:57:42 -04:00
tqiu8 40ca9b2f37 [wasm][debugger][tests] Update CheckBreakpoint with more descriptive name and use CheckLocation 2020-05-05 17:51:55 -04:00
tqiu8 0d532de801 [wasm][debugger][tests] add tests for multiple breakpoints 2020-05-05 17:28:25 -04:00
monojenkinsandLarry Ewing 7569ee7b36 [wasm][debugger] Add tests for floating common types (#19717)
Co-authored-by: Larry Ewing <[email protected]>
2020-05-05 13:56:00 -05:00
Larry Ewing fbc81c503e [3.2-wasm][wasm][debugger] Backport of #19688 (#19716)
* [wasm][debugger] Only choose the best match when mutiple locations are found

* OrderBy column just to be certain

* Add tests for the JS breakpoint behavior that we are duplicating

* remove accidentally disabled code
2020-05-05 13:55:15 -05:00
monojenkinsandBrzVlad 8bcfbc80f3 [interp] Move label outside of main loop (#19708)
Wasm has control flow limitations which don't go well with gotos. Move label outside of main loop because it translates to very poor wasm code. Other gotos don't seem to negatively impact instruction dispatch code, so leave them alone, for now ..

Co-authored-by: BrzVlad <[email protected]>
2020-05-05 12:36:08 -05:00
monojenkinsandAnkit Jain 5dc5126323 [3.2-wasm] [wasm][debugger][tests] Split tests into separate files (#19715)
* [wasm][debugger][tests] Move helper methods to base class

* [wasm][debugger][tests] Extract EvaluateOnCallFrame tests to new file

* [wasm][debugger][tests] Extract Array tests to a new file

* [wasm][debugger][tests] Extract CallFunctionOn tests to a new file

* [wasm][debugger][tests] Extract Delegate tests to a new file

* [wasm][debugger] Don't inherit from another test class

.. as that ends up running all the tests of the base class too.

* [wasm][debugger][tests] Improve retries in TestHarnessStartup

Sometimes `/json/list` seems to return an empty array (`[ ]`). Treat
that also as a case for retry.

* [wasm][debugger][tests] Bump timeout from 2s to 5s

* [wasm][debugger][tests] Launch chrome in incognito mode

* debugging

* [wasm][debugger] TestHarnessStartup - don't share `ProcessStartInfo`

.. instances. Instead, create one for every use.
We seem to run into cases where the `get_Environment` is modifying it's
`_environmentVariables` field, concurrently from multiple threads,
causing exceptions like:

```
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Diagnostics.Process.CreateEnvp(ProcessStartInfo psi)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at WebAssembly.Net.Debugging.TestHarnessStartup.LaunchAndServe(ProcessStartInfo psi, HttpContext context, Func`2 extract_conn_url) in /Users/radical/dev/w1/sdks/wasm/ProxyDriver/TestHarnessStartup.cs:line 82
   at WebAssembly.Net.Debugging.TestHarnessStartup.<>c__DisplayClass10_0.<<Configure>b__1>d.MoveNext() in /Users/radical/dev/w1/sdks/wasm/ProxyDriver/TestHarnessStartup.cs:line 167
```

* [wasm][debugger] Fix regression in debug.html

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

Co-authored-by: Ankit Jain <[email protected]>
2020-05-05 12:24:46 -05:00
monojenkinsandLarry Ewing f6e60534ff [wasm][debugger] Fix type argument (#19710)
Co-authored-by: Larry Ewing <[email protected]>
2020-05-05 11:36:13 -05:00
Alexander Köplinger 6fd32d873a [3.2-wasm][ci] Run only wasm CI legs (#19711) 2020-05-05 17:57:24 +02:00
monojenkinsandAnkit Jain cc6d4bf6cf [3.2-wasm] [wasm][debugger] Fix evaluateOnCallFrame for valuetype locals (#19644)
* [wasm][debugger] Fix `evaluateOnCallFrame` for valuetype locals

.. including generic, and async methods.

* [wasm][debugger] Remove some debug spew

(cherry picked from commit 2e042925b95a2e3eba693525a5c1e495cca47f2f)

Co-authored-by: Ankit Jain <[email protected]>
2020-04-28 11:06:08 -05:00
Larry EwingandZoltan Varga c5f62a7e7d [3.2-wasm] Backport wasm index fix (#19636)
* [corlib] Fix String.Replace (..., StringComparison.InvariantCultureIgnoreCase).

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

* Disable the test here

Co-authored-by: Zoltan Varga <[email protected]>
2020-04-22 17:32:04 -05:00
monojenkinsandZoltan Varga af98855016 [3.2-wasm] [wasm] Reenable the managed collation code, link it out by default, add a packager option to enable it. (#19608)
* [wasm] Reenable the managed collation code, link it out by default, add a packager option to enable it.

* Disable some xunit tests which fail because the test runner can't handle the [SkipOnTargetFramework(TargetFrameworkMonikers.Mono)] attribute.

* [csproj] Update project files

Co-authored-by: Zoltan Varga <[email protected]>
2020-04-22 14:20:34 -05:00
monojenkinsandMaxim Lipnin a0a972cabf [3.2-wasm] [wasm] Add throwing PNSE to where currently disabled tests throw something different (#19633)
* Add throwing PNSE to where currently disabled tests throw something different

* Add try-catch + PNSE to public SslStream ctor in case of WASM

Co-authored-by: Maxim Lipnin <[email protected]>
2020-04-22 13:47:27 -05:00
monojenkinsandAnkit Jain fe5a9ecec8 [3.2-wasm] [wasm][debugger] Fix enumerating for this on valuetypes (#19630)
* [wasm][debugger] `mono_wasm_call_function_on` - remove unncessary

.. parameter, since it is already present in the `args` object.

* [wasm] MonoProxy - convert cfo calls to MonoCommands

* [wasm][debugger] Fix enumerating `this` properties for a valuetype

* [wasm][debugger] `evaluateOnCallFrame` - fix `this` for valuetypes

* [wasm][debugger] Remove MonoCommands no longer used

* [wasm][debugger] Fix showing the name for generic methods

- We were using `method.Name` from Cecil, but that we want to the name
with the type arguments for the generic instance.

Co-authored-by: Ankit Jain <[email protected]>
2020-04-22 13:38:16 -05:00
monojenkinsandZoltan Varga 1bb2a7d171 Bump linker to the tip of mono-2020-02. (#19607)
Co-authored-by: Zoltan Varga <[email protected]>
2020-04-22 09:36:52 -05:00
Larry Ewing 70ff920a89 [wasm-3.2] Fix webdriver initialization (#19617) 2020-04-21 13:31:17 -05:00
monojenkinsandLarry Ewing 0122b3e0eb [3.2-wasm] [wasm][debugger] Fix command response handling (#19615)
* [wasm][debugger] send failed evaluations to the browser

Make sure that we allways either send a single result or return
false from Accept Command to ensure that we don't leave
messages spinning.

Co-authored-by: Larry Ewing <[email protected]>
2020-04-21 11:56:01 -05:00
7f581f1398 [3.2-wasm] [wasm][debugger] Support array expansion in VS via callFunctionOn (#19606)
* [wasm][debugger] Move `getProperties` implementation to `library_mono.js`,

.. from `MonoProxy.cs`. MonoProxy essentially just forwards the
request to `library_mono.js` now.

* [wasm][debugger] Add `length` info array details

- update tests to track the change

* [wasm][debugger][tests] Simplify some of the helper methods

* [wasm][debuggger] Implement `Runtime.callFunctionOn`

- This was prompted by vscode/vs requiring this for array expansion.
- It runs a given js function string, on a given object id.
- We handle the case for dotnet object ids.

Implementation:

- We build a proxy object that reflects the details of the real dotnet object/array
- And run the js function on that proxy object

- Then if `returnByValue` was requested, the result is returned as-is
- Else we cache that object, with a new special object id (`dotnet:cfo_res:..`),
  and return that id in the response.

- Subsequently, we would get `Runtime.getProperties` request on this new object id
- And a `Runtime.releaseObject` request, to free that function result.

- All this is handled currently

Tests:

- A few tests were added which invoke `callFunctionOn`, on JS objects, and checks the result
  - And the same checks are performed on equivalent dotnet objects, with the same js function
  - This should help stay in sync with what we think `callFunctionOn` should work as

  - These tests have an additional parameter - `roundtrip`, which calls a simple function

	`function () { return this; }`

    .. on a dotnet object, and gets the result object id. If `roundtrip == true`, then it
    runs that same function on the result object, and gets a new result object id. And the
    tests run their checks on that.

    - this helps to check that outside of the proxy, the result object behaves same as any
      other dotnet object.

- Also, most of the tests were modified to support an additional mode (`use_cfo`).
  - With this, whenever a test wants to run `Runtime.getProperties on an object, we pass that
    object through the earlier "identity" function, and then run `getProperties` on that
    resultant object.

  - This helps to take advantage most of the existing tests, and use them for `callFunctionOn`
    testing too, by ensuring that the results of CFO returns results same as any other object.

Fixes https://github.com/mono/mono/issues/19229, https://github.com/mono/mono/issues/19531

* Apply suggestions from code review

Applying suggestions to start CI

* Update sdks/wasm/src/library_mono.js

Co-authored-by: Ankit Jain <[email protected]>
Co-authored-by: Larry Ewing <[email protected]>
2020-04-21 11:32:04 -05:00
monojenkinsandLarry Ewing ae8e4b5b04 [3.2-wasm] [wasm][debugger] Add an option to clear navigator.webdriver on attach (#19592)
* [wasm][debugger] Add an option to clear navigator.webdriver on attach

* Pass the flag when it is useful

Co-authored-by: Larry Ewing <[email protected]>
2020-04-20 13:04:15 -05:00
monojenkinsandKenneth Pouncey c8cbcaad0d [wasm][sdk][nuget] Bump version. (#19585)
Co-authored-by: Kenneth Pouncey <[email protected]>
2020-04-18 00:50:30 -05:00
monojenkinsandLarry Ewing 91a8312033 [wasm][debugger] Add comment about embedded pdbs and fix old regression (#19582)
With embedded pdbs we have to try to load symbols even when the
pdb is missing then handle ArgumentException if there is no embedded
pdb.  This restores the intended error path and added an explanation
while still logging unexpected errors

Co-authored-by: Larry Ewing <[email protected]>
2020-04-17 17:42:57 -05:00
Larry EwingandAnkit Jain d76afcc147 [wasm][debugger] Show pointer type+address (#19537) (#19581)
* [wasm][debugger] Simplify the interface between debugger.c and

.. library_mono.js .

* [wasm][debugger] Show pointer type+address

* [wasm][debugger] Address review feedback

* [wasm][debugger] Small cleanups, from review feedback

* [wasm][debugger] declare mono_wasm_add_typed_value as extern

Co-authored-by: Ankit Jain <[email protected]>
2020-04-17 16:51:24 -05:00
Larry EwingandAnkit Jain fdf009e4d1 [wasm][debugger] Show signature for delegate, or target, if available… (#19535) (#19579)
* [wasm][debugger] Show signature for delegate, or target, if available (#19505)

* [wasm][debugger] Show signature for delegate, or target, if available

- As object properties, we return a `Target` which has the signature of
the delegate target.

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

* [wasm][debugger] Some tidying up

* [wasm][debugger] Remove unused `sig_desc`

* [wasm][debugger] Simplify code, avoid extra allocations

.. as suggested by @lewing

(cherry picked from commit 4eca12e794)

* [wasm][debugger] Fix tests broken because unused vars are not null

.. anymore, which is because we disabled optimizations in the
interpreter when debugging.

* [wasm][debugger][tests] Add tests to also check delegates in previous

.. frames.

* [wasm][debugger] Disable a test that tried to look at previous async

.. frames. This just happened to work. Currently, the trace has details
of the async machinery, instead of one reflecting what it might have
looked like for a non-async case. So, we can't reliably find the
previous method to inspect it's locals.

* [wasm][debugger] Fix test

Co-authored-by: Ankit Jain <[email protected]>
2020-04-17 16:31:08 -05:00
monojenkinsandLarry Ewing e630444dc6 [wasm][debugger] Always send the remove breakpoint command to the browser too (#19578)
Co-authored-by: Larry Ewing <[email protected]>
2020-04-17 16:09:18 -05:00
Larry Ewing f585a341d0 [wasm][debugger] Handle multi-doc methods and multiple results for breakpoints (#19449) (#19577)
* [wasm][debugger] Rework source loading

Add logic to support embedded sources and
add all the documents from multi-doc methods

Add logic to check source hashes against
pdb hash.

* [wasm][debugger] Fix breakpoints on delegates

Only add methods to a source once by RID

When column is != 0 specified the fronted only wants results
that match that column exactly.

* Allow checking pdb hash and remove source cache

* Fixup typesByName merge
2020-04-17 16:04:58 -05:00
Larry EwingandZoltan Varga 56ba392b3b [wasm] Debugger test improvements. (#19499) (#19573)
* Disable the Loaded: messages, they are not very useful.

* Add a Dotnet-test.setBreakpointByMethod protocol extensions to the proxy to set breakpoints in specific methods during testing.

* Add a new sample debugger test using the setBreakpointByMethod API.

* Remove some unrelated changes.

* Restore logging.

* Disable a log message which is printed when a pdb file is missing.

Co-authored-by: Zoltan Varga <[email protected]>
2020-04-17 00:49:36 -05:00
monojenkinsandLarry Ewing 1a6d1100c4 [wasm][debugger] Fix typo and silence output (#19567)
Co-authored-by: Larry Ewing <[email protected]>
2020-04-16 18:58:17 -05:00
monojenkinsandLarry Ewing 41a4f60bee Change OSPlatform for wasm to "BROWSER" rather than "WEBASSEMBLY" (#19568)
Following the guidance in https://github.com/dotnet/runtime/issues/33328
Change OSPlatform to BROWSER for wasm runtimeArchitecture.

Co-authored-by: Larry Ewing <[email protected]>
2020-04-16 18:58:01 -05:00
monojenkinsandvargaz c6fbfa6726 [wasm] Disable the AOT cache check on wasm as well. (#19553)
Co-authored-by: vargaz <[email protected]>
2020-04-16 14:27:34 -05:00
monojenkinsandLarry Ewing 84d12a33a0 [wasm] force set a local when running debugger tests (#19552)
Co-authored-by: Larry Ewing <[email protected]>
2020-04-15 14:45:24 -05:00
monojenkinsandLarry Ewing 4dba91e7f5 [wasm] Use browser style lang (#19551)
Co-authored-by: Larry Ewing <[email protected]>
2020-04-15 14:45:12 -05:00
monojenkinsandAnkit Jain c66e702ba5 [wasm][debugger] Show signature for delegate, or target, if available (#19505) (#19536)
* [wasm][debugger] Show signature for delegate, or target, if available

- As object properties, we return a `Target` which has the signature of
the delegate target.

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

* [wasm][debugger] Some tidying up

* [wasm][debugger] Remove unused `sig_desc`

* [wasm][debugger] Simplify code, avoid extra allocations

.. as suggested by @lewing

(cherry picked from commit 4eca12e794)

Co-authored-by: Ankit Jain <[email protected]>
2020-04-14 02:26:17 -04:00
monojenkinsandtqiu8 07d1f6452e [wasm] Add readme to package update scripts (#19533)
Co-authored-by: tqiu8 <[email protected]>
2020-04-13 19:59:42 -05:00
monojenkinsandAnkit Jain 3926eae609 [3.2-wasm] [wasm][debugger] Improve some valuetype visualization (#19532)
* [wasm][debugger] Fix up `value.description` for local vars too

- Local vars, when being enumerated in `mono_wasm_get_variables` don't
have an associated `name`, and so `_fixup_name_value_objects`
*incorrectly* ends up not fixing up the `value.description` field for
them.

* [wasm][debugger] For some types, use `ToString()` for their ..

.. `description`.

- `System.DateTime`
- `System.DateTimeOffset`
- `System.Decimal`
- `System.TimeSpan`
- `System.Guid`

* [wasm][debugger] Invoke all property getters, for some types

- `System.DateTime`
- `System.DateTimeOffset`
- `System.TimeSpan`

* [wasm][debugger] Show char symbol along with the code

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

* [wasm][debugger] Fix DateTime tests, don't use hardcoded strings for

.. description. Instead, use a `DateTime` object in the test to create
the expected string for the test. This should ensure that the expected
and actual were created in the same environment.

* [wasm][debugger] Special case `System.Guid` to use

.. `mono_guid_to_string`, instead of calling `ToString()` on it.

* [wasm][debugger] Don't box valuetypes for calling `ToString()`

Co-authored by @vargaz .

* [wasm][debugger] `System.Guid` is special-cased, so remove it from the

.. allowed list.

* [wasm][debugger] simple cleanup

Co-authored-by: Ankit Jain <[email protected]>
2020-04-13 19:59:15 -05:00
monojenkinsandLarry Ewing 4bfd29e820 [wasm][debugger] explicitly pass --lang=en_US for debugger tests (#19530)
Co-authored-by: Larry Ewing <[email protected]>
2020-04-13 17:37:49 -05:00
monojenkinsandMartin Baulig f2b7b0000d Bump CoreFX to pickup https://github.com/mono/corefx/pull/397. (#19526)
Co-authored-by: Martin Baulig <[email protected]>
2020-04-13 20:15:21 +02:00
monojenkinsandKenneth Pouncey 4f156f6e32 [wasm][browser][tests] Generate sdk version in global.json file automatically. (#19527)
Co-authored-by: Kenneth Pouncey <[email protected]>
2020-04-13 12:29:56 -05:00
monojenkinsandZoltan Varga 8b290302b2 [wasm] Remove .stamp-build-debugger-test-app, the app can always be built. (#19524)
Co-authored-by: Zoltan Varga <[email protected]>
2020-04-13 11:51:11 -05:00
monojenkinsandZoltan Varga 3b761deb75 [3.2-wasm] [wasm] Disable interpreter optimizations when debugging. (#19516)
* [wasm] Disable interpreter optimizations when debugging.

* Fix tests.

Co-authored-by: Zoltan Varga <[email protected]>
2020-04-11 03:10:31 -05:00
monojenkinsandtqiu8 37221f2c32 add powershell and bash scripts for replacing default webassembly nuget packages from link or path (#19515)
Co-authored-by: tqiu8 <[email protected]>
2020-04-11 03:05:11 -05:00
monojenkinsandKenneth Pouncey 31c66244bd [3.2-wasm] [wasm][bcl] Handle correctly backslash in file name (#19514)
* [wasm][bcl] Handle correctly backslash in file name

- Modify IO file to assign backslash to alternate directory separator by default
- Add tests for issue https://github.com/mono/mono/issues/18933

* [wasm][tests] Skip two tests for wasm

- After internal discussions decided to skip these two tests on wasm

   1. GetDirectories_Backslash
   1. GetFiles_Backslash

* [wasm][tests] PathIsRooted tests failing

- skip subtest #9 if WASM
- To fix issue https://github.com/mono/mono/issues/18933 we set the AltDirectorySeparatorChar as well.  This causes the `Assert.IsTrue (!Path.IsPathRooted ("\\"), "IsPathRooted #09");` to fail. Path.IsPathFullyQualified Method handles paths that use both the DirectorySeparatorChar and the AltDirectorySeparatorChar characters.

* [wasm][tests] PathIsRooted tests failing

- skip if WASM

Co-authored-by: Kenneth Pouncey <[email protected]>
2020-04-11 02:58:37 -05:00
monojenkinsandLarry Ewing f9771388ab [3.2-wasm] [wasm][debugger] Wasm debug log level (#19512)
* [wasm][debugging] pass enable_debugging as debug engine log level

enable_debugging was already an int, with this change log_level
will remain at 1 by default but passing -1 will disable the log
spew

* Change the default debug level of 'Failed to lookup sequence point'

Co-authored-by: Larry Ewing <[email protected]>
2020-04-10 18:13:56 -05:00
monojenkinsandKenneth Pouncey 2925dcdc83 [wasm][bcl][zoneinfo] Fix local zone info marshaling (#19511)
- Correctly marshal Intl.DateTimeFormat().resolvedOptions().timeZone information

Co-authored-by: Kenneth Pouncey <[email protected]>
2020-04-10 18:13:40 -05:00
Larry Ewing d351fa1cfe [3.2-wasm][ci] Use path not name (#19513) 2020-04-10 16:59:57 -05:00
Larry Ewing 7055ff9b78 [3.2-wasm][ci] Fix typo in groovy 2020-04-10 15:36:59 -05:00
monojenkinsandLarry Ewing 08481dc20b [wasm][ci] Always build and package wasm (#19509)
Co-authored-by: Larry Ewing <[email protected]>
2020-04-10 14:53:47 -05:00
Larry Ewing 72ac1d024d Upload the zip in sdks/wasm (#19506) 2020-04-10 12:30:26 -05:00
monojenkinsandZoltan Varga a475a78a71 [runtime] Fix Type.GetTypeCode () for generic enums. (#19471)
Fixes https://github.com/mono/mono/issues/17735.

Co-authored-by: Zoltan Varga <[email protected]>
2020-04-08 12:01:16 -05:00
monojenkinsandPranav K 92e0af1500 [3.2-wasm] Produce System.Net.Http.WebAssemblyHttpHandler (#19474)
* Produce System.Net.Http.WebAssemblyMessageHandler

* Branding changes for WebAssembly.Net.Http -> System.Net.Http.WebAssemblyMessageHandler

* Change how fetch options are configured

* Fixup tests

* More fixup

* Update submodule

Co-authored-by: Pranav K <[email protected]>
2020-04-08 10:58:30 -05:00
Larry EwingandThays Grazia 4598104765 [wasm][debugger] Improving evaluate expression implementation (#19444) (#19469)
* - Adding tests to evaluate expression
- Adding a cache to local vars and object properties
- Fixing evaluate expressions like "this.a"
- Fixing evaluate expressions like "d + d"

Co-authored-by: Thays Grazia <[email protected]>
2020-04-07 17:25:02 -05:00
Larry Ewing c68c7cebe3 [sdks] Disable all sdk builds for this 3.2-wasm release branch
Disable the other sdks and enable the wask sdk for this branch
2020-04-07 15:13:29 -05:00
Thays Grazia 3fba2c8166 Some frames were skipped in MonoProxy but we don't skip the frame_id, doing this the call_stack has a different position than it's in the real stack on mono side. (#19447)
I changed the frame_id, so we will follow the frame_id from callstack even if we don't add all of them into the CallStack list in MonoProxy.
I also added a test.

Fixes #19379
2020-04-05 13:16:28 -05:00
Zoltan Varga 6ec38cc080 [llvm] Replace the LLVM got array with a set of scalar variables which are initialized by a callback called by the runtime. (#19267)
Long term, this will make the generated code depends less on got offsets etc., so it might be possible to
avoid recompiling it if the offsets change.
2020-04-05 10:21:10 -04:00
Thays Grazia 8ba4a2bca1 As suggested by @jbevain we should bump the protocol to implement this. (#19437) 2020-04-04 20:58:01 -03:00
Larry Ewing 2c5a02755d [wasm][debugger] Don't surface evaluation errors to the browser (#19439)
Instead of surfacing the error to the browser log it return
an empty result.
2020-04-04 14:24:08 -05:00
Kenneth Pouncey eb468076a7 [wasm] Wasm TimeZoneInfo implementation VFS (#17760)
* [wasm][bcl] TimeZoneInfo implementation for WebAssembly to read from WASM VFS `/zoneinfo`.

- Remove `TimeZoneInfo.WebAssembly.cs` file
- Remove source dependencies on `TimeZoneInfo.WebAssembly.cs`.
- Modify TimeZoneInfo for specific WASM functionality
   - Default root directory is `zoneinfo`
   -  Add icall `mono_timezone_get_local_name` for WASM in CreateLocal
- Add icall implementation
   - ves_icall_System_TimeZoneInfo_mono_timezone_get_local_name

* [wasm][build] Add `-s FORCE_FILESYSTEM=1` to mono wasm runtime build

- Required so that it includes support for loading pre preload packages

Message when generating the zoneinfo data.
   > Remember to build the main file with  -s FORCE_FILESYSTEM=1  so that it includes support for loading this file package

* [wasm] zoneinfo data and support files.

- Three files for zoneinfo VFS support.
   - `mono-webassembly-zoneinfo-fs-smd.js.metadata` - This is the separate metadata output by emscripten file-packager.  Used to parse the zoneinfo data in non browser environments.  See `runtime-tests.js`
   - `mono-webassembly-zoneinfo-fs.js` - Output by emscripten file-packager that will be referenced by browser environments to load the zoneinfo data into the VFS at `/zoneinfo`
   - `zoneinfo.data` - The binary file output by emscripten file-packager.  The file contains the actual zoneinfo data loaded into the VFS and parsed by `TimeZoneInfo`.

* [wasm][driver] Add backing support for icall `mono_timezone_get_local_name`

* Add TimeZone info test.

* [wasm][packger] Add `-s FORCE_FILESYSTEM=1`

- Required so that it includes support for loading preload packages

Message when generating the zoneinfo data.
   > Remember to build the main file with  -s FORCE_FILESYSTEM=1  so that it includes support for loading this file package

* Fix AOT tzd test

* Remove commented code lines for `TimeZoneInfo.WebAssembly.cs` module

* Regenerated zone info without --no-heap-copy as it causes problems.  This will create a warning in browser for now.

* Add zoneinfo support files to package

* Fix TimeZoneInfo tests to use the `--enable-fs` packager parameter

* Add back icall implementation after rebase
   - ves_icall_System_TimeZoneInfo_mono_timezone_get_local_name

* Add back backing support for icall `mono_timezone_get_local_name` after rebase

* Fix build error

* Add back zoneinfo tests to Makefile after rebase

* Fix packager zoneinfo sample builds.

* Address review comment about volatile not needed

* Address review comment about volatile not needed

* Address review comment about volatile not needed

* Address review comment volatile not needed
2020-04-04 13:37:21 +02:00
Ankit Jain b3210bf1e5 [wasm][debugger] Improve array visualization (#19424)
* [wasm][debugger][tests] Refactor test support methods

.. which will help in the upcoming changes.

* [wasm][debugger][tests] Add tests for arrays

- These don't include the broken cases which are fixed in the next
commits

* [wasm][debugger][tests] Fix enumerating locals in async method on a

.. struct.

* [wasm][debugger] Support ValueTypes in arrays

- ValueTypes in array elements are not expanded by default. Instead,
they get an object id like `dotnet:array:{arrayObjectId}:{index}`
- And these get expanded on request

* [wasm][debugger] Fix calls to `mono_wasm_add_null_var` from js

- when being called from `library_mono.js`, with a native string like -

    `MONO.mono_wasm_add_null_var ("string");`

.. which when passed to `Module.UTF8ToString (className)`, returns
`null`. So, if the result of that call is null, then use the `className`
argument as-is.

* [wasm][debugger][tests] Add test for local structs in an async method

* [wasm][debugger][tests] Add `TEST_ARGS` and `TEST_FILTER` arguments to

.. control `dotnet test` arguments.

Example use:

`make run-debugger-tests TEST_ARGS="--filter FullyQualifiedName~ArraysTests"`
or
`make run-debugger-tests TEST_FILTER="ArraysTests"`

* [wasm][debugger][tests] Make `label` the last argument, consistently.

* [wasm][debugger] Address review comments

- Return a `Result` response, instead of throwing an exception

* dummy commit to kick the pr
2020-04-03 20:36:44 -04:00
Thays GraziaandLarry Ewing 3122edcb7c [debugger][wasm] Implement evaluate in wasm debugger. (#19432)
* [debugger][wasm] Implement evaluate in wasm debugger.
-> evaluate expressions with constant values and variable values are working
-> evaluate expressions with methods not working yet
-> evaluate expressions with assignments not working yet

* removing extra ;

* Update sdks/wasm/Mono.WebAssembly.DebuggerProxy/EvaluateExpression.cs

Co-Authored-By: Larry Ewing <[email protected]>

* Update sdks/wasm/Mono.WebAssembly.DebuggerProxy/EvaluateExpression.cs

Co-Authored-By: Larry Ewing <[email protected]>

* Update sdks/wasm/Mono.WebAssembly.DebuggerProxy/EvaluateExpression.cs

Co-Authored-By: Larry Ewing <[email protected]>

* Fix what was suggested by @radical.

* Changing what @radical suggested

* Changing what @radical suggested

Co-authored-by: Larry Ewing <[email protected]>
2020-04-03 19:14:04 -03:00
Александр Хухлаев f713aef67b [WinForms] Show ToolTips for PropertyTab`s buttons (#19430)
for custom tabs.

when the mouse is on the native tab buttons, tooltips appear, and when on the custom tab buttons, then no
2020-04-03 22:04:46 +02:00
Thays Grazia fcc6731c83 [debugger] Fix set_value and get_value after invoke a method (#19378)
* When we run an invoke in a thread and after this we do a set_value and then a get_value, when we call set_value we consider restore_state, but when we call get_value we are not considering the restore_state.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1077790
2020-04-03 16:14:41 -03:00
Mitchell HwangandMitchell Hwang c6ff50ed49 Bump corefx to get https://github.com/mono/corefx/pull/395 (#19376)
Co-authored-by: Mitchell Hwang <[email protected]>
2020-04-03 19:39:46 +02:00
Zoltan Varga 798ced842a [wasm] Avoid including config.make into wasm/Makefile, its generated by one of the builds triggered by this Makefile. (#19427) 2020-04-03 13:18:08 -04:00
monojenkinsandBrzVlad 4988c9eeca [sgen] Implement api for allocating pinned arrays (#19407)
https://github.com/dotnet/runtime/issues/33583

Co-authored-by: BrzVlad <[email protected]>
2020-04-03 15:49:23 +03:00
monojenkinsandalexischr 5fc01701ad [mono][sre] Add an expected attribute on underlying fields of enum cl… (#19349)
…asses

Follow CoreCLR's example and add the RTSpecialName type attribute to any class field with the 'value__' name when , used as the value store for enumeration class instances.

Second part of the "RTSpecialName fix" that started with https://github.com/dotnet/runtime/pull/33389 - before, our behavior was to add the RTSpecialName immediately, as soon as the EnumBuilder was constructed.
Contributes to https://github.com/dotnet/runtime/issues/2389

Co-authored-by: alexischr <[email protected]>
2020-04-03 08:48:25 -04:00
Alexander Köplinger c55dee223f Fix iOS CI device test build
MONO_ENTER_GC_UNSAFE/MONO_EXIT_GC_UNSAFE aren't in a public header yet: https://github.com/mono/mono/issues/19421
2020-04-03 14:25:32 +02:00
Steve Sanderson bd2ca880f9 Fix Mono WebAssembly regression on Firefox (#19420)
Since 3 days ago, Mono WebAssembly no longer works on Firefox. The error is `ReferenceError: SharedArrayBuffer is not defined`.

This PR adds a trivial fix.
2020-04-03 01:09:25 +02:00
monojenkinsandCoffeeFlux edf3480ade [meta] Add mono_type_get_name_full to public API (#19414)
This is needed by Xamarin.Android to be able to round-trip with names fetched via reflection, as the only public API for this (`mono_type_get_name`) uses the IL format instead.

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

Co-authored-by: CoffeeFlux <[email protected]>
2020-04-02 12:45:51 -04:00
54e6ca20b4 [loader] Add append option to loader hook installation functions (#19371)
* [loader] Add append option to loader hook installation functions

Fixes https://github.com/dotnet/runtime/issues/34273

While this specific issue only affects the preload hook, I've added the append option to all the installation functions since this seems like a generally useful capability, both for internal use and embedders.

@BrzVlad tested locally and confirmed this patch solves the problem.

* Update callers in pedump and monodis

Co-authored-by: CoffeeFlux <[email protected]>
Co-authored-by: Ryan Lucia <[email protected]>
2020-04-02 12:39:10 -04:00
Larry Ewing 82dc6e8a5e [wasm][debugger] don't try to process commands sessions without context (#19394) 2020-04-02 08:35:34 -05:00
Kenneth Pouncey 2c783ab80b [wasm][README] WASM Dynamic Runtime doc (#19416)
* update sample config

* Add dynamic runtime config

* update dynamic runtime docs
2020-04-02 08:35:11 -05:00
Ankit Jain 2709c812c0 [wasm][debugger] Add support for visualizing valuetypes (#19232)
* [wasm][debugger] Move some of the variable name/value pairs fix up to

.. library_mono.js from MonoProxy.

* [wasm][debugger] Handle invalid scope id

- this would throw NRE, and the request would fail, and so the test
passed.

* [wasm][debugger][tests] Check functionName at breakpoints

.. and fix up tests.

* [wasm][debugger][tests] Remove unnecessary `ctx` arg

* [wasm][debugger] Add support for visualizing valuetypes

- Valuetypes are expanded into json, and cached. That gets used to
answer any `getProperties` request for them.

- When a valuetype is a local var, it's whole value expansion is
returned in `members` json field. This gets cached by MonoProxy, and
used to answer any `getProperties` requests for it's members.

- When a valuetype is part of an object, it is *not* expanded. Instead,
it gets an objectId of the form `dotnet:valuetype:containingObjectId:fieldOffset`.
  - Later, when the debuggers asks for that special id, we expand *all*
  the valuetypes in that containing object, and cache it.

  - For properties, the property "number" as they are enumerated, is
  used instead of the fieldOffset.

- this cache gets cleared whenever we step/resume the debugger.

* [wasm][debugger] Add support for visualizing enums

TODO: Flags

* [wasm][debugger] Don't invoke property getters when enumerating object

.. members.

* [wasm][debugger] Override `ToString` for `Result` class
2020-04-02 09:04:42 -04:00
sharkcz 2a531e04b3 update perf jitdump for ppc64/ppc64le and s390x (#19405)
Add missing constants to handle ppc64/ppc64le and s390x platforms.

Related: https://github.com/mono/mono/commit/68a8b9290958ee5e9b21d8ff6b73a707e2504d39
Fixes: https://github.com/mono/mono/issues/19402
2020-04-01 22:07:22 +02:00
Alex Thibodeau b1d4be3bab Ensure generic parameter constraint type is included when building image (#19395)
sets.

Making associated change to type_in_image to also check the constrained type for a match. Re-adding asserts now they they no longer trigger.

fixup, accidentally used old function

adjusting coding convention to K&R
2020-04-01 16:01:01 -04:00
Zoltan Varga bd635ac8b4 [wasm] Throw an exception when trying to start a thread instead of asserting. (#19396) 2020-04-01 15:13:20 -04:00
Alexis Christoforides 5733960ac4 [ios][sdks] Fix finalizer thread init in runner (#19412)
Starting with https://github.com/mono/mono/pull/16907 , the runtime ends in GC-Safe state (mode) after mono_jit_init_version() is called. mono_gc_init_finalizer_thread() expects the GC to not already be in safe mode.
2020-04-01 21:05:55 +02:00
Alexander Köplinger 9485a66d20 Fix Windows .msi build using newer xar
The old version didn't compile anymore with OpenSSL 1.1
2020-04-01 16:31:27 +02:00
monojenkinsandEgorBo a92528508e [mono] Fix setMArch, getArchName() doesn't work as expected (#19403)
Turns out `llvm::Triple(llvm::sys::getDefaultTargetTriple()).getArchName()` doesn't work as expected on all targets so the only option is to set arch via defines.

NOTE: it accepts "x86-64", not "x86_64

Co-authored-by: EgorBo <[email protected]>
2020-04-01 14:23:31 +02:00
monojenkinsandEgorBo ad0ee22923 [mono] Fix LLVM JIT on Arm64 (#19397)
`EB.selectTarget ();` used to return `NULL` on arm64 (and hit an assert later)
Turns out it needs MArch on arm (e.g. `"aarch64"`) set. No idea why it doesn't use host arch by default on arm (but works on x86).

Co-authored-by: EgorBo <[email protected]>
2020-04-01 12:43:06 +02:00
Alexander Köplinger e10990125d Fix Windows .msi build with recent cygwin updates
Cygwin now ships libssl 1.1 which removed OpenSSL_add_all_ciphers so the xar configure fails.
Replace the configure check with another existing function to fix it.
2020-04-01 12:36:26 +02:00
monojenkinsandpi1024e 49ea50d5b4 Remove duplicated .gitignore patterns (#19370)
Co-authored-by: pi1024e <[email protected]>
2020-04-01 11:46:54 +02:00
monojenkinsandEgorBo f301481bc1 [mono] fix SIMD instructions' availability (#19387)
Fixes: https://github.com/dotnet/runtime/issues/34304

@tannergooding @davidwrighton
Now it fully matches clang/LLVM behavior, e.g. even `-mattr=+avx2` (or `-mavx2` in clang) doesn't enable `pcmul` and `aes`. However, `-mattr=+sse4.2` (`-msse4.2`) enables `popcnt` (see https://godbolt.org/z/RWAp_D). The intel manual says

![image](https://user-images.githubusercontent.com/523221/78015652-59d70e00-7352-11ea-9f88-64772e76f842.png)

So is there a CPU with AVX set but without `popcnt`? The instruction is pretty useful (it is used in BCL) users might forget to define it when they use `mattr=avx` (or `mattr=avx2`).

However in C++ world programmers use named groups e.g. `mcpu=haswell` rather than listing these sets via attributes.

Co-authored-by: EgorBo <[email protected]>
2020-04-01 11:41:50 +02:00
Thays Grazia a17ab75dea Adding static to ss_req_acquire and ss_req_count (#19390) 2020-03-31 15:37:04 -03:00
Fan Yang 68a8b92909 Initial perf jitdump implementation (#19273)
* Initial perf jitdump implementation

* Incorporate PR feedback

* Incorporate feedback round 2

* Incorporate feedback round 3

* Minor change

* Incorporate feedback round 4
2020-03-31 09:03:43 -04:00
Zoltan Varga b9f52f3681 [runtime] Fix a problem with PR #19361. (#19374) 2020-03-31 05:06:12 -04:00
Kenneth Pouncey d525e3d5a3 Document threading setup for webassembly build (#19341) 2020-03-31 06:33:30 +02:00
Kenneth Pouncey 62e6a2e0c6 Reactivate the browser threads tests. (#19365) 2020-03-31 06:32:38 +02:00
monojenkinsandimhameed 722e58cc15 [mono][llvm] Improve LLVM 9 compatibility. (#19340)
Improve LLVM 9 compatibility.

Several intrinsics were removed in LLVM 7 and above; replace them with
IR sequences that generate the desired instructions.

Fix some type mismatch problems with the generated IR (in
Sse2.StoreAlignedNonTemporal, Vector128.CreateScalarUnsafe, and
Sse2.MaskMove); these were caught by running the coreclr hardware
intrinsic JIT tests.

Support the two-argument forms of Sse.SqrtScalar, Sse.ReciprocalScalar,
and Sse.ReciprocalSqrtScalar.

llvm::linkCoreCLRGC(), in llvm/CodeGen/GCs.h, was removed and replaced with
llvm::linkAllBuiltinGCs(), in llvm/CodeGen/BuiltinGCs.h.

In mono_llvm_dump_value and mono_llvm_dump_module, flush the c library's
stdout stream before using (and flushing) LLVM's own buffered output
functions.

Co-authored-by: imhameed <[email protected]>
2020-03-30 14:01:45 -07:00
Zoltan Varga b745e20e84 [wasm] Add a try-catch around GetCallingAssembly () calls in ResourceManager, it can fail on wasm aot. (#19358)
Fixes https://github.com/mono/mono/issues/19314.
2020-03-30 13:57:26 -04:00
Jérôme Laban 5bf237a2a4 [Wasm] Fix string_decoder when running with threading enabled (#19355)
* [Wasm] Fix string_decoder when running with threading enabled

Avoids the following error message:

```
Failed to execute 'decode' on 'TextDecoder': The provided ArrayBufferView value must not be shared.
```

* [Wasm] Cache text decoder
2020-03-30 10:13:55 -05:00
Zoltan Varga 4f6b3f30f0 [wasm] Throw an exception in some blocking operations in non-threaded mode. (#19363)
* [wasm] Throw an exception from Monitor.Wait () in non-threaded mode.

* [wasm] Throw an exception when waiting for unsignalled events in non-threaded mode.
2020-03-30 08:36:22 -04:00
monojenkinsandBrzVlad 771fbddefa [interp] Optimize Span<byte>.Fill (#19351)
Co-authored-by: BrzVlad <[email protected]>
2020-03-30 11:56:02 +03:00
Zoltan Varga a30be514e2 [llvmonly] Avoid marking the rgctx/vtable variable indirect, its not needed. (#19287)
In normal llvm mode, these variables are marked as indirect and stored to a stack slot so the EH code can access them.
2020-03-30 04:54:00 -04:00
Zoltan Varga 07febe2bb0 [runtime] Allocate the memory for gshared gparams from image sets. (#19361)
Fixes https://github.com/mono/mono/issues/18127.
2020-03-30 04:43:38 -04:00
Larry Ewing cf7d5d5f45 [wasm][sdk] fix output files (#19360) 2020-03-29 16:36:48 -04:00
Zoltan Varga fbc3a9757a [wasm] Fix threads support in the packager. (#19359) 2020-03-29 16:17:07 -04:00
Zoltan Varga 6e9e5b8ef2 Bump ikvm to pick up 26a033ed9de36f462946232a9b1b7984618c5e1f. 2020-03-29 13:21:00 +02:00
Zoltan Varga f2878d45d8 [wasm] Bump emscripten to 1.39.11. (#19342)
* [wasm] Bump emscripten to 1.39.11.

* [wasm] Build the debug runtime using -g, -g4 disables dwarf.

* Add runtime debugging docs.

* Avoid copying the dotnet.wasm.map file its not generated anymore with dwarf.
2020-03-29 04:21:53 -04:00
Zoltan Varga d336d6be30 [llvm] Handle this arguments as inputs to phi nodes, i.e. for IL code doing starg.0. (#19323) 2020-03-28 03:59:37 -04:00
Vlad Brezae 450a6d6ac7 [interp] Constant fold also checked conversion opcodes (#19294)
* [interp] Constant fold also checked conversion opcodes

* [interp] Remove duplicated opcode
2020-03-27 23:06:25 +02:00
Alex Thibodeau e5be81d921 Need to convert from uint instead of cast here to maintain consistency with mono_gchandle_new_weakref_internal. (#19333)
Looks like this was missed in: https://github.com/Unity-Technologies/mono/commit/941a335ea0f20c22a02a7947945f53787a56b2d3
2020-03-27 20:58:32 +01:00
monojenkinsandBrzVlad 09f5ce3588 [interp] Fix issues around not yet supported System.Runtime.Intrinsics (#19344)
Special cases around infinite recursiveness were not handled by the interpreter.

Co-authored-by: BrzVlad <[email protected]>
2020-03-27 17:03:17 +02:00
Kenneth Pouncey 42c9cfb1fd [wasm][tests] Cleanup browser tests (#19325)
* fix clean target

* Upgrade project to netstandard2.1 and change to not append framework when publish

* Move projects to netstandard2.1

* Remove code referencing framework paths
2020-03-27 06:05:55 +01:00
Kenneth Pouncey 48871c1ff5 [wasm][sdk] Remove Required attribute from Bindings Directory. (#19326)
- Causes build error if sdk path is not being overridden.
2020-03-27 06:04:49 +01:00
Zoltan Varga 36f41ac8df [wasm] Build aot-hello using --nobinding. (#19331) 2020-03-26 16:56:15 -04:00
Thays Grazia 282320c35f [debugger] Bump protocol for this commit https://github.com/mono/mono/pull/19248 (#19318)
* Bump protocol for this commit https://github.com/mono/mono/pull/19248 as suggested by @vargaz.

* Fix coding convention.
2020-03-26 16:51:45 -03:00
monojenkinsandCoffeeFlux 1add5cbc06 [meta] Make monovm.h public (#19305)
Co-authored-by: CoffeeFlux <[email protected]>
2020-03-26 11:42:21 -04:00
monojenkinsandCoffeeFlux 4c36b361c4 [loader] Initial work to support ALC collectability (#19304)
This should enable creation of a collectible ALC from managed, though it will not actually unload properly when Unload is called. This should be enough to unblock Xamarin porting work.

If you think the `mono_alc_cleanup` work is just noise I can remove that, but I thought it helpful to check in to make future diffs clearer as I split it up with the LoaderAllocator work.

Co-authored-by: CoffeeFlux <[email protected]>
2020-03-26 11:17:57 -04:00
Thays Grazia 78fe8c2969 [debugger] Fix suspend_policy that will be send to debugger-libs (#19317)
- Fix suspend_policy that will be sent to debugger-libs, because on debugger-libs we want to resume the VM only when it's suspended, but we were sending the wrong suspend_policy in the case of EVENT_KIND_VM_START and mono is started with suspend=y.
  With this fix we can do this PR again: https://github.com/mono/debugger-libs/pull/264/

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/999375/
2020-03-26 10:15:11 -03:00
Martin Baulig c9171a63be [wasm][debugger]: Correctly handle null sessionId. (#19327)
When the sessionId is null, don't send "null" but omit the field;
Canary does not permit "sessionId: null".
2020-03-26 14:07:14 +01:00
Zoltan Varga 151ba57d0f [llvm] Disable running the llvm verifier by default, it was enabled by mistake, and it takes a long time. (#19319) 2020-03-26 08:10:30 -04:00
Martin Baulig b0e3196b9f [wasm][debugger]: Move some of the internal helper classes into a separate file. (#19324) 2020-03-26 11:52:38 +01:00
monojenkinsandlateralusX c5a9510329 Add stack guarantee on Mono Windows to handle stack overflow. (#19296)
When hitting stackoverflow on Windows, the amount of stack available to exception handler is too small. Windows doesn't support alt stack as other platforms, but there is a way to guarantee a certain amount of available stack during stack overflow exceptions using
SetThreadStackGuarantee.

Fix add support on Windows platforms including SetThreadStackGuarantee API to reserve space needed to handle stack overflow exceptions. On Windows debug build the size needs to be larger since we might end up calling JIT that could have quite deep callstack that, on unoptimized
builds, will need more stack.

Co-authored-by: lateralusX <[email protected]>
2020-03-26 10:29:52 +01:00
Kenneth Pouncey eb9cb9b302 [wasm] Add make target to clean the framework directory (#19316) 2020-03-26 05:46:51 +01:00
d9089e914b [wasm][bindings] Remove typedarray length validation (#19315)
* [wasm][bindings] Remove typedarray length validation

fixes https://github.com/mono/mono/issues/19288

* Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/TypedArray.cs

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

Co-authored-by: Larry Ewing <[email protected]>
Co-authored-by: campersau <[email protected]>
2020-03-26 05:46:00 +01:00
Matt Mitchell 437ca1d81c Feed cleanup (#19321)
Switch away from blob feeds
2020-03-25 19:52:08 +01:00
Alex ThibodeauandJonathan Chambers b1a1f06110 Do not access unloading domains in debugger (case 1013579) (#19299)
There was a race where a domain was being unloaded while debugger would access it. A domain was only removed from the 'appdomains_list' as a very last step. The domain was already invalid to access at this point (locks freed for example).

Worse, images would be unloaded if only referenced by that domain. All places the debugger iterates domains hold the loader lock. The loader lock is acquired by the domain unloading process, so as long as a domain is not unloading when we access it inside of the loader lock we are safe.

include domain unloading check in collect_domain_bp

Co-authored-by: Jonathan Chambers <[email protected]>
2020-03-25 14:15:08 -03:00
monojenkinsandCoffeeFlux 2881514b3d [loader] Fix some log masks in native-library (#19280)
Copy-paste error

Co-authored-by: CoffeeFlux <[email protected]>
2020-03-25 16:43:41 +01:00
CzBiX 9967b065b2 Refine UnixEndPoint to support Windows Unix socket (#19274)
On windows, remote end point client will not return file name, but socket address size still isn't `0x02`.
So check empty file name after bytes readed.
2020-03-25 16:25:57 +01:00
monojenkinsandCoffeeFlux 45694f7c99 [loader] Clear filename when debugging assembly unloading (#19303)
Co-authored-by: CoffeeFlux <[email protected]>
2020-03-25 11:09:35 -04:00
monojenkinsandCoffeeFlux a89b6d3217 [metadata] Skip symbol name mangling on non-Windows for netcore (#19281)
Fixes dotnet/runtime#33246

Co-authored-by: CoffeeFlux <[email protected]>
2020-03-25 15:23:00 +01:00
Kenneth Pouncey 61830e01f6 [wasm][sdk] Add functionality to override the bindings framework location (#19310)
* [wasm][sdk] Add functionality to override the bindings framework location

- Facilitate testing of intree build during the browser tests.

* white space
2020-03-25 12:02:46 +01:00
Vlad Brezae 8ec501a34f [jit] Initialize correct class for tls fields (#19300)
Initialize the klass containing the field to be accessed, rather than the class of the method from where we are accessing.
2020-03-25 10:06:27 +02:00
Zoltan Varga 8543df76a9 [llvmonly] Throw an ExecutionEngine exception with a helpful message when we try to execute a method which failed AOT compilation. (#19302) 2020-03-25 00:40:09 -04:00
dotnet-maestro[bot]anddotnet-maestro[bot] 4eb25bc4b6 Update dependencies from https://github.com/dotnet/arcade build 20200321.1 (#19289)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20171.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20171.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2020-03-25 00:40:51 +01:00
monojenkinsandCoffeeFlux 9f390a7d8a [metadata] Fix leak in custom attribute lookup (#19279)
https://github.com/dotnet/runtime/commit/9dec6ae2ea81d46884bf49d2df8b26cc1e28eb12#r37604565

Co-authored-by: CoffeeFlux <[email protected]>
2020-03-24 19:40:34 -04:00
a9bf876bb7 [debugger] Implementing step through multithreaded code. (#19103)
* Implementing step through multithreaded code.

* Fixing concurrency in the case that more than one thread will run the same code, then when the jit is finished, the thread which jitted the code calls jit_done and the others that were waiting don't call, in this case, the other threads can run before the thread which is calling the jit_done set the breakpoint, so the other threads will not stop in the breakpoint.
As I understood we don't need to check if the try_suspend_runtime is returning false or true when we  hit a breakpoint from context, so removed the call.

Fixes #14456

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
Co-authored-by: monojenkins <[email protected]>
2020-03-24 18:24:33 -03:00
Alexander Köplinger 4cbcc9195d Reenable a bunch of disabled iOS Mono SDKs test suites (#19301)
* Reenable a bunch of disabled iOS Mono SDKs test suites

System, System.Net.Http, System.Web.Services, Mono.CSharp and Mono.Data.Sqlite test suites are running now.

Also tweaks the test UI so you can query it via Xcode's UITest in an automated way.

* Switch to APIs from public headers added in 1425b4d4d0
2020-03-24 20:41:38 +01:00
monojenkinsandlambdageek 1425b4d4d0 [mono] Make some API functions public and private (#19259)
See https://github.com/dotnet/runtime/pull/33633 and https://github.com/xamarin/xamarin-macios/blob/master/runtime/exports.t4

* `mono_install_load_aot_data_hook` was already a `MONO_API`, but it was not in a public header.
  It is added to `mono/jit/mono-private-unstable.h`
* `mono_gc_init_finalizer_thread` was [used by Xamarin.iOS](https://github.com/xamarin/xamarin-macios/blob/63ab48e679716264b33af00f86c24426da1d9f97/runtime/mono-runtime.h.t4#L278) for a long time without being in any public header.  It's one of the reasons we have to compile Mono for XI with `--disable-visibility-hidden`.  Make the function a proper `MONO_API` unconditionally - but make it do nothing if the runtime is compiled without `--with-lazy-thread-creation` (the default).  It is now a public Mono API function.
* `mono_trace_init` was a `MONO_API` function in a non-public header that was already used by embedders that need to set up logger hooks.  It is now not necessary to call this before calling the logger functions to set up logger hooks such as `mono_trace_set_log_handler`

Co-authored-by: lambdageek <[email protected]>
2020-03-24 09:29:34 -04:00
Vlad Brezae 77bcd7497d [interp] Replace ldloca + ldfld/stfld pairs with ldloc/stloc (#19286)
* [interp] Move INDIRECT flag to a separat counter variable

We will optimize away some ldlocas, so a local can stop being indirect at a future cprop iteration.

* [interp] Replace ldloca + ldfld/stfld pairs with ldloc/stloc

If loaded/stored field is the only field of the valuetype. This is meant to mainly optimize IntPtr accesses.

* [interp] Add counter for removed LDLOCA
2020-03-24 13:59:03 +02:00
Alexander Köplinger 81939f45c4 Bump nunitlite to get https://github.com/mono/NUnitLite/pull/26 2020-03-24 11:17:32 +01:00
monojenkinsandlateralusX db7c5aa72e Remove Mono runtime vcruntime140.dll release build dependency. (#19270)
CoreCLR static link vcruntime140.dll, but dynamic link rest of C-runtime using ucrt.lib in release build. Commit align Mono runtime to follow same pattern, removing dependency on vcruntime140.dll.

Co-authored-by: lateralusX <[email protected]>
2020-03-24 08:24:01 +01:00
monojenkinsandlateralusX 7d33bd36f1 Implement icall used by RuntimeHelpers.EnsureSufficientExecutionStack on netcore Mono. (#19271)
Current implementation always returned true for Windows/Linux/Android. There are however use of this API in Task library to make sure recursive tasks won't hit stackoverflow. There are several tests in System.Threading.Tasks that currently hit this, at least on Windows, causing test failures.

Fix use stack limits already setup in register_thread and used by GC when doing conservative stack scan. If the limits have not been setup or is not supported on platform, we will use old defaults, always assume there is enough stack space available. Heuristics around size of minimum execution
stack needed are picked from corresponding CoreCLR implementation.

With this fix all tests run in System.Threading.Tasks.Tests pass on Windows using Mono runtime:

```
=== TEST EXECUTION SUMMARY ===
     System.Threading.Tasks.Tests  Total: 682, Errors: 0, Failed: 0, Skipped: 3, Time: 11,419s
----- end 2020-03-20 13:43:35,72 ----- exit code 0 ----------------------------------------------------------
```

Before fix the following tests hit stackoverflow:

LongContinuationChain_ContinueWith_DoesNotStackOverflow
LongContinuationChain_Unwrap_DoesNotStackOverflow
LongContinuationChain_Await_DoesNotStackOverflow
RunStackGuardTests

Co-authored-by: lateralusX <[email protected]>
2020-03-24 08:22:32 +01:00
Johan Lorensson fa0f2ce8ab Move unbox tramp method address table to data segment, MONO_ARCH_CODE_EXEC_ONLY. (#19292)
unbox tramp method addresses are emitted as a table of calls and read
at runtime by get_call_table_entry. This is problematic on platforms
that doesn't allow data to be read from instruction stream.

Fix follow same pattern as we method address table emitted as function
pointers into table in data segment when using MONO_ARCH_CODE_EXEC_ONLY.
2020-03-24 00:28:15 -04:00
monojenkinsandlambdageek 9504df9ad2 [mono] retry mono_threads_pthread_kill if result == EAGAIN on Linux (#19291)
Try to address https://github.com/dotnet/runtime/issues/32377
(signal queue overflow) by sleeping and retrying a few times.

This is kind of a hack, but it would be good to see if it will address the issue

Co-authored-by: lambdageek <[email protected]>
2020-03-23 23:14:00 -04:00
monojenkinsandlambdageek 0102498d01 [mono] Add headers for unstable APIs (#19272)
We have functions that are de-facto part of the Mono embedding API that are
used by Xamarin.iOS or Xamarin.Android that are not in a state where we want to
commit to supporting them forever in their current form.

Nonetheless, we would like to make sure that the symbols for these functions
are visible even if we otherwise compile the runtime with
`-fvisisibility=hidden`, and we would like to discourage declaring the
functions in the embedder's own headers.

The functions that go into the
`mono/{utils,metadata,jit}/mono-private-unstable.h` headers will all be marked
with `MONO_API MONO_RT_EXTERNAL_ONLY` but we will not guarantee that the
functions will be there from one release to the next or that they will not
change their signatures or their behaviors.

Co-authored-by: lambdageek <[email protected]>
2020-03-23 19:54:25 -04:00
Zoltan Varga bf75db1199 [jit] Perform inlining earlier during call processing to avoid loading vtable/rgctx args which are not needed. (#19283)
* [jit] Perform inlining earlier during call processing to avoid loading vtable/rgctx args which are not needed.

* Avoid inlining calls marked with .tail.
2020-03-23 15:16:56 -04:00
Jay Krell 93457ec8c3 [debug_interp] Do not use uninitialized local. (#19275) 2020-03-23 12:38:37 +01:00
CoffeeFlux 47d542a1b8 [loader] Fix mistake in netcore_load_reference comment
The code here was right, the comment wrong. Also updated to mention that we now check APP_PATHS.
2020-03-23 07:11:05 +01:00
Zoltan Varga 3a08f494a9 [llvm] Unify the emission of GOT access. NFC. (#19250)
* [llvm] Use the _typed version of get_aotconst () everywhere. Lowercase aotconst variable names.

* [llvm] Unify the emission of GOT access. NFC.

* [llvm] Unify the mini_llvm_init_method icalls, use only 1 icall.
2020-03-21 21:17:58 -04:00
Vlad Brezae e0ea5d5de5 [interp] Remove MINT_TYPE_P (#19269)
MINT_TYPE_P is equivalent to the integer versions. By removing it we reduce the number of interpreter types and instructions, making it also easier to apply optimizations on instructions targeting these types.
2020-03-20 17:08:38 +02:00
campersau 12055c887b [wasm] WasmHttpMessageHandler abort connection when response or response content is disposed (#18765) 2020-03-20 16:07:52 +01:00
Aleksey Kliger (λgeek) a416864867 [coop] Make MONO_ENTER_GC_UNSAFE fatal if no_safepoints is set (#18992)
Previously it would print a warning, only, because otherwise we would get a
second assert in the same place while the crash machinery would run from the
current thread from the abort in `mono_fatal_with_history`

The solution is to turn off the "no safepoints" bit since we know we're
definitely going to assert here.

Also record the current state in the checked mode state transition history to
make it a bit easier to diagnose where the problem surfaced.

Also fixed up a pair of other debugging/tracing messages so the message strings
accurately reflect the state.
2020-03-20 10:58:41 -04:00
41d607b629 Updating the Copyright line display when running 'mono --version' (#19060)
Removes the copyright year.

```
$ mono --version
Mono JIT compiler version 6.6.0.166 (2019-08/d9001b5ae70 Wed Feb 12 19:20:16 EST 2020)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	Interpreter:   yes
	LLVM:          yes(610)
	Suspend:       hybrid
	GC:            sgen (concurrent by default)
```

Co-authored-by: Alfonso, Ivan <[email protected]>
Co-authored-by: Alexander Köplinger <[email protected]>
2020-03-20 13:22:08 +01:00
Thays Grazia 871bfad41d [debugger] Fix NOT_IMPLEMENTED while debugging. (#19248)
- Changed the behavior on debugger-agent, if we can't parse the new behavior is to return invalid_argument and not assert and stop debugging
- Changed the mono_domain_set_fast before return from assembly_commands.
- Add error message when return INVALID_ARGUMENT

Fixes #19146
2020-03-20 09:21:26 -03:00
Jay Krell ca1e5c3214 Remove dead code from bug-10127.cs. (#18762) 2020-03-20 13:08:06 +01:00
Phil Jaenke aa688393ba [FreeBSD] Fix for libinotify support and compile (#19234)
Resolves #18528 in for both detection and compiling. This should backport cleanly to next release.

Tested on 12.1-RELEASE with libinotify; configure detects features correctly, compiles successfully, resolves some observed issues during run.

```
#define HAVE_SYS_INOTIFY_H 1
#define HAVE_LIBINOTIFY 1
#define HAVE_INOTIFY_INIT 1
#define HAVE_INOTIFY_ADD_WATCH 1
#define HAVE_INOTIFY_RM_WATCH 1
#define HAVE_INOTIFY 1
```
2020-03-20 13:00:13 +01:00
dotnet-maestro[bot]anddotnet-maestro[bot] 4a22f285e5 Update dependencies from https://github.com/dotnet/arcade build 20200312.3 (#19236)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20162.3
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20162.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2020-03-20 12:49:55 +01:00
Alexander Köplinger 0763fb8b13 Bump boringssl submodule 2020-03-20 11:54:54 +01:00
monojenkinsandlambdageek 2a11ec6687 [mono] Enter GC Unsafe mode in some string allocation functions (#19261)
All these functions are MONO_RT_EXTERNAL_ONLY and they all allocate managed
objects.

Fixes a coop state machine assertion if an embedder calls the function and it needs to take the GC
lock to do a collection.

Co-authored-by: lambdageek <[email protected]>
2020-03-19 19:00:26 -04:00
monojenkinsandEgorBo d1362b026e [mono] return false for AdvSimd.IsSupported and friends (#19263)
Fixes StackOverflow in https://github.com/dotnet/runtime/pull/33749#issuecomment-601271356
Intrinsify all `get_IsSupported` under `System.Runtime.Intrinsics*` to just `false` (except the sets we support, see mono_emit_simd_intrinsics).

Co-authored-by: EgorBo <[email protected]>
2020-03-20 01:30:02 +03:00
Zoltan Varga 8ca4d3e6a2 [runtime] Fix the mapping of 'int' in jit icall signatures, it should be int32 not native int. (#19249)
* [runtime] Fix the mapping of 'int' in jit icall signatures, it should be int32 not native int.

* Add a sizet type to icall signatures.
2020-03-19 06:38:19 -04:00
monojenkinsandlateralusX 729bd0a88d Ignore register unwinder callback for empty patch_info data table on Windows Mono Runtime. (#19254)
Running System.Runtime.Serialization.Xml test suite triggers calls to mono_code_manager_reserve with 0 size code block. On Windows, allocating code regions from code manager will also add callback for code region into unwinder function table, but since region could be 0 length, it will be causing a crash in RtlInstallFunctionTableCallback OS call.

Fix hardens code to not try to register callbacks for code regions of size 0, since that is considered a critical error by Windows OS API.

Co-authored-by: lateralusX <[email protected]>
2020-03-19 11:02:03 +01:00
Vlad Brezae 4359b8ff6f [interp] Optimize out intptr ctor (#19252)
* [interp] Extract nint/nfloat intrisifying code into separate method

* [interp] Optimize out intptr ctor

We avoid the newobj_vt opcode and the ctor's contents by emitting a conversion opcode directly.
2020-03-19 10:37:21 +02:00
monojenkinsandlateralusX 468ef7b362 Mono DISABLE_SIMD still emits OP codes depending on SIMD support. (#19251)
Fix makes sure runtime checks also report that SIMD has been disabled. Returning FALSE from is_simd_supported will turn of MONO_OPT_SIMD and disable all SSE/AVX cpu features will prevent code checking cpu capabilities to emit SIMD instructions.

Co-authored-by: lateralusX <[email protected]>
2020-03-18 23:31:47 -04:00
monojenkinsandlateralusX d43e869bc8 Fix warning building Mono using -Wint-conversion. (#19253)
Co-authored-by: lateralusX <[email protected]>
2020-03-18 23:29:25 -04:00
Vlad Brezae 001d4b3338 [interp] Inline also constructors of valuetypes (#19238)
* [interp] Inline also valuetype constructors

* [interp] Unify vt and non-vt inlining code

* [interp] Fix c++
2020-03-18 23:47:08 +02:00
Vlad Brezae 0d9d923e94 [interp] Do cfold for a few more unary operators (#19200)
That are accessing the stack value at level -2.
2020-03-18 23:11:30 +02:00
Johan Lorensson 56088a653f Fix additional constants embedded in instruction stream on AMD64. (#19246)
A couple of more op codes embedded constant values in instruction stream.
When using MONO_ARCH_CODE_EXEC_ONLY these needs to be moved into GOT slots.
2020-03-18 13:51:00 +01:00
Jay Krell acfa161730 Remove useless ip += from MINT_JMP, it is assigned later. (#19217) 2020-03-18 02:42:56 -04:00
Kenneth Pouncey c1b0b95549 [wasm] cleanup npm/node install. (#19244)
browser tests were failing with node command not being found if the other tests were not run before.  This makes sure that the  NPM command can be found by installing it if not there.

This also separates out the npm version that is being installed.
2020-03-17 11:11:53 +01:00
Johan Lorensson 696ec4da7e Fix usage of JIT_FLAG_CODE_EXEC_ONLY flag. (#19237)
Current implementation didn't convert the JIT flags into options on cfg
meaning that code currently checked JIT_FLAG_CODE_EXEC_ONLY never
executed. Fix handles the new JIT flag in same way as other JIT flags,
converted into bit field on cfg.
2020-03-17 00:51:10 -04:00
Alexis ChristoforidesandAleksey Kliger edf6c286a1 [merp] Add breadcrumb for StackHash (#19240)
* [merp] Add breadcrumb for StackHash

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

* Update mono/utils/mono-state.c

Co-Authored-By: Aleksey Kliger (λgeek) <[email protected]>

* Update mono/metadata/threads.c

Co-Authored-By: Aleksey Kliger (λgeek) <[email protected]>

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
2020-03-16 22:23:21 -04:00
Zoltan Varga 05880086f5 [jit] Transition the SIMD code to use the MONO_CPU_... set of flags instead of the SIMD_VERSION_... flags. (#19139)
* [jit] Transition the SIMD code to use the MONO_CPU_... set of flags instead of the SIMD_VERSION_... flags.

* Enable SIMD version checking when targeting llvm.
* AOT test assemblies using -mcpu=native.

* Remove unused mono_arch_cpu_enumerate_simd_versions (). Move the SIMD_VERSION_ constants to simd-intrinsics.c.

* Use -mcpu=native for aot testing.
2020-03-16 21:02:32 -04:00
Mitchell HwangandMitchell Hwang ab893a369a [Loader] Change mono_trace level from info to debug (#19110)
* [metadata] Change mono_trace levels from info to debug

* [mini] Change mono_trace level from info to debug

* [sgen] Change mono_trace levels from info to debug

* Amended metadata changes

* Amended mini changes

* Amend assembly.c no special case

* Amend sgen-mono.c elevate to warning level

Co-authored-by: Mitchell Hwang <[email protected]>
2020-03-16 08:27:24 -04:00
monojenkinsandEgorBo 2e73a3a25a [mono] Implement all Ssse3 and Sse42 intrinsics (#19225)
Implement all `Ssse3` and `Sse42` intrinsics for LLVM back-end.
`Sse41` is left over (that's why `Sse42.IsSupported` still returns false always outside of corelib)

Godbolt: https://godbolt.org/z/7cd7q5

Co-authored-by: EgorBo <[email protected]>
2020-03-14 23:20:24 -04:00
Zoltan Varga 4ac244261c [wasm] Add a sample for collecting coverage data. (#19223) 2020-03-14 15:16:43 -04:00
monojenkinsandEgorBo 8248c90656 [mono] Implement missing SSE2 intrinsics (#19222)
https://github.com/dotnet/runtime/pull/33465 implemented 99% of them but a few were missing. This PR implements the missing pieces and unlocks `Sse2.IsSupported`.

@vargaz I hope I didn't step on your toe (feel free to close if you already have it locally).

Co-authored-by: EgorBo <[email protected]>
2020-03-13 23:36:01 -04:00
Zoltan Varga d147c60e31 [jit] Add support for emitting r4/r8 constants outside of the text segment. (#19219) 2020-03-13 18:26:29 -04:00
Zoltan Varga 786fdf6a38 [runtime] Coverage profiler improvements. (#19213)
* [interp] Add support for the coverage profiler.

* [runtime] Add 'write-at-method' and 'send-to-method' options to the coverage profiler, they work similarly to options in the AOT profiler.

* Fix c++-isms.
2020-03-13 18:01:00 -04:00
monojenkinsandlambdageek ed2df9c816 [threads] If shutting_down, don't create new thread, kill current thread (#19082)
If the runtime is shutting down, instead of creating a new thread, or throwing
an exception on the current thread, just shut down the current thread.

This takes advantage of `mono_threads_set_shutting_down`'s behavior that if you
call it after shutdown is already started, it will suspend, detach and exit
from the current thread.

Fixes https://github.com/dotnet/runtime/issues/31842

Co-authored-by: lambdageek <[email protected]>
2020-03-13 10:45:14 -04:00
monojenkinsandjkotas 873067cb27 Fix line endings under src/mono (#19215)
Fixes dotnet/runtime#2222

Co-authored-by: jkotas <[email protected]>
2020-03-13 09:54:51 -04:00
Thays Grazia b777471fca If there is a crash and the debugger is attached, we call mini_get_dbg_callbacks ()->send_crash(). (#19191)
That call ends up in mono_debugger_agent_send_crash which does all kinds of questionable stuff like trying to take the loader lock. Eventually it ends up calling socket_transport_send which tries to do a transition to GC Safe mode.
I inserted a MONO_ENTER_GC_UNSAFE in mono_debugger_agent_send_crash function and this fixes the assert.

Fixes #18794
2020-03-13 00:46:06 -03:00
Thays Grazia 0c2f59e016 [wasm][debugger] Continue SS after leaving managed code (#19140)
* Continue stepping over/into/out of managed code to native code, without this fix the behavior was resume when a SS leaves the managed code.
2020-03-13 00:44:49 -03:00
Larry Ewing 6e7146041a [wasm][tests] be slightly more careful looking for the connection string (#19211)
be slightly more strict about connection strings from chrome
2020-03-12 21:42:31 -05:00
monojenkinsandvargaz cb39826fc6 [jit] Add more SSE2 opcodes. Enable SSE2. (#19187)
Co-authored-by: vargaz <[email protected]>
2020-03-12 21:47:42 -04:00
Larry Ewing 150ffb7af3 [wasm][bindings] rework argument marshalling in call_method (#19150)
store a converter object for each type string passed in
use that object to simplify the marshalling step. do one allocation
for arguments and exceptions.
2020-03-12 20:43:43 -05:00
Larry Ewing 35415b28a7 [wasm][bindings] clean up symbol resolution (#19149)
Instead of hard coding a switch of available types we do a one type lookup for each type by name and store that result.
2020-03-12 20:37:30 -05:00
Larry Ewing 54f64a9d08 [wasm][websocket] Buffer writes when endOfMessage == false (#19185)
* [wasm][websocket] Buffer writes when endOfMessage == false

* [wasm][websocket] Set binaryType to arrayBuffer and handle that case
2020-03-12 20:32:24 -05:00
Aleksey Kliger (λgeek) f72f47b90e [corlib] Capture the ExceptionDispatchInfo when rethrowing from TaskContinuation (#19168)
* [corlib] Capture the ExceptionDispatchInfo when rethrowing from TaskContinuation

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

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

* [test] Add regression test

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

Additionally because the unhandled exception in the root domain would normally
terminate the application, we need to run this in a new appdomain.
2020-03-12 20:07:08 -04:00
Ankit Jain e0ec8de4b2 [master] Bump msbuild to track xplat-master (#19204) 2020-03-12 23:38:30 +01:00
Alexander Köplinger dcdec02b84 [metadata] Disable three icalls on netcore monodroid (#19198)
They aren't used there.
2020-03-12 19:17:36 +01:00
Johan Lorensson b58d7489be Disable Windows as default build host for WSL sdk builds. (#19196)
SDK builds done under WSL was done like Cygwin in order to be a
Cygwin replacement going forward. This has caused issues when building
sdk's under WSL when Linux is the assumed build host.

Adding an additional define where WSL build host can be overridden to
Windows, but default will now be Linux. This can in future be used
from configure scripts, setting it in sdks/Make.config when needed,
but will be an opt in feature to override Linux as default build host
for WSL.
2020-03-12 13:12:33 -04:00
Zoltan Varga 8fe10ad8e3 [wasm] Add some makefile dependencies. (#19193) 2020-03-12 11:25:08 -05:00
monojenkinsandlateralusX 70141f4959 Share managed EventSource/EventPipe implementation between CoreCLR and Mono. (#19173)
First set of changes needed in order to start sharing managed EventSource/EventPipe code between CoreCLR and Mono runtime. Shareable code has been moved into S.P.C library project and split into runtime specific source files when needed, kept within each runtime specific S.P.C project files.

Mono runtime has been extended with a set of icalls needed by EventPipeInternal, just to make sure EventPipe can be initialized, current Mono runtime implementation returns dummy values.

Current change also enables ETW provider support on Mono Windows runtime.

NOTE, this is just initial changes needed in order to share managed EventSource/EventPipe code between runtimes. Future changes will incrementally add EventPipe native code into Mono runtime.

Co-authored-by: lateralusX <[email protected]>
2020-03-12 13:36:24 +01:00
Alexis Christoforides 662f744a93 [merp] Remove unnecessary call to msync in mono_state_free_mem (#19167)
Closes https://github.com/mono/mono/issues/19136
2020-03-12 06:51:36 -04:00
Alexander Köplinger aeda6f0b26 Fix mistake in previous commit 2020-03-12 01:19:38 +01:00
Alexander Köplinger 306ebdfd30 Don't disable dllmap for mobile on netcore 2020-03-12 01:13:27 +01:00
Alexander Köplinger 0cc83ec613 Add assert when dllmap is disabled and fix support build in netcore mode
Ported from https://github.com/dotnet/runtime/commit/a54d391d9daebf7b53e7f1efc1690c1c35177570
2020-03-12 01:09:46 +01:00
Vlad Brezae b99f79fa94 [interp] Add more Math intrinsics (#19174)
* [interp] Add missing intrinsics for double Math operations

* [interp] Add math intrinsics for float operations

* [interp] Add more math intrinsics

With different type of signature

* [interp] Remove intrinsic for Round for now

Which has different semantics from the libc's round
2020-03-12 00:14:41 +02:00
Larry Ewing 691665884b [wasm][benchmarks] Add --wasm-package to bench runner to consume package builds (#19190)
This adds an option the standalone-benchmark runner to extract the package zips created with the package target and available from jenkins for commits to master.
2020-03-11 15:20:33 -05:00
Zoltan Varga 19fa221a33 Avoid passing /features:peverify-compat to csc, it generates very inefficient code in some cases. (#19144)
See https://github.com/mono/mono/issues/18572#issuecomment-595924767.

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

Disable the IL verifier for now, it can't handle code compiled without /features:peverify-compat.
2020-03-11 19:43:19 +01:00
Vlad Brezae 94ff330b60 [interp] Optimize delegate invokes (#19065)
Add a specialized MINT_CALL_DELEGATE invoke, which is faster than executing a separate generic managed wrapper method.
2020-03-11 20:09:55 +02:00
monojenkinsandEgorBo 7d623e5e62 [mono] Optimize boxing in Pattern Matching idioms (#18812)
This PR optimizes boxing for pattern matching idioms. Basically, it copies existing optimizations from CoreCLR to mono, see [impBoxPatternMatch](https://github.com/dotnet/runtime/blob/084dd1a5aae0fbe6ed4f9164ac4ee1c5f0b2398f/src/coreclr/src/jit/importer.cpp#L5856-L6032) (one of them was recently added by me for coreclr, see https://github.com/dotnet/runtime/pull/1817)
#### 1) `box + isinst + brtrue/brfalse`  -->  `ldc.i4.0/1 + brtrue/brfalse`
```csharp
public static int Case1<T>(T t)
{
    if (t is int)
        return 42;
    return 0;
}
/*
    IL_0000: ldarg.0
    IL_0001: box !!T
    IL_0006: isinst [System.Private.CoreLib]System.Int32
    IL_000b: brfalse.s IL_0010
    IL_000d: ldc.i4.s 42
    IL_000f: ret
    IL_0010: ldc.i4.0
    IL_0011: ret
*/
```
#### 2) `box + isinst + ldnull + ceq/cgt.un`  -->  `ldc.i4.0/1`
```csharp
public static bool Case2<T>(T t)
{
    return t is int;
}
/*
    IL_0000: ldarg.0
    IL_0001: box !!T
    IL_0006: isinst [System.Private.CoreLib]System.Int32
    IL_000b: ldnull
    IL_000c: cgt.un
    IL_000e: ret
*/
```
#### 3) `box + isinst + unbox.any`  -->  `nop`
```csharp
public static int Case3_1<T>(T o)
{
    if (o is int x)
        return x;
    return 0;
}

// or

public static int Case3_2<T>(T o) => o is int n ? n : 42;

// or

public static int Case3_3<T>(T o)
{
    return o switch
    {
        int n => n,
        string str => str.Length,
        _ => 0
    };
}
```
Tests can be found here: https://github.com/dotnet/runtime/tree/master/src/coreclr/tests/src/JIT/Generics/Conversions/Boxing

[Sharplab.io link](https://sharplab.io/#v2:EYLgtghgzgLgpgJwDQxASwDYB8CwAoAAQAYACAZQAsIEAHAGQmADoAlAVwDsY0w4BufPgIBmEgQCMANjEAmEgGF8Ab3wk1Y0ROlouC6HHEAeACoA+ABTGSMAJSr1KvOuck0AMxLmYrqK652nFyCCAHYSABYZAUDgsKJo5wBfezUUjTEpEmAAe2yMPSg4GRMLK1s0xyC1UOsfPxgE9WSYkjSRDO1deX1hAH0jM0sSbIDnSqr3T2y6nW8AD1Gq5xq5xtiSeLTmts1M2YK4PuLBqxGSAF5TYZndDhIAfhI7kAiowRb2rXqDvuESoZGFTSyzC0ygAHc0DAAMYUYFVcZLIL7O6XJ5IeFIjKkWAIC5XXFMOhwDgAcxgFAxLSxal6+I2mJciTWJGaznwiSAA===) to observe IL code for the samples above.

#### Codegen diff example:
```csharp
static bool Test(int n) => Validate(n);

static bool Validate<T>(T t) => t is int;
```
Before (for `Test`):
```asm
0000000000000000	pushq	%r14
0000000000000002	pushq	%rbx
0000000000000003	pushq	%rax
0000000000000004	movl	%edi, %ebx
0000000000000006	movabsq	$0x7fdf9c5090c0, %rax
0000000000000010	movabsq	$0x7fdfad0268e8, %r14
000000000000001a	leaq	0x1be800(%r14), %rdi
0000000000000021	movl	$0x14, %esi
0000000000000026	callq	*(%rax)
0000000000000028	movl	%ebx, 0x10(%rax)
000000000000002b	movq	(%rax), %rax
000000000000002e	cmpq	%r14, (%rax)
0000000000000031	sete	%al
0000000000000034	addq	$0x8, %rsp
0000000000000038	popq	%rbx
0000000000000039	popq	%r14
000000000000003b	retq
```
After:
```asm
0000000000000000	movb	$0x1, %al
0000000000000002	retq
```

Co-authored-by: EgorBo <[email protected]>
2020-03-11 19:45:48 +03:00
imhameed b74bbe9269 [arm] Fix branch island disassembly for arm64 and thumb. (#19188)
Followup to https://github.com/mono/mono/pull/19126 and
https://github.com/mono/mono/pull/19169.

Bring arm64 `mono_arch_get_call_target` in line with other platforms by
returning NULL on failure instead of asserting. Bits 30-26 in an arm64
unconditional branch are exactly 0b00101, so 0x1f (0b11111) is used as a
mask to determine if the branch uses an immediate target--0x7 (0b111)
would incorrectly match against branches using register targets. The
extracted immediate is now sign extended in a branch-free way.

Avoid following blx entries in the method address table; ld64 can emit 4
different instruction sequences for islands involving thumb, and I'd
rather not implement support for them all now because 32-bit iOS is old
and large unlinked assemblies seem rare.
2020-03-11 13:43:08 +01:00
monojenkinsandpi1024e 30f5d34400 No need to have a "while (TRUE)" statement if we can check at the end of the loop or at the beginning. (#19111)
Whenever there must be a loop that goes indefinitely, there are either return statements or break statements in the code.

However, in this codebase, there are "infinite loops" that appear as such until the next line is checked, which is an if statement saying to break if a condition is true.

This unneeded complexity can be resolved by inverting the condition and making that the while-loop condition.

Co-authored-by: pi1024e <[email protected]>
2020-03-11 13:41:15 +01:00
Jay Krell 2746d98c1e [interp][32bit] Fix warning about precedence/parentheses. (#19184)
/s/mono2/mono/mini/interp/transform.c:3166:25: note: place parentheses around
      the '&&' expression to silence this warning
        if (mt >= MINT_TYPE_I1 && mt <= MINT_TYPE_I4
            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
2020-03-11 10:20:40 +01:00
Jay Krell 60a192b98d [tools/sgen] Fix warnings about adding integers to string pointers. (#19180)
Kind of a silly warning.

mono/sgen/sgen-protocol-def.h:102:1: warning: adding 'unsigned long' to
      a string does not append to the string [-Wstring-plus-int]

BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_block_alloc, TYPE_POINTER, addr, TYPE_SIZE, size)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/sgen/sgen-grep-binprot.c:394:2: note: expanded from macro
      'BEGIN_PROTOCOL_ENTRY_HEAVY2'
        BEGIN_PROTOCOL_ENTRY2 (method,t1,f1,t2,f2)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/sgen/sgen-grep-binprot.c:291:26:
  note: BEGIN_PROTOCOL_ENTRY3 (binary_protocol_world_stopping,
  TYPE_INT, generation, TYPE_LONGLONG, timestamp, TYPE_POINTER, thread)exp

mono/sgen/sgen-protocol-def.h:102:1: note: use array indexing to
  silence this warning
2020-03-11 10:19:26 +01:00
Jay Krell 731b9cac54 [mini] Fix warning about unused variables. (#19182)
/s/mono2/mono/mini/mini-generic-sharing.c:1415:9: warning: unused variable
      'param_names' [-Wunused-variable]
        char **param_names;
2020-03-11 10:17:53 +01:00
Jay Krell 0ef53bae78 [wasm] Fix warnings about unused variables. (#19179)
/s/mono2/mono/metadata/sgen-mono.c:2883:16: warning: unused variable
      'last_major_gc_warned' [-Wunused-variable]
        static gint32 last_major_gc_warned = -1;
                      ^
/s/mono2/mono/metadata/sgen-mono.c:2884:16: warning: unused variable
      'num_degraded' [-Wunused-variable]
        static gint32 num_degraded = 0;
                      ^
/s/mono2/mono/metadata/sgen-mono.c:2886:9: warning: unused variable
      'major_gc_count' [-Wunused-variable]
        gint32 major_gc_count = mono_atomic_load_i32 (&mono_gc_stats.maj...
               ^
2020-03-11 10:13:36 +01:00
Jay Krell be9ced1a0f Fix warnings about misleading indentation. (#19186)
This is subtle and not actually misleading,
because it tends to be space tab or space tab, not wrong
number of tabs or significant wrong number of spaces.

/s/mono2/mono/metadata/class.c:4010:6: warning: misleading indentation;
      statement is not part of the previous 'if' [-Wmisleading-indentation]
                                 if (mono_class_implement_interface_slo...

/s/mono2/mono/metadata/class.c:4039:3: warning: misleading indentation;
      statement is not part of the previous 'if' [-Wmisleading-indentation]
        if (m_class_is_delegate (target) && mono_class_has_variant_gener...

/s/mono2/mono/mini/driver.c:1780:4: warning: misleading indentation; statement
      is not part of the previous 'if' [-Wmisleading-indentation]
                if (strncmp (argv [i], "--debugger-agent=", 17) == 0) {
2020-03-11 10:11:39 +01:00
Jay Krell fe5078961f [wasm] Fix warnings about unused variables. (#19181)
/s/mono2/mono/mini/mini-runtime.c:2284:15: warning: unused variable 'ji'
      [-Wunused-variable]
        MonoJitInfo *ji;
2020-03-11 10:08:41 +01:00
Larry Ewing 10cf3041d6 [wasm][packager] add option to pull from a different runtime directory (#19178) 2020-03-10 18:53:53 -05:00
Larry Ewing 488da04761 [wasm][standalone-benchmarks] Support mac (#19175)
This just handles systems (mac) without realpath installed and with a version of bash
that doesn't support &>>. It also trims path information from the benchmark name
2020-03-10 15:03:07 -05:00
monojenkinsandmdh1418 9ce7798c41 [mono] Include filename in Invalid image error messages (#19112)
Fixes dotnet/runtime#31649
Fixes dotnet/runtime#31650

**Testing**:
Reproduced Error via
`<Runtime Repo Root>/build.sh /p:RuntimeFlavor=mono`
Removing `[ActiveIssue("https://github.com/dotnet/runtime/issues/31650", TestRuntimes.Mono)]` in AssemblyTests.cs
Running `dotnet msbuild /t:RebuildAndTest /p:XunitMethodName=System.Reflection.Tests.AssemblyTests.LoadFile_NoSuchPath_ThrowsFileNotFoundException`

Fixing issue resulted in no errors.

Co-authored-by: mdh1418 <[email protected]>
2020-03-10 10:48:43 -04:00
monojenkinsandEgorBo 84bc62d113 [mono] Disable SIMD support for Windows target (#19172)
A temp fix for https://github.com/dotnet/runtime/issues/1933

Co-authored-by: EgorBo <[email protected]>
2020-03-10 14:45:55 +01:00
Jay Krell 5a065f628f [interp] Add EXCEPTION_CHECKPOINT to MINT_JMP consistent with other method tranform paths. (#19157) 2020-03-10 13:00:59 +01:00
Johan Lorensson fd61732c83 Convert PLT table and call site to execute only on AMD64. (#19114)
Current implementation embedded critical runtime information directly
into PLT slot. It also depends on finding call site in generic trampoline
reading call target from instruction stream in order to locate PLT slot
in use and then read GOT offset as well as PLT info offset from PLT slot
instruction stream.

This is problematic on platforms where code is execute only. Fix changes
how the metadata needed in order to correctly patch PLT is discovered.
Instead of depending on reading instruction stream, it is loaded into
RAX (free to be used when calling through PLT on AMD64) in PLT slot
before jmp takes place that moves control over to generic trampoline.

The PLT slot is the only place where we have access to both GOT index
(used in jmp), PLT info offset (currently embedded after jmp instruction)
and emitted PLT slot index. Since PLT slot index can be used to recover
GOT offset used by PLT slot as well as PLT info offset at runtime,
PLT slot index will be emitted into instruction stream and loaded into
RAX (prepared to be configurable to other reg if needed) before doing the
jump over to generic trampoline. Size of emitted imm constant is optimized
based on number of total PLT slots used in image, meaning that 1, 2, or 4
bytes could be used to store PLT slot index as an imm constant in
instruction stream. The additional jmp should have minimal to no
performance overhead since it should complete within 1 cycle, reading
imm constant from instruction stream that shouldn’t incur additional
cache misses and sine there is no data dependency between mov and jmp,
there should be options to pipeline both instructions. Since mov has
smaller latency than indirect jmp, mov should be complete once control
gets into the generic tramp (if pipelined).

In order to resolve plt info offset at runtime, needed information is
now emitted as part of got_info_offsets, increase table with 4 bytes/plt
slot, same size currently emitted into the PLT slot instruction stream.

Code size of PLT slot is currently 10 bytes (6 bytes jmp and 4 byte PLT
info offset). Since PLT info offset has been moved into got_info_offset
table, size of PLT slot will be 2, 4, 5 byte mov (depending on needed imm
size) and 6 bytes jmp instruction. As an example, mscorlib can emit all
its PLT slots using 2 byte imm constant, meaning that the PLT slot will
still be 10 bytes, but since PLT info offset of 4 bytes is moved into
got_info_offset, total image increase will be 4 bytes/PLT slot. This is
however still cheaper than alternatives that would burn 1 trampoline/PLT
slot (at least 10 additional bytes/slot) or setup lookup tables in image
or calculate more info at runtime, all-consuming more memory in total.

Note, using this approach is optional and runtime needs to be built using
MONO_ARCH_CODE_EXEC_ONLY in order to enable it since it’s only an opt in
features on platforms that can't read from instructions stream.

Current implementation is AMD64 only, but same pattern could be applied
to other architectures when needed.
2020-03-10 12:19:52 +01:00
monojenkinsandEgorBo 1ec2c9f7fd [Mono] Intrinsify Interlocked.And and Interlocked.Or using LLVM (#19135)
These APIs were introduced recently in https://github.com/dotnet/runtime/pull/33042 and already used in several places e.g. in `Task`, `InterlockedBitVector32`, `SafeHandle`, `RegexCharClass`

It should emit `%reg = atomicrmw and (or)` in LLVM IR. (and unlike `Interlocked.Add` these API return old value, see https://github.com/dotnet/runtime/pull/33102

Addresses https://github.com/dotnet/runtime/issues/32239 for Mono.

Co-authored-by: EgorBo <[email protected]>
2020-03-10 11:49:09 +03:00
monojenkinsandvargaz 5b644ae5a9 [jit] Implement support for all Sse1 intrinsics for netcore. (#19155)
* Add generic OP_XOP opcodes for opcodes which the JIT doesn't care about.
  Add a SimdOp enum to list the operations performed by these opcodes.
* Add a SimdIntrinsic struct so the mapping between the .net methods
  and the JIT opcodes can be specified declaratively.
* Add all intrinsics from the Sse class.

Co-authored-by: vargaz <[email protected]>
2020-03-09 22:48:05 -04:00
monojenkinsandpi1024e 8b447b4ccf No need to force to bool, when C does that automatically in the if statement. (#19095)
In C, the if statement checks if the value is 0 or not 0. !!, or forcing to 1 or 0, is unnecessary here.

Co-authored-by: pi1024e <[email protected]>
2020-03-09 20:28:36 +01:00
imhameed 90430277a1 [arm][ios] Follow branch islands when determining method entry addresses. (#19126)
Fixes https://github.com/mono/mono/issues/18612; `aot_code_low_addr` and
`aot_code_high_addr` were set to a range that included only first-level
branch islands, so `find_aot_module` would fail early when passed a
genuine function address.

This change only affects monotouch for now.

Why not use relative offsets stored in a read-only section? One reason
is that llvm-as cannot handle a `.long` directive containing a
subtraction expression involving externally-defined symbols. The AOT
method address table and AOT LLVM-generated code are currently emitted
in separate object files, so the method address table would include
expressions with undefined symbols.

Related: https://xamarin.github.io/bugzilla-archives/70/707/bug.html
2020-03-09 12:28:13 -07:00
Larry Ewing 9057498794 [wasm] Convert MonoString to string without utf8 intermediate (#19156)
* [wasm] Convert MonoString to string without utf8

Previously when converting strings from mono objects to js we used a utf8 intermediate buffer, this change builds the js string from the mono string without an intermediate.
2020-03-09 13:42:21 -05:00
Larry Ewing 66545a2abd [wasm] remove m_strdup (#19158) 2020-03-09 11:58:11 -04:00
Rares95andRares Sebastian Popa a25fe91245 Remove redundant mono_gc_collect during domain unload (#19130)
* Remove redundant mono_gc_collect during domain unload

Ifdef out mono_gc_collect when Boehm GC is present as it doesn't use remsets

* Fix trailing whitespace

Co-authored-by: Rares Sebastian Popa <[email protected]>
2020-03-09 16:47:45 +01:00
Aleksey Kliger (λgeek) 621a2219ef [corlib] Suppress finalization of underlying console FileStreams (#19137)
* [corlib] Suppress finalization of underlying console FileStreams

We already suppress the finalization of the CStreamReader and CStreamWriter,
but during shutdown, the underlying FileStream may be finalized which
invalidates its access field which can lead to a crash.

Addresses https://github.com/mono/mono/issues/19005
2020-03-09 10:01:16 -04:00
Marek Safar 1d575d8fe7 Bump linker (#19151) 2020-03-09 13:29:21 +01:00
dotnet-maestro[bot]anddotnet-maestro[bot] ebe382d49d Update dependencies from https://github.com/dotnet/arcade build 20200308.2 (#19163)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20158.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20158.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2020-03-09 13:27:40 +01:00
monojenkins 1713304e55 [bcl] Update BCL Linked Size 2020-03-09 07:14:17 +01:00
Marek Safar c6a3143c1e Freeze linker on mono-2020-02 branch 2020-03-08 10:35:42 +01:00
Zoltan Varga 8daffc3e4c Bump emscripten to 1.39.9. (#19147) 2020-03-07 23:16:18 -06:00
Zoltan Varga d083e2a828 [llvm] Move intrinsics definitions into a template header file llvm-intrinsics.h. (#19133)
* [llvm] Move intrinsics definitions into a template header file llvm-intrinsics.h.

* [llvm] Add a call_intrins () helper function.

* [llvm] Add globals for the SSE vector types to make code more compact.

* [llvm] Refactor the registration and lookup of intrinsics.

* Use the Intrinsics class from LLVM to register intrinsics.
* Identify intrinsics using an id instead of their name.

* Disable the wasm intrinsics on older llvm versions.

* Simplify mono_llvm_register_overloaded_intrinsic ().
2020-03-07 00:49:17 -05:00
monojenkinsandpi1024e 1690cadee2 Changed signedness of iterator to fix warnings. (#19014)
numOperands is an unsigned integer. In addition, getArgOperand has unsigned int arguments. As a result, I have no idea why i is an int, but to fix compiler warnings, I made it an unsigned int.

Co-authored-by: pi1024e <[email protected]>
2020-03-06 14:19:11 +01:00
Zoltan Varga be52633175 [jit] Use OP_EXTRACT_R4 in simd-intrinsics.c when using LLVM. (#19129)
* [jit] Use OP_EXTRACT_R4 in simd-intrinsics.c when using LLVM.

* [jit] Check for sse41 support before using the sse41.dpps intrinsic.
2020-03-06 07:32:47 -05:00
Larry Ewing 9ab10fd987 [wasm][debugger] Hash messages and sessions directly (#19128)
* [wasm][debugger] Hash messages and sessions directly
2020-03-05 16:07:19 -06:00
Larry Ewing f95d1413d3 [wasm][debugger] Check runtime state before attempting to resolve breakpoints (#19134)
Handle the case where the breakpoint request comes in very early before the runtime initialized by deferring resolution until normal runtime init.
2020-03-05 13:35:41 -06:00
Thays Grazia 93e7ef2b0f [debugger] NRE when 2 threads try to call GetThreads at same time (#19122)
As analysed by @jstedfast and me the only way to get this exception with this callstack below is 2 threads call GetThreads at same time, so while one of them is filling the items in the array, the other one is already trying to use the array with null items.

```
System.NullReferenceException: Object reference not set to an instance of an object
  at Mono.Debugging.Soft.SoftDebuggerSession.GetId (Mono.Debugger.Soft.ThreadMirror thread) [0x00000] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:3227
  at Mono.Debugging.Soft.SoftDebuggerSession.OnGetThreads (System.Int64 processId) [0x0002c] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:879
  at Mono.Debugging.Soft.SoftDebuggerSession.GetThread (Mono.Debugging.Client.ProcessInfo process, Mono.Debugger.Soft.ThreadMirror thread) [0x00008] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:902
  at Mono.Debugging.Soft.SoftDebuggerSession.HandleBreakEventSet (Mono.Debugger.Soft.Event[] es, System.Boolean dequeuing) [0x00501] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:2038
  at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet (Mono.Debugger.Soft.EventSet es) [0x0005b] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:1687
  at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler () [0x0005d] in /Users/runner/runners/2.164.6/work/1/s/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs:1625

```
 PR on mono/debugger-libs -> https://github.com/mono/debugger-libs/pull/300

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1070384/
2020-03-05 13:22:34 -03:00
Sam Patel 4c348d6567 [llvm] Don't set the LLVM JIT TLS variable in AOT. (#19127)
Should fix https://github.com/mono/mono/issues/19115. This bug was
introduced in https://github.com/mono/mono/pull/18824, which
conditionally initalized an LLVM JIT-related TLS slot while preserving
unconditonal stores to that same slot.

The value stored in this TLS slot should only be used during JIT
compilation, so set/reset it in `mono_llvm_compile_method` instead of
during IR construction in `mono_llvm_emit_method`. No non-JIT code
should depend on the existence or presence of this TLS variable, so
remove `mono_llvm_jit_set_tls_cfg`.
2020-03-05 08:29:01 -05:00
Aleksey Kliger (λgeek) a374dbb6f1 [merp] Add a test for Mono.Runtime.SendExceptionToTelemetry() (#18781)
Contributes to https://github.com/mono/mono/issues/18078
2020-03-04 21:25:57 -05:00
Larry Ewing a497dc7c5d [wasm][debugger] Rework breakpointRequest handling across sessions (#19113)
Try to follow CDP ordering constraints by not responding Debugger.enable until
we've fired scriptParsed events for any already loaded assemblies.

Send Debugger.scriptParsed asynchronously as we load assemblies instead of
waiting for them all to load first and fix some of the sequence point processing
to speed up debugger initialization time.

Rework breakpoint request handling by always passing the request to the browser
then storing both the request and the resultant id for use in when any new scripts
are loaded.

Pass any previous breakpoint requests to the new execution context on page reload.
2020-03-04 18:39:15 -06:00
Ryan LuciaandRyan Lucia a5f8905afa [loader] Clean up locking around adding assemblies to domain/ALC (#18967)
This cleans up three components of assembly loading that could potentially cause races/crashes.

First, both `add_assemblies_to_domain` and `add_assembly_to_alc` now ignore resolved references on netcore. We were seeing a crash on CI related to an assertion in here that resulted from two threads using the same MonoImage simultaneously as one is being loaded in with LoadFile, and this should solve that. Fixes dotnet/runtime#2305

Second, we take both the domain and ALC loaded assemblies locks simultaneously around the assembly being added to both lists, ensuring they stay in sync.

Finally, MonoImage now takes the image lock when writing to references instead of using the global `assemblies_mutex` in assembly.c for all images. This potentially helps reduce contention. Work here is not complete, but for this PR it's good enough. See dotnet/runtime#32889

Co-authored-by: Ryan Lucia <[email protected]>
2020-03-04 17:09:08 -05:00
Stefan e1d3b7ba64 Minor formatting of the manuals (#19124) 2020-03-04 17:51:28 +01:00
Thays Grazia c40f1ba79f [dim] Class overriding interface method that was already override by another interface (#18962)
The problem was a parent class overriding an interface that was already override by another interface.
Refactor class-init.c
2020-03-04 12:48:25 -03:00
dotnet-maestro[bot] c1b392f02b Update dependencies from https://github.com/dotnet/arcade build 20200301.1 (#19093)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20151.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20151.1
2020-03-04 13:13:34 +01:00
Jay Krell 35cdbcb4a8 [cxx] Remove static initializers. (#19089)
In a current shipping Visual C++, 19.21.27702.2,
there is a bug involving const member data in structs, where for example:

static const struct a { // const on this line in either case
  const int b; // const on this line
} c = {1};

will have a static initializer, run usually reliably before main, but:

static const struct a { // const on this line in either case
  int b; // no const on this line
} c = {1};

will not.
The semantic difference is minuscule, so much so, that the first form
is relatively rare, and the bug shipped.

Just always use the second form.

The difference is that if you have a non-const a, b is still const, I guess.
If you have a const a, then no difference.

You can find these easily:

cd ...
for %a in (*.exe *.dll) do link /dump /disasm %a > %a.txt
findstr /c:"dynamic initializer" *.txt

Which could be automated and tested in CI.

This probably not an actual problem, but it is needlessly inefficient,
and potentially a problem. The timing/ordering of the initializers
is a bit not deterministic. You get writable data where you expect
read only.

It is in fact a compiler bug, fixed in later releases.
But it has been shipping for a while, I first noticed it over two years
ago, in code of mine that it caused to not work (a delayload implementation
which runs before main).
2020-03-04 12:54:13 +01:00
Aleksey Kliger (λgeek) 0bcc388ce8 [threads] Add a global "runtime startup is finished" flag (#18994)
This contributes to https://github.com/mono/mono/issues/18916
(to make coop locking not bother with state transitions if the runtime isn't
ready yet).
2020-03-03 18:29:04 -05:00
Steve Pfister c483eaf070 Changed Max and MinLengthAttribute validation (#19084)
It should now validate against ICollection or any other type that has a Count property for that matter.

We're still relying on the reference source implementation because corefx strips some types out.

Fixes https://github.com/mono/mono/issues/19022
2020-03-03 15:26:46 -05:00
monojenkinsandEgor Bogatov ede05b997b [Mono] Fix Sse2.ConvertScalarToVector128 and add signed overloads (#19108)
@vargaz noticed I used an incorrect opcode for ConvertScalarToVector128*
I will add a sort of fuzzy tests later (which use all kind of SRI APIs and compare results with CoreCLR) something like this: https://github.com/mono/mono/blob/master/netcore/tests/HwIntrinsics/Program.cs
Also, add signed version of ConvertScalarToVector128*.

Co-authored-by: Egor Bogatov <[email protected]>
2020-03-03 23:14:59 +03:00
Alexis Christoforides 0ec7957d7c [merp] Create a 'reason' breadcrumb for the crash dump process (#19072)
For example, the system name of a signal ('segv') or 'MANAGED_EXCEPTION' are typical arguments.
2020-03-03 11:47:19 -05:00
Johan Lorensson b5a9fe49e1 Fix Mono Tool MSVC Debug build. (#19075)
Changes done in object-offsets.h adding offsets for TARGET_AMD64 exposed
a build configuration error in the Mono Tool MSVC debug build due to
incorrectly setting both X86 and AMD64 defines causing compile errors
when including object-offset.h. Release configuration didn't have this
configuration error, meaning that CI builds wouldn't trigger build error.

Fix makes sure all MSVC build configurations for Mono Tools
(genmdesc, monodis, pedump) matches the build configuration for other
binaries and that debug build configuration is inline with release build
configuration.
2020-03-03 16:11:30 +01:00
Zoltan Varga 4622ad0635 [WIP] [aot] Add support for emitting the method address table as a table of normal pointers in the data segment. (#19086)
* [aot] Rename acfg->opts to acfg->jit_opts.

* [aot] Add support for emitting the method address table as a table of normal pointers in the data segment.
2020-03-03 07:43:11 -05:00
Zoltan Varga b91580bafa [amd64] Obtain the trampoline argument in the generic_trampoline in the AOT case without decoding the call instruction. (#19091)
* [amd64] Obtain the trampoline argument in the generic_trampoline in the AOT case without decoding the call instruction.

* [amd64] Unify the aot specific trampolines so they have the same size/layout, so its easier to compute the address before the call.
2020-03-02 20:16:53 -05:00
Ankit Jain 3aab3884f6 [master] Bump msbuild to track xplat-master (#19077) 2020-03-02 17:49:08 -05:00
monojenkinsandEgor Bogatov 0f0c284a41 [Mono] Implement missing Sse2 intrinsics (#19101)
For now we only implement intrinsics used by corlib internally to optimize code.

Fixes https://github.com/dotnet/runtime/issues/32510 crash.

`ConvertScalarToVector128UInt32/64` is expanded into LLVM's `insertelement`
`ConvertToUInt32/64` is expanded into LLVM's `extractelement`

Co-authored-by: Egor Bogatov <[email protected]>
2020-03-03 01:09:46 +03:00
monojenkinsandRyan Lucia 0e38adf329 Use GArray instead of GList when getting custom attributes from an image (#19083)
Xamarin.Forms calls this _constantly_ during startup, to the point where the malloc calls were actually showing up in the profile. This should help with that, and gives us some ms back during startup.

There are also a bunch of calls that return empty arrays, which in theory could be created in managed for a perf boost. However, it seems the Xamarin.Android team has mostly gotten rid of those calls and that optimization would complicate the code and require changes to our managed CustomAttribute implemented for both legacy and netcore, so I've opted to not check it in for now. If the empty calls continue to show up down the line, I can dig the code back up from my local branch and PR it separately.

If this is producing huge arrays and malloc continues to show up in the profile, consider https://github.com/dotnet/runtime/issues/32972. Even without that, this is a substantial improvement.

Co-authored-by: Ryan Lucia <[email protected]>
2020-03-02 16:46:09 -05:00
Zoltan Varga 89e8a484e1 [wasm] Allow SIMD only in netcore mode. (#19087) 2020-03-02 12:56:43 -05:00
monojenkinsandRyan Lucia f7e1a23dd8 [loader] Free some leaked strings in NativeLibrary resolution (#19085)
Oops.

Co-authored-by: Ryan Lucia <[email protected]>
2020-03-02 17:46:09 +01:00
monojenkinsandRyan Lucia 80ff8817d0 [threading] Switch domain assemblies lock from OS to Coop (#18918)
I don't think you can create a root domain without reaching the thread info attach call, so this should be safe to change outright.

Fixes dotnet/runtime#32177

We should complete https://github.com/mono/mono/issues/18915 and then convert over other locks as needed, but this fixes the immediate CI hang.

Co-authored-by: Ryan Lucia <[email protected]>
2020-03-02 17:45:57 +01:00
Zoltan Varga 89902e8d22 [wasm] Pass --exclude-feature deserialization to the linker. (#19031)
* [wasm] Pass --exclude-feature deserialization to the linker.

* Add a --linker-exclude-deserialization packager option.
2020-02-28 23:41:03 -05:00
Alexander Köplinger 1a6eb5a597 Update mono-extensions 2020-02-28 19:58:22 +01:00
Jay Krell ec9db26150 Remove non-functional spawn code.
Subject to configuration, spawn has three widely divergent behaviors:

succeed but do nothing
print and exit
do what it sounds like
Rather than mislead the callers, provide only option 3 and let the caller decide what to do otherwise.
2020-02-28 13:19:55 -05:00
Maxim Lipninandmonojenkins 68470ddfb0 [wasm] Use PNSE version of System.Net.NetworkInformation.NetworkInterface (#19074)
PNSE coverage of wasm bcl has shown that only three public members of `System.Net.NetworkInformation.NetworkInterface` class throw `PlatformNotSupportedException`.

Now all public members throw PNSE on WASM.

Relates to https://github.com/mono/mono/issues/18735


Co-authored-by: monojenkins <[email protected]>
2020-02-28 19:17:40 +01:00
Alexander Köplinger 716b73221e Update mono-extensions 2020-02-28 19:05:43 +01:00
Alexander Köplinger 00b19731c6 Bump mono-extensions 2020-02-28 15:25:03 +01:00
monojenkinsandRyan Lucia 8951940260 [loader] Remove unnecessary newline in loader mono_trace call (#19069)
Co-authored-by: Ryan Lucia <[email protected]>
2020-02-28 11:37:18 +01:00
Vlad Brezae 941a335ea0 [runtime] Use pointer size gchandles (#19039)
* [runtime] Use pointer size gchandles

This would enable in the future to use CoreCLR's GC with mono. This doesn't change the current embedding api, but, in the future, we will end up aligning with coreclr on an embedding api that uses pointer sized gchandles.

* [gc] Change format of gchandles to be netcore compatible

On netcore, the GCHandle class assumes the lowest bit to be usable, for perf improvements. Move the responsability to have this bit available down to the GC implementation, since for CoreCLR GC we shouldn't do any shifting above the gc interface.
2020-02-28 09:05:55 +02:00
Larry Ewing d11eeadb66 [wasm][debugger] use console.debug to signal runtime init (#19057)
* [wasm][debug] use console.trace instead to init runtime

Using a `debugger` breakpoint in Mono.mono_wasm_runtime_ready has
unfortunate side effects, this changes the logic to use console.trace
and checks the stackTrace when the event is arrives.

* add a console.trace stub to runtime-test.js

* Use console.debug with a magic number instead
2020-02-27 12:07:55 -06:00
Johan Lorensson 188ac1b0a7 Clean up libmono-dynamic.vcxproj dependency for netcore. (#19040) 2020-02-27 18:08:34 +01:00
Larry Ewing 76f5086687 [wasm][debugger] allow stepping out of c# (#19059) 2020-02-27 07:50:59 -06:00
Johan Lorensson d2e6bd2aff Detect build config mismatch for MSVC Windows LLVM build. (#19044)
If LLVM build is done using different build configuration, Mono build
will fail to static link LLVM libraries due to incompatibility between
release and debug C++ runtime library, generating a lot of linker errors
like this:

error LNK2038: mismatch detected for 'RuntimeLibrary':
value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug'
in mini-llvm-cpp.obj

error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL':
value '0' doesn't match value '2' in mini-llvm-cpp.obj

This is normally not a problem when doing local builds of LLVM but
when using an external provided build, like netcore Mono build,
this problem is more likely to occur.

This fix adds an additional check to make sure build configuration reported
by llvm-config.exe --build-mode matches current Mono build configuration
and if not give a more specific msbuild error:

error : LLVM build Configuration=Release doesn't match current Mono
build Configuration=Debug
2020-02-27 13:28:07 +01:00
Nikita Voronchev 4b42804803 [WinForms] Colorize PropertyGrid's Categories properly (#19045)
Assume, one have colorized `PropertyGrid propertyGrid` control:
```
propertyGrid.CategoryForeColor = Color.Red;
propertyGrid.LineColor = Color.Blue;
```

Before changes proposed by the current PR we get the following image:
![before](https://user-images.githubusercontent.com/12382656/75364102-3391fe80-58cc-11ea-9136-347bcd567731.png)
After:
![after](https://user-images.githubusercontent.com/12382656/75364115-3987df80-58cc-11ea-95d1-20691a4a8467.png)
(item labeled "_Child 2_" is selected by user)
2020-02-27 11:25:14 +01:00
imhameed 5e5b1ed425 [aot] Avoid mono_defaults when creating trampolines. (#19055)
Fixes https://github.com/mono/mono/issues/19009.

https://github.com/mono/mono/pull/18505 made PLT initialization occur at
image load time. When initializing the PLT for mscorlib,
`mono_defaults.corlib` is not yet initialized.

This change works around this by using `mscorlib_aot_module`--which is
initialized relatively early--instead of `mono_defaults.corlib`. PLT
initialization is also moved slightly later: it now happens after
`use_page_trampolines` has been initialized. The `USE_PAGE_TRAMPOLINES`
macro has also been changed to dereference `mscorlib_aot_module`.

This commit also removes an unused parameter from
`mono_aot_create_specific_trampoline`.
2020-02-27 08:56:59 +01:00
Larry Ewing 7f6a9bb783 [wasm][debugger] Always pass failed breakpoint requests to target (#19053)
* [wasm][debugger] Always pass failed breakpoint requests to target

Originally we had a simple way to detect that breakpoints were
meant for the runtime but that is no longer true.  Now if we
can't location a breakpoint we need to pass the request on to the
target so it can make an attempt.

* Fix test byUrl is a logical breakpoint and should not fail
2020-02-26 23:07:57 -06:00
Ankit Jain de54af770c [wasm][debugger] Show the typename for valuetypes (#19046)
- no details of the valuetype are accessible

Fixes #18232
2020-02-26 20:32:48 -06:00
Larry Ewing 9793a1e5be [wasm][debugger] clean up scriptid parsing (#19052) 2020-02-26 20:26:56 -06:00
Larry Ewing ac5240640c [wasm][debugger] Since System.Url normalizes the path sep also try to match on the doc.Url (#19051)
Match against the pdb document url as well as the Url we calculated in case the urls have been
processed incompatibly
2020-02-26 17:39:32 -06:00
Steve Sanderson 3b0e35d1bc Debug proxy updates (#19026)
Currently, the Mono WebAssembly debug proxy logic is treated as "shared source" with ASP.NET Core. Each time we update by copying the sources from this repo into the ASP.NET Core repo, we need to make some updates to avoid problems. The intention of this PR is to make the updates here at source, so we can simply copy the sources as-is and don't need to update them each time.

The changes are:

Making everything internal, since this is not intended as public API surface for ASP.NET Core developers. It's an internal implementation detail of the framework.
To retain convenience for the ProxyDriver and Mono test code, this PR also adds a simple public entrypoint called DebuggerProxy. This exposes nothing except the ability to connect a debugger proxy instance to a websocket. In the ASP.NET Core code, we'll simply omit this file since it's not needed, but even if we did get it in the future when the proxy feature is published as a package, it would still be fine since it doesn't expose any public API that would be expensive to support and maintain.
Replacing all the Console.WriteLine calls with use of ILogger from the standard Microsoft.Extensions.Logging package, as used by most .NET Core-based application frameworks including ASP.NET Core.
This allows external code to control what happens with log output, what severity levels are filtered in/out, etc. In ProxyDriver and Mono test code, I've configured it to behave just like before: it logs to console, and doesn't filter out anything.
This has the benefit that various bits of commented-out logging code no longer need to be commented out. Instead, when calling the logger.Log* methods, each call site can specify a severity level and then (for example) the filter level could be set to Debug so that all Trace items are filtered out by default.
2020-02-26 12:52:36 -06:00
Zoltan Varga 6c5a18ba50 [runtime] Remove MONO_LLVM_INTERNAL. (#19032) 2020-02-26 17:48:29 +01:00
Ankit Jain 546833b534 Merge pull request #19035 from radical/async-local-fixes
[wasm][debugger] Fixes to get async method locals
2020-02-26 11:18:28 -05:00
monojenkinsandJohan Lorensson 907d59798c Fix Mono netcore preload hook to work with Windows CoreRun.exe. (#19027)
Current hook compares TPA list file names using case sensitive compare. On Windows, the TPA list, when passed from CoreRun.exe makes all file paths lower case, meaning that our checks fails to find assemblies in TPA list.

Since CoreRun.exe is used for both CoreCLR and Mono, removing the tolower on file paths added to the TPA list in CoreRun.exe could be an option, but that might introduce regressions in CoreCLR, so this fix isolate the change to Mono's netcore preload hook.

Co-authored-by: Johan Lorensson <[email protected]>
2020-02-26 12:06:40 +01:00
Zoltan Varga 91e026de9d [wasm] Improve error handling in the packager. (#19037) 2020-02-25 23:56:18 -05:00
Katelyn Gadd 5c8da9e284 Add basic set of standalone benchmarks for wasm (#18977)
Adds a basic set of standalone benchmarks from multiple sources, along with simple infrastructure for running them in mono, netcore and node.js wasm. A couple of them also have original JS versions you can run from a JS shell.
2020-02-25 18:24:10 -08:00
monojenkinsandpi1024e 3cba804069 Braces around subobject of initialization warning fix (#18866)
When compiling for Mono, Apple's compiler gives a warning saying to put braces around the 0 as it is a subobject. To silence the compiler, I put braces around the 0. Simple fix.

Co-authored-by: pi1024e <[email protected]>
2020-02-25 16:42:42 -08:00
Jay Krell 79e6ce6423 Change macro CLOSE_PIPE to function mono_close_pipe. (#19030)
Extracted from https://github.com/mono/mono/pull/19025
2020-02-25 19:54:38 +01:00
Jay Krell 1bd3b7a614 Fix warnings: GPid vs. pid_t function signature mixup in glib test code. (#19028)
Extracted from https://github.com/mono/mono/pull/19025
2020-02-25 19:46:10 +01:00
Ankit Jain 5c0b1e1c83 [wasm][debugger] Fix getting async method locals, and this
- async local field names don't start with `<`, surface those
- `this` for the actual async method is in a field named like
`<>4__this`, surface it as the `this` object
2020-02-25 13:36:38 -05:00
Ankit Jain f6bef135d5 [wasm][debugger][tests] Update tests to track test api changes 2020-02-25 11:38:37 -05:00
Ankit Jain c2f8fd8bc7 [wasm][debugger][tests] Ensure to always check location when sending
.. commands.
2020-02-25 10:24:50 -05:00
Ankit Jain 5f85de2b56 [wasm][debugger][tests] extract method to set breakpoints 2020-02-25 10:23:39 -05:00
716718a4bc Bump linker. (#19006)
* Bump linker.

* Bump linker tools framework version

* [csproj] Update project files

Co-authored-by: Marek Safar <[email protected]>
Co-authored-by: monojenkins <[email protected]>
2020-02-25 12:48:18 +01:00
Matthew Baird 6b3a7986ef Ensure ListView ItemCheck event can update the checked state (#18926) (#18937)
Fixes #18926
2020-02-25 10:19:01 +01:00
Vlad Brezae 49deb4bcea [interp] Enable more interp tests (#19012) 2020-02-25 09:12:01 +02:00
Zoltan Varga 8da9361ab2 [llvm] Remove loaded llvm support, the startup perf penalty doesn't seem to exist any more. (#18868)
* [llvm] Remove loaded llvm support, the startup perf penalty doesn't seem to exist any more.

* Fix the windows build.

* Remove more mini-llvm-loaded.c references.

* Remove more --enable-loadedllvm references.

* Make --enable-loadedllvm the same as --enable-llvm.

* Fix run-jenkins.sh.

* Address review comments.
2020-02-24 20:35:00 -05:00
Larry Ewing ed012b6e89 [wasm][debugger] revert DotNetUrl changes (#19021) 2020-02-24 18:31:52 -06:00
Jay Krell 9fa3eb26e1 [interp] Reorder InterpMethod to reduce padding (#18982)
for alignment. Sizes goes from 192 to 184.
2020-02-25 01:30:26 +01:00
Jay Krell bb40a1a2d9 Whittle away at warnings: (#18874)
Return address of local (deliberate).
 Pointer cast to different size.
 Function parameter and declaration badly mismatch (pid_t vs. void*).
 Unused locals.
 Top level volatile is ignored.
 Negative shift undefined.
 Call to undeclared function (getpid).

Some are fixed, some are disabled temporarily.
2020-02-24 18:41:06 -05:00
Larry Ewing fafa41f448 Use AsLocation when creating location (#19016) 2020-02-24 14:55:48 -06:00
monojenkinsandpi1024e 655dd296bf Fix compilation warning for converting negative integer constant to unsigned. (#19013)
When compiling, Visual Studio gives two compiler warnings in the sysmath.c file about FPILOGB0/-2147483648 being converted into an unsigned integer.

The standard library math.h states that FPILOGB0 be INT_MIN, so I replaced -2147483648 with the INT_MIN macro so the behavior is much more clear as well as stifling the compiler warnings.

Changes tested manually and automatically.

Co-authored-by: pi1024e <[email protected]>
2020-02-24 13:51:14 -05:00
Ankit Jain 27c5660659 [wasm][debugger] Don't mark the runtime ready before clearing the (#19015)
.. breakpoints. Chrome tries set the breakpoints from previous sessions
when the debugger starts up. And we set that in mono, if the runtime is
ready.

But in `MonoProxy.RuntimeReady`, we mark the runtime ready *before*
clearing the breakpoints. So, we end up setting the breakpoints, as
asked by chrome debugger, but then subsequently clearing them!

This manifests as previously set breakpoints in managed code not getting
hit, but if we reset the breakpoint manually then it gets hit.
2020-02-24 13:50:10 -05:00
Ankit Jain ace2e34aae Merge pull request #19003 from radical/improve-locals-access
[wasm][debugger] Improve accessing locals
2020-02-24 13:49:45 -05:00
Alexis Christoforides 1dffbd0200 [merp] Produce hashes for unmanaged thread stacks also (#18943)
Before, this was only done for managed stacks.

Addresses https://github.com/mono/mono/issues/18941
2020-02-24 13:02:17 -05:00
Alexis Christoforides 981da38038 [merp] Increase buffer size for state dump (#18798)
Addresses https://github.com/mono/mono/issues/18796
2020-02-24 10:21:34 -05:00
Ankit Jain 881dfd770f [master] Bump msbuild to track xplat-master (#18987) 2020-02-24 15:53:08 +01:00
dotnet-maestro[bot] 9f2297bcfd Update dependencies from https://github.com/dotnet/arcade build 20200223.1 (#19011)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20123.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20123.1
2020-02-24 15:50:09 +01:00
Jay Krell 9fb0820ca5 [interp] Use alloca for InterpFrame. (#19007)
This is like https://github.com/mono/mono/pull/19002 but next_free is initialized upon allocation instead of `pop_frame` which is a slight optimization.
2020-02-24 10:30:46 +01:00
Jay Krell ae1c7c010c [interp] Decruft PowerPC. (#18981) 2020-02-24 09:12:56 +01:00
monojenkins e4cf488054 [bcl] Update BCL Linked Size 2020-02-24 08:24:19 +01:00
Jay Krell 5941141433 [interp] Remove some unused paths in newobj and cleanup a little. (#18998) 2020-02-23 15:15:14 +02:00
Jay Krell e9886db7e4 [interp] Pop leave and calli_nat frames. (#19000) 2020-02-23 15:11:14 +02:00
Ankit Jain 9049967106 [wasm][debugger] mono_wasm_get_var_info - don't repeatedly walk the
.. stack, instead find the target frame, and read in one go.
2020-02-22 18:07:06 -05:00
Ankit Jain 01e089bc46 [wasm][debugger] Fix nested class names for this 2020-02-22 17:58:37 -05:00
Ankit Jain 547e4180df [wasm][debugger] Fix issue in getting locals for previous frames
`mono_wasm_get_var_info` didn't correctly reset the `data.cur_frame`
required for `mono_walk_stack_with_ctx`, as the stack is walked
repeatedly to get the variables.
2020-02-22 17:49:56 -05:00
Zoltan Varga cc8a5b5513 [corlib] Link out more SR/SRE types (#18770)
* [corlib] Invoke TypeBuilderInstantiation.MakeGenericType through a delegate created in the TypeBuilder ctor to break a linker dependency between RuntimeType and TypeBuilderInstantiation.

* [corlib] Update linker descriptor.

* UnmanagedMarshal is not used from native code at all.
* AssemblyName is not used from native code at all.
2020-02-22 17:34:00 -05:00
monojenkins 008a10c43a [bcl] Update BCL Linked Size 2020-02-22 22:48:39 +01:00
Thays Grazia a8d34b2a03 [wasm][debugger] Enable embedded ppdb on wasm (#18966)
* Enabling PPDB on Wasm.
2020-02-22 00:35:59 -06:00
Ankit Jain d02bbe4c32 [wasm][debugger] Handle exceptions from JS
- correctly mark `Result` with the error
2020-02-21 19:43:11 -05:00
Ankit Jain cbc722ddaf [wasm][debugger] SetException on all the inspector waiters for uncaught exceptions 2020-02-21 19:43:07 -05:00
Fan Yang 041fbe0900 Revert linker change of 5a65a97 (#18991)
This is needed because  the required='false' field in
```
<type fullname="System.Reflection.Emit.TypeBuilder" required='false' preserve="fields" feature="sre">
			<method name="SetCharSet" feature="sre" />
			<!-- reflection.c mono_reflection_call_is_assignable_to () -->
			<method name="IsAssignableTo" feature="sre" />
```
Fails to preserve the IsAssignableTo method.
2020-02-22 01:27:09 +01:00
Aleksey Kliger (λgeek) 7707eda633 [metadata] Mark mono_signature_get_return_type external only (#18990)
Also mark mono_signature_get_params external only.

Runtime should use mono_signature_get_return_type_internal
and mono_signature_get_params_internal
2020-02-21 17:35:55 -05:00
Larry Ewing dce53cc9f3 [wasm][debugger] Store more per session state and force some event ordering (#18747)
* [wasm][debugger] Store more per session state and force some event ordering

Register a DebugStore and ExecutionContext per session and force some commands
to block on source loading so that scripts are loaded before attempting to use
them. This should populate the sources in vscode-js-debug properly.
2020-02-21 15:06:45 -06:00
monojenkinsandNathan Ricci 840ba017ef Added some parenthesis and a cast to control order of operations. (#18972)
This fixes https://github.com/mono/mono/issues/17140; intermittent incorrect results from GetTotalBytesAllocated for current thread. uint64_t and a pointer difference are not the same type/width on all architectures, so incorrect results can happen with out the parenthesis.

Co-authored-by: Nathan Ricci <[email protected]>
2020-02-21 14:17:39 -05:00
monojenkinsandNathan Ricci ac7a77f245 Correct values for HighMemoryLoadThresholdBytes, MemoryLoadBytes. (#18913)
Correct values fort HighMemoryLoadThresholdBytes, MemoryLoadBytes. I looked in the code for CoreCLR and spoke with Maoni Stephens and Jan Kotas about the values used in CoreCLR, so I am confident they are all correct now.

HighMemoryThresholdBytes is a system wide memory usage threshold at which CoreCLR changes its compaction strategy. There is no direct correspondance to anything in mono-sgen. But since it used by software caches to determine when memory in the system is "nearly" exhauste, mono-sgent will use .9 * total physical memory as an acceptable value.

Co-authored-by: Nathan Ricci <[email protected]>
2020-02-21 19:36:20 +01:00
Larry Ewing a3e03430ea [wasm][tests] clean up a couple of the Contains assertions 2020-02-21 10:52:41 -06:00
Aleksey Kliger (λgeek) ed017481e8 [monodis] Escape names that start with a digit (#18759)
Code like this:

```
using System;
class Program
{
    static byte[] bla = new byte[] {1,2,3,4,5};
    static void Main()
    {
    }
}
```

Compiles to a private field declaration for the array with a compiler generated
name, that name should be quoted if it starts with a digit.  For example:

```
	IL_0007:  ldtoken field valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=5' '<PrivateImplementationDetails>'::'74F81FE167D99B4CB41D6D0CCDA82278CAEE9F3E2F25D5E5A3936FF3DCEC60D0'
```

Fixes https://github.com/mono/mono/issues/18750
2020-02-21 11:43:27 -05:00
Cody RussellandAlexander Köplinger 7a3c321b42 Bump bockbuild for Pango nil check fix. (#18936)
https://github.com/mono/bockbuild/pull/153

Co-authored-by: Alexander Köplinger <[email protected]>
2020-02-21 17:24:43 +01:00
monojenkinsandBernhard Urban-Forster 802d57a741 [mono/metadata] add definitions for ENCLog/ENCMap (#18976)
Co-authored-by: Bernhard Urban-Forster <[email protected]>
2020-02-21 14:42:33 +01:00
Jay Krell f4d5c11610 [interp] Cleanup: Replace retval-> with result. and retval with &result. (#18951) 2020-02-21 11:24:38 +01:00
Jay Krell 3e3499e89a [interp] Allow historical inlining due tO: (#18948)
1. This wasn't generally conserving the important stack.
2. Larger mechanisms are in place now.

Granted, tuning out rare paths could still be valuable.
2020-02-21 10:43:40 +02:00
Jay Krell 40187209f8 [interp] Non-recursive newobj. (#18931)
A few weird here, esp. for string, but CI passes.
Acknowledged but skipped for now, a request to also refactor the opcode -- it doesn't seem like much throwaway work to go in either order, even if the code is dead (which I don't know).

Also amend recent nonrecursive PR to simulate stack +2 instead of +1.
2020-02-20 18:19:27 -05:00
Ankit Jain 91b125af92 [wasm] Improve locals visualization (#18919)
* [wasm] Improve locals visualization in the debugger

- improves handling of generic types, null objects, delegates
- improves getting the name for nested types, arrays, generic types

top todos from this:
- Remove arity in "foo`2<int, int>" from the type name
- Convert nested type names from `foo/bar` to `foo.bar`.

* [wasm] Fix scoping for `mono_wasm_add_null_var`

- which caused runtime uncaught exceptions

* [wasm] Fix possible lost exception in GetScopeProperties

- An exception, eg., because of an invalid scope id just ends up
uncaught instead of showing up as a failed Result.

* [wasm] Address review feedback

- Replace `stringify_type` with `mono_type_full_name` which does exactly
the same thing!

* [wasm][debugger] Fixup nested class, and generic type names

```
	// Fix up generic names like Foo`2<int, string> to Foo<int, string>
	// and nested class names like Foo/Bar to Foo.Bar
```
2020-02-20 14:23:02 -05:00
sharkcz 74f90c824b Add struct offset definitions to s390x (#18958)
* [mini-s390x] standardize on using MONO_STRUCT_OFFSET

* [mono-s390x] add struct offset definitions to s390x

Add s390x specific struct offset definitions to object-offsets.h and
update the array member accesses in mini-s390x.c.

Related: https://github.com/mono/mono/commit/79135c6ea57b516addf187a08cb01826bb0197c6
Fixes: https://github.com/mono/mono/issues/18930
2020-02-20 15:05:26 +01:00
Thays Grazia dd5926cc79 [debugger] Enable reading embedded ppdb (#18895)
To fix the issue of enabling embedded pdb everywhere the problem was that when the roslyn tests are compiling sources it creates embedded pdb with source file "", and before enable reading the embedded pdb we don't read this information, and now we read and our StackTrace file written in our corlib doesn't expect a source file "", it's okay if it's NULL but not "".
I could fix in corlib or in mono, I prefer to fix on mono because I don't know if there is any other place that doesn't expect source file "".
2020-02-20 09:59:40 -03:00
Egor Bogatov e441aa4d21 Remove TestEnvVarSwitchForInnerHttpHandler test as it should be in XA/LinkerTests.cs instead (#18952)
The test will be moved to XA's `src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs` 

It only works if 
```xml
<AndroidHttpClientHandlerType>System.Net.Http.MonoWebRequestHandler, System.Net.Http</AndroidHttpClientHandlerType>
```
is set in `Xamarin.Android.Bcl-Tests.csproj` and we don't want it (other tests expect SocketsHttpHandler to be default one). As an alternative we can add it to the `Xamarin.Android.Bcl-Tests.csproj`'s Linker exceptions but `/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs` is a better place for it.
2020-02-20 11:10:58 +01:00
Jay Krell 90c66725d3 Remove LOCK_DECLARE and LOCK_INIT -- unused and incorrect comments (not idempotent). (#18945) 2020-02-20 10:51:29 +01:00
monojenkinsandBernhard Urban-Forster 1d92b01cf4 [metadata] use descriptive constants for method table columns (#18944)
Co-authored-by: Bernhard Urban-Forster <[email protected]>
2020-02-20 09:30:38 +01:00
Jay Krell a03dee09f9 [interp] inline newobj. (#18903)
The real goal is to make it not recursive.
This is just a step along the way.
Note that the actual not-recursive change has *not* yet been developed,
so this *might* amount to nothing useful.
2020-02-19 23:32:15 +01:00
Vlad Brezae 5d87716ea4 [sgen] Disable managed allocator when using nursery-canaries (#18932)
The managed allocator included in a full aot image does not support canaries, leading to inconsistent object layout.

Fixes https://github.com/mono/mono/issues/18925
2020-02-20 00:10:49 +02:00
Vlad Brezae 47687bdb47 [interp] Fix incorrect propagation of indirect local (#18924)
We never don't track the value of locals who have their address taken in a method, since their value can change without the pass detecting it, leading to propagation of incorrect values. We failed to check for this when doing a stloc.np optimization.

Fixes System.Reflection.Metadata.Tests.ImmutableByteArrayInteropTest.DangerousCreateFromUnderlyingArray

Enable more interp tests, which don't seem to fail on my machine.
2020-02-20 00:09:16 +02:00
monojenkinsandRyan Lucia 7d38e12a1e [loader] Add check to mono_domain_ensure_entry_assembly for AOT (#18938)
Fixes a crash with AOT because domain->setup is NULL here

Co-authored-by: Ryan Lucia <[email protected]>
2020-02-19 22:48:50 +01:00
Zoltan Varga 5fe94fd99f [wasm] Avoid spilling refs to the stack in gsharedvt wrappers, those functions don't need safepoints. (#18820) 2020-02-19 14:30:08 -05:00
Mitchell Hwang 30c1012ed5 [bcl] Default XmlSerializer stream serialize to UTF8 Encoding (#18836)
* [mcs] Default XmlSerializer stream serialize to UTF8 Encoding

* [bcl] Add XmlSerialize Test to preserve UTF chars in stream
2020-02-19 14:11:07 -05:00
monojenkinsandRyan Lucia 45cb6fbba6 [loader] Parse in more netcore hosting properties (#18850)
This includes some other minor cleanup to the netcore hosting functions.

Setting `assemblies_path` with `APP_PATHS` despite it also being set by `MONO_PATH` doesn't scare me too much because:
1) Anyone using `MONO_PATH` is probably not going through the hosting API and is using `mono-sgen` directly
2) The default host doesn't set `APP_PATHS` (and we've worked fine without it being set at all up until now
3) This is a temporary measure; we will have to refactor our preload hook when we want to properly support the other loader properties anyway

Co-authored-by: Ryan Lucia <[email protected]>
2020-02-19 14:10:33 -05:00
Zoltan Varga b4337dd4e8 [llvm] Remove the disable-self-init debug option, it doesn't work any more. (#18929) 2020-02-19 11:43:20 -05:00
Egor Bogatov 6ef5dd4523 Move HttpClientHandlerTests.Android.cs to nunit (#18883) 2020-02-19 16:34:37 +03:00
Alexander Köplinger 885226b1f0 [netcore] Disable ARM64 CI runs (#18922)
They were moved over to dotnet/runtime: https://github.com/dotnet/runtime/pull/32303
2020-02-19 02:36:38 +01:00
Jay Krell d1603aaca1 Remove some #if __cplusplus wrt inlining. (#18891)
The code is fine, and we should put it back at some point,
but I want things to be clearer regarding https://github.com/mono/mono/issues/18827.

i.e. That this does not cause it.
I don't know what does cause it, granted.
Maybe a preexisting race condition/deadlock, I don't know.

Repro is run a loop like:
```
type \s\1.cmd
for /l %%a in (1 1 999) do echo %%a && C:\s\mono2\msvc\build\sgen\x64\bin\Release\mono-sgen.exe \s\mono2\mono\tests\bug-10127.exe
```
2020-02-19 01:26:46 +01:00
Jay Krell 6d0895ad3b Make MONO_API_DATA clearer. (#18897)
Make MONO_API_DATA clearer, its old form -- MONO_API extern.
extern "C" { } should be added around it not within it, for clarity.
I've always found extern "C" without braces unclear, esp. for data.

i.e.

```
 extern "C" {
1   extern void function(); // redundant but clear
                            // same as void function();
2   extern int data; // not redundant, and clear
}
```

vs.
```
3   extern "C" void function(); // I guess clear.
4   extern "C" int data; // unclear -- is it extern or extern "C" or both?
```

This PR in particular turns 4 into 2.
2 is clearly a declaration, not a definition.
4 is unclear as to if it is a declaration or definition.

I was looking into https://github.com/mono/mono/issues/18827.

This does not actually change anything but makes things clearer.

This is similar/related in spirit to https://github.com/mono/mono/pull/18891.
It should not make a difference.
In this case, `#if __cplusplus` remains, but the meaning of it is clearer.
It becomes *only* about the common `extern "C" { }` and not even the less clear `extern "C"`.
2020-02-19 01:20:07 +01:00
Jay Krell 90f4013483 [interp] Make newobj_vt[st]_fast non-recursive. (#18902)
* [interp] Make newobj_vt_fast non-recursive.

* PR feedback: Attempt to provide similer primitive increase_max_stack_height
that is not so roundabout as move_stack (n) + move_stack (-n).

* [interp] Make newobj_vtst_fast not recursive.

This is builds upon https://github.com/mono/mono/pull/18875
and is easiest reviewed after it is merged.

Or, perhaps, this replaces it.

* comment-smithing
2020-02-19 01:17:14 +01:00
Alexis Christoforides 39ea4f4bbd [mono] Remove SIGTRAP handler, as it interferes with debugging (#18851)
* [mono] Remove SIGTRAP handler, as it interferes with debugging

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

* Fix lack of cleanup for SIGSYS
2020-02-18 16:33:44 -05:00
Aleksey Kliger (λgeek) 972896b2f1 [merp] Capture Environment.FailFast message in crash report (#18863)
* [merp] Capture Environment.FailFast message in crash report

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

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

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

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

Check that the resulting json blob includes the failfast message.
2020-02-18 15:59:14 -05:00
Vlad Brezae 4b96fefa7a [interp] Unwrap RuntimeWrappedException if needed, when throwing non exception objects (#18905)
Enable the entire System.Linq.Expressions suite with interpreter
2020-02-18 19:59:18 +01:00
Marius Ungureanu 104c201053 Bump bockbuild to bring in Gtk# regression fix (#18909)
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1055130
2020-02-18 19:46:24 +01:00
Alexander Köplinger e25d05be8d [netcore] Disable a flaky test on interpreter (#18904)
See https://github.com/mono/mono/issues/18695, it's most likely fixed in dotnet/runtime already but we can't easily get updated binaries into mono/mono.
2020-02-18 15:40:01 +01:00
Jay Krell 4649b5784f Remove #if __cplusplus from MagicTypeInfo. (#18898)
This wastes about 24 static const bytes which I think is ok.
6 bytes per struct, plus 2 padding, and there are 3 of them.

I was looking into https://github.com/mono/mono/issues/18827
and wanting to rule out #if __cplusplus.
2020-02-18 10:53:17 +01:00
Zoltan Varga 7038b1a426 [wasm] Implement generation of empty assemblies in wasm-tuner. (#18880)
The linker can completely link away some assemblies, but the rest of the ninja
build still requires them. Previously they were generated by running csc, but
thats too slow, so generate them using Cecil from wasm-tuner.
2020-02-18 02:33:45 -05:00
Jay Krell 15d61562ca Make non-recursive mutexes SRWLOCK instead of CRITICAL_SECTION. (#18847) 2020-02-17 22:34:44 +01:00
Jay Krell 1288a22890 [interp] Consolidate non-recursive call sites. (#18825)
Consolidate native_stack_addr as a result (resolving a FIXME).
 Builds on:
  https://github.com/mono/mono/pull/18857
  https://github.com/mono/mono/pull/18858
  https://github.com/mono/mono/pull/18869
2020-02-17 17:02:24 +01:00
Jay Krell 38256821ed Fix THREADS_SUSPEND_DEBUG to compile (id vs. mono_thread_info_get_tid). (#18871) 2020-02-17 15:59:48 +01:00
dotnet-maestro[bot] 14ae61555b Update dependencies from https://github.com/dotnet/arcade build 20200216.1 (#18887)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20116.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20116.1
2020-02-17 15:55:48 +01:00
imhameed 78fcd4b9f4 [llvm] Disable X86 call frame size optimization. (#18645)
* [llvm] Disable X86 call frame size optimization.

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

For calls that require parameters passed in stack memory,
X86CallFrameOptimization can sometimes replace a sequence of movs to
prologue-reserved stack memory with a sequence of pushes and a compensating sub
rsp after the call. LLVM accumulates an OpAdjustCfaOffset MCCFIInstruction for
each push and and records the ephemeral parameter space consumed by the call
using an OpGnuArgsSize MCCFIInstruction (i.e. DW_CFA_GNU_args_size).

MonoException doesn't support encoding OpGnuArgsSize MCCFIInstructions, and
attempting to encode this instruction can cause unpredictable behavior, due to
our use of llvm_unreachable with assertions disabled [1]. Moreover, even if
MonoException happens to emit valid call frame instructions despite the UB
induced by llvm_unreachable, Mono's exception handler will restore the stack
pointer to the value it contained at the time right before the protected call
instruction was made, without compensating for any ephemeral parameter space.

The stack pointer could be fixed before the jump to the EH handler by
supporting DW_CFA_GNU_args_size or by executing call frame instructions for the
EH handler's frame all the way to the end of the protected instruction address
range--which will include a sub rsp with an appropriate immediate--to determine
an appropriate delta. But it's easier to just disable this optimization. We
already disable it for AOT [2]. It's sometimes disabled by LLVM on Darwin [3].

Also, this commit adds a test (which is a nearly verbatim copy of laszk's
reproduction sample in #17285) for EH failures caused by the interaction of our
EH code and X86CallFrameOptimization.

See also [4], [5], and [6].

[1] https://github.com/dotnet/llvm-project/blob/adeaa08e7bbc9aba5d67cb16c2b348be12deb000/llvm/lib/CodeGen/AsmPrinter/MonoException.cpp#L209-L210
[2] https://github.com/mono/mono/blob/1317cf06da06682419f8f4b0c9810ad5d5d3ac3a/mono/mini/aot-compiler.c#L9872-L9875
[3] https://github.com/dotnet/llvm-project/blob/adeaa08e7bbc9aba5d67cb16c2b348be12deb000/llvm/lib/Target/X86/X86CallFrameOptimization.cpp#L146-L152
[4] https://bugs.llvm.org/show_bug.cgi?id=24792
[5] https://reviews.llvm.org/D13132
[6] http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151005/304074.html

* Address feedback: add an explanatory comment.
2020-02-17 15:41:50 +01:00
Alexander Köplinger e9981608c4 Bump linker submodule (#18884)
Contains fix for -out argument.
2020-02-17 14:54:44 +01:00
Zoltan Varga 3e1f029eb8 [wasm] Make cil-strip quiet. (#18881) 2020-02-17 14:22:39 +01:00
Bernhard Urban-Forster f6dfce1aba [cross] check against correct alignment value (#18712)
It's essentially dead code in any of our configurations.

`MONO_ALIGN_gint8` is define here:
https://github.com/mono/mono/blob/ab2321c1dc1bf0293dadd7e52436b2bd87f2b7c3/mono/metadata/abi-details.h#L26-L35

And the correct value is set here:
https://github.com/mono/mono/blob/ab2321c1dc1bf0293dadd7e52436b2bd87f2b7c3/mono/metadata/abi.c#L71-L75
2020-02-17 14:22:10 +01:00
Zoltan Varga 79ab49333e [jit] Run static cctors for inlined methods, the cctor might not have ran in AOT mode. (#18706)
* [jit] Run static cctors for inlined methods, the cctor might not have ran in AOT mode.

* Emit the class init code later since it contains a branch.

* Emit the class init in the first code bblock.
2020-02-17 08:21:49 -05:00
Bernhard Urban-Forster 79135c6ea5 [abi-details] add explaining comment for macro magic (#18713)
* [abi-details] add explaining comment for macro magic

I think the fallback was added because "let's get it back to work quickly", back in the dark times without CI: https://github.com/mono/mono/commit/b655fb35c61fd3422003de01eed8e634d46b4186

* add constant version. to be used when offset is needed for static array sizes

* missing offset for windows

* windows define fix
2020-02-17 14:21:13 +01:00
Jay Krell 9a147baef1 Remove unnecessary ifdef before undef. (#18877)
* Remove unnecessary ifdef before undef.

* PR feedback: Remove educational comment.
2020-02-17 14:01:34 +01:00
Jay Krell 9adb352348 Remove duplicated Windows header content. (#18846) 2020-02-17 13:48:53 +01:00
Jay Krell 9a6b9c8a2a Fix/quash some warnings. (#18873)
mini\mini.c(1253,59): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3100,43): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3273,49): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3281,49): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3480,51): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3490,49): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3626,48): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3664,48): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3722,48): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini.c(3944,47): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\mini-runtime.c(549,64): warning C4390:  ';': empty controlled statement found; is this the intent?
mini\method-to-ir.c(11838,2): warning C4065:  switch statement contains 'default' but no 'case ' labels
metadata\sre.c(2286,11): warning C4309:  '=': truncation of constant value
metadata\sre.c(2179,11): warning C4309:  '=': truncation of constant value
metadata\sre.c(2204,11): warning C4309:  '=': truncation of constant value
metadata\sre.c(2232,11): warning C4309:  '=': truncation of constant value
mini\method-to-ir.c(11838,2): warning C4065:  switch statement contains 'default' but no 'case
mini\type-checking.c(167,3): warning C4334:  '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
2020-02-17 12:48:56 +01:00
Jay Krell e8601e7b12 Remove unnecesssary include. (#18872)
Less to build if you edit the file.
2020-02-17 12:47:20 +01:00
Jay Krell 68c9084466 [interp] Use method_entry at interp entry instead of duplicating the code. (#18869)
tracing was a mix of:
 - sometimes ifdef out, sometimes not; make it always ifdefed
 - sometimes int, sometimes gint, sometimes gboolean; make it always int

Much of this PR will end up deleted when the multiple nonrecursive calls are
consolidated, but two will remain -- entry and call: label.

https://github.com/mono/mono/pull/18825 is where this is going but it was deemed
too large and requested to be split up. This is part of it.
2020-02-17 12:46:22 +01:00
Jay Krell 2d0ddf0abd [interp] Work toward consolidating multiple nonrecursive call sites to just one. (#18858)
https://github.com/mono/mono/pull/18825 was deemed too large so this breaks
it down into smaller pieces.
To consolidate the multiple nonrecursive call sites requires they share the smae
retval variable. Go ahead and share them all.
2020-02-17 12:43:34 +01:00
Jay Krell d98b7bf9f9 [interp] Fix incorrect comment -- stackval has no size. (#18876) 2020-02-17 12:42:08 +01:00
monojenkinsandEgor Bogatov 79bb3e2031 [mono] Fix msvc mono build and add CopyMonoRuntimeFilesFromArtifactsToDestination target (#18797)
Fixes
```
fatal error C1083: Cannot open include file: '../../support/libm/complex.c': No such file or directory
```
when `mono-netcore.sln` is opened in vs2019

Also, add `CopyMonoRuntimeFilesFromArtifactsToDestination` target to mono.proj to be able to copy mono runtime bits to any folder (needed for the performance team, cc @fanyang-mono)

Co-authored-by: Egor Bogatov <[email protected]>
2020-02-17 12:02:18 +01:00
Jay Krell fed64a7019 [interp] Step toward consolidatation of non-recursive call sites. (#18857)
https://github.com/mono/mono/pull/18825 was too large.
This starts by replacing imethod with cmethod which is a necessary
part of the consolidation of multiple non-recursive call sites to just one.
2020-02-17 09:12:52 +01:00
Zoltan Varga 56f664f2d3 [llvmonly] Allow more direct calls. (#18819)
* [runtime] Add a few m_method_is_... inline functions.

* [llvmonly] Allow direct calls to tls accessors, its not a problem in llvmonly mode.

* [llvmonly] Allow direct calls to icalls/pinvokes/generic instances in the same module.

* Fix the loaded llvm build.
2020-02-15 01:52:28 -05:00
Zoltan Varga 12c13fdf37 [llvm] Remove unused llvm.mono.load/store intrinsics. (#18853) 2020-02-15 00:57:02 -05:00
Zoltan Varga e3ad74614a [llvmonly] Avoid adding the aot init wrappers to the method table, its not needed. (#18848) 2020-02-14 20:33:01 -05:00
imhameed 013e3c07e3 [llvm] Fix LLVM JIT when used with multiple AppDomains. (#18824)
We currently reuse LLVM's command line parsing system to configure and
enable passes. When using the default code generator pass configuration,
the `ImplicitNullChecks` and `X86CallFrameOptimization` passes can only
be enabled or disabled via the command line argument parser: the
`cl::opt`s controlling these (and many other) passes are private to
their translation units, and `TargetPassConfig`/`X86PassConfig` read
from these `cl::opt`s with no other means to override these values.

Unfortunately, some LLVM command line options have restrictions on the
number of times they may be set, and running the LLVM command line
argument parser more than once can fail, because the 'number of
occurrences' counter is stored in each global `cl::opt`. This causes
several tests to fail--one such test is unhandled-exception-7.cs.

This change:
- removes the lazy LLVM JIT initialization logic and instead
  runs this initialization once during `mini_init`,

- moves some stray JIT-only code from mini-llvm.c to llvm-jit.cpp,

- wraps the declarations in domain-internals.h with a
  `G_BEGIN_DECLS`/`G_END_DECLS` pair, so that they avoid name
  mangling when included in C++ source, and

- removes `exception_cb` and `emitted_cb`: neither were actually used
  by live code.
2020-02-14 17:29:45 -08:00
Vlad Brezae c9ba14796a [interp] Fix filter clauses (#18809)
When executing a filter we create a new interp frame, that is a duplicate of the original frame that contains the filter. Once the execution of the filter is finished, we were copying the stack contents back to the base frame. The problem with this is that when the filter is run, the stack is not completely unwinded, meaning that later we can still run a finally block in a frame called by the base frame. This finally block can access the stack arguments, which would reside on the stack of base frame. This means that we must not override the stack of the base frame, only the locals.

Fixes some tests from System.Linq.Expressions suite.
2020-02-14 14:38:25 -08:00
Zoltan Varga 948d7e3b3e [llvmonly] Emit stubs for methods which failed compilation. (#18802)
Emit a stub for methods which failed llvm compilation. Currently the stub will
throw a MissingMethodException, later it can fall back to the interpreter etc.
This is required for cross-assembly direct calls, since the caller doesn't
know that the callee has failed llvm compilation leading to missing
symbols during linking.
2020-02-14 10:59:41 -08:00
dotnet-maestro[bot] 5b775170f2 Update dependencies from https://github.com/dotnet/arcade build 20200214.1 (#18856)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20114.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20114.1
2020-02-14 18:21:46 +01:00
monojenkinsandLevi Broderick 2448e5685f Fix broken MSDN blogs links (#18852)
Fixes MSDN blogs links throughout our docs and source code comments that were broken during the great MSDN migration of 2019.

Note: I am changing the contents of the _davbr Blog Archives_ folder by fixing the broken links. If we need to keep these files exactly as they were when they were copied from the blog, I can revert.

Co-authored-by: Levi Broderick <[email protected]>
2020-02-14 18:15:42 +01:00
Egor Bogatov b5df4be189 Make MonoWebRequestHandler linker friendly (#18832)
Create it using reflection so it will be always linked out. However if it's set via `XA_HTTP_CLIENT_HANDLER_TYPE` linker will preserve it in a special substep: https://github.com/xamarin/xamarin-android/blob/master/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/PreserveHttpAndroidClientHandler.cs#L72-L80

I had to make its ctor **public** because Linker instantiate it via `Activator.CreateInstance(string)` ([here](https://github.com/xamarin/xamarin-android/blob/60363ef45cd6994a322adac1b73d4271b0658c1e/src/Mono.Android/Android.Runtime/AndroidEnvironment.cs#L369)). But the whole type remains internal so it's not a real API change.

Fixes issue from https://github.com/mono/mono/pull/18818#issuecomment-585611647
2020-02-14 13:04:46 +01:00
Fan YangandAlexander Köplinger 549a38cd4d Bump linker submodule (#18844)
* Bump linker submodule

* Use -o instead of -out for linker output

The arguments changed in linker.

Co-authored-by: Alexander Köplinger <[email protected]>
2020-02-14 12:20:19 +01:00
Bernhard Urban-Forster 26a5d63384 [sdks] add anroid-interpreter-{arm64-v8a,armeabi-v7a,x86,x86_64} targets (#18814)
The Xamarin.Android team prefers that we ship two different `libmonosgen-2.0.so` for each target, e.g. for arm64 we will have with this PR:

* `./sdks/out/android-arm64-v8a-release/lib/libmonosgen-2.0.so`
* `./sdks/out/android-interpreter-arm64-v8a-release/lib/libmonosgen-2.0.so`

As the names indicate one has the interpreter enabled.

This is contrary to what we do for Xamarin.iOS. There, `--enable-minimal=interpreter` has the side-effect that the build will produce a `libmono-ee-interp.dylib` that can be linked next to `libmonosgen-2.0.dylib`. We _could_ do the same for Android, but that would require us to

* Add `--disable-visibility-hidden` to the Android Mono runtime builds. There are concerns however that this will slow down `dlopen (libmonosgen-2.0.so)` on the Xamarin.Android side.
* Do some changes to the interpreter infrastructure, because `--disable-minimal=interpreter` is designed to be used with a cross compiler in mind. For example, we would need a different solution for this: https://github.com/mono/mono/blob/d7e6fcbda82639fd5afe106b0e7a65a2a72a4f63/mono/mini/tramp-arm64.c#L631-L634
2020-02-14 08:26:58 +01:00
Thays Grazia fa0af37014 Removing PPDB. 2020-02-13 22:39:27 -06:00
Thays Grazia 2d0337ee31 Enabling PPDB on Wasm. 2020-02-13 22:39:27 -06:00
Zoltan Varga 2146f1f418 [runtime] Disable assertion messages for g_assertf as well if DISABLE_ASSERT_MESSAGES is used. (#18774) 2020-02-13 13:20:21 -08:00
monojenkinsandRyan Lucia b89e6208b3 [mini] Move netcore hosting functionality into separate file (#18799)
Made minor fixes to the preload hook in the process.

The runtime will still crash if you don't specify the TPA paths and include corlib in that list, but it will at least hit an assert that makes clear it can't find corlib instead of attempting to dereference a null pointer in the preload hook.

The monovm header functions are exported for testing purposes, but the file is intentionally not made public as of now.

Co-authored-by: Ryan Lucia <[email protected]>
2020-02-13 15:36:46 -05:00
Zoltan VargaandBernhard Urban-Forster 362cb3084f [wasm] Avoid compiling release configuration with -s ASSERTIONS=1 in AOT mode, it generates a lot of extra code. (#18703)
* [wasm] Avoid compiling release configuration with -s ASSERTIONS=1 in AOT mode, it generates a lot of extra code.

* Update sdks/wasm/packager.cs

Co-Authored-By: Bernhard Urban-Forster <[email protected]>

Co-authored-by: Bernhard Urban-Forster <[email protected]>
2020-02-13 10:25:05 -08:00
Alexander Köplinger c03b6244e0 [tests] Disable bug-10127.exe runtime test on Windows x64 (#18828)
It hangs: https://github.com/mono/mono/issues/18827
2020-02-13 13:50:00 +01:00
Vlad Brezae e8f392412b [interp] Always init locals (#18811)
Storing uninitialized locals in a managed object shouldn't crash the runtime, so they should be zeroed. This doesn't seem to regress performance on wasm since the initlocals flag is always set, currently. We should be able to remove it most of the time, once we add some multi basic block support to the cprop phase. This will enable us to further reduce call overhead.

Fixes https://github.com/mono/mono/issues/18527
2020-02-13 13:00:33 +01:00
Vlad Brezae 0db68c3f27 [interp] Add missing conversion opcodes from r4 (#18813)
Fixes tests from System.Linq.Expressions suite
2020-02-13 12:58:28 +01:00
Zoltan Varga 3129d4ca8b [runtime] Add --enable-minimal=processes,config options to disable support for processes and .config files. (#18822) 2020-02-13 12:55:02 +01:00
Vincent Povirk a645a2d3c7 [System.Drawing] Release the Graphics HDC on Dispose. (#18801)
Libgdiplus will fail when attempting to delete a Graphics object
that has an unreleased HDC. This allows Dispose to succeed in
that case.

This more closely resembles the behavior of corefx.
2020-02-13 10:40:07 +01:00
Jay Krell 19bc9a8dd3 [interp][wasm] Make newobj_fast not recursive, cleanup, fix EXCEPTION_CHECKPOINT. (#18734)
* [interp[wasm] Make newobj_fast not recursive.
This contributes to https://github.com/mono/mono/issues/18646,
and against master might even fix it.
Though much recursion remains in the interpreter/transform.

* [interp] Cleanup redundant code and child_frame vs. frame.
Only the recursive paths need child_frame separate from frame.

Callers of method_entry tended to duplicate parts of it.
Notice it is marked MONO_ALWAYS_INLINE.

And if that isn't right, it should be split into fast and slow forms,
i.e. regarding frame->imethod->transformed.

* Need to EXCEPTION_CHECKPOINT more often -- when transform occurs but does not raise an exception.

* Preserve prior faster paths.

* Making call_vararg added the following to all calls:
  storing is_void in a larger scoped local
  save is_void
  restore is_void
  check is_void, along with preexisting check of retval == null

Because retval must be set even for void call_varargs,
because the arglist is found from it.

This removes the check of retval == null, it should be redundant with is_void.

* A little cleaner -- unlikely is in method_entry.

* Comma to make comment easier to read.
2020-02-13 00:13:34 -08:00
monojenkinsandJo Shields e901d4fe1a Enable Mono ARM & ARM64 Linux builds (#18810)
Traditionally, Mono is build with native compilers (i.e. "build for this architecture" running in an ARM or ARM64 chroot on an ARM64 server), but to align with CoreCLR, let's go the cross-compile way.

This enables cross-compiler support, by passing a whole bunch of extra info to `./configure`, some of which is set in the common YAML (like the `--sysroot` value)

Co-authored-by: Jo Shields <[email protected]>
2020-02-13 01:15:38 -05:00
Zoltan Varga 0a4c3069be [wasm] Update WASM-REQUESTS.md. (#18816) 2020-02-12 18:04:49 -08:00
Zoltan Varga c76bbb23f9 Revert "[wasm] Pass direct-pinvoke to the AOT compiler. (#18775)" (#18807)
This reverts commit eb85a108a3.
2020-02-12 16:21:51 -08:00
Zoltan Varga 3776b416ad [llvm] Remove a wasm limitation which no longer exists. (#18803) 2020-02-12 16:19:21 -08:00
monojenkinsandRyan Lucia cd46f5c77c [WIP][threading] Switch to a native implementation of LowLevelLifoSemaphore (#18559)
This change is motivated on two main fronts. The first is maintainability - the current managed implementation is difficult to understand and I worry diagnosing any potential issues would be a massive time sink. The second is performance - the current implementation appears to suffer from significant lock contention when running the TechEmpower plaintext benchmark. My hope is that the simpler, cleaner native implementation here will avoid both problems, but I don't want to merge it until we have benchmarking data. However, even if the numbers are similar, I still think it's worth merging just from a maintainability perspective.

The native LifoSemaphore implementation has only ever been tested on posix-like platforms, so Windows behavior is unknown. Currently the Windows implementation of LowLevelLifoSemaphore is very different, so unless we have need for the LifoSemaphore elsewhere in the runtime this isn't a concern.

Many thanks to @filipnavara for the initial implementation.

Co-authored-by: Ryan Lucia <[email protected]>
2020-02-12 17:14:30 -05:00
Jo Shields d7e6fcbda8 Fix native mkbundle (#18739)
* Use clearer Bash conditionals, since we force Bash anyway

* Add libmono-native.so to bundle

* Add logic to add a etc/mono/config without $mono_libdir to bundle

Mostly resolves: #16991
2020-02-12 15:57:54 -05:00
Zoltan Varga 3cbc14f6ff [wasm] Remove chakra and xs from the jsvu update list. (#18804)
Chakra is no longer getting updated and we don't use XS.
2020-02-12 10:05:06 -08:00
Zoltan Varga a50f0b1197 [wasm] Switch to the lts version of node. (#18805)
* [wasm] Switch to the lts version of node.

* Fix a typo.
2020-02-12 10:02:55 -08:00
Ankit Jain 8437ecf9d1 [master] Bump msbuild to track xplat-master (#18790)
* [master] Bump msbuild to track xplat-master

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

* Update nuget.exe to match xbuild

- the closest version available right now, to `5.5.0-rtm.6422` is
`5.5.0-preview2`, so using that for now.
2020-02-12 17:10:31 +01:00
Egor Bogatov 76e577c00f Allow users to switch to MonoWebRequestHandler on Android via UI (#18764)
* Bring back old HttpHandler for Android
2020-02-12 16:25:46 +03:00
Zoltan Varga e2c0b5ef27 [runtime] Call mono_stack_mark_record_size () only in a checked build, its slow, and the __FUNCTION__ argument creates a C string for every function name. (#18773) 2020-02-12 10:43:35 +01:00
monojenkinsandRyan Lucia 07dc4b88e7 [utils] Add unused attribute to fix warning in checked-build.c (#18800)
At least on my machine, this is the only warning we have when building netcore in the default configuration.

Co-authored-by: Ryan Lucia <[email protected]>
2020-02-11 22:57:15 -08:00
Zoltan Varga 1c7295cfdf [jit] Add an #ifdef around MONO_CPU_WASM_SIMD. (#18771) 2020-02-11 22:56:34 -08:00
monojenkinsandEgor Bogatov fc75795ed2 [mono] Implement Sse2.AddSaturate using LLVM (#18793)
Mono currently supports a limited subset of **Sse1**-**Sse42** intrinsics used only by CoreLib internally. So once a new API is used to optimize things there we also have to implement it in Mono. So it recently happened in https://github.com/dotnet/runtime/pull/32036 (`Sse2.AddSaturate` was used for the first time).

So this PR implements it for mono (with all Sse2 overloads) using named LLVM intrinsics. It turns out it's different between LLVM6 (we currently based on) and LLVM9 (we plan to migrate to soon).

for `Vector128<byte>` overload it emits
```llvm
%result = call <8 x i16> @llvm.x86.sse2.paddus.b(<16 x i8> %left, <16 x i8> %right)
```
which is then emitted as `vpaddusw`

Co-authored-by: Egor Bogatov <[email protected]>
2020-02-12 00:55:25 +01:00
Zoltan Varga eb85a108a3 [wasm] Pass direct-pinvoke to the AOT compiler. (#18775) 2020-02-11 12:08:49 -08:00
Zoltan Varga b260b327fe [runtime] Simplify access to runtime TLS variables when DISABLE_THREADS is defined, they become simple globals. (#18772) 2020-02-11 11:49:24 -08:00
Alexander Köplinger e8527db725 [mini] Wrap check for debug info enabled in ENABLE_NETCORE in all places (#18789)
See if this fixes the weird bug-10127.exe test failure that only occurs on Windows C++ builds.
2020-02-11 16:50:14 +01:00
565 changed files with 35151 additions and 21847 deletions

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@
<configuration>
<packageSources>
<clear />
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
-5
View File
@@ -434,7 +434,6 @@ Disables compilation for the SSA optimization
framework, and the various SSA-based optimizations.
* `--enable-llvm`
* `--enable-loadedllvm`
* This enables the use of LLVM as a code generation engine
for Mono. The LLVM code generator and optimizer will be
@@ -447,10 +446,6 @@ full details and up-to-date information on this feature.
* You will need to have an LLVM built that Mono can link
against.
* The `--enable-loadedllvm` variant will make the LLVM backend
into a runtime-loadable module instead of linking it directly
into the main mono binary.
* `--enable-big-arrays` - Enable use of arrays with indexes larger
than Int32.MaxValue.
+58 -23
View File
@@ -755,6 +755,12 @@ fi
# for mono/metadata/debug-symfile.c
AC_CHECK_HEADERS(elf.h)
# for perf jit dump support
AC_CHECK_HEADERS(sys/mman.h)
if test "x$host_linux" = "xyes" -a x$ac_cv_header_sys_mman_h = xyes -a x$ac_cv_header_elf_h = xyes -a x$ac_cv_header_sys_syscall_h = xyes; then
AC_DEFINE(ENABLE_JIT_DUMP, 1, [Enable jit dump support on Linux])
fi
# for support
AC_CHECK_HEADERS(poll.h)
AC_CHECK_HEADERS(sys/poll.h)
@@ -1208,6 +1214,7 @@ if test x$enable_monotouch = xyes; then
fi
AC_ARG_ENABLE(cxx, [ --enable-cxx compile some code as C++])
AM_CONDITIONAL(ENABLE_CXX, test x$enable_cxx = xyes)
# mono/corefx/native has a lot of invalid C++98 in its headers
# dotnet/corefx/native looks a lot better, i.e. 44e5bdafb8d989a220c9cf1b94f31a64a6e4f052
@@ -1382,7 +1389,9 @@ if test x$with_runtime_preset = xnetcore; then
mono_feature_disable_gac='yes'
mono_feature_disable_perfcounters='yes'
mono_feature_disable_attach='yes'
mono_feature_disable_dllmap='yes'
if test "x$enable_monodroid" = "x" -a "x$enable_monotouch" = "x"; then
mono_feature_disable_dllmap='yes' # FIXME: the mobile products use this
fi
disable_mono_native=yes
support_boehm=no
elif test x$with_runtime_preset = xnet_4_x; then
@@ -1758,7 +1767,7 @@ AM_CONDITIONAL(ENABLE_STATIC_GCC_LIBS, test "x$enable_static_gcc_libs" = "xyes")
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier, dllmap,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, interpreter, simd, soft_debug, perfcounters, normalization, desktop_loader, shared_perfcounters, remoting,
security, lldb, mdb, assert_messages, cfgdir_config, cleanup, sgen_marksweep_conc, sgen_split_nursery, sgen_gc_bridge, sgen_debug_helpers, sockets, gac, threads.],
security, lldb, mdb, assert_messages, config, cfgdir_config, cleanup, sgen_marksweep_conc, sgen_split_nursery, sgen_gc_bridge, sgen_debug_helpers, sockets, gac, threads, processes.],
[
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
eval "mono_feature_disable_$feature='yes'"
@@ -1939,6 +1948,11 @@ if test "x$mono_feature_disable_cfgdir_config" = "xyes"; then
AC_MSG_NOTICE([Disabled config directories.])
fi
if test "x$mono_feature_disable_config" = "xyes"; then
AC_DEFINE(DISABLE_CONFIG, 1, [Disable .config file support.])
AC_MSG_NOTICE([Disabled .config file support.])
fi
if test "x$mono_feature_disable_cleanup" = "xyes"; then
AC_DEFINE(DISABLE_CLEANUP, 1, [Disable runtime cleanup.])
AC_MSG_NOTICE([Disabled runtime cleanup.])
@@ -1985,6 +1999,11 @@ if test "x$mono_feature_disable_threads" = "xyes"; then
AC_MSG_NOTICE([Disabled threading support])
fi
if test "x$mono_feature_disable_processes" = "xyes"; then
AC_DEFINE(DISABLE_PROCESSES, 1, [Disable process support])
AC_MSG_NOTICE([Disabled process support])
fi
AC_ARG_ENABLE(executables, [ --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes)
AM_CONDITIONAL(DISABLE_EXECUTABLES, test x$enable_executables = xno)
@@ -2359,14 +2378,6 @@ if test x$host_win32 = xno; then
dnl *****************************
AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
case "$host" in
*-*-*freebsd*)
dnl *****************************
dnl *** Checks for libinotify ***
dnl *****************************
AC_CHECK_LIB(inotify, inotify_init, LIBS="$LIBS -linotify")
esac
dnl *****************************
dnl *** Checks for IPPROTO_IP ***
dnl *****************************
@@ -3635,6 +3646,35 @@ if test x$host_win32 = xno; then
AC_MSG_RESULT(no)
])
case "$host" in
*-*-*freebsd*)
dnl *****************************
dnl *** Checks for libinotify ***
dnl *****************************
AC_CHECK_LIB(inotify, inotify_init, LIBS="$LIBS -linotify")
if test "x$ac_cv_lib_inotify_inotify_init" = "xyes" ; then
AC_DEFINE(HAVE_LIBINOTIFY, 1, [FreeBSD libinotify kqueue shim])
dnl Needs to be done this way to avoid collision with various
dnl ports including glib and llvm*
METADATA_CFLAGS="-I/usr/local/include"
AC_SUBST(METADATA_CFLAGS)
fi
dnl Workaround due to inotify_rm_watch check failing without -I
AC_MSG_CHECKING(for inotify_rm_watch with unsigned wd in libinotify)
AC_TRY_LINK([
#include </usr/local/include/sys/inotify.h>
], [
intptr_t fd;
uint32_t wd;
int result = inotify_rm_watch(fd, wd);
],[
AC_MSG_RESULT(yes)
AC_DEFINE(INOTIFY_RM_WATCH_WD_UNSIGNED, 1, [inotify_rm_watch with unsigned wd])
], [
AC_MSG_RESULT(no)
])
esac
CFLAGS="$ORIG_CFLAGS"
AC_MSG_CHECKING(for shm_open that works well enough with mmap)
@@ -4204,6 +4244,11 @@ if test "x$enable_llvm" = "xdefault"; then
enable_llvm=$enable_llvm_default
fi
if test "x$enable_loadedllvm" = "xyes"; then
AC_MSG_WARN("Loadable LLVM is no longer supported. Enabling default LLVM support instead.")
enable_llvm=yes
fi
enable_llvm_msvc_only="no"
if test "x$enable_llvm" = "xyes"; then
if test "x$host_win32" = "xyes"; then
@@ -4218,10 +4263,6 @@ if test "x$enable_llvm" = "xyes"; then
;;
esac
fi
if test "x$enable_loadedllvm" = "xyes"; then
AC_MSG_WARN("Loadable LLVM currently not supported on Windows. Disabling feature.")
enable_loadedllvm=no
fi
fi
fi
@@ -4291,13 +4332,6 @@ fi
AM_CONDITIONAL(ENABLE_LLVM, [test x$enable_llvm = xyes && test x$enable_llvm_msvc_only != xyes])
AM_CONDITIONAL(LOADED_LLVM, [test x$enable_loadedllvm = xyes && test x$enable_llvm_msvc_only != xyes])
if test "x$enable_loadedllvm" = "xyes"; then
if test "x$enable_llvm_msvc_only" != "xyes"; then
AC_DEFINE(MONO_LLVM_LOADED, 1, [The LLVM back end is dynamically loaded])
fi
fi
if test "x$enable_llvm" = "xyes"; then
enable_llvm_runtime=yes
fi
@@ -6558,7 +6592,7 @@ elif case $host_os in freebsd*) true;; *) false;; esac; then
MONO_NATIVE_CXX=$CXX
MONO_NATIVE_CPPFLAGS=$CPPFLAGS
MONO_NATIVE_CXXFLAGS=$CXXFLAGS
MONO_NATIVE_CFLAGS=$CFLAGS
MONO_NATIVE_CFLAGS="$CFLAGS -I/usr/local/include"
MONO_NATIVE_LDFLAGS=$LDFLAGS
mono_native=yes
@@ -6752,6 +6786,7 @@ AC_COMPILE_IFELSE(
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(CCLDFLAGS)
AC_SUBST(ZLIB_CFLAGS)
# Update all submodules recursively to ensure everything is checked out
@@ -7018,7 +7053,7 @@ echo "
Engine: $jit_status
BigArrays: $enable_big_arrays
DTrace: $enable_dtrace
LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm, built in-tree: $internal_llvm, assertions: $enable_llvm_asserts, msvc only: $enable_llvm_msvc_only)
LLVM Back End: $enable_llvm (built in-tree: $internal_llvm, assertions: $enable_llvm_asserts, msvc only: $enable_llvm_msvc_only)
Spectre: $spectre_mitigation_status
Mono.Native: $mono_native_text
+4 -4
View File
@@ -15,13 +15,13 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20109.1">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20171.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>b0e8d3944155f94f83deea8afe025debe369e69f</Sha>
<Sha>7dbc907fa03eacf4c57f827cb4235d77b7ed4fcd</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20109.1">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20171.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>b0e8d3944155f94f83deea8afe025debe369e69f</Sha>
<Sha>7dbc907fa03eacf4c57f827cb4235d77b7ed4fcd</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
-159
View File
@@ -1,159 +0,0 @@
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
. $PSScriptRoot\pipeline-logging-functions.ps1
function FirstMatchingSymbolDescriptionOrDefault {
param(
[string] $FullPath, # Full path to the module that has to be checked
[string] $TargetServerParameter, # 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 $TargetServerParameter $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 -FullPath $_.FullName -TargetServerParameter '--microsoft-symbol-server' -SymbolsPath $SymbolsPath
$SymbolsOnSymWeb = FirstMatchingSymbolDescriptionOrDefault -FullPath $_.FullName -TargetServerParameter '--internal-server' -SymbolsPath $SymbolsPath
Write-Host -NoNewLine "`t Checking file" $_.FullName "... "
if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) {
Write-Host "Symbols found on MSDL (${$SymbolsOnMSDL}) and SymWeb (${$SymbolsOnSymWeb})"
}
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-PipelineTelemetryError -Category 'CheckSymbols' -Message "Missing symbols for $Status modules in the package $FileName"
}
Write-Host
}
}
CheckSymbolsAvailable
-83
View File
@@ -1,83 +0,0 @@
<!-- 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>
-84
View File
@@ -1,84 +0,0 @@
<!-- 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>
<PublishToSymWeb Condition="'$(PublishToSymWeb)' == ''">true</PublishToSymWeb>
<PublishToMSDL Condition="'$(PublishToMSDL)' == ''">true</PublishToMSDL>
<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) and $(PublishToMSDL)"/>
<!--
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) and $(PublishToSymWeb)"/>
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.SymbolUploader.Build.Task" Version="$(SymbolUploaderVersion)" />
</ItemGroup>
</Project>
-83
View File
@@ -1,83 +0,0 @@
<!-- 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 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>
-195
View File
@@ -1,195 +0,0 @@
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
)
function ValidateSourceLinkLinks {
if (!($GHRepoName -Match "^[^\s\/]+/[^\s\/]+$")) {
Write-PipelineTelemetryError -Category "Build" -Message "GHRepoName should be in the format <org>/<repo>"
$global:LASTEXITCODE = 1
return
}
if (!($GHCommit -Match "^[0-9a-fA-F]{40}$")) {
Write-PipelineTelemetryError -Category "Build" -Message "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-PipelineTelemetryError -Category "Build" -Message "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
}
}
try {
. $PSScriptRoot\pipeline-logging-functions.ps1
# Cache/HashMap (File -> Exist flag) used to consult whether a file exist
# in the repository at a specific commit point. This is populated by inserting
# all files present in the repo at a specific commit point.
$global:RepoFiles = @{}
$ValidatePackage = {
param(
[string] $PackagePath # Full path to a Symbols.NuGet package
)
# Ensure input file exist
if (!(Test-Path $PackagePath)) {
throw "Input file does not exist: $PackagePath"
}
# Extensions for which we'll look for SourceLink information
# For now we'll only care about Portable & Embedded PDBs
$RelevantExtensions = @(".dll", ".exe", ".pdb")
Write-Host -NoNewLine "Validating" ([System.IO.Path]::GetFileName($PackagePath)) "... "
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId
$FailedFiles = 0
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Directory]::CreateDirectory($ExtractPath);
$zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath)
$zip.Entries |
Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} |
ForEach-Object {
$FileName = $_.FullName
$Extension = [System.IO.Path]::GetExtension($_.Name)
$FakeName = -Join((New-Guid), $Extension)
$TargetFile = Join-Path -Path $ExtractPath -ChildPath $FakeName
# We ignore resource DLLs
if ($FileName.EndsWith(".resources.dll")) {
return
}
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true)
$ValidateFile = {
param(
[string] $FullPath, # Full path to the module that has to be checked
[string] $RealPath,
[ref] $FailedFiles
)
# Makes easier to reference `sourcelink cli`
Push-Location $using:SourceLinkToolPath
$SourceLinkInfos = .\sourcelink.exe print-urls $FullPath | Out-String
if ($LASTEXITCODE -eq 0 -and -not ([string]::IsNullOrEmpty($SourceLinkInfos))) {
$NumFailedLinks = 0
# We only care about Http addresses
$Matches = (Select-String '(http[s]?)(:\/\/)([^\s,]+)' -Input $SourceLinkInfos -AllMatches).Matches
if ($Matches.Count -ne 0) {
$Matches.Value |
ForEach-Object {
$Link = $_
$CommitUrl = -Join("https://raw.githubusercontent.com/", $using:GHRepoName, "/", $using:GHCommit, "/")
$FilePath = $Link.Replace($CommitUrl, "")
$Status = 200
$Cache = $using:RepoFiles
if ( !($Cache.ContainsKey($FilePath)) ) {
try {
$Uri = $Link -as [System.URI]
# Only GitHub links are valid
if ($Uri.AbsoluteURI -ne $null -and $Uri.Host -match "github") {
$Status = (Invoke-WebRequest -Uri $Link -UseBasicParsing -Method HEAD -TimeoutSec 5).StatusCode
}
else {
$Status = 0
}
}
catch {
$Status = 0
}
}
if ($Status -ne 200) {
if ($NumFailedLinks -eq 0) {
if ($FailedFiles.Value -eq 0) {
Write-Host
}
Write-Host "`tFile $RealPath has broken links:"
}
Write-Host "`t`tFailed to retrieve $Link"
$NumFailedLinks++
}
}
}
if ($NumFailedLinks -ne 0) {
$FailedFiles.value++
$global:LASTEXITCODE = 1
}
}
Pop-Location
}
&$ValidateFile $TargetFile $FileName ([ref]$FailedFiles)
}
$zip.Dispose()
if ($FailedFiles -eq 0) {
Write-Host "Passed."
}
}
Measure-Command { ValidateSourceLinkLinks }
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'SourceLink' -Message $_
ExitWithExitCode 1
}
+5
View File
@@ -26,6 +26,11 @@ Param(
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)
# Unset 'Platform' environment variable to avoid unwanted collision in InstallDotNetCore.targets file
# some computer has this env var defined (e.g. Some HP)
if($env:Platform) {
$env:Platform=""
}
function Print-Usage() {
Write-Host "Common settings:"
Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
@@ -1,41 +0,0 @@
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)
@@ -1,42 +0,0 @@
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)
+45 -51
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
__NDK_Version=r14
__NDK_Version=r21
usage()
{
@@ -16,11 +16,11 @@ usage()
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."
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.28-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
__ApiLevel=28 # The minimum platform for arm64 is API level 21 but the minimum version that support glob(3) is 28. See $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/glob.h
__BuildArch=arm64
__AndroidArch=aarch64
__AndroidToolchain=aarch64-linux-android
@@ -53,13 +53,20 @@ for i in "$@"
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 )"
__ScriptBaseDir="$( 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"
__CrossDir="$__ScriptBaseDir/../../../.tools/android-rootfs"
if [[ ! -f "$__CrossDir" ]]; then
mkdir -p "$__CrossDir"
fi
# Resolve absolute path to avoid `../` in build logs
__CrossDir="$( cd "$__CrossDir" && pwd )"
__NDK_Dir="$__CrossDir/android-ndk-$__NDK_Version"
__lldb_Dir="$__CrossDir/lldb"
__ToolchainDir="$__CrossDir/android-ndk-$__NDK_Version"
if [[ -n "$TOOLCHAIN_DIR" ]]; then
__ToolchainDir=$TOOLCHAIN_DIR
@@ -78,60 +85,47 @@ echo "Target Toolchain location: $__ToolchainDir"
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
wget -q --progress=bar:force:noscroll --show-progress https://dl.google.com/android/repository/android-ndk-$__NDK_Version-linux-x86_64.zip -O $__CrossDir/android-ndk-$__NDK_Version-linux-x86_64.zip
unzip -q $__CrossDir/android-ndk-$__NDK_Version-linux-x86_64.zip -d $__CrossDir
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
wget -q --progress=bar:force:noscroll --show-progress https://dl.google.com/android/repository/lldb-2.3.3614996-linux-x86_64.zip -O $__CrossDir/lldb-2.3.3614996-linux-x86_64.zip
unzip -q $__CrossDir/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 "Download dependencies..."
__TmpDir=$__CrossDir/tmp/$__BuildArch/
mkdir -p "$__TmpDir"
echo Generating the $__BuildArch toolchain
$__NDK_Dir/build/tools/make_standalone_toolchain.py --arch $__BuildArch --api $__ApiLevel --install-dir $__ToolchainDir
# combined dependencies for coreclr, installer and libraries
__AndroidPackages="libicu"
__AndroidPackages+=" libandroid-glob"
__AndroidPackages+=" liblzma"
__AndroidPackages+=" krb5"
__AndroidPackages+=" openssl"
# 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
for path in $(wget -qO- http://termux.net/dists/stable/main/binary-$__AndroidArch/Packages |\
grep -A15 "Package: \(${__AndroidPackages// /\\|}\)" | grep -v "static\|tool" | grep Filename); do
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
if [[ "$path" != "Filename:" ]]; then
echo "Working on: $path"
wget -qO- http://termux.net/$path | dpkg -x - "$__TmpDir"
fi
done
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/
cp -R "$__TmpDir/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.${__ApiLevel}-${__BuildArch}" > $__ToolchainDir/sysroot/android_platform
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
echo "Now to build coreclr, libraries and installers; run:"
echo ROOTFS_DIR=\$\(realpath $__ToolchainDir/sysroot\) ./build.sh --cross --arch $__BuildArch \
--subsetCategory coreclr
echo ROOTFS_DIR=\$\(realpath $__ToolchainDir/sysroot\) ./build.sh --cross --arch $__BuildArch \
--subsetCategory libraries
echo ROOTFS_DIR=\$\(realpath $__ToolchainDir/sysroot\) ./build.sh --cross --arch $__BuildArch \
--subsetCategory installer
+36 -6
View File
@@ -43,10 +43,30 @@ if(TARGET_ARCH_NAME STREQUAL "armel")
endif()
endif()
set(CMAKE_SYSROOT "${CROSS_ROOTFS}")
set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
set(CMAKE_ASM_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
if("$ENV{__DistroRid}" MATCHES "android.*")
if(TARGET_ARCH_NAME STREQUAL "arm")
set(ANDROID_ABI armeabi-v7a)
elseif(TARGET_ARCH_NAME STREQUAL "arm64")
set(ANDROID_ABI arm64-v8a)
endif()
# extract platform number required by the NDK's toolchain
string(REGEX REPLACE ".*\\.([0-9]+)-.*" "\\1" ANDROID_PLATFORM "$ENV{__DistroRid}")
set(ANDROID_TOOLCHAIN clang)
set(FEATURE_EVENT_TRACE 0) # disable event trace as there is no lttng-ust package in termux repository
set(CMAKE_SYSTEM_LIBRARY_PATH "${CROSS_ROOTFS}/usr/lib")
set(CMAKE_SYSTEM_INCLUDE_PATH "${CROSS_ROOTFS}/usr/include")
# include official NDK toolchain script
include(${CROSS_ROOTFS}/../build/cmake/android.toolchain.cmake)
else()
set(CMAKE_SYSROOT "${CROSS_ROOTFS}")
set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
set(CMAKE_ASM_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
endif()
# Specify link flags
@@ -63,7 +83,7 @@ endif()
# Specify compile options
if(TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$")
if(TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$" AND NOT "$ENV{__DistroRid}" MATCHES "android.*")
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN})
@@ -71,7 +91,17 @@ endif()
if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$")
add_compile_options(-mthumb)
add_compile_options(-mfpu=vfpv3)
if (NOT DEFINED CLR_ARM_FPU_TYPE)
set (CLR_ARM_FPU_TYPE vfpv3)
endif (NOT DEFINED CLR_ARM_FPU_TYPE)
add_compile_options (-mfpu=${CLR_ARM_FPU_TYPE})
if (NOT DEFINED CLR_ARM_FPU_CAPABILITY)
set (CLR_ARM_FPU_CAPABILITY 0x7)
endif (NOT DEFINED CLR_ARM_FPU_CAPABILITY)
add_definitions (-DCLR_ARM_FPU_CAPABILITY=${CLR_ARM_FPU_CAPABILITY})
if(TARGET_ARCH_NAME STREQUAL "armel")
add_compile_options(-mfloat-abi=softfp)
if(DEFINED TIZEN_TOOLCHAIN)
+3 -3
View File
@@ -7,7 +7,7 @@ param (
. $PSScriptRoot\tools.ps1
function InstallDarcCli ($darcVersion) {
function InstallDarcCli ($darcVersion, $toolpath) {
$darcCliPackageName = 'microsoft.dotnet.darc'
$dotnetRoot = InitializeDotNetCli -install:$true
@@ -32,13 +32,13 @@ function InstallDarcCli ($darcVersion) {
Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g"
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g
}else {
Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g --tool-path '$toolpath'"
Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity --tool-path '$toolpath'"
& "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath"
}
}
try {
InstallDarcCli $darcVersion
InstallDarcCli $darcVersion $toolpath
}
catch {
Write-Host $_.ScriptStackTrace
+1 -1
View File
@@ -63,7 +63,7 @@ case $cpuname in
amd64|x86_64)
buildarch=x64
;;
armv7l)
armv*l)
buildarch=arm
;;
i686)
+40 -9
View File
@@ -34,6 +34,14 @@ while (($# > 0)); do
force=true
shift 1
;;
--donotabortonfailure)
donotabortonfailure=true
shift 1
;;
--donotdisplaywarnings)
donotdisplaywarnings=true
shift 1
;;
--downloadretries)
download_retries=$2
shift 2
@@ -52,6 +60,8 @@ while (($# > 0)); do
echo " - (default) %USERPROFILE%/.netcoreeng/native"
echo ""
echo " --clean Switch specifying not to install anything, but cleanup native asset folders"
echo " --donotabortonfailure Switch specifiying whether to abort native tools installation on failure"
echo " --donotdisplaywarnings Switch specifiying whether to display warnings during native tools installation on failure"
echo " --force Clean and then install tools"
echo " --help Print help and exit"
echo ""
@@ -92,6 +102,7 @@ if [[ -z $install_directory ]]; then
fi
install_bin="${native_base_dir}/bin"
installed_any=false
ReadGlobalJsonNativeTools
@@ -103,8 +114,8 @@ else
for tool in "${!native_assets[@]}"
do
tool_version=${native_assets[$tool]}
installer_name="install-$tool.sh"
installer_command="$native_installer_dir/$installer_name"
installer_path="$native_installer_dir/install-$tool.sh"
installer_command="$installer_path"
installer_command+=" --baseuri $base_uri"
installer_command+=" --installpath $install_bin"
installer_command+=" --version $tool_version"
@@ -118,11 +129,29 @@ else
installer_command+=" --clean"
fi
$installer_command
if [[ $? != 0 ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed"
exit 1
if [[ -a $installer_path ]]; then
$installer_command
if [[ $? != 0 ]]; then
if [[ $donotabortonfailure = true ]]; then
if [[ $donotdisplaywarnings != true ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed"
fi
else
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed"
exit 1
fi
else
$installed_any = true
fi
else
if [[ $donotabortonfailure == true ]]; then
if [[ $donotdisplaywarnings != true ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script"
fi
else
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script"
exit 1
fi
fi
done
fi
@@ -135,8 +164,10 @@ if [[ -d $install_bin ]]; then
echo "Native tools are available from $install_bin"
echo "##vso[task.prependpath]$install_bin"
else
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Native tools install directory does not exist, installation failed"
exit 1
if [[ $installed_any = true ]]; then
Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Native tools install directory does not exist, installation failed"
exit 1
fi
fi
exit 0
+20 -1
View File
@@ -6,7 +6,7 @@
<Python>py -3</Python>
<CoreRun>%HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe</CoreRun>
<BaselineCoreRun>%HELIX_CORRELATION_PAYLOAD%\Baseline_Core_Root\CoreRun.exe</BaselineCoreRun>
<HelixPreCommands>$(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd</HelixPreCommands>
<HelixPreCommands>$(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd;set PYTHONPATH=%HELIX_WORKITEM_PAYLOAD%\scripts%3B%HELIX_WORKITEM_PAYLOAD%</HelixPreCommands>
<ArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts</ArtifactsDirectory>
<BaselineArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts_Baseline</BaselineArtifactsDirectory>
<ResultsComparer>%HELIX_CORRELATION_PAYLOAD%\performance\src\tools\ResultsComparer\ResultsComparer.csproj</ResultsComparer>
@@ -99,4 +99,23 @@
<Timeout>4:00</Timeout>
</HelixWorkItem>
</ItemGroup>
<ItemGroup Condition="'$(AGENT_OS)' == 'Windows_NT'">
<HelixWorkItem Include="Crossgen System.Private.Xml.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Private.Xml.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
<HelixWorkItem Include="Crossgen System.Linq.Expressions.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Linq.Expressions.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
<HelixWorkItem Include="Crossgen Microsoft.CodeAnalysis.VisualBasic.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.VisualBasic.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
<HelixWorkItem Include="Crossgen Microsoft.CodeAnalysis.CSharp.dll">
<PayloadDirectory>$(WorkItemDirectory)\ScenarioCorrelation</PayloadDirectory>
<Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.CSharp.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root</Command>
</HelixWorkItem>
</ItemGroup>
</Project>
+3 -1
View File
@@ -31,7 +31,9 @@ function Write-PipelineTelemetryError {
$PSBoundParameters.Remove('Category') | Out-Null
$Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message"
if($Force -Or ((Test-Path variable:ci) -And $ci)) {
$Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message"
}
$PSBoundParameters.Remove('Message') | Out-Null
$PSBoundParameters.Add('Message', $Message)
Write-PipelineTaskError @PSBoundParameters
@@ -0,0 +1,25 @@
param(
[Parameter(Mandatory=$true)][string] $PromoteToChannels, # List of channels that the build should be promoted to
[Parameter(Mandatory=$true)][array] $AvailableChannelIds # List of channel IDs available in the YAML implementation
)
try {
. $PSScriptRoot\post-build-utils.ps1
# Check that every channel that Maestro told to promote the build to
# is available in YAML
$PromoteToChannelsIds = $PromoteToChannels -split "\D" | Where-Object { $_ }
foreach ($id in $PromoteToChannelsIds) {
if (($id -ne 0) -and ($id -notin $AvailableChannelIds)) {
Write-PipelineTaskError -Type 'warning' -Message "Channel $id is not present in the post-build YAML configuration!"
}
}
Write-Host 'done.'
}
catch {
Write-Host $_
Write-PipelineTelemetryError -Category 'CheckChannelConsistency' -Message "There was an error while trying to check consistency of Maestro default channels for the build and post-build YAML configuration."
ExitWithExitCode 1
}
@@ -1,44 +0,0 @@
param(
[Parameter(Mandatory=$true)][int] $BarBuildId, # ID of the build which assets should be downloaded
[Parameter(Mandatory=$true)][string] $DropLocation, # Where the assets should be downloaded to
[Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, # Token used to access Maestro API
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', # Maestro API URL
[Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2019-01-16' # Version of Maestro API to use
)
try {
. $PSScriptRoot\post-build-utils.ps1
Write-Host 'Installing DARC ...'
. $PSScriptRoot\..\darc-init.ps1
$exitCode = $LASTEXITCODE
if ($exitCode -ne 0) {
Write-PipelineTelemetryError -Category "Darc" -Message "Something failed while running 'darc-init.ps1'. Check for errors above. Exiting now..."
ExitWithExitCode $exitCode
}
# For now, only use a dry run.
# Ideally we would change darc to enable a quick request that
# would check whether the file exists that you can download it,
# and that it won't conflict with other files.
# https://github.com/dotnet/arcade/issues/3674
# Right now we can't remove continue-on-error because we ocassionally will have
# dependencies that have no associated builds (e.g. an old dependency).
# We need to add an option to baseline specific dependencies away, or add them manually
# to the BAR.
darc gather-drop --non-shipping `
--dry-run `
--continue-on-error `
--id $BarBuildId `
--output-dir $DropLocation `
--bar-uri $MaestroApiEndpoint `
--password $MaestroApiAccessToken `
--latest-location
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category "Darc" -Message $_
ExitWithExitCode 1
}
+1 -1
View File
@@ -9,7 +9,7 @@ param(
try {
. $PSScriptRoot\post-build-utils.ps1
$url = 'https://raw.githubusercontent.com/NuGet/NuGetGallery/jver-verify/src/VerifyMicrosoftPackage/verify.ps1'
$url = 'https://raw.githubusercontent.com/NuGet/NuGetGallery/3e25ad135146676bcab0050a516939d9958bfa5d/src/VerifyMicrosoftPackage/verify.ps1'
New-Item -ItemType 'directory' -Path ${ToolDestinationPath} -Force
@@ -37,6 +37,12 @@ jobs:
- name: _BuildConfig
value: ${{ parameters.configuration }}
- group: Publish-Build-Assets
# Skip component governance and codesign validation for SDL. These jobs
# create no content.
- name: skipComponentGovernanceDetection
value: true
- name: runCodesignValidationInjection
value: false
steps:
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
@@ -84,6 +84,7 @@ stages:
- job: publish_assets
displayName: Publish Assets
dependsOn: setupMaestroVars
timeoutInMinutes: 120
variables:
- name: BARBuildId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
@@ -10,6 +10,8 @@ parameters:
transportFeed: ''
shippingFeed: ''
symbolsFeed: ''
# If the channel name is empty, no links will be generated
akaMSChannelName: ''
stages:
- stage: ${{ parameters.stageName }}
@@ -83,6 +85,7 @@ stages:
- job: publish_assets
displayName: Publish Assets
dependsOn: setupMaestroVars
timeoutInMinutes: 120
variables:
- name: BARBuildId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
@@ -94,6 +97,8 @@ stages:
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ]
- name: AzDOBuildId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ]
- name: ArtifactsCategory
value: ${{ coalesce(variables._DotNetArtifactsCategory, '.NETCore') }}
condition: or(contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.channelId }} )), eq(dependencies.setupMaestroVars.outputs['setReleaseVars.PromoteToMaestroChannelId'], ${{ parameters.channelId }}))
pool:
vmImage: 'windows-2019'
@@ -132,7 +137,7 @@ stages:
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet
/p:ArtifactsCategory=$(_DotNetArtifactsCategory)
/p:ArtifactsCategory=$(ArtifactsCategory)
/p:IsStableBuild=$(IsStableBuild)
/p:IsInternalBuild=$(IsInternalBuild)
/p:RepositoryName=$(Build.Repository.Name)
@@ -158,6 +163,9 @@ stages:
/p:AzureDevOpsStaticTransportFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)'
/p:AzureDevOpsStaticSymbolsFeed='${{ parameters.symbolsFeed }}'
/p:AzureDevOpsStaticSymbolsFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)'
/p:LatestLinkShortUrlPrefix=dotnet/'${{ parameters.akaMSChannelName }}'
/p:AkaMSClientId=$(akams-client-id)
/p:AkaMSClientSecret=$(akams-client-secret)
${{ parameters.artifactsPublishingAdditionalParameters }}
- template: ../../steps/publish-logs.yml
@@ -90,3 +90,10 @@ variables:
value: https://dotnetclimsrc.blob.core.windows.net/dotnet/index.json
- name: InternalInstallersBlobFeedKey
value: $(dotnetclimsrc-access-key)
# Skip component governance and codesign validation for SDL. These jobs
# create no content.
- name: skipComponentGovernanceDetection
value: true
- name: runCodesignValidationInjection
value: false
@@ -1,23 +0,0 @@
parameters:
ChannelId: 0
jobs:
- job: gatherDrop
displayName: Gather Drop
dependsOn: setupMaestroVars
condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.ChannelId }}))
variables:
- name: BARBuildId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
pool:
vmImage: 'windows-2019'
steps:
- task: PowerShell@2
displayName: Darc gather-drop
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/darc-gather-drop.ps1
arguments: -BarBuildId $(BARBuildId)
-DropLocation $(Agent.BuildDirectory)/Temp/Drop/
-MaestroApiAccessToken $(MaestroApiAccessToken)
-MaestroApiEndPoint $(MaestroApiEndPoint)
-MaestroApiVersion $(MaestroApiVersion)
+76 -10
View File
@@ -22,6 +22,22 @@ parameters:
publishDependsOn:
- Validate
# Channel ID's instantiated in this file.
# When adding a new channel implementation the call to `check-channel-consistency.ps1`
# needs to be updated with the new channel ID
NetEngLatestChannelId: 2
NetEngValidationChannelId: 9
NetCoreDev5ChannelId: 131
GeneralTestingChannelId: 529
NETCoreToolingDevChannelId: 548
NETCoreToolingReleaseChannelId: 549
NETInternalToolingChannelId: 551
NETCoreExperimentalChannelId: 562
NetEngServicesIntChannelId: 678
NetEngServicesProdChannelId: 679
Net5Preview1ChannelId: 737
Net5Preview2ChannelId: 738
stages:
- stage: Validate
dependsOn: ${{ parameters.validateDependsOn }}
@@ -31,6 +47,24 @@ stages:
jobs:
- template: setup-maestro-vars.yml
- job:
displayName: Post-build Checks
dependsOn: setupMaestroVars
variables:
- name: InitialChannels
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'] ]
- name: PromoteToMaestroChannelId
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.PromoteToMaestroChannelId'] ]
pool:
vmImage: 'windows-2019'
steps:
- task: PowerShell@2
displayName: Maestro Channels Consistency
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/check-channel-consistency.ps1
arguments: -PromoteToChannels "$(InitialChannels)[$(PromoteToMaestroChannelId)]"
-AvailableChannelIds ${{parameters.NetEngLatestChannelId}},${{parameters.NetEngValidationChannelId}},${{parameters.NetCoreDev5ChannelId}},${{parameters.GeneralTestingChannelId}},${{parameters.NETCoreToolingDevChannelId}},${{parameters.NETCoreToolingReleaseChannelId}},${{parameters.NETInternalToolingChannelId}},${{parameters.NETCoreExperimentalChannelId}},${{parameters.NetEngServicesIntChannelId}},${{parameters.NetEngServicesProdChannelId}},${{parameters.Net5Preview1ChannelId}},${{parameters.Net5Preview2ChannelId}}
- job:
displayName: NuGet Validation
dependsOn: setupMaestroVars
@@ -165,7 +199,36 @@ stages:
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NetCore_Dev5_Publish'
channelName: '.NET Core 5 Dev'
channelId: 131
akaMSChannelName: 'net5/dev'
channelId: ${{ parameters.NetCoreDev5ChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net5_Preview1_Publish'
channelName: '.NET 5 Preview 1'
akaMSChannelName: 'net5/preview1'
channelId: ${{ parameters.Net5Preview1ChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net5_Preview2_Publish'
channelName: '.NET 5 Preview 2'
akaMSChannelName: 'net5/preview2'
channelId: ${{ parameters.Net5Preview2ChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
@@ -178,7 +241,8 @@ stages:
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net_Eng_Latest_Publish'
channelName: '.NET Eng - Latest'
channelId: 2
akaMSChannelName: 'eng/daily'
channelId: ${{ parameters.NetEngLatestChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
@@ -191,7 +255,8 @@ stages:
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net_Eng_Validation_Publish'
channelName: '.NET Eng - Validation'
channelId: 9
akaMSChannelName: 'eng/validation'
channelId: ${{ parameters.NetEngValidationChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
@@ -204,7 +269,8 @@ stages:
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'General_Testing_Publish'
channelName: 'General Testing'
channelId: 529
akaMSChannelName: 'generaltesting'
channelId: ${{ parameters.GeneralTestingChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing-symbols/nuget/v3/index.json'
@@ -217,7 +283,7 @@ stages:
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NETCore_Tooling_Dev_Publishing'
channelName: '.NET Core Tooling Dev'
channelId: 548
channelId: ${{ parameters.NETCoreToolingDevChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json'
@@ -230,7 +296,7 @@ stages:
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NETCore_Tooling_Release_Publishing'
channelName: '.NET Core Tooling Release'
channelId: 549
channelId: ${{ parameters.NETCoreToolingReleaseChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json'
@@ -243,7 +309,7 @@ stages:
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NET_Internal_Tooling_Publishing'
channelName: '.NET Internal Tooling'
channelId: 551
channelId: ${{ parameters.NETInternalToolingChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal-symbols/nuget/v3/index.json'
@@ -256,7 +322,7 @@ stages:
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'NETCore_Experimental_Publishing'
channelName: '.NET Core Experimental'
channelId: 562
channelId: ${{ parameters.NETCoreExperimentalChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental-symbols/nuget/v3/index.json'
@@ -269,7 +335,7 @@ stages:
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net_Eng_Services_Int_Publish'
channelName: '.NET Eng Services - Int'
channelId: 678
channelId: ${{ parameters.NetEngServicesIntChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
@@ -282,7 +348,7 @@ stages:
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net_Eng_Services_Prod_Publish'
channelName: '.NET Eng Services - Prod'
channelId: 679
channelId: ${{ parameters.NetEngServicesProdChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json'
+7 -2
View File
@@ -399,7 +399,12 @@ function LocateVisualStudio([object]$vsRequirements = $null){
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
try {
Invoke-WebRequest "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/vswhere/$vswhereVersion/vswhere.exe" -OutFile $vswhereExe
}
catch {
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
}
}
if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs }
@@ -630,7 +635,7 @@ function MSBuild-Core() {
$exitCode = Exec-Process $buildTool.Path $cmdArgs
if ($exitCode -ne 0) {
Write-PipelineTelemetryError Category 'Build' -Message 'Build failed.'
Write-PipelineTelemetryError -Category 'Build' -Message 'Build failed.'
$buildLog = GetMSBuildBinaryLogCommandLineArgument $args
if ($buildLog -ne $null) {
+1 -1
View File
@@ -252,7 +252,7 @@ function GetDotNetInstallScript {
# Use curl if available, otherwise use wget
if command -v curl > /dev/null; then
with_retries curl "$install_script_url" -isSLv --retry 10 --create-dirs -o "$install_script" || {
with_retries curl "$install_script_url" -sSL --retry 10 --create-dirs -o "$install_script" || {
local exit_code=$?
Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to acquire dotnet install script (exit code '$exit_code')."
ExitWithExitCode $exit_code
+1 -1
+1 -1
+1 -1
+2 -2
View File
@@ -3,7 +3,7 @@
"dotnet": "5.0.100-alpha1-015772"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20109.1",
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20109.1"
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20171.1",
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20171.1"
}
}
+1 -1
View File
@@ -49,4 +49,4 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR certmgr(1)
.BR certmgr (1)
+2 -3
View File
@@ -37,6 +37,5 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR makecert(1), signcode(1)
.BR makecert (1),
.BR signcode (1)
+2 -1
View File
@@ -184,4 +184,5 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR makecert(1), setreg(1)
.BR makecert (1),
.BR setreg (1)
+4 -1
View File
@@ -43,4 +43,7 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR signcode(1), makecert(1), certmgr(1), setreg(1)
.BR signcode (1),
.BR makecert (1),
.BR certmgr (1),
.BR setreg (1)
+2 -1
View File
@@ -53,4 +53,5 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR certmgr(1), at(1)
.BR certmgr (1),
.BR at (1)
+2 -3
View File
@@ -116,6 +116,5 @@ for more information.
.SH WEB SITE
Visit: http://www.go-mono.com for details
.SH SEE ALSO
.BR mcs(1), mono(1)
.BR mcs (1),
.BR mono (1)
+2 -1
View File
@@ -58,7 +58,8 @@ Display information about ilasm
.B \--version
Display ilasm version
.SH SEE ALSO
.BR mono(1), mcs(1)
.BR mono (1),
.BR mcs (1)
.SH COPYRIGHT
Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com)
.SH MAILING LISTS
+1 -1
View File
@@ -172,4 +172,4 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR signcode(1)
.BR signcode (1)
+1 -1
View File
@@ -38,4 +38,4 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR monodocer(1)
.BR monodocer (1)
+3 -3
View File
@@ -468,6 +468,6 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
.SH WEB SITE
Visit: http://www.mono-project.com for details
.SH SEE ALSO
.BR mcs(1), mono(1), mono-config(5).
.BR mcs (1),
.BR mono (1),
.BR mono-config (5)
+1 -1
View File
@@ -33,4 +33,4 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR mono(1)
.BR mono (1)
+4 -1
View File
@@ -21,4 +21,7 @@ Mailing lists are listed at http://www.mono-project.com/community/help/mailing-l
mono-cil-strip is licensed under the MIT/X11 license. Please read the accompayning
MIT.X11 file for details.
.SH SEE ALSO
.BR monolinker(1),mkbundle(1),mono(1),mcs(1).
.BR monolinker (1),
.BR mkbundle (1),
.BR mono (1),
.BR mcs (1)
+3 -1
View File
@@ -135,4 +135,6 @@ when running under the Solaris and FreeBSD operating systems.
.fi
.SH SEE ALSO
.BR mono(1), monodis(1), mint(1)
.BR mono (1),
.BR monodis (1),
.BR mint (1)
+1 -2
View File
@@ -86,7 +86,6 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
.SH WEB SITE
Visit: http://www.mono-project.com for details
.SH SEE ALSO
.BR mono(1)
.BR mono (1)
.PP
.BR N:System.ServiceProcess
+2 -1
View File
@@ -82,4 +82,5 @@ http://www.mono-project.com/community/help/mailing-lists/
.SH WEB SITE
http://www.mono-project.com
.SH SEE ALSO
.BR mono(1), mcs(1).
.BR mono (1),
.BR mcs (1)
+7 -1
View File
@@ -1498,6 +1498,9 @@ scanning is available.
\fBno-managed-allocator\fR
Disables the managed allocator.
.TP
\fBmanaged-allocator\fR
Enables the managed allocator.
.TP
\fBcheck-scan-starts\fR
If set, does a plausibility check on the scan_starts before and after each collection
.TP
@@ -1523,7 +1526,10 @@ sgen-gc.c. You can then use this command to explore the output
\fBnursery-canaries\fR
If set, objects allocated in the nursery are suffixed with a canary (guard)
word, which is checked on each minor collection. Can be used to detect/debug
heap corruption issues.
heap corruption issues. This disables the usage of the managed allocator,
because allocation from full aot code is inconsistent with this option. If
the application is guaranteed not to use aot code, the managed allocator can
be enabled back with managed-allocator option.
.TP
\fBdo-not-finalize(=\fIclasses\fB)\fR
+4 -1
View File
@@ -216,4 +216,7 @@ the Google Summer of Code.
The linker is licensed under the MIT/X11 license. Please read the accompayning
MIT.X11 file for details.
.SH SEE ALSO
.BR al(1),mkbundle(1),mono(1),mcs(1).
.BR al (1),
.BR mkbundle (1),
.BR mono (1),
.BR mcs (1)
+3 -1
View File
@@ -174,4 +174,6 @@ http://www.mono-project.com/community/help/mailing-lists/
.SH WEB SITE
http://www.mono-project.com
.SH SEE ALSO
.BR mono(1), certmgr(1). setreg(1)
.BR mono (1),
.BR certmgr (1),
.BR setreg (1)
+3 -3
View File
@@ -104,6 +104,6 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
.SH WEB SITE
Visit: http://www.mono-project.com for details
.SH SEE ALSO
.BR mcs(1), mono(1), mono-config(5).
.BR mcs (1),
.BR mono (1),
.BR mono-config (5)
+2 -1
View File
@@ -42,4 +42,5 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR sn(1), signcode(1)
.BR sn (1),
.BR signcode (1)
+3 -1
View File
@@ -35,4 +35,6 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR chktrust(1), certmgr(1), makecert(1)
.BR chktrust (1),
.BR certmgr (1),
.BR makecert (1)
+3 -1
View File
@@ -67,4 +67,6 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR xsd(1),wsdl(1),genxs(1)
.BR xsd (1),
.BR wsdl (1),
.BR genxs (1)
+3 -1
View File
@@ -90,4 +90,6 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR chktrust(1), makecert(1), cert2spc(1)
.BR chktrust (1),
.BR makecert (1),
.BR cert2spc (1)
+1 -1
View File
@@ -159,4 +159,4 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
.SH WEB SITE
Visit http://www.mono-project.com for details
.SH SEE ALSO
.BR secutil(1)
.BR secutil (1)
+2 -1
View File
@@ -184,7 +184,8 @@ On Mac OSX, for locating pkg-config (.pc) files, xbuild additionally
looks in "/Library/Frameworks/Mono.framework/External/pkgconfig" .
.SH SEE ALSO
.BR mono(1), mcs(1)
.BR mono (1),
.BR mcs (1)
.SH COPYRIGHT
Copyright (C) 2011 Novell, Inc (http://www.novell.com)
.SH MAILING LISTS
+1 -2
View File
@@ -19,8 +19,7 @@ endif
TEST_HARNESS = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/$(PARENT_PROFILE)nunit-lite-console.exe
PLATFORM_DEBUG_FLAGS = /debug:portable
# Workaround for https://bugzilla.xamarin.com/show_bug.cgi?id=59967
MCS_FLAGS = /features:peverify-compat /langversion:latest
MCS_FLAGS = /langversion:latest
LIBRARY_FLAGS =
ifndef CFLAGS
CFLAGS = -g -O2
+1 -1
View File
@@ -8,7 +8,7 @@ MCS = $(BOOTSTRAP_MCS)
profile-check:
@:
TARGET_NET_REFERENCE = v4.6
TARGET_NET_REFERENCE = v4.7
DEFAULT_REFERENCES = mscorlib
PROFILE_MCS_FLAGS = -d:NET_4_6 -d:MONO -d:WASM_TOOLS -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS)
+6 -6
View File
@@ -216,19 +216,19 @@
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'wasm_tools' ">
<Reference Include="./../../../external/binary-reference-assemblies/v4.6/System.Core.dll">
<Reference Include="./../../../external/binary-reference-assemblies/v4.7/System.Core.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>./../../../external/binary-reference-assemblies/v4.6/System.Core.dll</HintPath>
<HintPath>./../../../external/binary-reference-assemblies/v4.7/System.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="./../../../external/binary-reference-assemblies/v4.6/System.dll">
<Reference Include="./../../../external/binary-reference-assemblies/v4.7/System.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>./../../../external/binary-reference-assemblies/v4.6/System.dll</HintPath>
<HintPath>./../../../external/binary-reference-assemblies/v4.7/System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="./../../../external/binary-reference-assemblies/v4.6/mscorlib.dll">
<Reference Include="./../../../external/binary-reference-assemblies/v4.7/mscorlib.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>./../../../external/binary-reference-assemblies/v4.6/mscorlib.dll</HintPath>
<HintPath>./../../../external/binary-reference-assemblies/v4.7/mscorlib.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
@@ -409,6 +409,9 @@ namespace Mono.Debugger.Soft
public ErrorCode ErrorCode {
get; set;
}
public string ErrorMessage {
get; set;
}
}
/*
@@ -436,7 +439,7 @@ namespace Mono.Debugger.Soft
* with newer runtimes, and vice versa.
*/
internal const int MAJOR_VERSION = 2;
internal const int MINOR_VERSION = 54;
internal const int MINOR_VERSION = 57;
enum WPSuspendPolicy {
NONE = 0,
@@ -792,10 +795,12 @@ namespace Mono.Debugger.Soft
// For reply packets
offset = 0;
ReadInt (); // length
var len = ReadInt (); // length
ReadInt (); // id
ReadByte (); // flags
ErrorCode = ReadShort ();
if (ErrorCode == (int)Mono.Debugger.Soft.ErrorCode.INVALID_ARGUMENT && connection.Version.AtLeast (2, 56) && len > offset)
ErrorMsg = ReadString ();
}
public CommandSet CommandSet {
@@ -810,6 +815,10 @@ namespace Mono.Debugger.Soft
get; set;
}
public string ErrorMsg {
get; internal set;
}
public int Offset {
get {
return offset;
@@ -1792,7 +1801,7 @@ namespace Mono.Debugger.Soft
LogPacket (packetId, encoded_packet, reply, command_set, command, watch);
if (r.ErrorCode != 0) {
if (ErrorHandler != null)
ErrorHandler (this, new ErrorHandlerEventArgs () { ErrorCode = (ErrorCode)r.ErrorCode });
ErrorHandler (this, new ErrorHandlerEventArgs () { ErrorCode = (ErrorCode)r.ErrorCode, ErrorMessage = r.ErrorMsg});
throw new NotImplementedException ("No error handler set.");
} else {
return r;
@@ -34,6 +34,11 @@ namespace Mono.Debugger.Soft
}
}
public int GetId()
{
return id;
}
public EventType EventType {
get {
return etype;
@@ -367,7 +367,10 @@ namespace Mono.Debugger.Soft
} else {
if (r.Exception != null)
throw new InvocationException ((ObjectMirror)r.VM.DecodeValue (r.Exception));
//refresh frames from thread after running an invoke
r.Thread.GetFrames();
Value out_this = null;
if (r.OutThis != null)
out_this = r.VM.DecodeValue (r.OutThis);
@@ -171,8 +171,7 @@ namespace Mono.Debugger.Soft
HashSet<ThreadMirror> threadsToInvalidate = new HashSet<ThreadMirror> ();
ThreadMirror[] threadCache;
object threadCacheLocker = new object ();
void InvalidateThreadAndFrameCaches () {
lock (threadsToInvalidate) {
foreach (var thread in threadsToInvalidate)
@@ -200,7 +199,7 @@ namespace Mono.Debugger.Soft
var fetchingEvent = new ManualResetEvent (false);
vm.conn.VM_GetThreads ((threadsIds) => {
ids = threadsIds;
threadCache = threads = new ThreadMirror [threadsIds.Length];
threads = new ThreadMirror [threadsIds.Length];
fetchingEvent.Set ();
});
if (WaitHandle.WaitAny (new []{ vm.conn.DisconnectedEvent, fetchingEvent }) == 0) {
@@ -215,6 +214,8 @@ namespace Mono.Debugger.Soft
//if (threadCache != threads) {//While fetching threads threadCache was invalidated(thread was created/destoyed)
// return GetThreads ();
//}
Thread.MemoryBarrier ();
threadCache = threads;
return threads;
} else {
return threads;
@@ -371,7 +372,7 @@ namespace Mono.Debugger.Soft
case ErrorCode.NO_SEQ_POINT_AT_IL_OFFSET:
throw new ArgumentException ("Cannot set breakpoint on the specified IL offset.");
default:
throw new CommandException (args.ErrorCode);
throw new CommandException (args.ErrorCode, args.ErrorMessage);
}
}
@@ -657,7 +658,9 @@ namespace Mono.Debugger.Soft
internal EventRequest GetRequest (int id) {
lock (requests_lock) {
return requests [id];
EventRequest obj;
requests.TryGetValue (id, out obj);
return obj;
}
}
@@ -885,13 +888,18 @@ namespace Mono.Debugger.Soft
public class CommandException : Exception {
internal CommandException (ErrorCode error_code) : base ("Debuggee returned error code " + error_code + ".") {
internal CommandException (ErrorCode error_code, string error_message) : base ("Debuggee returned error code " + error_code + (error_message == null || error_message.Length == 0 ? "." : " - " + error_message + ".")) {
ErrorCode = error_code;
ErrorMessage = error_message;
}
public ErrorCode ErrorCode {
get; set;
}
public string ErrorMessage {
get; internal set;
}
}
public class VMNotSuspendedException : InvalidOperationException
@@ -613,6 +613,12 @@ public class Tests : TestsBase, ITest2
pointers2 ();
return 0;
}
if (args.Length >0 && args [0] == "ss_multi_thread") {
ss_multi_thread ();
return 0;
}
test_invalid_argument_assembly_get_type ();
frame_setvalue_withlist ();
return 3;
}
@@ -641,6 +647,21 @@ public class Tests : TestsBase, ITest2
LocalReflectClass.RunMe ();
}
public static void test_invalid_argument_assembly_get_type () {
}
public static void frame_setvalue_withlist () {
string someLocalString = "Hello";
string someLocalString2 = "Hello";
var aList = new List<string>();
aList.Add("a");
aList.Add("B");
aList.Add("c");
someLocalString2 = someLocalString;
}
public static void breakpoints () {
/* Call these early so it is JITted by the time a breakpoint is placed on it */
bp3 ();
@@ -861,6 +882,24 @@ public class Tests : TestsBase, ITest2
n.Buffer2 = new char4('a', 'b', 'c', 'd');
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ss_multi_thread () {
for (int i = 0; i < 5; i++)
{
var t = new Thread(mt_ss);
t.Name = "Thread_" + i;
t.Start();
}
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
static void mt_ss()
{
int a = 12;
int b = 13;
int c = 13;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void test_new_exception_filter () {
test_new_exception_filter1();
+124 -2
View File
@@ -470,7 +470,6 @@ public class DebuggerTests
var pdbFromMemory = assemblyMirror.GetPdbBlob ();
if (!File.Exists (pdbPath)) {
Assert.IsFalse (assemblyMirror.HasPdb);
Assert.IsTrue (assemblyMirror.HasFetchedPdb);
continue;
}
@@ -5198,9 +5197,132 @@ public class DebuggerTests
Assert.IsInstanceOfType (typeof (ArgumentException), ex);
}
}
[Test]
public void InvalidArgumentAssemblyGetType () {
Event e = run_until ("test_invalid_argument_assembly_get_type");
var assembly = entry_point.DeclaringType.Assembly;
try {
var type = assembly.GetType ("System.Collections.Generic.Dictionary<double, float>.Main");
}
catch (CommandException ex) {
Assert.AreEqual(ex.ErrorMessage, "Unexpected assembly-qualified type \"System.Collections.Generic.Dictionary<double, float>.Main\" was provided");
}
}
[Test]
public void InvokeSingleStepMultiThread () {
vm.Detach ();
Start (dtest_app_path, "ss_multi_thread");
MethodMirror m = entry_point.DeclaringType.GetMethod ("mt_ss");
int firstLineFound = m.Locations [0].LineNumber + 1;
int line_first_counter = 5;
int line_second_counter = 5;
int line_third_counter = 3;
Event e = run_until ("ss_multi_thread");
EventRequest req = create_step (e);
req.Disable ();
ReusableBreakpoint breakpoint = new ReusableBreakpoint (this, "mt_ss");
breakpoint.Continue ();
e = breakpoint.lastEvent;
req = create_step (e);
while (line_first_counter > 0 || line_second_counter > 0 || line_third_counter > 0) {
var thread = e.Thread;
var l = thread.GetFrames ()[0].Location;
var frame = thread.GetFrames()[0];
if (l.LineNumber == firstLineFound)
line_first_counter--;
if (l.LineNumber == firstLineFound + 1)
line_second_counter--;
if (l.LineNumber == firstLineFound + 2)
line_third_counter--;
if (req.GetId() != breakpoint.req.GetId())
req.Disable ();
req = create_step (e);
((StepEventRequest)req).Size = StepSize.Line;
try {
if ((e.Thread.GetFrames ()[0].Location.LineNumber == firstLineFound + 1 && (e.Thread.Name.Equals("Thread_0") || e.Thread.Name.Equals("Thread_1"))) || l.LineNumber == firstLineFound + 2) {
vm.Resume ();
e = GetNextEvent ();
}
else
e = step_over_or_breakpoint ();
req = e.Request;
}
catch (Exception z){
//expected vmdeath
break;
}
}
Assert.AreEqual(0, line_first_counter);
Assert.AreEqual(0, line_second_counter);
Assert.AreEqual(0, line_third_counter);
vm = null;
}
[Test]
public void CheckSuspendPolicySentWhenLaunchSuspendYes () {
vm.Exit (0);
var port = GetFreePort ();
// Launch the app using server=y,suspend=y
var pi = CreateStartInfo (dtest_app_path, "attach", $"--debugger-agent=transport=dt_socket,address=127.0.0.1:{port},server=y,suspend=y");
pi.UseShellExecute = false;
var process = Diag.Process.Start (pi);
string failMessage = null;
try {
vm = ConnectToPort (port);
vm.EnableEvents (EventType.AssemblyLoad, EventType.ThreadStart);
var es = vm.GetNextEventSet ();
Assert.AreEqual (es.SuspendPolicy, SuspendPolicy.All);
Assert.AreEqual (EventType.VMStart, es[0].EventType);
}
catch (Exception ex) {
failMessage = ex.Message;
}
finally {
vm.Exit (0);
vm = null;
}
if (failMessage != null)
Assert.Fail (failMessage);
}
[Test]
public void Frame_SetValue_WithList () {
Event e = run_until ("frame_setvalue_withlist");
var req = create_step (e);
req.Enable ();
e = step_once ();
e = step_over ();
e = step_over ();
e = step_over ();
e = step_over ();
e = step_over ();
e = step_over ();
StackFrame frame = e.Thread.GetFrames () [0];
var l = frame.Method.GetLocal ("someLocalString");
var l1 = frame.Method.GetLocal ("aList");
TypeMirror t = l1.Type;
var m = t.GetMethod ("get_Count");
var contentOrig1 = frame.GetValue (l1);
var v = (contentOrig1 as ObjectMirror).InvokeMethod (e.Thread, m, null);
var contentOrig = frame.GetValue (l);
var str = vm.RootDomain.CreateString ("test1");
frame.SetValue (l, str);
contentOrig = frame.GetValue (l);
e.Thread.GetFrames ();
contentOrig = frame.GetValue (l);
AssertValue ("test1", contentOrig);
}
#endif
} // class DebuggerTests
} // namespace
@@ -75,13 +75,6 @@ namespace Mono.Unix
throw new ArgumentException ("socketAddress is not a unix socket address.");
*/
if (socketAddress.Size == 2) {
// Empty filename.
// Probably from RemoteEndPoint which on linux does not return the file name.
UnixEndPoint uep = new UnixEndPoint ("a");
uep.filename = "";
return uep;
}
int size = socketAddress.Size - 2;
byte [] bytes = new byte [size];
for (int i = 0; i < bytes.Length; i++) {
@@ -92,6 +85,14 @@ namespace Mono.Unix
break;
}
}
if (size == 0) {
// Empty filename.
// Probably from RemoteEndPoint which on linux/windows does not return the file name.
UnixEndPoint uep = new UnixEndPoint ("dummy");
uep.filename = "";
return uep;
}
string name = Encoding.Default.GetString (bytes, 0, size);
return new UnixEndPoint (name);
@@ -63,5 +63,6 @@ partial class DataAnnotationsResources
public const string MinLengthAttribute_InvalidMinLength = "MinLengthAttribute must have a Length value that is zero or greater.";
public const string MinLengthAttribute_ValidationError = "The field {0} must be a string or array type with a minimum length of '{1}'.";
public const string ArgumentIsNullOrWhitespace = "The argument '{0}' cannot be null, empty or contain only white space.";
public const string LengthAttribute_InvalidValueType = "The field of type {0} must be a string, array or ICollection type.";
}
}
@@ -168,6 +168,7 @@
<Compile Include="..\referencesource\System.ComponentModel.DataAnnotations\DataAnnotations\Validator.cs" />
<Compile Include="Assembly\AssemblyInfo.cs" />
<Compile Include="ReferenceSources\SR.cs" />
<Compile Include="corefx\CountPropertyHelper.cs" />
<ProjectReference Include="$(SolutionDir)\msvc\scripts\genconsts.csproj">
<Name>genconsts</Name>
<Project>{702AE2C0-71DD-4112-9A06-E4FABCA59986}</Project>
@@ -1,5 +1,6 @@
../../build/common/Consts.cs
Assembly/AssemblyInfo.cs
corefx/CountPropertyHelper.cs
../referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AppSettings.cs
../referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs
../referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs
@@ -18,3 +18,4 @@ System.ComponentModel.DataAnnotations/PhoneAttributeTest.cs
System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs
System.ComponentModel.DataAnnotations/FileExtensionsAttributeTest.cs
System.ComponentModel.DataAnnotations/CompareAttributeTest.cs
System.ComponentModel.DataAnnotations/MaxMinLengthAttributeTest.cs
@@ -0,0 +1,77 @@
//
// MaxMinLengthAttributeTest.cs
//
// Copyright (C) 2010 Novell, Inc. (http://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.
//
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using NUnit.Framework;
namespace MonoTests.System.ComponentModel.DataAnnotations
{
[TestFixture]
public class MaxMinLengthAttributeTest
{
[Test]
public void CheckMinLength () {
var attr = new MinLengthAttribute (2);
Assert.IsTrue (attr.IsValid (null), "#A1");
Assert.IsFalse (attr.IsValid ("1"), "#A2");
Assert.IsTrue (attr.IsValid ("12"), "#A3");
Assert.IsTrue (attr.IsValid ("123"), "#A4");
Assert.IsFalse (attr.IsValid (BuildQuickList (1)), "#A5");
Assert.IsTrue (attr.IsValid (BuildQuickList (2)), "#A6");
Assert.IsTrue (attr.IsValid (BuildQuickList (3)), "#A7");
}
[Test]
public void CheckMaxLength () {
var attr = new MaxLengthAttribute (2);
Assert.IsTrue (attr.IsValid (null), "#A1");
Assert.IsTrue (attr.IsValid ("1"), "#A2");
Assert.IsTrue (attr.IsValid ("12"), "#A3");
Assert.IsFalse (attr.IsValid ("123"), "#A4");
Assert.IsTrue (attr.IsValid (BuildQuickList (1)), "#A5");
Assert.IsTrue (attr.IsValid (BuildQuickList (2)), "#A6");
Assert.IsFalse (attr.IsValid (BuildQuickList (3)), "#A7");
}
List<string> BuildQuickList (int count) {
var items = new List<string> ();
for (int i = 0; i < count; i++) {
items.Add(i.ToString());
}
return items;
}
}
}
@@ -0,0 +1,27 @@
using System.Collections;
using System.Diagnostics;
using System.Reflection;
internal static class CountPropertyHelper
{
public static bool TryGetCount(object value, out int count)
{
Debug.Assert(value != null);
if (value is ICollection collection)
{
count = collection.Count;
return true;
}
PropertyInfo property = value.GetType().GetRuntimeProperty("Count");
if (property != null && property.CanRead && property.PropertyType == typeof(int))
{
count = (int)property.GetValue(value);
return true;
}
count = -1;
return false;
}
}
@@ -288,6 +288,9 @@ namespace System.Drawing
{
Status status;
if (! disposed) {
if (deviceContextHdc != IntPtr.Zero)
ReleaseHdc ();
if (GDIPlus.UseCarbonDrawable || GDIPlus.UseCocoaDrawable) {
Flush ();
if (maccontext != null)
@@ -3543,6 +3543,16 @@ namespace MonoTests.System.Drawing {
}
}
}
[Test]
public void GetHdcWithoutRelease ()
{
using (Bitmap b = new Bitmap (10, 10)) {
using (Graphics g = Graphics.FromImage (b)) {
g.GetHdc ();
}
}
}
}
[TestFixture]
@@ -0,0 +1,27 @@
using System.Reflection;
namespace System.Net.Http
{
partial class HttpClientHandler : HttpMessageHandler
{
static IMonoHttpClientHandler CreateDefaultHandler ()
{
string envvar = Environment.GetEnvironmentVariable ("XA_HTTP_CLIENT_HANDLER_TYPE")?.Trim ();
if (envvar?.StartsWith("System.Net.Http.MonoWebRequestHandler", StringComparison.InvariantCulture) == true)
{
Type monoWrhType = Type.GetType (envvar, false);
if (monoWrhType != null)
return (IMonoHttpClientHandler) Activator.CreateInstance (monoWrhType);
}
// Ignore other types of handlers here (e.g. AndroidHttpHandler) to keep the old behavior
// and always create SocketsHttpHandler for code like this if MonoWebRequestHandler was not specified:
//
// var handler = new HttpClientHandler { Credentials = ... };
// var httpClient = new HttpClient (handler);
//
// AndroidHttpHandler is used only when we use the parameterless ctor of HttpClient
return new SocketsHttpHandler ();
}
}
}
+1 -1
View File
@@ -38,7 +38,7 @@ LIB_MCS_FLAGS += -d:XAMARIN_MODERN
endif
ifeq (wasm,$(PROFILE))
API_BIN_REFS := WebAssembly.Net.Http
API_BIN_REFS := System.Net.Http.WebAssemblyHttpHandler
endif
TEST_LIB_REFS = System System.Core
@@ -70,7 +70,7 @@ namespace System.Net.Http
TimeSpan? timeout;
bool disposed;
internal MonoWebRequestHandler ()
public MonoWebRequestHandler ()
{
allowAutoRedirect = true;
maxAutomaticRedirections = 50;
@@ -1328,7 +1328,7 @@
<Compile Include="..\..\..\external\corefx\src\System.Net.Http\src\System\Net\Http\StreamContent.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Http\src\System\Net\Http\StreamToStreamCopy.cs" />
<Compile Include="..\..\..\external\corefx\src\System.Net.Http\src\System\Net\Http\StringContent.cs" />
<Compile Include="HttpClientHandler.SocketsHandler.cs" />
<Compile Include="HttpClientHandler.SocketsHandler.Android.cs" />
<Compile Include="HttpClientHandler.cs" />
<Compile Include="HttpRequestMessage.Mono.cs" />
<Compile Include="IMonoHttpClientHandler.cs" />
@@ -1407,9 +1407,9 @@
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'wasm' ">
<Reference Include="./../../../external/binary-reference-assemblies/build/monowasm/WebAssembly.Net.Http.dll">
<Reference Include="./../../../external/binary-reference-assemblies/build/monowasm/System.Net.Http.WebAssemblyHttpHandler.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>./../../../external/binary-reference-assemblies/build/monowasm/WebAssembly.Net.Http.dll</HintPath>
<HintPath>./../../../external/binary-reference-assemblies/build/monowasm/System.Net.Http.WebAssemblyHttpHandler.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
@@ -8,27 +8,34 @@ namespace System.Net.Http {
static HttpMessageHandler CreateDefaultHandler ()
{
Type type = Type.GetType("Android.Runtime.AndroidEnvironment, Mono.Android");
if (type == null)
return GetFallback ("Invalid Mono.Android assembly? Cannot find Android.Runtime.AndroidEnvironment");
string envvar = Environment.GetEnvironmentVariable ("XA_HTTP_CLIENT_HANDLER_TYPE")?.Trim ();
MethodInfo method = type.GetMethod ("GetHttpMessageHandler", BindingFlags.Static | BindingFlags.NonPublic);
if (method == null)
return GetFallback ("Your Xamarin.Android version does not support obtaining of the custom HttpClientHandler");
if (string.IsNullOrEmpty (envvar))
return new HttpClientHandler ();
object ret = method.Invoke (null, null);
if (ret == null)
return GetFallback ("Xamarin.Android returned no custom HttpClientHandler");
if (envvar?.StartsWith ("System.Net.Http.MonoWebRequestHandler", StringComparison.InvariantCulture) == true)
{
Type monoWrhType = Type.GetType (envvar, false);
if (monoWrhType != null)
return new HttpClientHandler ((IMonoHttpClientHandler) Activator.CreateInstance (monoWrhType));
var handler = ret as HttpMessageHandler;
if (handler == null)
return GetFallback ($"{ret?.GetType()} is not a valid HttpMessageHandler");
return handler;
}
return new HttpClientHandler ();
}
Type handlerType = Type.GetType (envvar, false);
if (handlerType == null && !envvar.Contains (", "))
{
// if assembly was not specified - look for it in Mono.Android too
// (e.g. AndroidHttpHandler is there)
handlerType = Type.GetType (envvar + ", Mono.Android", false);
}
if (handlerType == null)
return new HttpClientHandler ();
if (Activator.CreateInstance (handlerType) is HttpMessageHandler msgHandler)
return msgHandler;
static HttpMessageHandler GetFallback (string message)
{
Console.WriteLine (message + ". Defaulting to System.Net.Http.HttpClientHandler");
return new HttpClientHandler ();
}
}
@@ -2,6 +2,6 @@ namespace System.Net.Http
{
public partial class HttpClient
{
static HttpMessageHandler CreateDefaultHandler () => new WebAssembly.Net.Http.HttpClient.WasmHttpMessageHandler ();
static HttpMessageHandler CreateDefaultHandler () => new System.Net.Http.WebAssemblyHttpHandler ();
}
}
@@ -13,11 +13,11 @@ namespace System.Net.Http
{
public class HttpClientHandler : HttpMessageHandler
{
WebAssembly.Net.Http.HttpClient.WasmHttpMessageHandler wasmHandler;
System.Net.Http.WebAssemblyHttpHandler wasmHandler;
public HttpClientHandler ()
{
wasmHandler = new WebAssembly.Net.Http.HttpClient.WasmHttpMessageHandler ();
wasmHandler = new System.Net.Http.WebAssemblyHttpHandler ();
}
protected override void Dispose (bool disposing)
@@ -175,7 +175,7 @@ namespace MonoTests.System.Net.Http
}
}
const int WaitTimeout = 5000;
const int WaitTimeout = 10000;
[Test]
public void Ctor ()
@@ -99,8 +99,6 @@ namespace MonoTests.System.Net.Http
[Test]
public void Ctor_RelativeUri ()
{
var client = new HttpClient ();
client.BaseAddress = new Uri ("http://en.wikipedia.org/wiki/");
var uri = new Uri ("Computer", UriKind.Relative);
var req = new HttpRequestMessage (HttpMethod.Get, uri);
// HttpRequestMessage does not rewrite it here.
@@ -124,8 +122,6 @@ namespace MonoTests.System.Net.Http
[Test]
public void Ctor_RelativeUriString ()
{
var client = new HttpClient ();
client.BaseAddress = new Uri ("http://en.wikipedia.org/wiki/");
var req = new HttpRequestMessage (HttpMethod.Get, "Computer");
// HttpRequestMessage does not rewrite it here.
Assert.IsFalse (req.RequestUri.IsAbsoluteUri);
@@ -1 +1,2 @@
HttpClient.DefaultHandler.cs
HttpClientHandler.SocketsHandler.cs
@@ -1,2 +1,3 @@
#include socketshandler.sources
System.Net.Http/HttpClient.android.cs
HttpClientHandler.SocketsHandler.Android.cs
@@ -273,6 +273,8 @@ namespace System.Windows.Forms
ItemCheckEventArgs icea = new ItemCheckEventArgs (Index,
new_value, current_value);
owner.OnItemCheck (icea);
// consumers can update NewValue (e.g. to prevent checking an entry)
new_value = icea.NewValue;
if (new_value != current_value) {
// force re-population of list
@@ -99,7 +99,7 @@ namespace System.Windows.Forms
property_tabs = new PropertyTabCollection(this);
line_color = SystemColors.ScrollBar;
category_fore_color = line_color;
category_fore_color = SystemColors.ControlText;
commands_visible = false;
commands_visible_if_available = false;
property_sort = PropertySort.CategorizedAlphabetical;
@@ -939,6 +939,7 @@ namespace System.Windows.Forms
if (tabs != null && tabs.Count > 0) {
foreach (PropertyTab tab in tabs) {
PropertyToolBarButton button = new PropertyToolBarButton (tab);
button.ToolTipText = Locale.GetText(tab.TabName);
button.Click += new EventHandler (toolbarbutton_clicked);
toolbar.Items.Add (button);
if (tab.Bitmap != null) {
@@ -598,7 +598,7 @@ namespace System.Windows.Forms.PropertyGridInternal {
if (grid_item.GridItemType == GridItemType.Category) {
font = bold_font;
brush = SystemBrushes.ControlText;
brush = ThemeEngine.Current.ResPool.GetSolidBrush (property_grid.CategoryForeColor);
pevent.Graphics.DrawString (grid_item.Label, font, brush, rect.X + 1, rect.Y + ENTRY_SPACING);
if (grid_item == this.SelectedGridItem) {
@@ -667,11 +667,11 @@ namespace System.Windows.Forms.PropertyGridInternal {
0, yLoc, V_INDENT, row_height);
if (grid_item.GridItemType == GridItemType.Category) {
pevent.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (property_grid.CategoryForeColor), depth*V_INDENT,yLoc,ClientRectangle.Width-(depth*V_INDENT), row_height);
pevent.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (property_grid.LineColor), depth*V_INDENT,yLoc,ClientRectangle.Width-(depth*V_INDENT), row_height);
}
DrawGridItemLabel (grid_item, pevent,
depth,
depth,
new Rectangle (depth * V_INDENT, yLoc, SplitterLocation - depth * V_INDENT, row_height));
DrawGridItemValue (grid_item, pevent,
depth,
@@ -677,6 +677,30 @@ namespace MonoTests.System.Windows.Forms
item1.ToolTipText = null;
Assert.AreEqual (String.Empty, item1.ToolTipText, "ToolTipText#1");
}
[TestCase(CheckState.Checked, CheckState.Unchecked, CheckState.Unchecked)]
[TestCase(CheckState.Checked, CheckState.Unchecked, CheckState.Checked)]
[TestCase(CheckState.Unchecked, CheckState.Checked, CheckState.Unchecked)]
public void ListViewItemCheckEventChangesValue (CheckState currentValue, CheckState newValue, CheckState overrideNewValue)
{
ListView lv = new ListView ();
ListViewItem item1 = lv.Items.Add ("Item 1");
item1.Checked = currentValue == CheckState.Checked;
ItemCheckEventHandler checkEventHandler = (object sender, ItemCheckEventArgs args) => {
Assert.AreEqual (currentValue, args.CurrentValue, "#1");
Assert.AreEqual (newValue, args.NewValue, "#2");
args.NewValue = overrideNewValue;
};
lv.ItemCheck += checkEventHandler;
try {
item1.Checked = newValue == CheckState.Checked;
Assert.AreEqual (overrideNewValue == CheckState.Checked, item1.Checked, "#3");
} finally {
lv.ItemCheck -= checkEventHandler;
}
}
}
[TestFixture]
@@ -429,13 +429,9 @@ namespace System.Xml.Serialization
}
}
static Encoding DefaultEncoding = Encoding.Default;
public void Serialize (Stream stream, object o)
{
XmlTextWriter xmlWriter = new XmlTextWriter (stream, DefaultEncoding);
xmlWriter.Formatting = Formatting.Indented;
Serialize (xmlWriter, o, null);
Serialize (stream, o, null);
}
public void Serialize (TextWriter textWriter, object o)
@@ -452,7 +448,7 @@ namespace System.Xml.Serialization
public void Serialize (Stream stream, object o, XmlSerializerNamespaces namespaces)
{
XmlTextWriter xmlWriter = new XmlTextWriter (stream, DefaultEncoding);
XmlTextWriter xmlWriter = new XmlTextWriter (stream, Encoding.UTF8);
xmlWriter.Formatting = Formatting.Indented;
Serialize (xmlWriter, o, namespaces);
}
@@ -2676,6 +2676,19 @@ namespace MonoTests.System.XmlSerialization
Assert.AreEqual ("<:GenComplexStructOfInt32String http://www.w3.org/2000/xmlns/:xsd='http://www.w3.org/2001/XMLSchema' http://www.w3.org/2000/xmlns/:xsi='http://www.w3.org/2001/XMLSchema-instance'><:something>123</><:simpleclass><:something>456</></><:simplestruct><:something>789</></><:listclass><:somelist><:int>100</><:int>200</></></><:arrayclass><:arr><:int>11</><:int>22</><:int>33</></></><:twoclass><:something1>10</><:something2>Ten</></><:derivedclass><:something1>two</><:something2>2</><:another1>1</><:another2>one</></><:derived2><:something1>4</><:something2>four</><:another1>3</><:another2>three</></><:nestedouter><:outer>5</></><:nestedinner><:inner>six</><:something>6</></></>", WriterText);
}
[Test]
public void TestSerializeStreamPreserveUTFChars () {
string foo = "BÄR";
XmlSerializer serializer = new XmlSerializer (typeof (string));
MemoryStream stream = new MemoryStream ();
serializer.Serialize (stream, foo);
stream.Position = 0;
foo = (string) serializer.Deserialize (stream);
Assert.AreEqual("BÄR", foo);
}
[Test] // bug #80759
public void HasNullableField ()
{
Loaded 100 of 565 files, more files were not shown because too many files have changed in this diff. Show more