Skip to content

integrate command failed with multiple --consumer-eligible-configurations #241

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

Open
1 of 4 tasks
jkmathew opened this issue Aug 14, 2024 · 1 comment
Open
1 of 4 tasks
Labels
bug Something isn't working good first issue Good for newcomers starter-task

Comments

@jkmathew
Copy link

jkmathew commented Aug 14, 2024

My integration setup

  • CocoaPods cocoapods-xcremotecache plugin
  • Automatic integration using xcprepare integrate ...
  • Manual integration
  • Carthage

Expected/desired behavior
The xcprepare integrate should work with multiple --consumer-eligible-configurations.

Minimal reproduction of the problem with instructions

Run the integrate command with comma-separated consumer-eligible-configurations

Consumer Logs

Filtering the log data using "sender == "xcprepare""
Timestamp               Ty Process[PID:TID]
2024-08-14 17:24:49.475 E  xcprepare[59946:3ceea] XCRemoteCache cannot be initialized with a consumer mode. Error: statusError("status 64: Error: Unexpected argument \134'Release\134'\134nUsage: xc-prepare-main prepare [--configuration <configuration> ...] [--platform <platform> ...] [--xcode <xcode>] [--format <format>]", 64).

I ran this command,

XCRemoteCache/xcprepare integrate --input MyProj.xcodeproj --mode consumer --consumer-eligible-configurations "Debug,Release"

No matter what is the value of consumer-eligible-configurations if there is a comma, it fails.
If I run separately it either runs without error or fails with noArtifactsToReuse depending on the availability of artefacts, Which is expected.

Environment

  • XCRemoteCache: v0.3.29
  • cocoapods-xcremotecache: NA
  • HTTP cache server: AWS
  • Xcode: 15.1
@polac24
Copy link
Collaborator

polac24 commented Aug 15, 2024

Yes, that is a bug. The fix is easy: in XcodeProjIntegrate.swift we should prefix each configuration with --configuration, so something like:

let args = consumerEligibleConfigurations.flatMap {["--configuration", $0]} + consumerEligiblePlatforms.flatMap {["--platform", $0]}

If you could prepare a PR with (bonus points for a test), that would be a good starter task.

@polac24 polac24 added bug Something isn't working good first issue Good for newcomers starter-task labels Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers starter-task
Projects
None yet
Development

No branches or pull requests

2 participants