223 Commits
Author SHA1 Message Date
Larry Ewing 82f7144f79 [wasm] Enable tests blocked by IL2105 (#57457)
* Disable ReflectionCachesUpdateHandler_CachesCleared with aggressive trimming

* Enable more tests stopped by 2105

* Create tests.mobile.targets

Suppress IL2025

* Remove comment enabling trim warnings

* Mark more active issues
2021-08-17 16:28:09 -05:00
Ankit JainandLarry Ewing 3e3b00c53b [wasm] Add incremental build support (#57113)
* Update tasks to support incremental build

MonoAOTCompiler:
- Compiles assemblies to .bc files.
- Hashes for the .bc files are stored in a json cache file.
- And uses .depfile generated by mono-aot-cross, to figure out the
  if any of the dependencies have changed
- Writes out the actual .bc file only if the assembly, or it's
  dependencies changed

EmccCompile.cs: Support a `%(Dependencies)` metadata on the source
files, to compile the files only when needed.

* Update wasm targets

* don't pass unncessary args to RunTests

* Add tests for incremental builds

* Disable non-wasm builds, for testing

* Add miggins LogAsErrorException.cs

* Bump sdk for workload testing to 6.0.100-rc.1.21410.3

* fix build

* MonoAOTCompiler: use the full path to copy the final .bc file

* Make the method used with `MemberData`, static

otherwise xunit just shows a cryptic:
```
    Wasm.Build.Tests.RebuildTests.NoOpRebuild [STARTING]
    Wasm.Build.Tests.RebuildTests.NoOpRebuild [FAIL]
      System.NotSupportedException : Specified method is not supported.
```

* add back builds

* Split Wasm.Build.Tests into multiple helix jobs

* Revert "add back builds"

This reverts commit 1d031c04e13780ec73180ba6f06a37ee42c24203.

* Split up native rebuild tests

* remove non-test classes

* add back builds

This reverts commit b008130a7886c2e2b9f16c83641c1b8c936082f6.

* MonoAOTCompiler: make cache optional

* MonoAOTCompiler: handle the case where we have a cache entry, but the file on disk doesn't exist

* Fix aot compiler task output

* MonoAOTCompiler: Use hashes of .bc files instead of assemblies

`--depfile` isn't supported on aot config used by android, and fails
with:

```
* Assertion at /__w/1/s/src/mono/mono/mini/aot-compiler.c:14216, condition `acfg->aot_opts.llvm_only && acfg->aot_opts.asm_only && acfg->aot_opts.llvm_outfile' not met
```

Instead, use hashes of the .bc.tmp files generated, with the existing
.bc files.

* MonoAOTCompiler: Support more than one output file

The earlier implementation assumed that there would be only one output
file. But in some cases (eg. android), there are more than one, like
`.s`, `.dll-llvm.o`.

* -bump sdk for workload testing

* MonoAOTCompiler: don't use tmp files at all, when cache isn't being

.. used.

Co-authored-by: Larry Ewing <[email protected]>
2021-08-17 11:58:50 -05:00
Ankit Jain 98ca2ffa27 [wasm] Don't use workload for tfm < net6.0 (#56606)
* Bump sdk used for testing to 6.0.100-rc.1.21402.6

* InstallWorkloadFromArtifacts: Add OnlyUpdateManifests parameter

* [wasm] Run Wasm.Build.Tests with sdk/no-workload/+EMSDK

Currently, Wasm.Build.Tests are run in two modes:

1. sdk(`$(SdkVersionForWorkloadTesting)`)+workload installed
2. sdk(from global.json)+EMSDK+LocalBuild targets

this commit changes (2) to:

2. sdk(`$(SdkVersionForWorkloadTesting)`), no workload installed, +
   EMSDK+LocalBuild targets

This makes it closer to what a user would actually use.

Also, for the workload tests, this removes `$(WasmNativeWorkload)`
always being set to `true`. The workload should be setting that, and not
the tests.

* Wasm.Build.Tests: Add test for net5.0 blazor projects

* Disable unrelated builds for now

* Revert "Disable unrelated builds for now"

This reverts commit 6fa0efe2ffcfdbcfaba3bdf519a7717809c22672.

* Rename OnlyWasmBuildTests -> TestWasmBuildTests
2021-08-15 13:10:26 -05:00
7d12f7596a Upgrade SDK to 6.0.100-rc.1.21411.13 (#57143)
* Upgrade SDK to 6.0.100-rc.1.21379.2

Both the AzDO and the Core-Eng team believe believe that the issue is on our side and was caused by a thread pool regression. The assumption stands that we need to update to a newer SDK which contains the fix for the thread pool hang.

Pros:
-	AzDO and Core-Eng believe that this will mitigate the AzDO feed restore issues.
Cons:
-	We will upgrade to an unsigned SDK build. Arcade and other repos already did the same to workaround the issue.
-	That SDK build isn’t officially released and won’t until RC 1 ships. This means that developers need to install that build via the nightly channel (from https://github.com/dotnet/installer) if they want to use their globally installed SDK in combination with dotnet/runtime.
-	Even though this is a breaking change, we can’t wait for the next monthly infrastructure rollout.

* set StaticWebAssetsEnabled=false

* Remove IsSupported2 since asserting it is true when it might not be

* Try enabling the runtimeconfig generator everywhere

* Revert part of runtimeconfig parser change

* Fix System.Text.Json tests to run with trimming by setting MetadataUpdaterSupport=true.

Work around SDK issue by overwriting EnableUnsafeUTF7Encoding in System.Text.Encoding

* Disable bundling tests on Mac due to bug

See https://github.com/dotnet/runtime/issues/57242

* Make ProcessInfo tests resilient to RuntimeConfig switches on commandline

* Update global.json

Updating to 6.0.100-rc.1.21411.13

* Update to latest SDK.
Remove System.Text.Encoding.Tests workaround

* ignore runtimeconfig switches _if_ they show up

* Remove test which uses `dotnet run, which is SDK-specific

Co-authored-by: Larry Ewing <[email protected]>
Co-authored-by: Eric Erhardt <[email protected]>
Co-authored-by: Andy Gocke <[email protected]>
Co-authored-by: John Salem <[email protected]>
Co-authored-by: Dan Moseley <[email protected]>
2021-08-12 15:09:01 -07:00
Jose Perez Rodriguez ffa6aae114 Clean up rd.xml now that DCS has been annotated (#57013)
* Clean up rd.xml now that DCS has been annotated

* Adding annotation to keep KeyValue.GetKeyValuePair method

* Use GetMemberWithSameMetadataDefinitionAs instead

* fix typo in the type being kept

* Save constructor metadata as a workaround as opposed to using DynamicDependency
2021-08-11 11:10:30 -05:00
Fan YangandAnkit Jain 13f80656cd Add runtimeconfig.json support for WebAssembly (#56486)
* Initial change for adding runtimeconfig to wasm

* Add runtimeconfig support to wasm

* Move test folder and update runtimeconifg task name

* Fix test

* Fix test csproj file

* Use the right var for main dll name

* Resolve review feedback part 1

* Resolve review feedbacks part 2

* Add doc for updating dependencies when adding new tasks

* Remove redundant condition and redundant copy

* There is no runtimeconfig.json file to parse, when OutputType is library. So skip it.

* Skip for Android tests as well.

* Remove the wrong locatioin of WasmFilesToIncludeInFileSystem

* Update runtimeconfig file path

* Add RuntimeConfigParserTasksAssemblyPath to linker test project template

* Fix test failures on WASM EAT and AOT lanes

* [wasm] Add a test for reading runtimeconfig.json

* improve error reporting slightly

* Enable tests

* One more thing to enable tests

* Run target _WasmGenerateRuntimeConfig when runtimeconfig.json file exists

* Add a test for configure runtime using msbuild properties

* Fix runtime test failures

* Update tests base on feedback

* Add missing ")"

* Add one more condition

* More format changes

* Better error handling

* [wasm] Fix build for a test support project

This fixes the build for ApplyUpdateReferencedAssembly.csproj, which is
a support project for HotReload wasm functional test.

```
D:\workspace\_work\1\s\src\mono\wasm\build\WasmApp.targets(131,5): error : Could not find
    D:\workspace\_work\1\s\artifacts\bin\ApplyUpdateReferencedAssembly\net6.0-Release\browser-wasm\publish\ApplyUpdateReferencedAssembly.runtimeconfig.json
    for D:\workspace\_work\1\s\artifacts\bin\ApplyUpdateReferencedAssembly\net6.0-Release\browser-wasm\publish\ApplyUpdateReferencedAssembly.dll.

    [D:\workspace\_work\1\s\src\tests\FunctionalTests\WebAssembly\Browser\HotReload\ApplyUpdateReferencedAssembly\ApplyUpdateReferencedAssembly.csproj]
```

The wasm targets should be run at all for this project. But they are run
because they get imported by tests.wasm.targets, which gets imported because
`$(IsTestProject)=true`.

The csproj has `$(IsTestProject)=false`, and `$(IsTestSupportProject)=true`,
which should mean that the test.props/targets don't get imported. But the
import is conditioned on `$(EnableTestSupport)`, which gets set in
`src/libraries/Directory.Build.props`. And that means setting
`$(IsTestProject)=true` in the csproj is too late.

So, instead, set that in a `Directory.Build.props`. And also, ensure that the
`Directory.Build.props` for functional tests doesn't override the value!

Co-authored-by: Ankit Jain <[email protected]>
2021-08-06 09:04:16 -04:00
9dc2059c32 Enable WASM AOT microbenchmark run (#55353)
* bring up WASM AOT microbenchmarks run

* bring up WASM AOT microbenchmarks run

* adding diagnostice log for testing

* commend out some jobs while testing to save lab run resource

* commend out some jobs while testing to save lab run resource

* Add WASM AOT in not scheduled run

* Only run selected jobs

* add "ls -l" to print out permission before calling performance-setup.sh

* add "ls -l" to print out permission before calling performance-setup.sh

* Add "--buildTimeout 3600" to benchmarkdotnet to extend default timeout time. Adjust -aotcompilermode format to "--aotcompilermode=wasm".

* Add "--buildTimeout 3600" to benchmarkdotnet to extend default timeout time. Adjust -aotcompilermode format to "--aotcompilermode=wasm".

* Correct runtimeSrcDir value

* Correct --runtimeSrcDir location to $HELIX_CORRELATION_PAYLOAD

* Correct --runtimeSrcDir location to $HELIX_CORRELATION_PAYLOAD

* Remove not used parameters in WASM AOT mode and  add temperary diagnostic info

* Remove not used parameters in WASM AOT mode and  add temperary diagnostic info

* make \$HELIX_CORRELATION_PAYLOAD/dotnet-wasm to be the root directory of runtime repo source

* Only copy runtime repo source directory to helix payload when it's wasm aot

* Add diagnosic log for testing only

* omite unneeded runtime repo file from helix payload

* omite unneeded runtime repo file from helix payload

* use rsync instead of cp exclusion command since cp doesn't work with sub directory as expected.

* Add temp diagnostic logging, should be removed before PR.

* remove artifacts/obj from helix payload

* remove artifacts/obj from helix payload

* copy back helix job for diagnosis and silent rsync

* For testing only, clone performance repor alicial/hikeMicro-benchmark private branch, which contains copying back helix job folder for diagnosis

* enable rsync verbose for diagnosis

* add --keepfiles for wasm intepreter as well for diagnosis

* Remove temporary diagnostic code

* recover all the jobs in the pipeline

* recover all the jobs in the pipeline

* copy wasm build drop to the location that aot build expects

* using private perf branch to enable binlog for benchmarkdotnet for diagnosis

* comment out none wasm runs temporarily for testing only

* comment out none wasm runs temporarily for testing only

* add "--keepfiles" to keep diagnostic files

* fixed $wasm_dotnet_path/artifacts/BrowserWasm/artifacts path

* instead of copy, move $wasm_dotnet_path/artifacts/BrowserWasm/artifacts/* to save space

* benchmarkdotnet using --cli \$HELIX_CORRELATION_PAYLOAD/dotnet-wasm/dotnet.sh instead

* benchmarkdotnet using --cli \$HELIX_CORRELATION_PAYLOAD/dotnet-wasm/dotnet.sh instead

* add executable permission

* Enable other non run to compare

* Enable other non run to compare

* remove "--cli \$HELIX_CORRELATION_PAYLOAD/dotnet-wasm/dotnet.sh"

* fixes per CR

* copy EMSDK_PATH to expected location in helix payload

* install emsdk

* fix emsdk path

* minor fix

* removed more not used files to reduce helix payload size

* remove more jobs for testing purpose

* Fix the download path

* Add BenchmarkDotNet sources to the payload

* Fix __download__ path

* set BenchmarkDotNetSources to use benchmarkdotnet built from source

* use benchmarkdotnet private branch:alicial/tempwasmaot for BenchmarkDotNetSources

* use benchmarkdonet private branch with BenchmarkDotNetSources option

* Debug prints

* Clone B.NET to different location

Fix rsync exclusion
Add more debug prints

* Move B.NET back, clone upstream B.NET

To avoid:

    [INFO] ERROR(S):
    [INFO]   Option 'BenchmarkDotNetSources' is unknown.

* Use my branch for performance repo

* Revert "set BenchmarkDotNetSources to use benchmarkdotnet built from source"

This reverts commit bccfadde684922c0440d928224c8e7ec7c220fe9.

To avoid:

    [INFO] ERROR(S):
    [INFO]   Option 'BenchmarkDotNetSources' is unknown.

* Disable one more job I missed in merge

* Switch back to nuget packages for BenchmarkDotNet

* tempararily use pr-alicias-branch to test new fixes

* [mono] Fix invalid memory write

Fixes https://github.com/dotnet/runtime/issues/56526 and probably also
https://github.com/dotnet/runtime/issues/53546

Allocate enough memory when `SIZEOF_REGISTER == 4`, so that code like

    defs [ins->dreg + 1] = NULL;
    defs [ins->dreg + 2] = NULL;

doesn't write after allocated range.

* [mono] Fix an uninitialized memory access in the ABCREM pass.

Detected by valgrind.

* clean up PR

* add missing param

* fix perf.yml and make wasm interpreter to be consistent with wasm AOT

* comment out more job for fast testing

* remove extra job

* exclude copying __download__ dir instead of delete it.

* add parameters.codeGenType

* fix aot javascriptengine

* correct livelibrariesbuildconfig from release to Release

* install emsdk before copy $source_directory

* add back all the temporarily commented out jobs in perf.yml

* clean up work around code

* minor clean up

* remove performance submodule

* switch back to use performance repo main branch

* add --quiet to git clone

Co-authored-by: Radek Doulik <[email protected]>
Co-authored-by: Zoltan Varga <[email protected]>
2021-08-04 20:00:15 -07:00
a35aff789d [main] Update dependencies from mono/linker (#56593)
* Update linker warning suppressions

https://github.com/mono/linker/pull/2145 warns when accessing members
annotated with DynamicallyAccessedMembers using reflection, and
https://github.com/mono/linker/pull/2162 updates the warning origin of
warnings for DynamicallyAccessedMembers on types.

This adds suppressions for the new warnings.

* Add windows-specific suppressions

* Update dependencies from https://github.com/mono/linker build 20210729.2

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21379.2

* Fix failures and address feedback

- Annotate mono's EnumBuilder and TypeBuilder
- Add (non-unique) readable short names to the warning codes

* Update dependencies from https://github.com/mono/linker build 20210730.2

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21380.2

* Suppress IL2111

* Update dependencies from https://github.com/mono/linker build 20210802.2

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21402.2

* Feedback

- Suppress IL2111 in trimming tests
- Remove unnecessary DynamicDependency
- Fix indentation

* Update readable warning names

Co-authored-by: Sven Boemer <[email protected]>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-08-03 15:31:28 -07:00
Drew Scoggins f35b474fd5 Add new msbuild prop for wasm runtime config path (#56650) 2021-08-02 10:54:09 -07:00
Alexander Köplinger 5938d685c4 Remove invalid Castle.DynamicProxy.Internal.AbstractInvocation from ILLink descriptor files (#56392)
The type is actually in the `Castle.DynamicProxy` namespace, not the `.Internal` one.
This causes an error with newer linker versions.

The whole `Castle.DynamicProxy` namespace is already preserved so we can remove the entry for AbstractInvocation.
2021-07-27 15:06:31 -05:00
Steve Pfister 881f3c6c2b [Mono] Cleans up test build when targeting iOS/tvOSSimulator on arm64. Enables arm64 sim on CI (#55577) 2021-07-23 12:40:37 -04:00
159a01acab Update SDK to 6.0 Preview 5 (#55283)
* Update SDK to 6.0 Preview 5

Part of https://github.com/dotnet/runtime/issues/55281

* Enable COM support to work around missing symbols in tests

* Update eng/testing/linker/project.csproj.template

* Disable the workload targets

* Disable workloads for wasm builds

For in-tree builds, and tests we don't want to use workloads from dotnet
being used to build these.

For the projects being built on the build machine, we can disable them
via `Directory.Build.props`, and wasm's InTree/LocalBuild props. But for
projects that get built on helix, eg. the runtime tests, we are setting
the property values as environment variables.

* Fix setting envvars for disabling workloads

* Another attempt to fix wasm tests

In preview5, the workload manifest overrides
`$(UsingBrowserRuntimeWorkload)` setting, so pass it on the command
line.

``xml
    <PropertyGroup Condition="'$(RuntimeIdentifier)' == 'browser-wasm'">
        <UsingBrowserRuntimeWorkload Condition="'$(RunAOTCompilation)' == 'true' or '$(UsingMicrosoftNETSdkBlazorWebAssembly)' != 'true'" >true</UsingBrowserRuntimeWorkload>
        <UsingBrowserRuntimeWorkload Condition="'$(UsingBrowserRuntimeWorkload)' == ''" >$(WasmNativeWorkload)</UsingBrowserRuntimeWorkload>
    </PropertyGroup>
```

* Fix host tests after upgrade to P5

In P5 we don't generate .runtimeconfig.dev.json anymore. Some tests started to fail because they relied on the .runtime.dev.json to include local nuget cache in the probing paths.

I changed one of those tests to force-generate .runtimeconfig.dev.json as for the tested scenario it seems to make sense. For the other test I modified it to copy the necessary dependency into the right location instead.

* Fix up reflection to private FileStatus field

* Disable workload resolver for wasm.build.tests, EMSDK run

* Disable workloads for wasm with MSBuildEnableWorkloadResolver=false everywhere

* remove linker workaround

* [wasm] Remove args unnecessary for disabling workloads

* Pass MSBuildEnableWorkloadResolver property to individual trimming projects

Co-authored-by: Juan Sebastian Hoyos Ayala <[email protected]>
Co-authored-by: Santiago Fernandez Madero <[email protected]>
Co-authored-by: Larry Ewing <[email protected]>
Co-authored-by: Ankit Jain <[email protected]>
Co-authored-by: vitek-karas <[email protected]>
Co-authored-by: Eric Erhardt <[email protected]>
Co-authored-by: Anirudh Agnihotry <[email protected]>
2021-07-22 12:27:11 -07:00
Radek DoulikandPeter Sollich a587fa4b85 [wasm] Run browser tests on helix/windows (#52699)
* [wasm] Run browser tests on helix/windows

* Build just wasm/browsertests on helix/windows

* Use $(ChromiumRevision) in windows links

* Fix conditions

* Set PATH differently

* Use backslash in PATH on windows

* Try different version of chromium

* Pass scenario and browser host to build

And set browser path on windows to be able to start chrome
from xharness

* Try to get more info from the helix workitems

* Fix dir separator, add broser path

* Create WasmBuildSupportDir

* Revert "Try to get more info from the helix workitems"

This reverts commit 8807434a33a09a27f2c21cb321b743f155955cb2.

* Put the dir cmds back, fix mkdir call

* More debug info

* Bump xharness

* Bump xharness again

With darc this time

* StressLogAnalyzer didn't print the number of messages correctly if it exceeded the int range (2 billion). (#54832)

Fix is to just use 64 bit ints instead.

* Found a race condition where the LOH flag on a segment is set too late. This gives another thread the chance to allocate in a fresh LOH region that doesn't have the LOH flag set just yet and trip over an assert in Object::ValidateInner. (#54839)

The fix is simply to set the flag in get_new_region before the region is put on the list for the LOH generation.

* Try to show the chrome logs

* Use different path for chrome logs

* Use newer image with font for chrome

The chrome was crashing, because it didn't find any sans-serif font.

* Increase timeouts

* Disable tests which timeout

* Remove debug calls

* Put back normal scenario

* Do not set scenario in build args

* Add browser sample exclusion

* Restore the platform matrix

* Remove the wasm build test changes

That will be handled in https://github.com/dotnet/runtime/pull/54451

* Remove duplicate exclusion

* Suggested property name change

* Fix last merge

* Simplify condition

We don't pass Scenario anymore

* Include chrome and chromedriver in the payload

Co-authored-by: Peter Sollich <[email protected]>
2021-07-18 22:32:33 -05:00
62fad9df39 Disable array support for the COM variant wrapper classes when built-in COM is disabled. (#55756)
* Disable array support for the COM variant wrapper classes when built-in COM is disabled.

Fixes #55600

* Fix config call.

* Fix one more location of wrapper class usage.

* Fix method name.

* Add trimming test.

* Fix AV in IsArrayOfWrappers

* Fix trimming test

* Apply suggestions from code review

Co-authored-by: Eric Erhardt <[email protected]>

* Set Trim=true

Co-authored-by: Elinor Fung <[email protected]>
Co-authored-by: Eric Erhardt <[email protected]>
2021-07-18 18:46:19 -05:00
Steve Pfister 44655fd0dc Include native underlying handler support in HttpClientHandler for iOS/tvOS/MacCatalyst and Android (#55384)
Completes the plan for net6 laid out in https://github.com/dotnet/designs/blob/main/accepted/2020/mono-convergence/platform-specific-httpclient.md#the-plan-for-net-5

This change supports using either the native HttpMessageHandler types that exist in the Xamarin repos (NSUrlSessionHandler for iOS/tvOS/Catalyst and AndroidMessageHandler for Android) or SocketsHttpHandler as the underlying handler in HttpClientHandler.

The behavior for new HttpClient() was established earlier in net6, but did not go all the way. For example, if the System.Net.Http.UseNativeHttpHandler feature switch was set to true, using HttpClient in different ways would lead to different underlying handlers.

Before this PR:

// System.Net.Http.UseNativeHttpHandler == true

new HttpClient();    // Chooses the native handler as the underlying handler

var handler = new HttpClientHandler();       // SocketsHttpHandler is the only choice 
new HttpClient(handler);

The change creates a handful of partial HttpClientHandler files in order to split out the platform specific parts. As you review the PR, you'll notice a bunch of if (IsSocketHandler) blocks. The intent of these are to make use of the linker and get linked out once the linker knows which handler is the active one.

get
{
    if (IsSocketHandler)
    {
        return _socketHandler!.UseCookies;
    }
    else
    {
        return GetUseCookies();
    }
}

Get and Set methods like GetUseCookies make it easier to tell the linker via DynamicDependency to preserve the reflection calls being made to the native underlying handler.

[DynamicDependency("get_UseCookies", "Xamarin.Android.Net.AndroidMessageHandler", "Mono.Android")]
private bool GetUseCookies() => (bool)InvokeNativeHandlerMethod("get_UseCookies");

It is important to point out that the underlying handler has to be derived from HttpMessageHandler. It cannot be HttpClientHandler or you'll end up with a circular dependency.
2021-07-15 00:36:02 -04:00
Ankit JainandLarry Ewing d953229d54 [wasm] Run Wasm.Build.Tests against workloads (#54451)
Co-authored-by: Larry Ewing <[email protected]>
2021-07-14 10:47:03 -04:00
Ankit JainandLarry Ewing 0ef56df4a7 [wasm] Update Wasm.Build.Tests to build with net6.0 (#54936)
Co-authored-by: Larry Ewing <[email protected]>
2021-07-07 19:32:43 -04:00
Bill Wert 1c79e60368 Fix LLVM path (#55244) 2021-07-07 12:08:08 -07:00
Bill Wert 656775f584 Add llvm ios (#55222)
* add LLVM scenario

* add copy to payload

* reverse paths

* fix log path

* Move log fix

* remove extra scenario
2021-07-06 12:00:30 -07:00
Fan Yang a291fabdad Preserve necessary type and method (#54932)
* Preserve necessary type and method

* Change the way of getting the type

* Inline the constants

* Enable NonValidated_ValidAndInvalidValues_DictionaryMembersWork

* Enable TransformStrStrResolver3
2021-07-01 13:11:09 -04:00
a5e27d0cab [main] Update dependencies from 8 repositories (#54907)
* Update dependencies from https://github.com/dotnet/arcade build 20210628.2

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.GenFacades , Microsoft.DotNet.GenAPI , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SharedFramework.Sdk
 From Version 6.0.0-beta.21324.3 -> To Version 6.0.0-beta.21328.2

* Update dependencies from https://github.com/dotnet/icu build 20210628.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 6.0.0-preview.7.21321.1 -> To Version 6.0.0-preview.7.21328.1

* Update dependencies from https://github.com/dotnet/xharness build 20210628.4

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21328.2 -> To Version 1.0.0-prerelease.21328.4

* Update dependencies from https://github.com/dotnet/llvm-project build 20210628.1

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 11.1.0-alpha.1.21321.1 -> To Version 11.1.0-alpha.1.21328.1

* Update dependencies from https://github.com/mono/linker build 20210628.2

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21327.1 -> To Version 6.0.100-preview.6.21328.2

* Update dependencies from https://github.com/dotnet/hotreload-utils build 20210628.1

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.1-alpha.0.21321.1 -> To Version 1.0.1-alpha.0.21328.1

* Update dependencies from https://github.com/dotnet/emsdk build 20210629.1

Microsoft.NET.Runtime.Emscripten.2.0.23.Node.win-x64
 From Version 6.0.0-preview.7.21323.1 -> To Version 6.0.0-preview.7.21329.1

* Address new IL3002 and IL3003 warnings for the latest linker to unblock the build.

* Disable the trim analyzer for tests with EnableAggressiveTrimming

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20210629.4

optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.21320.4 -> To Version 1.0.0-prerelease.21329.4

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

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.GenFacades , Microsoft.DotNet.GenAPI , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SharedFramework.Sdk
 From Version 6.0.0-beta.21321.1 -> To Version 6.0.0-beta.21329.8

* Update dependencies from https://github.com/mono/linker build 20210629.2

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21317.4 -> To Version 6.0.100-preview.6.21329.2

* Update dependencies from https://github.com/dotnet/emsdk build 20210630.1

Microsoft.NET.Runtime.Emscripten.2.0.23.Node.win-x64
 From Version 6.0.0-preview.7.21323.1 -> To Version 6.0.0-preview.7.21330.1

* Update dependencies from https://github.com/mono/linker build 20210630.1

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21317.4 -> To Version 6.0.100-preview.6.21330.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Ankit Jain <[email protected]>
Co-authored-by: Eric Erhardt <[email protected]>
2021-07-01 00:37:22 -05:00
Viktor Hofer 6f7f30e118 Revert "[main] Update dependencies from 11 repositories (#54741)" (#54909)
This reverts commit 8103a7e3f2.
2021-06-29 18:18:36 +02:00
dotnet-maestro[bot] 8103a7e3f2 [main] Update dependencies from 11 repositories (#54741)
[main] Update dependencies from 11 repositories


 - Address new IL3002 and IL3003 warnings for the latest linker to unblock the build.

 - Disable the trim analyzer for tests with EnableAggressiveTrimming

 - Merge branch 'main' into darc-main-997daf91-1bd1-4e82-9eac-1347a9231dc5
2021-06-29 16:02:32 +00:00
Eric Erhardt 8707275824 First round of converting System.Drawing.Common to COMWrappers (#54636)
* First round of converting System.Drawing.Common to COMWrappers

Using COM Wrappers makes the library trim compatible.

* Add Trimming Test for Icon.Save

* Add support for OS specific trimming tests

* Use function pointers instead of delegates
* Rename Guid to IID
* Better interop to closely match the native side
* Release any COM pointer that was QueryInterface
* Use pointers instead of Marshal.PtrToStructure/StructureToPtr
* No need for a VTable struct, just set each function pointer right into the table
* Wrap all managed calls in try-catch and return HResult
* Use COM naming
* Fix method signature to use pointer instead of out.
* CheckStatus => ThrowExceptionForHR

* Pass -1 to Marshal.GetExceptionForHR so it doesn't query GetErrorInfo, and always returns the correct exception type
* Create the PictureWrapper with UniqueInstance, so it doesn't get cached. Caching it causes lifetime issues.
2021-06-28 11:39:17 -05:00
Bill Wert 1c81556da6 Add non-LLVM iOS size scenario (#54585)
* Add non-LLVM iOS size scenario

* add category

* remove parens

* variables in the wrong place.

* move setting configs to before it is written
2021-06-24 10:46:31 -07:00
Radek DoulikandLarry Ewing 055a38a906 [wasm] Bump emscripten to 2.0.23 (#53603)
Bumps emscripten to 2.0.23

The Browser AOT tests now use `-Wl,-lto-O0` option to reduce memory usage of `wasm-ld` tool, which was in some cases going over avaiable 8GB on helix machines.

* Revert "Add ActiveIssue to the MemoryMappedFiles tests"

This reverts commit ec1ae530606ef1061680600fc046226cc1c4cbc3.

* Revert "Add ActiveIssue attr to the FileSystem tests"

This reverts commit 356b3ff2a703980ac01b9df697a594e8c341c436.

* Bump emscripten version to 2.0.23

* Use newer docker images with 2.0.23

* Update docs

* Use 2.0.23 emscripten nuget packages

* Revert "Revert "Add ActiveIssue attr to the FileSystem tests""

This reverts commit eb2f9548b08c114b359fab8d867ba50de098fe48.

The fix is not present in 2.0.23

* Revert "Revert "Add ActiveIssue to the MemoryMappedFiles tests""

This reverts commit 8be39f583499a8d8451034c65260a785330b0795.

The fix is not present in 2.0.23

* Increase timeout for AOT tests

* Add description of emscripten bump to README

* Try to get information about resources

* Get all limits

* Escape & chars

* Reduce platform matrix

* Lets try one more build with doubled timeout

* Revert "Lets try one more build with doubled timeout"

This reverts commit 67dd7754bb79218b2c6b687034162d041715093e.

* Try -Wl,-O0 on CI

To be sure it behaves the same as in local build

* Use -Wl,-lto-O0 do lower link time optimization

It looks like it reduces the memory load a lot

* Set EmccLinkOptimizationFlag for AOT tests

And reset the default value

* Escape commas

* Revert "Reduce platform matrix"

This reverts commit fec0e557208eb165824e75cd57b895a74d164de4.

* Remove resource info retrieval

* Bump emsdk versions

Co-authored-by: Larry Ewing <[email protected]>
2021-06-24 17:20:26 +02:00
Ankit Jain 5f778101c6 [wasm] Collect, and process satellite assemblies automatically (#53656) 2021-06-22 12:35:38 -04:00
Ankit Jain 8761cb9cf2 [wasm][aot] Add support for passing items to the aot/helix test project (#54425) 2021-06-18 18:40:07 -04:00
Bill Wert 00024ea611 Remove crossgen tests (#54252) 2021-06-16 10:07:27 -07:00
8698d0f345 Update dotnet SDK to 6.0 Preview 4 (#53808)
* Update dotnet SDK to 6.0 Preview 4

Update the minimum and target version of the SDK to 6.0 Preview 4.

Part of https://github.com/dotnet/runtime/issues/53411

* Switch to using eng/targetingpacks.targets for redirecting runtime pack location in src/mono/sample

* Fix binder tracing tests

* Set UseMonoRuntime property so the dotnet SDK can pull the mono runtime packs

This is necessary after the changes from https://github.com/dotnet/sdk/pull/16909.

* Move UseMonoRuntimeProperty and set it to false in coreclr

Co-authored-by: Alexander Köplinger <[email protected]>
Co-authored-by: Elinor Fung <[email protected]>
2021-06-11 18:55:09 +02:00
Drew Scoggins 327deea877 Remove AOT exclusion for full PGO runs (#53943) 2021-06-09 17:32:13 -07:00
Jo Shields ccec848395 Create Sdk.props in AOT compilers with a template (#53685)
* Create Sdk.props in AOT compilers with a template

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

Example:

```
sudo cat Sdk/Sdk.props
<Project>
  <ItemGroup>
    <MonoAotCrossCompilerPath Include="$(MSBuildThisFileDirectory)..\tools\mono-aot-cross" RuntimeIdentifier="iossimulator-arm64" />
  </ItemGroup>
</Project>
```
2021-06-07 17:09:38 -04:00
1d9ff9eff0 [mono] Add a no-exec code manager for AOT compilation; switch Catalyst CI to JustInterp AOT mode (#53197)
* Initial pass at trying to run catalyst in aot interp only mode

* Cleanup

* Remove yml dup

* Incorporate changes and identify native libraries to skip during System.Diagnostics.FileVersionInfo test run

* [mini] Add a no-exec code manager for AOT compilation

   Don't allocate pages with execute permission if we're never going to be executing code.  Also don't try to toggle per-thread write protection if we're not expecting to write to executable pages.

* also set no_exec earlier and create the ALC codeman with noexec

* Don't assert on Catalyst in mono_codeman_enable_write

   We defensively also toggle the page write protect bits when resolving some AOT patch targets in mono_resolve_patch_target_ext.  Instead allow the call, but don't do anything.

* Set ENABLE_MONOTOUCH for MacCatalyst arm64.  Define MONOTOUCH in one place

* [aot] mscorlib.dll isn't CoreLib on netcore

   It's a forwarding assembly.  Don't treat it specially

* [testing] In JustInterp mode, only AOT System.Private.CoreLib

   We only need to AOT the trampolines in System.Private.CoreLib in interpreter-only mode.  We don't need to AOT any of the user code in other assemblies.

   Side effect: fixes the System.Runtime.Loader.DefaultContext testsuite in JustInterp mode.  Still broken in Full AOT mode. (That testsuite references the System.Runtime.Loader.Noop.Assembly assembly, but with a different filename
System.Runtime.Loader.Noop.Assembly_test.dll which causes linking errors due to incorrect symbols in AOT module registration in AppleAppBuilder)

* Update iOS sample to use JustInterp

   and adhoc signing

* Don't run iOS sample on the CI build machine

* Disable some tests

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

Co-authored-by: Steve Pfister <[email protected]>
Co-authored-by: Steve Pfister <[email protected]>
2021-06-02 13:00:34 -04:00
Ankit Jain 024a727ed1 [wasm] Add comments with linker fixes made for running aot tests in (#52006) 2021-06-01 12:33:22 -04:00
Mitchell HwangandMitchell Hwang c6b5994fbc [libraries] Move library tests Feature Switches defaults to Functional tests (#53253)
* [libraries] Remove UseSystemResourceKeys true default

* [libraries] Remove UseSystemResourceKeys for iOS

* [libraries] Resolve WebSockets System resource keys activeissue

* [tests] Move default feature switches from libraries to functional tests

* [tests] Move Browser wasm default switches into FuntionalTests scope

* Add Browser OS condition

* Move DefaultFeatureSwitches initialization to FunctionalTests project

* Consolidate trimming framework library features and condition for libraries with EnableAggressiveTrimming

* [testing][EAT] Revert trimming framework library features to browser defaults for enable aggressive trimming

* [tests] Add Xamarin Android, Xamarin Mac/iOS, and Wasm feature defaults to Functional tests

* Fixup tabs to spaces

* Add common feature switches, links, and cleanup

* Cleanup Xamarin Android link

Co-authored-by: Mitchell Hwang <[email protected]>
2021-05-28 20:07:13 -04:00
Drew Scoggins 529e12dbaf Add WebKit (javascriptcore) WASM runs (#53257)
* Add javascript engine selection and runs

* Fixup runs

* Testing

* Fix spacing

* Change jsc to javascriptcore

* Remove testing comments

* Add back V8 runs
2021-05-26 15:03:58 -07:00
Drew Scoggins 6c31866e2c Add different pgo data runs (#52780)
* Add different pgo data runs

* Fix if else formatting

* Update log artifact name

* Turn off failing tests for these runs

* Remove filter

* Fix config order

* Remove testing comments
2021-05-26 10:52:41 -07:00
Jose Perez Rodriguez 84b7c67242 Removing unnecessary nowarns from trimming tests (#53251)
* Removing unnecessary nowarns from trimming tests

* Also change the way we mark managedassemblies to link

* Remove target and instead use TrimmerDefaultAction

* Adding the suppression of warnings from the linker
2021-05-26 01:02:27 +00:00
Filip Navara 45143278b0 Add runtimeconfig.json support to AppleAppBuilder, reenable affected tests (#53172) 2021-05-24 20:11:26 +02:00
Viktor Hofer 68c5658b93 Stop reading TargetFramework prop in props files (#52897)
* Stop reading TargetFramework prop in props files

The TargetFramework property isn't expected to be set in props files
before a project's body is evaluated.

Don't let BuildTargetFramework property fallback to TargetFramework as
BTF's sole intent is to convey the TargetFramework to filter to and not
the current selected TargetFramework. Reduce usage of BTF so that it is
only used in places where code is actually conditioned on filtering.

In addition to that, specify BuildTargetFramework as a global property for
all traversal builds so when invoking one of the traversal projects directly
(src.proj, ref.proj, etc.), BuildTargetFramework doesn't need to specified
manually to get the default behavior (filter on compatible to net6.0).
Remove the inferred BuildingNetCoreAppVertical because of that and
inline its meaning.

Make sendtohelix a normal NoTargets proj so that it has access to the
properties which were moved into the Directory.Build.targets file as
otherwise it wouldn't import that file.
2021-05-19 20:04:01 +02:00
Radek Doulik 1dc5010cbb [wasm] Make windows wasm build run tests on helix (#51951)
Some of the tests were disabled for now: https://github.com/dotnet/runtime/issues/52138

* Make windows wasm build run tests on helix

* Update sendtohelixhelp.proj

* More changes for wasm/windows

* More changes to run on windows

* Fix xharness output paths

* Disable failing tests

* Use ProjectExclusions when adding wasm samples

* Restore platform matrix

* Disable the tests only on windows/helix

Also make the new property groups conditional to improve perf
2021-05-12 14:26:45 +02:00
Drew Scoggins dfd55d90f3 Fix timeout for Pizza app and add min app (#52626) 2021-05-11 16:50:32 -07:00
Jo Shields 26000448d2 Enable tests for MacCatalyst x64 (#51139) 2021-05-08 08:30:58 -04:00
Steve Pfister b9ac0e3f7f Remove AOT compiler binaries from all mono runtime packs (#51782)
Since we now package AOT compilers separately and include them in the mono workload, there is no longer a need to have them in the mono runtime packs.

You can find the AOT compiler packs in the net6 feed with the following format:

Microsoft.NETCore.App.Runtime.AOT.<host-rid>.Cross.<target-rid>
2021-05-07 19:53:20 -04:00
Steve Pfister 77a87df248 PNSE BinaryFormatter on mobile and skip related tests (#52248) 2021-05-07 16:12:13 -04:00
Filip NavaraandMitchell Hwang 01619ed19a Re-enable some iOS tests (#52385)
* [mobile][testing] Remove AppBundlePath directory to save space on CI

Co-authored-by: Mitchell Hwang <[email protected]>
2021-05-06 21:25:59 +02:00
Drew Scoggins bffe0e4c68 Move to main channel (#52350) 2021-05-05 19:59:30 -05:00
Drew Scoggins 1b30c00e55 Add AOT WASM SoD for template and BlazingPizza (#52089)
* Add AOT WASM SoD for template and BlazingPizza

* Update SOD dirs location for Pizza App
2021-05-05 10:48:41 -07:00
Ankit Jain c3658d272e [wasm] Fix Emscripten SDK provisioning for tests (#52273)
- For running on AOT tests on helix, we need to send emsdk as a payload
- On the CI machines, emscripten is available in `/usr/local/emscripten/`
- but the helix tasks try to write a `.payload` file in that dir, which fails
  because of permissions

- So, we copy emsdk to local `src/mono/wasm/emsdk`
- But we were doing it as part of *every* test build!
    - this meant unncessarily copying, and races causing errors like:

```
/__w/1/s/eng/testing/tests.wasm.targets(138,5):
    error MSB3026: Could not copy "/usr/local/emscripten/emsdk/node/14.15.5_64bit/bin/node" to "/__w/1/s/src/mono/wasm/emsdk/node/14.15.5_64bit/bin/node".

    Beginning retry 1 in 1000ms. The process cannot access the file '/__w/1/s/src/mono/wasm/emsdk/node/14.15.5_64bit/bin/node' because it is being used by another process.  [/__w/1/s/src/libraries/System.Collections.Specialized/tests/System.Collections.Specialized.Tests.csproj]
```

- Instead, do that once when preparing work items for helix

Fixes https://github.com/dotnet/runtime/issues/52254 .
2021-05-04 22:11:10 -04:00
4c7ae35f2d Update the SDK to 6.0 Preview 3 (#52196)
* Update the SDK to 6.0 Preview 3

Updating the minimum and target version of the SDK to 6.0 Preview 3.

Contributes to https://github.com/dotnet/runtime/issues/51716

* Fix Linker Trimming tests

* Fix ILLink warnings for latest SDK

- Remove ILLink.Descriptors entry for non-existant method
- Suppress ILLink warnings in mobile tests

Co-authored-by: Jose Perez Rodriguez <[email protected]>
Co-authored-by: Eric Erhardt <[email protected]>
2021-05-04 20:29:02 +02:00