Git Product home page Git Product logo

Comments (14)

daveverwer avatar daveverwer commented on July 18, 2024 2

The good news is that it's in the index!

I'll make an issue now on the main project and tag you. Getting Linux builds up and running might be possible without too much hassle, but we don't have a mechanism yet to do the same for Apple platform builds. We do have a method in mind that's recently become feasible, but we have not implemented it yet. This could be the trigger to that implementation so I'll open the issue now.

I’ll close this issue. Thanks for the package and apologies for the bumpy ride into the index.

from packagelist.

daveverwer avatar daveverwer commented on July 18, 2024 1

Thanks @mrLSD! I've added it via #7587 and I'll watch for the next few minutes to make sure the index picks it up with correct metadata.

The builds will very likely fail, but that's a separate issue.

from packagelist.

mrLSD avatar mrLSD commented on July 18, 2024

⚠️ Please NOTE, to pass CI it must brew install llvm and set ENV PATH, as it operates with LLVM C API.
➡️ In Github repo, CI passed successfully.

from packagelist.

daveverwer avatar daveverwer commented on July 18, 2024

Hi @mrLSD, and thanks for adding this. Unfortunately we're even failing to run swift package dump-package, which we need to validate the package and analyse basic metadata. I'm assuming there's some code in Package.swift that either requires macOS (we run analysis on Linux) or maybe the dependency is needed there.

I don't have time to look at it this weekend, but we'll take a look next week at what we can do to get this in the index.

from packagelist.

mrLSD avatar mrLSD commented on July 18, 2024

Hi @daveverwer , as I mentioned before it requires LLVM C libraries, as the library itself is LLVM C API wrapper for Swift.
So requirements are installed llvm and ENV variables for linking. I can help with that if you need any advice.

It doesn't matter whether Linux or MacOS.

from packagelist.

daveverwer avatar daveverwer commented on July 18, 2024

Apologies if I wasn't clear. I saw your note about the dependency, but I was wondering if the Package.swift needed it, because that's the first issue to solve before we get to CI which is what you mentioned.

I just took a quick look at the manifest and I see the dependency is indeed needed even in the manifest. We don't currently have any packages that need dependencies at that point. We will have to discuss this. I'll leave this issue open until @finestructure and I have had a chance to talk about what we can do.

from packagelist.

mrLSD avatar mrLSD commented on July 18, 2024

Thanks

from packagelist.

finestructure avatar finestructure commented on July 18, 2024

Unfortunately, your package can't pass the validation process as is due to the logic that's embedded. It actually locks up when I run it locally. The command to try and reproduce this is the following:

docker run --rm -v $PWD:/host -w /host swiftlang/swift@sha256:30154112a700a5a95fd1760716bd2040e8b735f54f081a4865823abdec67d17e swift package dump-package

In order to at least be able to add it to the index, I'd recommend making dump-package possible by making getLLVMConfig() conditional. For example

#if MY_BUILD
let (cFlags, linkFlags, _version) = try! getLLVMConfig()
#else
let (cFlags, linkFlags, _version) = ([String](), [String](), [Int]())
#endif

This way dump-package wouldn't block on this call and pass verification.

The bad news is that the build is very unlikely to pass given all the logic that's embedded. However, I know there's at least one other package that's using llvm as a dependency and that's Hylo, using their own base image. Perhaps their solution might be feasible for your project as well?

from packagelist.

mrLSD avatar mrLSD commented on July 18, 2024

Thanks @finestructure for the absolutely awesome project Hylo, that's I want to find a great example of using LLVM in Swift for creating compilers.

Actually Hylo used pkg-config. Previously I also used pkg-config, but it's always an extra step as it need to be generated always with LLVM update. ))

But for me, it is unclear how locally (for testing) to run their image, to invoke: docker run ... swift package dump-package
And also unclear, after changing Package.swift and adding new GH tag - should I add something additional to indicate using theit docker image?

from packagelist.

finestructure avatar finestructure commented on July 18, 2024

The dump-package command is the same for all packages, the one I showed above:

docker run --rm -v $PWD:/host -w /host swiftlang/swift@sha256:30154112a700a5a95fd1760716bd2040e8b735f54f081a4865823abdec67d17e swift package dump-package

Your package needs to succeed with this command in order for us to even add it to the index. Therefore, you should make sure that no OS level dependencies are actually required for running the dump-package command.

The custom image part is only relevant for actual builds once the package has been added to the index. Let's cross that bridge when we get there :)

from packagelist.

mrLSD avatar mrLSD commented on July 18, 2024

I was added new release that passed dump-package for docker run.

Some funny fact:

swift build  -Xswiftc "-DCLI_BUILD"

Package.swift can't recognize CLI_BUILD flag. ))

from packagelist.

mrLSD avatar mrLSD commented on July 18, 2024

@daveverwer it's possible to do in the same way like: Hylo, using their own base image.

I added support for pkg-config.

from packagelist.

daveverwer avatar daveverwer commented on July 18, 2024

@daveverwer it's possible to do in the same way like: Hylo, using their own base image.

I added support for pkg-config.

That will get Linux builds running, but no Apple platform builds. I'm writing more in the issue.

from packagelist.

daveverwer avatar daveverwer commented on July 18, 2024

Tracked in SwiftPackageIndex/SwiftPackageIndex-Server#3227

from packagelist.

Related Issues (20)

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.