Skip to content

Commit

Permalink
Fix lstat P/Invoke on arm64 (#12437)
Browse files Browse the repository at this point in the history
* Fix lstat P/Invoke on arm64

* Bump TargetFrameworkVersion for mmp (to match mtouch)
  • Loading branch information
filipnavara committed Aug 16, 2021
1 parent e396948 commit 454831f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions tools/common/PathUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,20 @@ struct stat { /* when _DARWIN_FEATURE_64_BIT_INODE is defined */
public ulong st_qspare_2;
}

[DllImport ("/usr/lib/libSystem.dylib", EntryPoint = "lstat$INODE64", SetLastError = true)]
static extern int lstat (string path, out stat buf);
[DllImport ("/usr/lib/libc.dylib", EntryPoint = "lstat$INODE64", SetLastError = true)]
static extern int lstat_x64 (string file_name, out stat buf);

[DllImport ("/usr/lib/libc.dylib", EntryPoint = "lstat", SetLastError = true)]
static extern int lstat_arm64 (string file_name, out stat buf);

static int lstat (string path, out stat buf)
{
if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64) {
return lstat_arm64 (path, out buf);
} else {
return lstat_x64 (path, out buf);
}
}

public static bool IsSymlink (string file)
{
Expand Down
2 changes: 1 addition & 1 deletion tools/mmp/mmp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<OutputType>Exe</OutputType>
<AssemblyName>mmp</AssemblyName>
<RootNamespace>mmp</RootNamespace>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down

4 comments on commit 454831f

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ [CI Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (only version changes)

Packages generated

View packages

Test results

2 tests failed, 242 tests passed.

Failed tests

  • monotouch-test/iOS Unified 64-bits - simulator/Debug (LinkSdk) [dotnet]: Failed
  • Documentation/All: Failed

Pipeline on Agent XAMBOT-1028.BigSur'
Fix lstat P/Invoke on arm64 (#12437)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests tvOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
Fix lstat P/Invoke on arm64 (#12437)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests iOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
Fix lstat P/Invoke on arm64 (#12437)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ Tests failed on macOS M1 - Mac Big Sur (11.5) ❌

Tests failed on M1 - Mac Big Sur (11.5).

Failed tests are:

  • xammac_tests

Pipeline on Agent
Fix lstat P/Invoke on arm64 (#12437)

Please sign in to comment.