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

Put (Swift) Target Runtimes in Separate Repos #1774

Closed
hanjoes opened this issue Mar 19, 2017 · 5 comments
Closed

Put (Swift) Target Runtimes in Separate Repos #1774

hanjoes opened this issue Mar 19, 2017 · 5 comments

Comments

@hanjoes
Copy link
Member

hanjoes commented Mar 19, 2017

Introduction

This is a proposal to separate out (some) target's runtime into separate repos for better project integration.

For e.g.: The current way of importing the Swift Antlr4 runtime is not ideal because:

  1. It can only work with Xcode. (all of the configuration is Xcode dependent) so it does not work on non-darwin platforms.
  2. It does not work with Swift Package Manager (1st party support for Swift's dependency management), neither Carthage (3rd party package manager) which also requires a git repo or at least a remote space that stores the artifact (not ideal for Swift because of ABI stability).

Motivation

Although in 4.6 release we added SPM integration, but without a separate repo for swift target, the workflow is like this:

  • clone/fork the antlr4 repository
  • 'git init' in the swift runtime folder, and tag the runtime repository
  • create a remote repository that should hold the swift runtime
  • push to the remote repository just created
  • add the remote repository as dependency in our projects SPM manifest file.
  • run 'swift build' will then pull dependency from the repository

This workflow is awkward. Reference.

This change will end all the hassle in adding swift runtime to a project, and instead, make it as easy as adding the git repository to Package.swift:

let package = Package(
  name: "ProjectUsingSwiftRuntime",
  targets: [
    Target(name: "ProjectUsingSwiftRuntime", dependencies: []),
  ],
  dependencies: [
    .Package(url: "https://github.com/antlr/antlr4-swift-runtime.git", majorVersion: x.x.x)
  ]
)
@ericvergnaud
Copy link
Contributor

ericvergnaud commented Mar 20, 2017 via email

@hanjoes
Copy link
Member Author

hanjoes commented Mar 20, 2017

I agree. I have a gut feeling that it can be supported. But there must be some maintenance overhead.

@parrt
Copy link
Member

parrt commented Mar 21, 2017

Yeah, All of your reasons are good, which is why we originally had separate repos, but we went through a huge effort to actually integrate everything into one repository. There are negatives as you both point out but I think I'd like to keep everything together. Can we make tools or something to make integration easier? Perhaps we make a script that generates a read-only repo or something?

@hanjoes
Copy link
Member Author

hanjoes commented Mar 23, 2017

Good to know. Separating runtimes doesn't seem worth the effort given what you've mentioned. We can do some workaround to make integration easier. Anything can be done, it's all about tradeoffs after all. Closing!

@hanjoes hanjoes closed this as completed Mar 23, 2017
@Patrick-Remy
Copy link

Since SPM4 supports custom Source locations, a simple workaround would be to put the Package.swift in root folder.

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

4 participants