Comments (3)
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.
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.
Here's a possible solution that I proposed in the #webassembly
channel of SwiftPM Slack:
- 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. - 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 inPackage.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)
- Calling `sleep()` causes `TypeError: can't convert null to BigInt`
- Enchancement: Add a link to the docs HOT 4
- Export function returning a JSValue HOT 2
- Arguments in JSClosure HOT 4
- JSPromise(resolver:) usage HOT 3
- Asynchronous calls in JSClosure HOT 5
- Making JSObject hashable HOT 5
- Compile error on macOS 12.2.1 HOT 6
- UserAgent support? HOT 1
- WebSockets implementation HOT 2
- Generate JavaScriptKit `.js` runtime with SwiftPM build tool HOT 6
- `JSNumber` type to support `long long` type in Web API IDL
- PUT request using Fetch HOT 2
- Occasional JSClosure has been already released by Swift side HOT 4
- Compiled module was created by a different version of the compiler; rebuild 'JavaScriptKit' and try again HOT 2
- Cannot perform DataView.prototype.setBigUint64 on a detached ArrayBuffer HOT 2
- JSClosure will be overriden from other closure HOT 1
- Are JSValue bitmasks possible? HOT 2
- `JSClosure.async` doesn't work at all
- Init `JSUInt8ClampedArray` from `[UInt8]` failed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javascriptkit.