Giter VIP home page Giter VIP logo

Comments (3)

kateinoigakukun avatar kateinoigakukun commented on July 30, 2024

Yes, you can't use a tag to specify a fixed revision due to unsafe flags.
So you need to specify a commit hash to fix revision like here

But in the long run, we need to support these flags safely in SwiftPM.

from javascriptkit.

MaxDesiatov avatar MaxDesiatov commented on July 30, 2024

I think this becomes a higher priority as it prevents any projects that depend on JavaScriptKit from being built for any platform other than WASI. For example, it's currently blocking TokamakUI/Tokamak#276.

The big problem is that it may require changes to the package manifest API, such as new safe linker settings. Any new settings won't be available on non-WASI platforms until the next version of Swift is released. If we add new linker settings, they definitely need to land upstream before the next version is branched off, but I think we also need to find some workaround in the meantime.

from javascriptkit.

MaxDesiatov avatar MaxDesiatov commented on July 30, 2024

Here's a possible solution that I proposed in the #webassembly channel of SwiftPM Slack:

  1. For SwiftWasm 5.3 we could hardcode the flags and apply them in our forked SwiftPM if target/product name is JavaScriptKit. We then remove unsafe flags from Package.swift in JavaScriptKit as our forked SwiftPM would know how to build it anyway. We already have an ugly hardcoded check in our fork to allow unsafe flags in JavaScriptKit anyway. This would be a temporary fix only applicable to 5.3 snapshots.
  2. For future versions of Swift either apple/swift-package-manager#2749 resolves the issue, or we need to submit more PRs upstream that allow specifying export linker flags safely with new linkerSettings cases in Package.swift.

Yuta noted that:

If we have to update linker flag after the 5.3 toolchain will be released, we have to modify the SwiftPM and release a new patched version.

My counterargument is that upstream Swift for Linux has monthly patch releases anyway. So we'd expect 5.3.1 in October/November, 5.3.2 in December etc. I think we'd probably want our SwiftWasm patch releases for 5.3 to follow that schedule too.

Would JavaScriptKit change linker flags more frequently than once a month? If not, that would be an acceptable workaround until the next version of Swift is released. I hope we'll see Swift 5.4 or whatever the next version will be (maybe even Swift 6.0?) early next year. At least that was the upstream schedule recently: at least two minor releases a year, and patch releases every month for Linux (and now for Windows I guess)

So we only need to live with this workaround until early next year if all goes well 🙂

from javascriptkit.

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.