Bug 59106 - comment inside type tag broke linker
Summary: comment inside type tag broke linker
Alias: None
Product: Android
Classification: Xamarin
Component: Linker (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Radek Doulik
Depends on:
Reported: 2017-08-30 03:23 UTC by Eric Liu
Modified: 2017-10-05 15:32 UTC (History)
3 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:

comment in xml breaks mono linker (1.27 KB, text/plain)
2017-08-30 18:03 UTC, Eric Liu

Description Eric Liu 2017-08-30 03:23:47 UTC
<?xml version="1.0" encoding="utf-8" ?>
  <assembly fullname="assembly">
    <type fullname="type" >

adding the comment line is breaking the linker
Comment 1 Jon Douglas [MSFT] 2017-08-30 05:08:42 UTC
Hi Eric,

First off, thanks for the bug report. We really appreciate you taking the time and effort to file this issue.

With regards to your report, can you please provide a reproducible case in which this demonstrates a comment line causing the LinkAssemblies Task to fail? The item you have copied will fail on the first <assembly> line because "assembly" is not an actual assembly name. For investigation purposes, we would need a valid test case. You can attach a reproduction project, or provide reproduction steps with code snippets!

I took a quick look into the source:

https://github.com/mono/linker/tree/master/linker (lots of great documentation here)



I then tested a simple type such as:

<?xml version="1.0" encoding="utf-8" ?>
  <assembly fullname="System.Core">
    <type fullname="System.Threading.ReaderWriterLockSlim" >

Which seems to build just fine. Thus it seems the linker has no problems with XML comments. Let me know what you find out on your end. Thanks again!
Comment 2 Eric Liu 2017-08-30 18:03:44 UTC
Created attachment 24486 [details]
comment in xml breaks mono linker

Sorry, forgot to add attachment.

[ working case ]:
<type fullname="System.Linq.AsyncEnumerable" >

this option not stripping AsyncEnumerable

[ non-working case ]:
<type fullname="System.Linq.AsyncEnumerable" >

this option with comment still stripping out AsyncEnumerable, so basically I think the linker somehow thinks there is only 1 child in type to exclude from linking, but it's a comment
Comment 3 Eric Liu 2017-08-30 18:07:15 UTC
I'm aware about the mono linker, but I don't have time to dig it out.

Note You need to log in before you can comment on or make changes to this bug.