Skip to content

Commit

Permalink
[apidiff] Fix range expression. (#8837)
Browse files Browse the repository at this point in the history
The C# range expression is somewhat confusing: the lower bound is inclusive,
but the upper bound is exclusive. This means that [0..15] is 15 characters,
not the 16 characters we want here.

Fixes this during API comparison:

    System.ArgumentException: Byte array for GUID must be exactly 16 bytes long.
    Parameter name: b
      at System.Guid..ctor (System.ReadOnlySpan`1[T] b) [0x00111] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Guid.cs:66
      at System.Guid..ctor (System.Byte[] b) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Guid.cs:45
      at Merger.Process (System.String platform, System.String path, System.String os) [0x001d1] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/apidiff/merger.cs:60
      at Merger.Main (System.String[] args) [0x00002] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/apidiff/merger.cs:94
    make[2]: *** [tvos-markdown] Error 1

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
  • Loading branch information
monojenkins and rolfbjarne authored Jun 11, 2020
1 parent 9438658 commit b7051c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/apidiff/merger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static void Process (string platform, string path, string os)
using (var md = SHA256.Create ())
digest = md.ComputeHash (Encoding.UTF8.GetBytes (filename));
// (not cryptographically) unique (but good enough) for each filename - so document remains with the same id when it's updated/regenerated
var guid = new Guid (digest[0..15]);
var guid = new Guid (digest[0..16]);

var headers = new StringWriter ();
var title = $"{platform} SDK API diff: {from} vs {to}";
Expand Down

2 comments on commit b7051c7

@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) 'Running XM tests on '10.12', Running XM tests on '10.10', Running XM tests on '10.10'' 🔥

Build succeeded
✅ Packages:

API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
🔥 Xamarin.Mac tests on 10.12 failed: Xamarin.Mac tests on macOS 10.12 failed (apitest) 🔥
🔥 Xamarin.Mac tests on 10.10 failed: Xamarin.Mac tests on macOS 10.10 failed (apitest) 🔥
🔥 Test run failed 🔥

Test results

2 tests failed, 183 tests passed.

Failed tests

  • [xUnit] Mono Mac OS X BCL tests group 4/Mac Full/Debug: Failed (Test run failed.)
  • monotouch-test/watchOS 32-bits - simulator/Debug: Failed

@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.

🔥 Device tests completed (Failed) on iOS on Azure DevOps(iOS): Html Report 🔥

Test results

2 tests failed, 148 tests passed.

Failed tests

  • [NUnit] Mono BCL tests group 2/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Failed
  • [NUnit] Mono BCL tests group 2/iOS Unified 64-bits - device/AssemblyBuildTarget: SDK framework (release): Failed

Please sign in to comment.