Skip to content

iOS App testing fails from Xcode version mismatch  #36536

@mdh1418

Description

@mdh1418

After applying no-weak-imports workaround when building iOS apps and deploying to a local device following this

<runtime-repo>/build.sh -os iOS -arch x64 -subset Mono+Libs
cd <runtime-repo>/src/libraries/System.Numerics.Vectors/tests
../../../../dotnet.sh build /t:Test /p:TargetOS=iOS /p:TargetArchitecture=x64 /p:DevTeamProvisioning=UBF8T346G9

The following error occurs

  Ld System.Numerics.Vectors.Tests/Release-iphonesimulator/System.Numerics.Vectors.Tests.app/System.Numerics.Vectors.Tests normal x86_64
      cd /Users/mdhwang/runtime/artifacts/bin/System.Numerics.Vectors.Tests/net5.0-Debug/ios-x64/AppBundle
      export PATH="/Applications/Xcode113.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode113.app/Contents/Developer/usr/bin:/Users/mdhwang/runtime/.dotnet:/usr/local/opt/[email protected]/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin:/Users/mdhwang/mono/runtime/_tmpinst/bin:/Users/mdhwang/mono/mini"
      /Applications/Xcode113.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios10.1-simulator -isysroot /Applications/Xcode113.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk -L/Users/mdhwang/runtime/artifacts/bin/System.Numerics.Vectors.Tests/net5.0-Debug/ios-x64/AppBundle/System.Numerics.Vectors.Tests/Release-iphonesimulator -F/Users/mdhwang/runtime/artifacts/bin/System.Numerics.Vectors.Tests/net5.0-Debug/ios-x64/AppBundle/System.Numerics.Vectors.Tests/Release-iphonesimulator -filelist /Users/mdhwang/runtime/artifacts/bin/System.Numerics.Vectors.Tests/net5.0-Debug/ios-x64/AppBundle/System.Numerics.Vectors.Tests/System.Numerics.Vectors.Tests.build/Release-iphonesimulator/System.Numerics.Vectors.Tests.build/Objects-normal/x86_64/System.Numerics.Vectors.Tests.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/usr/local/opt/[email protected]/lib -Wl,-headerpad_max_install_names -framework Foundation -framework Security -framework UIKit -framework GSS -lz -liconv -force_load /Users/mdhwang/runtime/artifacts/bin/System.Numerics.Vectors.Tests/net5.0-Debug/ios-x64/publish/libmono.a -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/mdhwang/runtime/artifacts/bin/System.Numerics.Vectors.Tests/net5.0-Debug/ios-x64/AppBundle/System.Numerics.Vectors.Tests/System.Numerics.Vectors.Tests.build/Release-iphonesimulator/System.Numerics.Vectors.Tests.build/System.Numerics.Vectors.Tests.app-Simulated.xcent -Xlinker -dependency_info -Xlinker /Users/mdhwang/runtime/artifacts/bin/System.Numerics.Vectors.Tests/net5.0-Debug/ios-x64/AppBundle/System.Numerics.Vectors.Tests/System.Numerics.Vectors.Tests.build/Release-iphonesimulator/System.Numerics.Vectors.Tests.build/Objects-normal/x86_64/System.Numerics.Vectors.Tests_dependency_info.dat -o /Users/mdhwang/runtime/artifacts/bin/System.Numerics.Vectors.Tests/net5.0-Debug/ios-x64/AppBundle/System.Numerics.Vectors.Tests/Release-iphonesimulator/System.Numerics.Vectors.Tests.app/System.Numerics.Vectors.Tests
  Undefined symbols for architecture x86_64:
    "___darwin_check_fd_set_overflow", referenced from:
        _socket_transport_connect in libmono.a(libmono_dbg_la-debugger-agent.o)
        _mono_poll in libmono.a(libmonoutils_la-mono-poll.o)
        _read_pipes in libmono.a(libeglib_la-gspawn.o)
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error : ** BUILD FAILED ** [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error :  [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error :  [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error : The following build commands failed: [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error : 	Ld System.Numerics.Vectors.Tests/Release-iphonesimulator/System.Numerics.Vectors.Tests.app/System.Numerics.Vectors.Tests normal x86_64 [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error : (1 failure) [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018: The "AppleAppBuilderTask" task failed unexpectedly. [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018: System.Exception: Error: ** BUILD FAILED ** [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018:  [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018:  [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018: The following build commands failed: [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018: 	Ld System.Numerics.Vectors.Tests/Release-iphonesimulator/System.Numerics.Vectors.Tests.app/System.Numerics.Vectors.Tests normal x86_64 [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018: (1 failure) [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018:  [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018:  [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018:    at Utils.RunProcess(String path, String args, IDictionary`2 envVars, String workingDir, Boolean ignoreErrors) in /Users/mdhwang/runtime/src/mono/msbuild/AppleAppBuilder/Utils.cs:line 73 [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018:    at Xcode.BuildAppBundle(String xcodePrjPath, String architecture, Boolean optimized, String devTeamProvisioning) in /Users/mdhwang/runtime/src/mono/msbuild/AppleAppBuilder/Xcode.cs:line 149 [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018:    at AppleAppBuilderTask.Execute() in /Users/mdhwang/runtime/src/mono/msbuild/AppleAppBuilder/AppleAppBuilder.cs:line 172 [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]
/Users/mdhwang/runtime/eng/testing/tests.mobile.targets(86,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/Users/mdhwang/runtime/src/libraries/System.Numerics.Vectors/tests/System.Numerics.Vectors.Tests.csproj]

Whole log

It turns out that the active developer directory had been set to Xcode 11.3

xcode-select -p
/Applications/Xcode113.app/Contents/Developer

However, the main build uses /Applications/Xcode.app/Contents/Developer which after updating to Xcode 11.4, would cause a version mismatch, leading to the linker issue.

This can be resolved through
sudo xcode-select -s /Applications/Xcode.app
or perhaps building according to xcode-select -p

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions