* Change the default Nullable to enabled for src projects
* Set Nullable=enable as the default for ref projects
* Fixup merge conflicts
* Disable nullable on shim projects and EventLog.Messages
* Set Nullable to blank on EventLog.Messages
This way no CodeAnalysis attributes are emitted into the assembly.
* Remove usage of !! from dotnet/runtime
- Use ArgumentNullException.ThrowIfNull instead where possible. It's only usable for projects that only target .NET 6+, and it can't be used in places like this(...) or base(...).
- In other cases, if the project already has a ThrowHelper, augment it for null as needed and use that.
- For most of the extensions projects, add a ThrowHelper.ThrowIfNull that replicates ArgumentNullException.ThrowIfNull.
- For everything else, just use "throw new".
* Address PR feedback
* Address PR feedback
* Remove false positives from searches
* Address PR feedback
* Add dependency on Unsafe package
With the removal of the Unsafe package, a few projects regressed which
previously had a direct dependency on the latest version of Unsafe
(6.0.0) by now depending on the transitive Unsafe dependency of i.e.
System.Memory which is a very old version (4.5.*).
Fixing those projects to declare the direct dependency again.
* Cleanup
* Update coding-style to include target-typed new guideline
Similar to `var` usage, `new()` usage is only allowed when the Type can be understood from the same line.
Fix#53369
* Fix coding style violations
* Use SDK logic for IsTrimmable
* Address some analyzer warnings
* Disable analyzer when baseline suppressions exist
* Don't mark unannotated test project as trimmable
* Add nativeaot annotations
* Add suppression in windows-only code
* Import illink.targets only when trimming mobile tests
* Don't run analyzer on unannotated windows OOBs
* PR feedback
Use pragma instead of UnconditionalSuppressMessage
Use TargetFramework instead of TargetFrameworks property whenever a
test project targets a single target framework only.
This avoid unnecessary outer builds and evaluations and makes the build
faster.
* Fix slngen.proj
The SolutionName property is defined by the SDK and hence the condition was always true. Also the star (*) didn't expand when using the ValurOrDefault msbuild function. Fixing this by using a different name `SolutionNameOverride` and avoiding the ValueOrDefault msbuild function.
* Update solution files
Updating the solution files as those changed because of
microsoft/slngen@cb57e28 and apparently the solution files never were
updated.
* Don't use Targets* helper properties in libs projs
This change makes it possible to migrate 200+ (ref+src) projects to use
TargetFramework instead of TargetFrameworks which avoids the additional
outer build evaluation and invocation which ultimately makes the overall
build faster.
Targets* properties (i.e. TargetsWindows, TargetsAnyOS, TargetsUnix,
etc.) rely on the TargetFramework property which usually are set
inside a project. The TargetFramework property is only
available before a project specifies it if it's explicitly set in a props
file or if the project is cross-targeting and the outer-build dispatches
into the inner-build. During the dispatch, the TargetFramework property
is passed in as a global property.
Until now that behavior wasn't a problem because every libraries project
cross-targeted (by setting the TargetFrameworks property) even though
many only include a single TargetFramework (i.e. NetCoreAppCurrent).
To allow projects to use the TargetFramework property instead of
TargetFrameworks, the Targets* helper properties can't be calculated
anymore early in a props file as the TargetFramework property isn't set
at that time.
In general, the guidance by the SDK/msbuild team is to not read from the
TargetFramework property before the project sets it
(in a property group). That effectively means that the TargetFramework
property shouldn't be used in props files at all.
Therefore these helper properties can't be used anymore for property
conditions and I'm replacing their usage with TargetPlatformIdentifier
comparisons for both properties and items.
In nearly all cases, the Targets* helper properties can be replaced with
TargetPlatformIdentifier checks on items and in the few cases where
TargetsUnix or TargetsLinux marks multiple tfms as compatible, the exact
tfms must be used instead for the TargetPlatformIdentifier comparison.
Whenever a project needs to condition properties on the platform, I'm
first setting the TargetPlatformIdentifier the same way the SDK sets it
so that the SDK later doesn't need to set it again to avoid the
additional expensive msbuild function call.
* Use TargetFramework singular to avoid outer builds
Use TargetFramework instead of TargetFrameworks property whenever a
projects only targets a single target framework. This avoid unnecessary
outer builds and evaluations and makes the build faster.
* Bump version of C# compiler
This should be reverted when arcade brings in a new enough compiler.
* Fix a few new warnings from updating compiler
* Enable IDE0190 to employ parameter null checking
* Initial roll out of !!
* Fix more compiler warnings from upgrade, plus some test fixes / reverts
* Fix a few more tests
* Disable profiling test
* 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
With the newest udpate of slngen, the order of elements (configuration, folders, etc.) is in sync with how Visual Studio arranges them.
Also the order is now deterministic.
Based on that, updating all solution files to have the correct ordering of elements. This change also unblocks adding CI protection for
making sure that solution files are up-to-date in regards to their dependencies as slngen is now generating the files deterministically.
* Automatically generate .NETStandard compat errors
Before this change, a project had to explicitly add a
NETStandardCompatError item to declare that a given tfm range
shouldn't be supported when packaging.
Automate this logic so that projects don't need to specify the item
themselves anymore. Instead condition the NETStandardCompatError target
calcuation logic on the existence of both a .NETStandard and a
.NETCoreApp tfm.
* Update Directory.Build.targets
* Update packaging.targets
* Update eng/packaging.targets
Co-authored-by: Santiago Fernandez Madero <[email protected]>
Co-authored-by: Santiago Fernandez Madero <[email protected]>
* 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]>
Fixes#55313
The metrics test has to collect different events that
update counters in a specific interval of time. Previously
those intervals were 1 second long but ARM64 appears to
run slowly enough that some of the events didn't complete
until 2 seconds had passed.
I increased the intervals to 5 seconds each. We could go
longer to reduce the risk further, but I am trying not to
make the tests take overly long.
* 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>