Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-20Update dependencies from https://github.com/dotnet/runtime build 20210920.1 ↵dotnet-maestro[bot]
(#2284) [main] Update dependencies from dotnet/runtime
2021-09-20Update dependencies from https://github.com/dotnet/arcade build 20210916.4 ↵dotnet-maestro[bot]
(#2283) [main] Update dependencies from dotnet/arcade
2021-09-17Enable nullable on annotations (#2278)Tlakaelel Axayakatl Ceja
Enable nullable on Annotations.cs Check for null after TryResolve using 'is' keyword in MarkStep()
2021-09-17Warn on RUC annotated attribute ctors (analyzer) (#2201)Mateo Torres-Ruiz
* Warn on usage of attributes with annotated ctors * PR feedback Add ProducedBy from Test Restructure Add support for SetupCompileBefore in the analyzer Run analyzer tests on all members (not only methods) Move tests to RequiresCapability * Enable analyzer tests for attributes which use RUC annotated properties * Lint * Rename CheckAttributeCtor Check for instantiations that set annotated properties * Apply suggestions from code review Co-authored-by: Andy Gocke <angocke@microsoft.com> * Update comment Rename Linker => Trimmer in ProducedBy * Fix applied suggestions * Lint Co-authored-by: Andy Gocke <angocke@microsoft.com>
2021-09-16Change occurrences of 'mono/linker' to 'dotnet/linker' (#2277)Mateo Torres-Ruiz
2021-09-11Refactor how test case metadata is obtained. (#2268)Mike Voorhees
2021-09-10Make ILCompiler more flexible. (#2272)Mike Voorhees
2021-09-08Special case `MakeGenericMethod/Type` in RUC analyzer (#2209)Mateo Torres-Ruiz
* Add MakeGenericMethod and MakeGenericType to the special incompatible members of the RUC analyzer. * Don't produce diagnostics for MakeGenericMethod/MakeGenericType * Add comment * Lint
2021-09-08Warn on RUC annotated ctors invoked through `new()` constraint in analyzer ↵Mateo Torres-Ruiz
(#2254) * Add support in RUC analyzer for new() constraint on generics * Support `new()` constraint on types * Use SyntaxNodeAnalysisContext for constructor constraints * Lint * Update justification
2021-09-08Workaround NRE in SweepStep (#2264)Vitek Karas
Basically a workaround for #2260. This simply goes back to using the `Resolve` method and avoid the cache for now.
2021-09-08Add a test for #2260 (#2263)Vitek Karas
This uncovers a null ref in sweepstep. The test is order dependent: - Assembly (librarywithnonemtpy) has a virtual method which referes to type from second library (library). This processes the type reference. - The type is removed from library - The virtual method is re-processed again -> hits a type def which does not belong to any assembly/scope For this to happen the virtual method must be processed after the type has been removed. This also requires the method to be meant for removal later on (the body will be rewritten to throw), since otherwise the type would have been marked. This also requires the library with the removed type to be kept (so something else in it must be kept).
2021-09-08Update edited document before continuing code fixing (#2250)Mateo Torres-Ruiz
* PR feedback * Remove unnecessary method
2021-09-06[main] Update dependencies from dotnet/arcade (#2261)dotnet-maestro[bot]
[main] Update dependencies from dotnet/arcade - Workaround crashing analyzer
2021-09-06Update dependencies from https://github.com/dotnet/runtime build 20210906.1 ↵dotnet-maestro[bot]
(#2262) [main] Update dependencies from dotnet/runtime
2021-09-06Remove preview branding (#2259)Sven Boemer
2021-09-04Revert "Tag analyzer diagnostics as non configurable (#2252)" (#2257)Mateo Torres-Ruiz
This reverts commit 3e5edda958a88e799456ab787a16ff34b7df53e0.
2021-09-03Nullable annotations part 1 (#2253)Sven Boemer
* Nullable annotations part 1 Enable nullable annotations for LinkContext and the XML processing classes.
2021-09-03Tag analyzer diagnostics as non configurable (#2252)Mateo Torres-Ruiz
2021-09-02Stop using git protocol for submodule (#2248)Alexander Köplinger
GitHub is removing support for unauthenticated git soon: https://github.blog/2021-09-01-improving-git-protocol-security-github/
2021-09-02Skip peverify on CopyOfCoreLibrariesKeepsUnusedTypes (#2247)Mike Voorhees
2021-09-01Enable nullable warnings for linker (#2244)Sven Boemer
* Enable nullable warnings for linker * PR feedback Remove assert
2021-09-01Delete most mcs tests (#2245)Mike Voorhees
2021-09-01Update tests now that cecil issue is fixed (#2246)Mike Voorhees
2021-09-01Normalize warning messages (#2243)Mateo Torres-Ruiz
* Normalize warning messages * Apply suggestions from code review Co-authored-by: Sven Boemer <sbomer@gmail.com> * Update expected logged message Co-authored-by: Sven Boemer <sbomer@gmail.com>
2021-08-30Don't drop suite name from test name. (#2241)Mike Voorhees
This confuses IDE tests runners in different ways. * In Rider, if two folders contain a test with the same name, only 1 will ever run. Rider silently drops the other and never runs it. * In Visual Studio 2022 Preview the tests a grouped oddly in the UI. For example, tests under `Attributes.Csc.*` will appear as having their own top level grouping rather than nested under `Attributes`. I did not test if VS suffered from the above. It may also.
2021-08-30Add BannedApiAnalyzer (#2234)Sven Boemer
2021-08-30Refactor PeVerifier (#2236)Mike Voorhees
We are migrating our unit test projects to run on net5. However, we will continue to run our linker tests against a mono like profile (since that is what Unity is based on). Eliminating PeVerifier entirely causes us problems. We want to continue running it on the linker test executables. This PR refactors how PeVerifier is made to do nothing when compiling with NETCOREAPP defined. This approach lets the illink tests continue to operate as they do now. While also giving us the ability to run our `Unity.Linker.Tests` project on net5, our test case assemblies compiled against a .NET Framework profile, and have our test framework continue to run PeVerifier
2021-08-30Remove the requirement on 5.0 runtime since linker is now fully 6.0 (#2237)Vitek Karas
2021-08-30Update dependencies from https://github.com/dotnet/arcade build 20210827.6 ↵dotnet-maestro[bot]
(#2239) [main] Update dependencies from dotnet/arcade
2021-08-30Update dependencies from https://github.com/dotnet/runtime build 20210830.3 ↵dotnet-maestro[bot]
(#2240) [main] Update dependencies from dotnet/runtime
2021-08-26Remove hard coded case directory name (#2235)Mike Voorhees
This causes us problems with our test framework since our assembly containing additional test cases is called Unity.Linker.Tests.Cases.
2021-08-26Remove unused usings (#2229)Mike Voorhees
2021-08-26Validate unrecognized patterns against logged warnings (#2230)Sven Boemer
* Validate unrecognized patterns against logged warnings This changes the linker validation to check for unrecognized reflection access patterns against logged messages. The plan is to do the same for the analyzer tests, allowing us to make progress as we replace UnrecognizedReflectionAccessPatternAttribute with ExpectedWarningAttribute. The UnrecognizedReflectionAccessPatternAttribute is now checked against both the logged messages and recorded unrecognized reflection patterns. We check that it matches the same number of patterns as logged warnings for consistency. This required some changes to the signature formats used for validation, since the signatures used in this attribute now need to use the same format as the one we use for logged warnings. Changing the signature formats here uncovered some places where we were still using the cecil signature format even for user-visible warnings. These have been changed to use the format from GetDisplayName. Generic parameter dataflow validation treats the UnrecognizedReflectionAccessPatternAttribute differently, using the member name to refer to a generic type parameter. This inconsistency has been lifted into a separate custom attribute argument that specifies when the attribute refers to a generic parameter. Non-generic method parameters had a similar problem, but this was less common, so those usages were just replaced by ExpectedWarningAttribute. * PR feedback - Continue returning cecil signature as fallback (replace exception with a debug assert) - Remove left-over logic from debugging * Fix more tests - Use display name signature format for MethodReference - Revert changes that expect attributes to match only one warning - Remove debug output - Also add missing using
2021-08-25Set version to 7.0.100-alpha.1 in the main branch (#2228)Vitek Karas
2021-08-24Use plain int for TargetRuntimeVersion (#2227)Vitek Karas
2021-08-23Make linker forward compatible with regards to framework versioning (#2226)Vitek Karas
Runtime is trying to update to .NET 7 versioning, but this breaks linker since it hardcodes knowledge of all versions. This change makes it forward compatible by recognizing "higher than what I know". No test as there's not a really good way to test this without going through a lot of trouble. Tested locally with runtime targetting 7.0 versioning.
2021-08-23[main] Update dependencies from dotnet/runtime (#2224)dotnet-maestro[bot]
[main] Update dependencies from dotnet/runtime - Add dotnet7 feed
2021-08-23Update dependencies from https://github.com/dotnet/arcade build 20210820.4 ↵dotnet-maestro[bot]
(#2223) [main] Update dependencies from dotnet/arcade
2021-08-23Add static constructor behavior for RUC on type (#2207)Tlakaelel Axayakatl Ceja
Add new error code for cases in which the static constructor is annotated with RUC Add IL2116 to error codes Move static constructor verification in MarkField before pushing a new stack to print warnings in the method caller instead of fields Don't treat static constructors annotated with RUC as dangerous Add test for several static constructor calls Warn on field instead of warning on .cctor * Field should warn no matter the DependencyKind except DynamicallyAccessedMemberOnType * Add test for Access to field via reflection, dynamic dependency and using fields on attributes Co-authored-by: vitek-karas <vitek.karas@microsoft.com>
2021-08-18Support assembly as message origin (#2212)Sven Boemer
* Support assembly as message origin * Add tests * Fix test failures * Add missing file * Update src/linker/Linker.Steps/MarkStep.cs Co-authored-by: Mateo Torres-Ruiz <mateoatr@users.noreply.github.com> Co-authored-by: Mateo Torres-Ruiz <mateoatr@users.noreply.github.com>
2021-08-18Implement a custom ILProcessor and make it auto-fix IL corruptions (#2213)Vitek Karas
Cecil doesn't handle IL editing well. It doesn't patch scopes and branches. Added a linker-private IL processor which does this. Added tests for the IL corruption when removing branches around code which has exception handlers. I also removed now unnecessary test attribute, since in my previous change the exception handlers are now validated within the instruction stream, so no need for a second attribute to validate these. Co-authored-by: Sven Boemer <sbomer@gmail.com>
2021-08-16Update dependencies from https://github.com/dotnet/runtime build 20210815.6 ↵dotnet-maestro[bot]
(#2215) [main] Update dependencies from dotnet/runtime
2021-08-16Update dependencies from https://github.com/dotnet/arcade build 20210812.1 ↵dotnet-maestro[bot]
(#2214) [main] Update dependencies from dotnet/arcade
2021-08-14Fix warnings for DAMT on interfaces (#2210)Sven Boemer
* Fix warnings for DAMT on interfaces https://github.com/mono/linker/pull/2191 addressed issues with redundant warnings from base types, but interfaces need to be handled specially. There were a few issues with the interface handling in that change: - The binding logic didn't include interfaces for DAM.All when declaredOnly was specified, as @vitek-karas pointed out in https://github.com/mono/linker/pull/2206#discussion_r687573854. This could have led to us not marking interfaces for types derived from a DAMT.All-annotated type. Either way, the binding logic should not select interface _members_ when declaredOnly is specified. - The DAMT-on-type logic had special handling for base types, but didn't separately mark interface members, which is needed when applying annotations DAMT.All or DAMT.Interfaces. This could have led to missing interface impls or interface members for types which have (explicit or inherited) DAMT.All or DAMT.Interfaces annotations. Separately, the bit operations on DAMT also didn't correctly handle cases where there are bits shared by different enum members. * Remove debug output * Apply suggestions from code review Co-authored-by: Vitek Karas <vitek.karas@microsoft.com> Co-authored-by: Vitek Karas <vitek.karas@microsoft.com>
2021-08-12Fix broken try/catch/filter offsets after isinst optimization (#2205)Vitek Karas
The isinst optimization replaces that instruction with a pop, ldnull when the type is not instantiated. This changes the instruction and also changes the length of the instruction in that position. Cecil unfortunately doesn't update try/catch/filter references and they keep pointing to the old isinst instruction which not part of the method body anymore. When saving the assembly the offsets stores in the try/catch/filter records end up effective random and corrupted. This is a short-term fix to unblock failures in runtime due to this problem. Medium term fix would be to carefully handle all IL replacements in the linker with regard to try/catch/filter records. Ideally the long term fix would be to do this in Cecil in such a way that IL replacements would be correctly handled on their own. This fixes the Http3RequestStream failures mentioned in #2181, but I was not able to confirm if this fixes the CoreLib ArrayPool issues as well (I think it will not).
2021-08-12Fix suppression check with assembly suppressions (#2180)Sven Boemer
* Fix suppression check with assembly suppressions The change in https://github.com/mono/linker/pull/2171 was incorrect because it didn't account for the possibility that the suppressions cache already contains assembly or module suppressions for the provider. This fixes the check by re-using the cache to also track whether we have scanned for suppression attributes on the provider. This caching is necessary since we warn about duplicate suppressions. Providers without any suppressions may still be scanned multiple times since we don't cache the negative result. * Populate cache eagerly to avoid extra state Now whenever we add a record to the cache, we ensure that all of the suppressions that might apply to the member have been discovered. This way we don't need to track whether we have scanned the suppressed member, but have to do a bit more work up-front. * Use private accessibility For methods only used in UnconditionalSuppressMessageAttributeState
2021-08-11Fix wrong path after the TFM change (#2204)Vitek Karas
2021-08-11Target net6.0 for linker (#2202)Vitek Karas
2021-08-10Fix warnings for DAM.All (#2191)Sven Boemer
* Fix warnings for DAM.All Fixes https://github.com/mono/linker/issues/2159 * Add tests * PR feedback - Remove unnecessary helper * Avoid redundant DAM warnings for base members * PR feedback - Resolve -> TryResolve - Avoid nested yield returns - Testcases with base instantiated over self for generic parameter with requirements
2021-08-10Adds a test for issue #2196 (#2197)Vitek Karas
Property which marks itself via annotated attribute - leads to endless recursion in the linker.