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

Make cmark-gfm as dependency package #306

Closed
nbmisen opened this issue Mar 18, 2024 · 14 comments
Closed

Make cmark-gfm as dependency package #306

nbmisen opened this issue Mar 18, 2024 · 14 comments

Comments

@nbmisen
Copy link

nbmisen commented Mar 18, 2024

My project uses github.com/apple/swift-markdown's SPM as a dependency, and swift-markdown uses https://github.com/apple/swift-cmark as a dependency. When I also use swift-markdown-ui as a dependency, Xcode indicates a conflict with cmark-gfm. Therefore, is it possible to use cmark-gfm as a dependency rather than as source in the code?

Conflict report:multiple targets named 'cmark-gfm' in: 'swift-cmark', 'swift-markdown-ui'

@andreivladmatei
Copy link

I have the same issue. What's the recommendation?

@zhang-hongshen
Copy link

Same issue. Is this repository still active ?

@gonzalezreal
Copy link
Owner

gonzalezreal commented Apr 11, 2024

Hey folks,
Sorry for the late response. Unfortunately, apple/swift-cmark is not using semantic versioning, so is not possible make a flexible version requirement.

For instance, this doesn't work:

dependencies: [
  .package(url: "https://github.com/apple/swift-cmark", "swift-4.2-RELEASE"..<"swift-5.10-RELEASE")
]

Additionally, apple/swift-markdown depends on the gfm branch, instead of an specific version:

https://github.com/apple/swift-markdown/blob/907674c2ae2d24c32fba50101821b1a7fdd291e2/Package.swift#L48

I will be happy to use apple/swift-cmark if it were possible to have a flexible requirement on the version. I am open to any ideas.

Thanks!

@lovetodream
Copy link

Hey everyone, I had the same issue a few months ago and created a fork which uses apple/swift-markdown. Initially I've planned to open a PR here but since I had limited time and needed to remove a few methods from the public API (might be due to lack of knowledge), I've restrained from doing so.
Maybe it is of some help to anyone.
If this is interesting to you @gonzalezreal, I can open a PR.
Here's the branch: https://github.com/lovetodream/swift-markdown-ui/tree/feature/swift-markdown-refactor

@BelDaw
Copy link

BelDaw commented Sep 19, 2024

Having the same issue. Has there been a solution for this yet?

@hyperlink
Copy link

Having the same issue. Has there been a solution for this yet?

I ended up using @lovetodream branch which WFM.

@wesleymccloy
Copy link

@gonzalezreal swiftlang/swift-cmark has added semver tags (0.5.0 for example)

@gonzalezreal
Copy link
Owner

@wesleymccloy Good to know! I will give it a try.

@gonzalezreal
Copy link
Owner

You can try it here:

I would like to have some feedback before merging that PR. Please react with thumbs up if it works for you. Otherwise, let me know in the comments.

@hyperlink
Copy link

Hi @gonzalezreal I have noticed this warning in Xcode otherwise no issues:

image

@gonzalezreal
Copy link
Owner

gonzalezreal commented Oct 10, 2024

Hi @hyperlink,

You are probably getting that warning because your project is still pointing to apple/swift-markdown, instead of swiftlang/swift-markdown. Apple moved a bunch of open source projects from apple to the new swiftlang organization.

@hyperlink
Copy link

I created a new project and added swiftlang’s swift-markdown. However, I’m still seeing the warning.

image

The warning should be gone in the main branch, but the 0.5.0 tag still references Apple’s swift-markdown.

https://github.com/swiftlang/swift-markdown/blob/8f79cb175981458a0a27e76cb42fee8e17b1a993/Package.swift#L49

@gonzalezreal
Copy link
Owner

Yep, that could be the issue. So, the workaround is to use the main branch for swiftlang/swift-markdown until there is a new tag that uses the proper organization name for swift-cmark. There is nothing we can do on our side.

@gonzalezreal
Copy link
Owner

gonzalezreal commented Oct 11, 2024

I don't see any reason to hold #348, so I am going to merge it and close this issue.

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

8 participants