Age | Commit message (Collapse) | Author |
|
|
|
Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk
From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22558.4
|
|
Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk
From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22513.4
|
|
Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk
From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22464.4
|
|
Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk
From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22458.5
|
|
Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk
From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22418.4
|
|
* Use a HashSet instead of List for MarkStep._virtual_methods
|
|
annotated with Requires (#2973)
|
|
Adds an ILVerifier to check that the IL produced by the linker is valid. Unsafe C# produced unverifiable code, so we skip verification when we pass that flag to the compiler. Also, there are a few warnings that are produced by valid C# with new features like static abstract interface methods and ref fields and ref returns.
In the future, it may be nice to add better error messages with the type, method name, and IL offset that produced the error, and perhaps an [ExpectedILVerifyError] attribute instead of filtering all of a type of error, but those are non-trivial to implement and don't occur in many tests (<10), so I haven't done that yet.
|
|
|
|
If we produce a warning for the method itself (no IL offset) and the method has debug symbols, it can happen that there's no sequence point for the first instruction. In that case the current code will crash because we expect to always find sequence point for offset 0.
Fix this by looking for the first sequence point instead.
|
|
Adds support and basic tests for ref fields. The tests ensure that a value written to an ref field is properly annotated, or an address written to a ref field has a properly annotated value, but there are some holes that can be created by assigning the address of a local or over-annotated value to an annotated ref field.
|
|
This prevents invalid IL in situations where removing the last
instruction of a method would result in the last instruction
being a conditional branch. There needs to be some IL in the
not-taken branch for the IL to be valid, so this fixes the issue
by injecting "ldnull; throw" at the end.
Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com>
Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
|
|
|
|
Analyzers look for a newer version of Microsoft.CodeAnalysis than exists in the latest version of Visual Studio, and so they don't run in FullFramework tests in dotnet/sdk#26993. This reverts the version used in the analyzers.
PR #2969 will undo this change once Visual Studio ships with the correct version of Microsoft.CodeAnalysis.
|
|
Static methods implementing static interface methods are not marked as virtual and were not checked for matching RUC and DAM annotations. This change adds all base methods to the _virtual_methods list to be checked for matching DAM and RUC annotations. This may cause extra/unnecessary warnings for mismatched annotations even a method is removed by the linker.
|
|
|
|
fe3a96424d28fb5b1eee4ca8c7e1713aa37247a4 and
d9aebf322b9dd6dcea16576d886bffbbe15e902f together broke the build
because we are referencing a version of the compiler package greater
than that used to compile the project. This uses the same version for
both.
|
|
Adds test to use ref fields in various ways to confirm that they don't cause the linker to crash.
|
|
dede5f58dc9b7296de884ed62688b35d5b154b78 didn't fix the dependency
flow, because the packages for some reason are still being produced
with a preview7 in the runtimeconfig. Lacking better workarounds, this
change builds with the preview5 SDK that was selected in #2884 before
we decided to update to preview7 (due to a dotnet-format bug). This
disables the lint job to prevent those failures. We should turn it
back on once we can use preview7 (once dotnet/runtime and dotnet/sdk
are on preview7).
|
|
(#2951)
[main] Update dependencies from dotnet/runtime
|
|
|
|
Sync tweaks necessary for the linker/AOT integration
|
|
The existing code used exceptions as a way to determine if item is part of a dictionary. That is pretty expensive and slows down loading of the dependencies quite a bit (we do it A LOT).
Rewrite the code to avoid exceptions in this case.
|
|
|
|
SuppressTrimAnalysisWarnings now includes all warning codes produced by
the linker or trim analyzer. Previously, only warnings in the
"Trim analysis" category (see MessageSubCategory.cs) were suppressed by
this setting.
This makes the logic more future-proof so we don't need to keep adding
new warning codes to the list.
This does change the behavior a bit. It includes warnings that weren't previously
part of the list. Additionally, previously if you set:
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
you wouldn't see trim analysis warnings from the analyzer. With this change, you will.
Similarly, previously if you set
<ILLinkWarningLevel>5</ILLinkWarningLevel>
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
you wouldn't see trim analysis warnings, but after this change you will.
|
|
|
|
(#2935)
Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk
From Version 7.0.0-beta.22372.1 -> To Version 7.0.0-beta.22379.10
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
|
|
(#2936)
Microsoft.NET.Sdk.IL
From Version 7.0.0-rc.1.22374.4 -> To Version 7.0.0-rc.1.22381.5
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
|
|
* Add a test for the `<namespace>` element. There were no tests.
* Expand `CanPreserveTypesUsingRegex` to help highlight how it behaves differently from `<namespace>`
* Add more examples to the docs
|
|
Test for https://github.com/dotnet/linker/issues/2874.
|
|
should warn (#2942)
For correctness linker must be able to validate that generic parameters with new constraint will have their default .ctor preserved. If that can't be guaranteed, it needs to warn.
Added tests for cases around this.
Nullable<> is the only exception to this rule, so changed the code to completely skip any validation for it.
|
|
methods (#2868)
Fixes #2865
Also addresses marking of all static interface methods encompassing the changes from #2859, and updates the way that all interface methods are marked. Whether or not we mark an interface method due to its base method is now separated from marking other virtual methods and the marking is postponed to ProcessMarkedTypesWithInterface. In ProcessMarkedTypesWithInterfaces, interface implementations are marked, and methods that implement a marked/implemented interface are marked. Tests for static interface methods have also been updated.
Co-authored-by: Sven Boemer <sbomer@gmail.com>
|
|
(#2925) (#2940)
|
|
Implementation of the feature described in #2891.
|
|
|
|
This is like the existing test, but additionally shows a visible
difference in the warning behavior. When the warning is produced for
generic arguments rather than dataflow, it will show up even if we don't
do dataflow for the local function whose callsite was removed.
When branch removal breaks the link between the local function and
its user method, this can result in warning suppressions that don't
take effect.
We could use the desired warning behavior to decide what the fix
needs to do (whether it should do compiler-generated owning method
detection before vs after constant propagation for the method).
|
|
Add ExportCodeFixProvider attribute
Co-authored-by: Isabel Serrato <iserrato@olin.edu>
|
|
Serialization discovery is an undocumented quirk that exists for
back-compat in xamarin scenarios. We turned it on by default in .NET
6, but would like to remove such quirks from the default options in
.NET 7.
This changes the (undocumented) command-line option to be
opt-in. Xamarin SDKs will be expected to pass this option by setting
<_ExtraTrimmerArgs>--enable-serialization-discovery</_ExtraTrimmerArgs>.
|
|
See the test for description of what it does. It's basically the linker repro for the case hit in https://github.com/dotnet/runtime/issues/73027#issuecomment-1199199943
|
|
Suppressions can be now placed on properties and events.
|
|
[main] Update dependencies from dotnet/arcade
- Bump to 7.0 preview6 sdk
Fixes the dotnet-format issue.
- Use TryGetValue instead of ContainsKey for Dictionary
Fixes "error CA1854: Prefer a 'TryGetValue' call over a Dictionary indexer access guarded by a 'ContainsKey' check to avoid double lookup"
- Seal classes to fix CA1852
- Add 7.0 P6 runtime
- Upgrade SDK to nightly Preview 7 to get a fix for dotnet test bug
|
|
|
|
Add tests for some edge cases due to the analyzer not treating
captured parameters as hoisted variables like the linker does.
Currently the analyzer doesn't detect hoisted parameters, and it
will treat them like normal parameters - warning if a parameter
is assigned a value with an annotation that doesn't match the
parameter annotation. The linker will treat captured parameters
the same as other captured variables, tracking all values that
get assigned. So there is a subtle difference in the warning
behavior:
- Linker won't warn on assignment to annotated captured
parameter, but analyzer will.
- Linker will produce dataflow warnings for all values assigned
to a captured parameter, but analyzer will not.
|
|
Makes it so user does not have to zip their dumped dependencies file before running the analyzer and updates documentation to reflect the change.
|
|
This discovers type parameter mappings between generic type
parameters and static closures which reference them. It detects
the closure environment by scanning for stsfld instructions which
reference generic closure types. There may be multiple methods
associated with the same static closure, so this case doesn't
produce warnings.
This also fixes an unrelated issue where in Release mode, the
compiler can generate struct closure environments that will never
get instantiated via a ctor call. A new testcase runs the
CompilerGeneratedTypes tests in Release mode to cover this.
|
|
(#2913)
[main] Update dependencies from dotnet/runtime
|
|
* Create infrastructure for CodeFixers that will generate attribute flags for DynamicallyAccessedMembers (DAM) trimmer warnings. This commit includes fixers for the warnings `DynamicallyAccessedMembersMismatchParameterTargetsThisParameter` and `DynamicallyAccessedMembersMismatchFieldTargetsThisParameter`. Additional DiagnosticIds will be supported by future commits.
* Create new class for the DAM CodeFixer that does not rely on base class. The DAM warnings require different attribute placement depending on the type of warning that is raised, causing it to differ from the implementation of the base class.
* Added a test file specifically for the DAM CodeFixer, include tests for the functional fixes as well as tests for fixes that will soon be implemented.
* Converted all test cases within DAM to use string literals
Co-authored-by: Andy Gocke <andy@commentout.net>
|
|
|
|
This avoids unnecessarily running the reflection methodbody scanner in
the linker, and the dataflow analysis in the analyzer, for methods
that were previously only triggering dataflow analysis due to
annotated generic parameters.
This eliminates unnecessary warnings for reflection access to
compiler-generated code.
|