Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Swift tools version from 5.3 to 5.5 #206

Merged
merged 2 commits into from
Jun 16, 2022
Merged

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented Jun 14, 2022

Notice that this introduces an error when running swift test:

$ swift test

Building for debugging...
/Users/gio/Developer/a8c/tracks-apple-pod/Sources/Model/ObjC/Common/Core Data/TracksContextManager.m:24:24: error: use of undeclared identifier 'SWIFTPM_MODULE_BUNDLE'
    NSBundle *bundle = SWIFTPM_MODULE_BUNDLE;
                       ^
1 error generated.
[0/6] Compiling TracksContextManager.m
error: fatalError

This is a known Swift Package Manager issue. See:

However, bundle exec fastlane test, which uses xcodebuild under the hood, works.

Given our workflow is based on Xcode locally and Fastlane in CI, the regression seems acceptable.

The reason I'm keen to upgrade to 5.5 is that it's the required tooling version to integrate Buildkite's Test Analytics. See
https://github.com/buildkite/test-collector-swift/blob/v0.1.0/Package.swift#L1

Notice that this introduces an error when running `swift test`:

```
$ swift test

Building for debugging...
/Users/gio/Developer/a8c/tracks-apple-pod/Sources/Model/ObjC/Common/Core Data/TracksContextManager.m:24:24: error: use of undeclared identifier 'SWIFTPM_MODULE_BUNDLE'
    NSBundle *bundle = SWIFTPM_MODULE_BUNDLE;
                       ^
1 error generated.
[0/6] Compiling TracksContextManager.m
error: fatalError
```

This is a known Swift Package Manager issue. See:

- swiftlang/swift-package-manager#4500
- https://forums.swift.org/t/5-3-resources-support-not-working-on-with-swift-test/40381

However, `bundle exec fastlane test`, which uses `xcodebuild` under the
hood, works.

Given our workflow is based on Xcode locally and Fastlane in CI, the
regression seems acceptable.

The reason I'm keen to upgrade to 5.5 is that it's the required tooling
version to integrate Buildkite's Test Analytics. See
https://github.com/buildkite/test-collector-swift/blob/v0.1.0/Package.swift#L1
@mokagio mokagio force-pushed the use-swift-5.5-tooling branch from 51a730a to a1eedab Compare June 14, 2022 23:43
5.5 Swift tools were introduced in the previous commit,
bc86865
@mokagio mokagio force-pushed the use-swift-5.5-tooling branch from a1eedab to acd4b88 Compare June 15, 2022 00:27
@mokagio mokagio requested a review from a team June 15, 2022 00:42
Copy link
Contributor

@AliSoftware AliSoftware left a comment

Choose a reason for hiding this comment

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

Mitigation of the bug with swift test (given we use Xcode / xcodebuild / fastlane, not swift test) seems acceptable to me.

@mokagio mokagio merged commit 21ec5df into trunk Jun 16, 2022
@mokagio mokagio deleted the use-swift-5.5-tooling branch June 16, 2022 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants