* Build one MonoTargetsTasks assembly for Mono.NET.Runtime.MonoTargets.Sdk pack
Instead of 3 assemblies for some tiny tasks.
Building a single assembly also ensures that everything in the pack depends on and bundles identical versions of dependent assemblies. For example on net472, a single version of System.Text.Json with a single fixed version shared by both the JsonToItemsTaskFactory task factory and the RuntimeConfigParser task.
Related to https://github.com/dotnet/runtime/issues/59619
* Update testing and wasm to use MonoTargetsTasks.dll
* Move assembly stripper to a separate assembly
Build it with nullability checking disabled.
Build the main MonoTargetsTasks assembly with nullability enabled
* Don't include msbuild assemblies in MonoTargets package
* re-enable analyzers for the MonoTargetsTasks assembly
* Include *.dll in the MonoTargetsTasks nupkg
In particular, pick up all the dependent assemblies for the net472 build
* Update various READMEs
* remove unneeded target
* Switch ILStrip to use the same Parallel.ForEach logic as MonoAOTCompiler
* Remove unneeded NoWarn warnings
* rearrange package references in MonoTargetsTask.csproj for readabilty
* More ItemGroup reformatting
* fix nits
* Use SystemThreadingTasksExtensionsVersion instead of hardcoding
Co-authored-by: Ankit Jain <[email protected]>
* Remove EOL tfms and upgrade to net7.0
* Make linker tests net7 aware
Make installer tests run on net7.0
Don't attempt to use live apphost
Fix payloads
Regenerate test files
Fix package testing
* 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]>
* 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>
* 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]>
* 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]>
* 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.
* 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]>
* 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
* 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]>
* Adding browser-wasm trimming test leg
* Fix runtime subset for browser leg
* Addressing PR feedback
* Removing double RuntimePackProperty
* Addressing feedback and updating container image
* Addressing some PR feedback and fixing runtimepack path
* Disabling a test and updating the wasm container used for the build
* Remove restore race condition on trimming projects
* Fix last remaining failing trimming test in browser-wasm
* Removing workaround since the fix is in PR now
* Addressing PR feedback and rebasing to master
* Adding comment on tests.mobile.targets
* Removing unused trimming setting
* Remove duplicated ILLink PackageReference
The Arcade.SDK already package refrences the ILLink package. The
duplicate reference in illink.targets caused SDK errors as the Arcade
reference has IsImplicitlyDefined set which doesn't allow an additional
reference with the same identity.
Also, as the ILLink package already exposes the path to the assembly via
its props file, using that instead of manually constructing the path to
the assembly.
The SDK target version update is required as the sequencing of the
ILLink.props file was wrong and is required for this change. This isn't
considered a breaking change, as the SDK's minimum required version
isn't changed.
* Update arcade dependencies
* Remove NuGet pack tasks pkgref
* Add mega hack workaround
* Remove KnownFrameworkReference items
* Don't hardcode SDK value in helix submission...
* Update runtimeConfiguration.targets
* Fix double publishing error in mobile tests
* Set DotNetCliVersion to right version for aspnetcoreruntime
* Update sendtohelixhelp.proj
* Update sendtohelixhelp.proj
Co-authored-by: Santiago Fernandez Madero <[email protected]>
[master] Update dependencies from dotnet/xharness mono/linker dotnet/arcade Microsoft/vstest dotnet/llvm-project dotnet/icu
- Merge branch 'master' into darc-master-c2f56120-c0a9-49ac-83ec-d0550f2e6a36
- Fix merge conflict
- Revert override of local changes to send-to-helix.yml
- Fix path to ILLink.Tasks.dll
- Revert override of local changes to send-to-helix.yml
- Revert override of local changes to send-to-helix.yml
- Fix path to ILLink.Tasks.dll
- Fix another path to ILLink.Tasks.dll
* Update linker warning numbers
In response to https://github.com/mono/linker/pull/1385.
This replaces the global suppressions for IL2006 with the warnings that it was split into.
* Add suppressions for linker tests
[master] Update dependencies from dotnet/icu dotnet/llvm-project mono/linker
- Updates:
- Microsoft.NET.ILLink.Tasks: from 5.0.0-preview.3.20378.1 to 5.0.0-preview.3.20403.5
- Updates:
- Microsoft.NETCore.Runtime.ICU.Transport: from 5.0.0-preview.8.20378.2 to 5.0.0-preview.8.20403.1
- Updates:
- runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
- runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
- runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
- runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
- runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
- runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
- runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
- runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk: from 9.0.1-alpha.1.20365.1 to 9.0.1-alpha.1.20403.1
- Fix linker tests by fixing some warnings, and suppressing reflection warnings during the linker tests.
- Merge remote-tracking branch 'upstream/master' into UpdateLinker
- Suppress IL2008;IL2009 on non-Windows linker tests.
- Suppress more linker warnings on non-Windows.
- Suppress more linker warnings
The PrepareForILLink target will pass any ManagedAssemblyToLink that isn't marked as IsTrimmable=true to a TrimmerRootAssembly. This will cause the assembly to be passed to the linker with `-a`, which means the asesmbly won't be fully trimmed. So any assembly outside of the runtimepack will be passed with -a (for example Microsoft.Extensions.*).
Fix this by moving to BeforeTargets=PrepareForILLink and marking the single application assembly as a root.
* Preserve DebuggerTypeProxyAttribute classes
Also, ensure the test app assembly is linked, and not copied during trimming tests, which was a bug in our test infrastructure.
Fix#37307
* Add test for DebuggerTypeProxy string overload.
* Update ref to match impl.
* Update dependencies from https://github.com/mono/linker build 20200711.1
Microsoft.NET.ILLink.Tasks
From Version 5.0.0-preview.3.20360.3 -> To Version 5.0.0-preview.3.20361.1
* Update dependencies from https://github.com/dotnet/runtime-assets build 20200710.1
System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
From Version 5.0.0-beta.20319.2 -> To Version 5.0.0-beta.20360.1
* Update dependencies from https://github.com/dotnet/icu build 20200709.7
Microsoft.NETCore.Runtime.ICU.Transport
From Version 5.0.0-preview.8.20359.5 -> To Version 5.0.0-preview.8.20359.7
* Remove unsupported option
* Bump SDK dependency to bring updated ILLink task
* Update trimmer configuration property names
* Keep debug symbols as they are needed for the tests
* Disable trimming tests on Windows due to weird pdbs handling
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Marek Safar <[email protected]>
* Adding generation of substitution files for trimming out resources when feature switch is present
* Adding support for CoreLib as well and fix issue with SR returning empty string
* Cache result of AppContext Switch lookup
* Fixing allConfigurations leg and addressing feedback
* Fixing thread safety issue by removing caching
* Addressing feedback
* Apply suggestions from code review
Co-authored-by: Jan Kotas <[email protected]>
* Addressing feedback and adding tests
* Fix typo
Co-authored-by: Jan Kotas <[email protected]>
* Add support for shared source in linker test code
* Clean up DynamicDependencyAttribute usages
* Clean up DynamicDependencyAttribute: review feedback + another test
Co-authored-by: Jose Perez Rodriguez <[email protected]>
* Adding Trimming tests for StackFrameHelper and AppDomain
* Address PR feedback
* Adding PR Feedback
* More PR feedback
* Adding check for principal type to AppDomain tests
* Use Latest Linker for our Trimming tests and reenable test
* Address feedback
* Add environment variables to the Publish command so that it won't try to use a globally installed sdk