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
RFC: Per dependancy platform setting #2294
Comments
This has been discussed in #356. |
So it looks like Carthage might be open to accepting such a pull request? |
shoudn't the dependency have 3 dimensions? Version, Target, Platform? |
What would target refer to? |
Inside an Xcode Project there can be multiple targets. |
The big issue here is a design question: how should Cartfiles be extended? If we're going to extend them, they should be extended with an eye toward the future, recognizing that we will probably want other additions in the future. Previously, some work was done to implement an OGDL parser that was compatible with existing Cartfiles. That was quite a while ago, and I'm not sure if it would be a good direction for today. Once we have a format designed, then we can tackle a specific addition like this. |
@mdiep Why OGDL rather than a yaml ? The problem is that Carthage dependencies have no way to describe themselves. Why not something like:
see in JSON at: http://yaml-online-parser.appspot.com/ A few advantages:
If you are open to this approach I can submit a full proposal a-la swift-evolution. Otherwise, do you have something else in mind? |
From the OGDL FAQ:
Because that's considerably more complex than what we have and, I think, more complex than what we need. Everything doesn't need to be configurable, but we want room for more than one piece of configuration. |
I personally still don't buy OGDL, parsers for YAML are already there. I also don't see the the need for order preservation and duplicate entries. However if this is the preferred format I guess the same structure can be translated to OGDL. The dependency format that I have sketched is very verbose and it can be reduce by adopting some syntactic sugar but it contains all the information that is needed for:
It might look more complex to the eye at a first glance but the contents of it are very obvious. What is lacking for dependency management on Apple platforms are the following things:
@mdiep what would be the ideal next steps to move forward? |
I'm not personally tied to OGDL. It's just what was previously being considered.
It's a little unclear whether you mean to specify these things for dependencies only or to have a project define information about itself. But we want to avoid the latter. Versions, targets, etc. all exist already in Git and Xcode files; we don't want to duplicate that information.
I think a concrete proposal would be the next step. This should happen in a new issue or possibly in a PR that updates documentation. |
@mdiep Thanks for the clarification.
Both are possible. A "package" described above is a subset of a dependency. A "dependency" contains more detailed "lock" information.
They do, but the problem is that their relation to each others does not exist anywhere. That is what should be encoded. It's not possible to encode the relation between two targets without duplicating the the information from Xcode & Git. How do you encode that Carthage depends on "Curry-Mac.framework" in project "Curry" at version 3.0 for platform "macos" without mentioning explicitly all 4? The same information must be also available in some sort of manifest file Curry. Currently the manifest file is the sum of Git information + Xcode Project file. This requires a full checkout before anything can be said of the manifest itself. I believe that this worked well so far but it's not sustainable for the future. Even Apple with SPM migrated away and duplicates information in the package file. Now, I'm not saying that to support Carthage people will have to provide "package" information. In the solution above the user of the dependency himself can describe the package it depends upon, relieving the maintainers from this burden. |
Most of these options seem to be ideas to replace the current
Backwards compatibility
What are the desired fields in a new format?
|
The important bit is that we have backwards compatibility with the OGDL was looked into specifically because existing The current format has worked well for us IMO, so we should strive to stay as close to that as possible. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I like this idea, has this been explored more? The tools like Sourcery being more popular generating a template and format would be much easier and I think you’d be able to find a way to provide backwards support. One thing not being mentioned is that if a new format is chosen then I think it needs to support Versioning of the schema so it’s allowed to grow with the tool. We could consider the current files and formats Either way, I am still more of a fan of yaml over OGDL cause I want to be able to extend the format to someday support a pre and post action for dependencies in Carthage (example: call the Makefile in a project rather then let xcodebuild happen automatically if it’s possible). |
I want to make a suggestion, but looking for comments before working on an implementation, I couldn't find any existing discussion of this.
The idea is to be able to specify the build platforms in the
Cartfile
, for each dependency. I see two main reasons for doing so:carthage bootstrap
, by default it does builds for 4 platforms, but in most cases, you are only interested in one of these. If it was specified in theCartfile
you wouldn't have to know which platforms to include using--platforms
at bootstrap.--platforms
all your deps get built for iOS and watchOS.It would require extending the
Cartfile
syntax, something like:Most likely the
--platforms
argument would override this, and build for everything specifiedI think this can improve build times quite significantly.
The text was updated successfully, but these errors were encountered: