Skip to content

Commit

Permalink
[mtouch] Fix [InternalsVisibleTo] attribute parsing. Fixes #4895 (#4917)
Browse files Browse the repository at this point in the history
The input is a "user" string, i.e. not some well formatted metadata.
Spec [1] mention it's comma separated, but spaces are optional.

[1] https://docs.microsoft.com/en-us/dotnet/framework/reflection-and-codedom/specifying-fully-qualified-type-names#specifying-assembly-names

Fixes #4895
  • Loading branch information
spouliot authored Oct 3, 2018
1 parent 9466519 commit ac776ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/AssemblyInfo.cs.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ using System.Runtime.CompilerServices;
// [assembly: AssemblyCopyright ("Copyright 2011-2014 Xamarin Inc.")]
[assembly: AssemblyCompany ("Xamarin Inc.")]

[assembly: InternalsVisibleTo ("System.Net.Http, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: InternalsVisibleTo ("System.Net.Http,PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
6 changes: 3 additions & 3 deletions tools/linker/MonoTouch.Tuner/MonoTouchSweepStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ void SweepAttributes (IList<CustomAttribute> attributes)
// validating the public key and the public key token would be time consuming
// worse case (no match) is that we keep the attribute while it's not needed
var fqn = (ca.ConstructorArguments [0].Value as string);
int pk = fqn.IndexOf (", PublicKey=", StringComparison.OrdinalIgnoreCase);
if (pk != -1)
fqn = fqn.Substring (0, pk);
int comma = fqn.IndexOf (',');
if (comma != -1)
fqn = fqn.Substring (0, comma);

bool need_ivt = false;
foreach (var assembly in Context.GetAssemblies ()) {
Expand Down

3 comments on commit ac776ef

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build was (probably) aborted

🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Test run' 🔥 : hudson.AbortException: script returned exit code 2

Build succeeded
API Diff (from stable)
ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)
🔥 Test run failed 🔥

Test results

1 tests failed, 0 tests skipped, 224 tests passed.

Failed tests

  • monotouch-test/watchOS - simulator/Release (all optimizations): Crashed

@chamons
Copy link
Contributor

@chamons chamons commented on ac776ef Oct 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chamons
Copy link
Contributor

@chamons chamons commented on ac776ef Oct 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting state to success where context is continuous-integration/jenkins/branch.

No blocking issues found

Please sign in to comment.