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

One to many repository maps #12

Closed
erichoracek opened this issue Aug 19, 2016 · 9 comments
Closed

One to many repository maps #12

erichoracek opened this issue Aug 19, 2016 · 9 comments

Comments

@erichoracek
Copy link

erichoracek commented Aug 19, 2016

Carthage allows one repository to have many framework targets. When a carthage build is performed, it builds them all. An example of this is CocoaLumberjack, which produces two iOS frameworks from a single repository:

carthage build CocoaLumberjack --platform ios
*** Building scheme "CocoaLumberjack-iOS" in Lumberjack.xcworkspace
*** Building scheme "CocoaLumberjackSwift-iOS" in Lumberjack.xcworkspace

this produces:

Carthage/Build/iOS/CocoaLumberjack.framework
Carthage/Build/iOS/CocoaLumberjack.framework.dSYM
Carthage/Build/iOS/CocoaLumberjackSwift.framework
Carthage/Build/iOS/CocoaLumberjackSwift.framework.dSYM

It seems as if the [RepositoryMap] should allow for a single repository to map to many framework references. You could imagine it would look something like this:

[RepositoryMap]
  CocoaLumberjack CocoaLumberjack CocoaLumberjackSwift
@tmspzz
Copy link
Owner

tmspzz commented Aug 19, 2016

How do you see this working when:

  • rome (upload | download) CocoaLumberjack ? Should rome try to upload/download all resolved names?
  • rome list ([--missing] | [--present]) ?
  • Should rome report cache hits only when ALL resolved names are present?
  • Should rome report misses when ANY of the resolved names is a miss?

@erichoracek
Copy link
Author

erichoracek commented Aug 19, 2016

I think this one is a bit different from dSYMS. If you have specified that a framework has a one-to-many repository/framework relationship, it would seem like rome would try to upload/download all names if they're specified, and consider any operation a failure if one of the frameworks are unavailable. As far as I know, there is no way to tell carthage to only build a specific subset of frameworks from a repo.

In terms of the above questions, this would result in:

Should rome try to upload/download all resolved names?

Yes, and consider the operation a failure if any are missing.

Should rome report cache hits only when ALL resolved names are present?

Yes

Should rome report misses when ANY of the resolved names is a miss?

Yes

Unfortunately, since Rome isn't able to communicate with the internals of Carthage, it's not as simple as just parsing the output of xcodebuild -list like carthage:

https://github.com/Carthage/Carthage/blob/master/Source/CarthageKit/Xcode.swift#L167-L192
https://github.com/Carthage/Carthage/blob/master/Source/CarthageKit/Xcode.swift#L745-L769

@tmspzz
Copy link
Owner

tmspzz commented Sep 6, 2016

@erichoracek Please try https://github.com/blender/Rome/releases/tag/v0.6.0.8

I think that rome list could be improved to report what alias of the framework is missing

@tmspzz
Copy link
Owner

tmspzz commented Sep 9, 2016

Fixes a crash in v0.6.0.8 https://github.com/blender/Rome/releases/tag/v0.6.0.9

@erichoracek
Copy link
Author

From trying out version 0.6.0.9, this doesn't seem to be working quite as expected. We have a repo named libPusher-Carthage, which builds the Pusher and SocketRocket frameworks.

When specifying the following [RepositoryMap]:

[RepositoryMap]
    libPusher-carthage = Pusher, SocketRocket

and this Cartfile.resolved:

github "Automatic/libPusher-carthage" "1.6.1"

I get the following behavior on rome upload:

$ rome upload  
Successfully uploaded Pusher to: Pusher/Pusher.framework-1.6.1.zip
Successfully uploaded Pusher.dSYM to: Pusher/Pusher.framework.dSYM-1.6.1.zip

And the following behavior on rome download:

$ rome download
Donwloaded: Pusher.framework-1.6.1.zip
Unzipped: Pusher.framework-1.6.1.zip
Donwloaded: Pusher.framework.dSYM-1.6.1.zip
Unzipped: Pusher.framework.dSYM-1.6.1.zip
Error downloading  SocketRocket.framework-1.6.1.zip : The specified key does not exist.
Error downloading  SocketRocket.framework.dSYM-1.6.1.zip : The specified key does not exist.

However, if I reverse the ordering of the repository map:

[RepositoryMap]
    libPusher-carthage = SocketRocket, Pusher

I get the reverse behavior:

$ rome upload  
Successfully uploaded SocketRocket to: SocketRocket/SocketRocket.framework-1.6.1.zip
Successfully uploaded SocketRocket.dSYM to: SocketRocket/SocketRocket.framework.dSYM-1.6.1.zip

It seems like this is almost there—thanks for taking a stab at this!

@tmspzz
Copy link
Owner

tmspzz commented Sep 25, 2016

@erichoracek I believe your problem are additional white spaces around frameworks names. This is addressed in pre-release v6.0.10

@erichoracek
Copy link
Author

@blender Thanks! I'll try this out.

Re: the v0.6.0.10 release, it would appear that the binary is missing from the Github attachments.

@tmspzz
Copy link
Owner

tmspzz commented Sep 26, 2016

@erichoracek Sorry about that. Fixed.

@erichoracek
Copy link
Author

Appears to be working perfectly now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants