Giter VIP home page Giter VIP logo

Comments (6)

mattt avatar mattt commented on August 30, 2024 1

@cflorion Thanks for the kind words!

The issue you're running into stems from a limitation in how Swift Package Manager resolves transitive dependencies. Because SwiftSemantics depends on an exact version of swift-syntax, you can't depend on SwiftSemantics with a non-exact requirement.

The installation instructions in the README should work (if they don't, please let me know!) https://github.com/SwiftDocOrg/SwiftSemantics#installation

from swiftsemantics.

wgy6055 avatar wgy6055 commented on August 30, 2024 1

@mattt I can still reproduce. I'm using Xcode built-in Swift Package Managing function instead of editing Package.swift. So I just set like this πŸ‘‡

ζˆͺ屏2021-07-21 上午1 12 22

But I got this πŸ‘‡

ζˆͺ屏2021-07-21 上午1 09 11

I think we should change .revision("release/5.4")) into .exact("some.stable.version") to fix this problem.
PS. I tried to integrate by branch: main. I got passed. But I don't think it was a good solution :(

from swiftsemantics.

wgy6055 avatar wgy6055 commented on August 30, 2024

I think the point is that:
...but 'swiftsemantics' depends on an unstable-version package 'swift-syntax' ?

Because in [email protected],

    dependencies: [
        .package(name: "SwiftSyntax",
                 url: "https://github.com/apple/swift-syntax.git",
                 .revision("release/5.4")),
    ],

I'm using Xcode 12.5 which integrated Swift 5.4. I can still reproduce this problem.

from swiftsemantics.

mattt avatar mattt commented on August 30, 2024

@wgy6055 That's right, you'd need to specify an exact version of SwiftSemantics, too. I had that wrong in the README, but just updated it. Can you still reproduce with the latest instructions?

// swift-tools-version:5.3

import PackageDescription

let package = Package(
  name: "YourProject",
  dependencies: [
    .package(
        name: "SwiftSemantics",
        url: "https://github.com/SwiftDocOrg/SwiftSemantics",
        .exact("0.3.2")
    ),
    .package(name: "SwiftSyntax",
         url: "https://github.com/apple/swift-syntax.git",
         .revision("release/5.4")),
  ]
)

from swiftsemantics.

tjprescott avatar tjprescott commented on August 30, 2024

I too had to target "main" to add the package dependency as my source code doesn't live at the root of the repo and thus Package.swift doesn't work. Everything builds fine, but any time I try to run the project, I get a runtime error:

dyld: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib
  Referenced from: ...
  Reason: image not found

from swiftsemantics.

wgy6055 avatar wgy6055 commented on August 30, 2024

I too had to target "main" to add the package dependency as my source code doesn't live at the root of the repo and thus Package.swift doesn't work. Everything builds fine, but any time I try to run the project, I get a runtime error:


dyld: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib

  Referenced from: ...

  Reason: image not found

@tjprescott
I found something from README of SwiftSyntax. I believe this is what you need.

SwiftSyntax depends on the lib_InternalSwiftSyntaxParser.dylib/.so library which provides a C interface to the underlying Swift C++ parser. When you do swift build SwiftSyntax links and uses the library included in the Swift toolchain. If you are building an application make sure to embed _InternalSwiftSyntaxParser as part of your application's libraries.

from swiftsemantics.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.