-
-
Notifications
You must be signed in to change notification settings - Fork 44
Use JSKit runtime from SwiftPM resources #335
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1d1a106
Use JSKit runtime from SwiftPM resources
MaxDesiatov 5d3e6bc
Fix Node.js test runner
MaxDesiatov 28a68a3
Remove unused webpack npm packages
MaxDesiatov e5f4436
Update Swift version in `.swiftformat`
MaxDesiatov 44b4b1b
Fix browser and Node.js CJS/ESM handling
MaxDesiatov 130ae0d
Fix one of the tests, add CI time limit
MaxDesiatov a47fe43
Use Tokamak `update-jskit` branch to fix tests
MaxDesiatov aab188c
Use latest Vapor with `.mjs` content-type fix
MaxDesiatov 3c07433
Use dynamic import to detect JSKit presence
MaxDesiatov 4ce0a0b
Fix missing `runtimeConstructor` reference
MaxDesiatov fe3bed6
Update `StaticArchive.swift`
MaxDesiatov d3e14b2
Reduce the diff
MaxDesiatov af0acd6
Merge branch 'main' of github.com:swiftwasm/carton into maxd/jskit-sw…
MaxDesiatov 046e7b2
Address PR feedback
MaxDesiatov c115a97
Fix Node.js <-> JSKit integration test
MaxDesiatov 0f28ada
Update SwiftPM dependencies
MaxDesiatov 502f48c
Fix comment typo in `testNode.js`
MaxDesiatov 7d37adf
Reuse `__stack_sanitizer` across entrypoints
MaxDesiatov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ import TSCBasic | |
import TSCUtility | ||
import WasmTransformer | ||
|
||
public let compatibleJSKitVersion = Version(0, 14, 0) | ||
public let compatibleJSKitVersion = Version(0, 15, 0) | ||
|
||
enum ToolchainError: Error, CustomStringConvertible { | ||
case directoryDoesNotExist(AbsolutePath) | ||
|
@@ -86,10 +86,10 @@ extension PackageDependency { | |
default: break | ||
} | ||
if let exactVersion = exactVersion { | ||
return exactVersion == compatibleJSKitVersion | ||
return exactVersion >= compatibleJSKitVersion | ||
} | ||
if let versionRange = versionRange { | ||
return versionRange.upperBound >= compatibleJSKitVersion | ||
return versionRange.lowerBound >= compatibleJSKitVersion | ||
} | ||
return false | ||
} | ||
|
@@ -127,7 +127,8 @@ public final class Toolchain { | |
self.terminal = terminal | ||
if let workingDirectory = fileSystem.currentWorkingDirectory { | ||
let swiftc = swiftPath.parentDirectory.appending(component: "swiftc") | ||
manifest = await Result { try await Manifest.from(path: workingDirectory, swiftc: swiftc, fileSystem: fileSystem, terminal: terminal) | ||
manifest = await Result { | ||
try await Manifest.from(path: workingDirectory, swiftc: swiftc, fileSystem: fileSystem, terminal: terminal) | ||
} | ||
} else { | ||
manifest = .failure(ToolchainError.noWorkingDirectory) | ||
|
@@ -147,7 +148,7 @@ public final class Toolchain { | |
} | ||
|
||
private func inferDevProduct(hint: String?) throws -> ProductDescription? { | ||
let manifest = try self.manifest.get() | ||
let manifest = try manifest.get() | ||
|
||
var candidateProducts = manifest.products | ||
.filter { $0.type == .executable } | ||
|
@@ -201,7 +202,7 @@ public final class Toolchain { | |
} | ||
|
||
public func inferSourcesPaths() throws -> [AbsolutePath] { | ||
let manifest = try self.manifest.get() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change applied by the formatter. |
||
let manifest = try manifest.get() | ||
|
||
let targetPaths = manifest.targets.compactMap { target -> String? in | ||
|
||
|
@@ -224,7 +225,7 @@ public final class Toolchain { | |
} | ||
|
||
private func emitJSKitWarningIfNeeded() throws { | ||
let manifest = try self.manifest.get() | ||
let manifest = try manifest.get() | ||
guard let jsKit = manifest.dependencies.first(where: { | ||
$0.nameForTargetDependencyResolutionOnly == "JavaScriptKit" | ||
}) else { | ||
|
@@ -305,7 +306,7 @@ public final class Toolchain { | |
public func buildTestBundle( | ||
flavor: BuildFlavor | ||
) async throws -> AbsolutePath { | ||
let manifest = try self.manifest.get() | ||
let manifest = try manifest.get() | ||
let binPath = try inferBinPath(isRelease: flavor.isRelease) | ||
let testProductName = "\(manifest.displayName)PackageTests" | ||
let testBundlePath = binPath.appending(component: "\(testProductName).wasm") | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.