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

Verify & Resolve swift package index builds #466

Open
mjarvis opened this issue Dec 4, 2020 · 2 comments
Open

Verify & Resolve swift package index builds #466

mjarvis opened this issue Dec 4, 2020 · 2 comments

Comments

@mjarvis
Copy link
Member

mjarvis commented Dec 4, 2020

https://swiftpackageindex.com/ReSwift/ReSwift/builds

Swift package index is a useful resource. We should verify the functionality of each build -- notable is that it indicates the watchOS build is not working. We should verify each failing build and see if there is a way to fix it.

@DivineDominion
Copy link
Contributor

Odd that recent builds with Swift 5.4 work fine. The watchOS target there breaks because of the XCTest module.

The build command is

env DEVELOPER_DIR="/Applications/Xcode_12.2.app" xcrun xcodebuild -IDEClonedSourcePackagesDirPathOverride="$PWD/.dependencies" -derivedDataPath "$PWD/.derivedData" build -scheme "ReSwift" -destination "generic/platform=watchos"

I don't have Xcode 12.2 on my device at the moment, so I cannot test this right now.

The -scheme "ReSwift" setting stood out to me, too; I think the scheme name should be "ReSwift-watchOS", right?

Does this have consequences when using the packages? I think not, so I wouldn't worry about that too much, although it'd be great if someone checked out why their build system fails and Travis doesn't.

@DivineDominion
Copy link
Contributor

master looks quite ok now, except

watchOS on Swift 5.1/5.2/5.3

The build process tries to use XCTest, which isn't available.

Since tests aren't run by the Swift package index servers, I wonder if there's a way to disable test compilation.

The ReSwift-watchOS scheme doesn't include any test target instructions. But the failing build instructions don't list that scheme:

env DEVELOPER_DIR="/Applications/Xcode_12.4.app" xcrun xcodebuild \
    -IDEClonedSourcePackagesDirPathOverride="$PWD/.dependencies" \
    -derivedDataPath "$PWD/.derivedData" \
    build -scheme "ReSwift" -destination "generic/platform=watchos"

It should read -scheme "ReSwift-watchOS", I think. But I'm never quite sure if we did something clever here, too, that messes with the build settings.

FWIW I cannot reproduce successful builds on my machine when I copy the build command:

env DEVELOPER_DIR="/Applications/Xcode_13.1.app" xcrun xcodebuild -IDEClonedSourcePackagesDirPathOverride="$PWD/.dependencies" -derivedDataPath "$PWD/.derivedData" build -scheme "ReSwift" -destination "generic/platform=watchos"

xcodebuild: error: The project named "ReSwift" does not contain a scheme named "ReSwift". The "-list" option can be used to find the names of the schemes in the project.

So maybe we should raise an issue with Swift package index for this.

iOS on Swift 5.1

-- but the iOS errors there are pretty simple:


/Users/builder/builds/DVohN7oe/3/finestructure/swiftpackageindex-builder/spi-builder-workspace/ReSwiftTests/StoreSubscriptionTests.swift:103:54: error: type of expression is ambiguous without more context
        XCTAssertEqual(subscriber.receivedStates.map(\.testValue), [7])
                                                     ^~~~~~~~~~~
/Users/builder/builds/DVohN7oe/3/finestructure/swiftpackageindex-builder/spi-builder-workspace/ReSwiftTests/StoreSubscriptionTests.swift:116:54: error: type of expression is ambiguous without more context
        XCTAssertEqual(subscriber.receivedStates.map(\.testValue), [nil, 9])
                                                     ^~~~~~~~~~~
/Users/builder/builds/DVohN7oe/3/finestructure/swiftpackageindex-builder/spi-builder-workspace/ReSwiftTests/StoreSubscriptionTests.swift:131:54: error: type of expression is ambiguous without more context
        XCTAssertEqual(subscriber.receivedStates.map(\.testValue), [13])
                                                     ^~~~~~~~~~~

They are using Xcode 11.3.1 for the build. That of course isn't available on M1 Macs :) So I cannot provide a quick fix for these and test these locally at the moment.

We could also not make the tests backwards compatible. Again, SwiftPI doesn't run the tests, so compiling them is not necessary. Maybe we can tell SwiftPI to ignore test files in that case. Other packages like RxSwift seem to compile without tests, too, so this might be an issue of the project organization: https://swiftpackageindex.com/builds/F65F733A-80D8-4119-8B52-36FA6263D5B6

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

No branches or pull requests

2 participants