Age | Commit message (Collapse) | Author |
|
Cecil's MetadataResolver returns null if it cannot resolve something.
This requires the callers, like TypeReferenceExtensions, to do null
checks, otherwise a `NullReferenceException` can happens in the linker
code and it's not possible to give a useful error message to the
developer.
This is what's happening in
https://github.com/xamarin/xamarin-macios/issues/3215 (with test case)
and likely in
https://github.com/xamarin/xamarin-macios/issues/3210 (without test case)
|
|
field.
Fixes #213
|
|
|
|
Make interface marking overridable by derived classes, so that derived classes
can decide whether an interface implementation should be marked or not.
Also remove any non-marked interface implementations.
|
|
allowed
|
|
CopyUsed action specifies that the assembly should be copied intact if and only if
it is used (i.e., marked).
|
|
With this change the linker won't throw if it encounters an unresolved
type or method during MarkStep and -n true was specified.
|
|
Add -u switch to specify action on user (non-core) assemblies similar
to -c switch for core assemblies.
|
|
|
|
|
|
Rather than relative path. The sandboxing code isn't really setup to
allow files being placed in arbitrary sub directories.
|
|
|
|
|
|
the file. This allows link xml files to contain comments at the start.
|
|
Push actual custom attribute type instead of cecil custom attribute
instance. It also makes dependency graph more spread as we have more
vertices instead of one overused.
So for example we now have:
`TypeDef:System.Runtime.InteropServices.ComVisibleAttribute`
vertex instead of `Other:Mono.Cecil.CustomAttribute`
Do not add predicate method to the dependencies. It doesn't add much
value and makes the graph having vertex with too many edges, so we had
a lot of vertices with 15k+ total dependencies in flat view for XA
template application. Like:
```
Distance | TypeDef:Android.App.ActivityAttribute [total deps: 15100]
------------------------------------------------------------------------
1 | Method:System.Void Android.App.ActivityAttribute::.ctor()
2 | Other:Mono.Cecil.CustomAttribute
3 | TypeDef:System.Object
...
```
Now we have:
```
Distance | TypeDef:Android.App.ActivityAttribute [total deps: 9]
------------------------------------------------------------------------
1 | Method:System.Void Android.App.ActivityAttribute::.ctor()
2 | TypeRef:Android.App.ActivityAttribute
3 | TypeDef:XATemplateLA.MainActivity
...
```
|
|
Clean up corebuild to make sure all output is placed in bin or tools
subdirectories.
Add the first ILLInk custom step to clear InitLocals on all methods.
|
|
Added the ILogger interface for logging messages from the
linker. There is a new default implementation, the ConsoleLogger
class, which just continues to use simple S.C.WriteLine as before.
The LinkerContext newly contains Logger property, which can be set to
instance of class implementing ILogger interface. As an example,
Xamarin.Android linker will be able to provide own logger, forwarding
the messages to Microsoft.Build.Utilities.TaskLoggingHelper. This way
it will be possible to see linker messages, depending on the actual
msbuild's verbosity level, in the XA build output.
|
|
|
|
|
|
https://github.com/lucasmeijer/NiceIO/commit/30c78865094183c4aebe9f2094faa4f4497a1fcd
|
|
|
|
|
|
Can now compile .il files into assemblies
Add support for [Define] to set defines for a test case
Implement some basic type forwarding test cases
|
|
|
|
KeepTypeForwarder arg handling fix.
|
|
|
|
|
|
- fixes #57645
- ignore invalid forwards of nested types of exported forwarded
types, which were added by a bug in csc. description by Marek Safar
from https://bugzilla.xamarin.com/show_bug.cgi?id=57645#c13
Native csc (pre-Roslyn version) when encountered typeforwarded
type it added automatically all its nested types including
private/protected/internal ones. This bug was fixed in Roslyn
csc but there are still many assemblies compiled with native csc
(pre VS2015) which can have typeforwarded typeref to a type which
is not available because it's not included in public API.
- ignoring these forwarders here should be harmless, because if these
types were used somewhere in the application, the linker would fail
in the mark step, when trying to resolve the typereference to them
- also added throwing the LoadException in case of missing non-nested
forwarded exported types, instead of just crashing with
System.NullReferenceException
|
|
|
|
Skip PeVerifying of System.dll and System.Configuration.dll. PeVerify
reports problems in the unlinked mono class lib version of these
assemblies as well as the .NET Framework version. Also change the types
used by this test. Use types that exist in mono AOT profiles
|
|
|
|
|
|
AssemblyResolutionExceptions to ease debugging.
|
|
|
|
If a link.xml file has an assembly or type element that does not have
a preserve atttribute, treat that as if it is preserve="all". These two
tests verify the existing behavior.
|
|
|
|
Override ToString in ResolveFromXmlStep
Break recursive chains in the xml report
|
|
|
|
|
|
|
|
|
|
|
|
implementations.
As far as I'm aware, this only impacts winrt.
We added a new test to our WinRT test suite to verify this behavior, however since our winrt support has not been sent upstream, I am not able to include a test for this change.
|
|
sandboxed directory
are meant to be passed as references when compiling the test cases
|
|
|
|
|
|
|
|
Currently we mark everything. With this change we will not mark assembly and module attributes when their defining module has not been marked after processing all types.
This fixes the test ReferencesAreRemovedWhenAllUsagesAreRemoved when ran against the .NET Framework. When this test was ran against the .NET Framework, System.dll was being kept around because of the assembly attribute BitmapSuffixInSatelliteAssemblyAttribute, which is itself defined in System.dll.
Add a command line option to disable the blacklist step
Fixed bug with ResultChecker treating [RemovedAssembly] the same
as [KeptAssembly]
For the test cases, disable options that tend to pollute the linked output
with a bunch of preservations that are not needed for our very narrow test cases
I did not write a unit test for this case because (a) it would be tricky to do at the moment and (b) we are overly conservative with attributes as a whole and attribute linking need to be reviewed. When that happens, we can pin down the exact behavior we want. The goal of this PR is to get ReferencesAreRemovedWhenAllUsagesAreRemoved passing.
Add Il8n and Blacklist option attributes.
Only disable these things during the test that needs to
|
|
|
|
Allow multiple [Reference] attributes
|