Skip to content

Commit

Permalink
[dotnet] Remove workaround for dotnet/runtime issue with incorrect dy…
Browse files Browse the repository at this point in the history
…libs. (#11815)

The runtime issue has been fixed for a while now, so we don't need the
workaround anymore.

Ref: dotnet/runtime#34637
  • Loading branch information
rolfbjarne authored Jun 7, 2021
1 parent 0c28f7f commit 7ac5b95
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 73 deletions.
54 changes: 1 addition & 53 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -611,60 +611,8 @@
</ItemGroup>
</Target>

<PropertyGroup>
<_UpdateDynamicLibraryIdDependsOn>
_ComputeVariables;
_ParseBundlerArguments;
</_UpdateDynamicLibraryIdDependsOn>
</PropertyGroup>

<!-- The .dylibs shipped with mono comes with the original identity:
$ otool -l ~/.nuget/packages/microsoft.netcore.app.runtime.ios-x64/5.0.0-*/runtimes/ios-x64/native/libSystem.IO.Compression.Native.dylib | grep LC_ID_DYLIB -A 2
cmd LC_ID_DYLIB
cmdsize 184
name /Users/runner/runners/2.165.2/work/1/s/artifacts/obj/native/netcoreapp5.0-iOS-Release-x64/System.IO.Compression.Native/libSystem.IO.Compression.Native.dylib (offset 24)
This doesn't work after linking with these libraries, so this must be fixed to be @executable_path/. Eventually mono will ship dylibs we don't have to fix (https://github.com/dotnet/runtime/issues/34637).
-->
<Target
Name="_UpdateDynamicLibraryId"
DependsOnTargets="$(_UpdateDynamicLibraryIdDependsOn)"
Inputs="@(_MonoLibraryFix)"
Outputs="@(_MonoLibraryFix.TargetPath)"
Condition=" '$(_PlatformName)' != 'macOS'">

<PropertyGroup>
<_ExecutablePathPrefix Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'">@executable_path/</_ExecutablePathPrefix>
<_ExecutablePathPrefix Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">@executable_path/../$(_CustomBundleName)/</_ExecutablePathPrefix>
</PropertyGroup>

<!-- install_name_tool modifies the file in-place, so copy it first to a temporary directory before we fix it -->
<Copy
Condition="'$(IsMacEnabled)' == 'true'"
SessionId="$(BuildSessionId)"
SourceFiles="%(_MonoLibraryFix.FullPath)"
DestinationFolder="$(_IntermediateNativeLibraryDir)"
/>
<Exec
Condition="'$(IsMacEnabled)' == 'true'"
SessionId="$(BuildSessionId)"
Command="xcrun install_name_tool -id $(_ExecutablePathPrefix)%(_MonoLibraryFix.Filename)%(_MonoLibraryFix.Extension) %(_MonoLibraryFix.TargetPath)"
EnvironmentVariables="DEVELOPER_DIR=$(_SdkDevPath)"
/>

<!-- Update our item groups -->
<ItemGroup Condition="'$(IsMacEnabled)' == 'true'">
<_MonoLibraryFixed Include="@(_MonoLibraryFix -> '%(TargetPath)')" />
<ResolvedFileToPublish Remove="@(_MonoLibraryFix)" />
<ResolvedFileToPublish Include="@(_MonoLibraryFixed)" />
<_MonoLibrary Remove="@(_MonoLibraryFix)" />
<_MonoLibrary Include="@(_MonoLibraryFixed)" />
</ItemGroup>
</Target>

<Target Name="_LinkNativeExecutable"
DependsOnTargets="_DetectSdkLocations;_ComputeTargetArchitectures;_GenerateBundleName;_CompileNativeExecutable;_CompileAppManifest;_UpdateDynamicLibraryId"
DependsOnTargets="_DetectSdkLocations;_ComputeTargetArchitectures;_GenerateBundleName;_CompileNativeExecutable;_CompileAppManifest"
Inputs="@(_NativeExecutableObjectFiles)"
Outputs="$(_IntermediateNativeLibraryDir)$(_NativeExecutableName)"
>
Expand Down
20 changes: 0 additions & 20 deletions msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.Common.After.targets
Original file line number Diff line number Diff line change
Expand Up @@ -299,26 +299,6 @@ Copyright (C) 2011-2013 Xamarin. All rights reserved.
</Copy>
</Target>

<PropertyGroup>
<_UpdateDynamicLibraryIdDependsOn>
$(_UpdateDynamicLibraryIdDependsOn);
CopyDynamicLibrariesToMac;
</_UpdateDynamicLibraryIdDependsOn>
</PropertyGroup>

<Target Name="CopyDynamicLibrariesToMac" Condition="'$(_PlatformName)' != 'macOS'">
<ItemGroup>
<_MonoLibraryFixToMac Include="%(_MonoLibraryFix.FullPath)">
<TargetPath>%(FullPath)</TargetPath>
</_MonoLibraryFixToMac>
</ItemGroup>

<CopyFilesToBuildServer
Condition="'$(IsMacEnabled)' == 'true'"
SessionId="$(BuildSessionId)"
Files="@(_MonoLibraryFixToMac)" />
</Target>

<Target Name="_UpdateDebugType" BeforeTargets="CoreCompile">
<PropertyGroup>
<DebugType Condition="'$(DebugType)' == 'full'">portable</DebugType>
Expand Down

6 comments on commit 7ac5b95

@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 passed on Build. ✅

Tests passed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

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

Packages generated

View packages

🎉 All 221 tests passed 🎉

Pipeline on Agent XAMBOT-1025.BigSur'
[dotnet] Remove workaround for dotnet/runtime issue with incorrect dylibs. (#11815)

@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
[dotnet] Remove workaround for dotnet/runtime issue with incorrect dylibs. (#11815)

@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 passed on macOS Mac Mojave (10.14) ✅

Tests passed

All tests on macOS X Mac Mojave (10.14) passed.

Pipeline on Agent
[dotnet] Remove workaround for dotnet/runtime issue with incorrect dylibs. (#11815)

@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 passed on macOS Mac High Sierra (10.13) ✅

Tests passed

All tests on macOS X Mac High Sierra (10.13) passed.

Pipeline on Agent
[dotnet] Remove workaround for dotnet/runtime issue with incorrect dylibs. (#11815)

@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
[dotnet] Remove workaround for dotnet/runtime issue with incorrect dylibs. (#11815)

@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 iOS32b). ⚠️

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

Pipeline on Agent
[dotnet] Remove workaround for dotnet/runtime issue with incorrect dylibs. (#11815)

Please sign in to comment.