Skip to content

0.2.10-patch: Fix Xcode 11 Swift tests on pre-iOS 12.2 devices

Latest
Compare
Choose a tag to compare
@jverkoey jverkoey released this 03 Jan 20:29

This addresses errors like the following that happen when attempting to run bazel test on a unit test that includes Swift source with Xcode 11+ on an iOS simulator prior to iOS 12.2:

2019-12-28 22:46:29.889 xctest[72220:1587995] The bundle “UnitTests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2019-12-28 22:46:29.891 xctest[72220:1587995] (dlopen_preflight(/var/folders/nf/gl8gqkdd6fg98rjd9rgzkt70002gv0/T/test_runner_work_dir.X2gjTc/UnitTests/UnitTests.xctest/UnitTests): Library not loaded: @rpath/libswiftFoundation.dylib
  Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/lib/libXCTestSwiftSupport.dylib
  Reason: no suitable image found.  Did find:
	/usr/lib/swift/libswiftFoundation.dylib: mach-o, but not built for iOS simulator
	/usr/lib/swift/libswiftFoundation.dylib: mach-o, but not built for iOS simulator)

WORKSPACE:

http_file(
    name = "xctestrunner",
    executable = 1,
    urls = ["https://github.com/material-foundation/xctestrunner/releases/download/0.2.11/ios_test_runner.par"],
    sha256 = "a0a8be06b14f787f6017474b1ed33068c616b5b1154cf16e2e7ac3e7f047fd8c",
)