Commit Graph

232 Commits

Author SHA1 Message Date
Yuta Saito bf9fae77e4 Default back to wasm-5.8.0-RELEASE at this moment for docker image
Even with 5.8 being the default, users can still use 5.9 by specifying
the toolchain version in the .swift-version file.
2024-01-09 19:56:18 +09:00
STREGA f1d736efb1 Remove 5.9 code paths 2024-01-09 19:56:18 +09:00
STREGA 644a4c706a Target only 5.9 2024-01-09 19:56:18 +09:00
STREGA ef2d7fcce0 Always use SNAPSHOT 2024-01-09 19:56:18 +09:00
STREGA 811cd59ab5 Update DefaultToolchain.swift 2024-01-09 19:56:18 +09:00
STREGA 01d72e511f Use 5.9 on any macOS with 5.9 2024-01-09 19:56:18 +09:00
STREGA 521512c7be Revert template tools version 2024-01-09 19:56:18 +09:00
STREGA 3857a5e3bf Add reverted code path for pre 5.9 2023-09-30 08:20:16 -04:00
STREGA a3ffd95019 Add reverted code path for pre 5.9 2023-09-30 08:01:23 -04:00
STREGA 38ed54157a Fix NIO eventLoop requirement 2023-09-30 07:01:52 -04:00
STREGA b70d5d356c Add workaround for macOS 14 2023-09-30 07:01:07 -04:00
furby™ 504e2d91e3
Swift 5.9 support (#402) 2023-09-30 06:59:29 -04:00
Yuta Saito d2864bee74 Bump version to 0.19.0, update `CHANGELOG.md` 2023-05-08 12:39:36 +00:00
Yuta Saito a19e1ac541
Update default toolchain version to 5.8 channel snapshot (#398) 2023-05-08 21:00:19 +09:00
Yuta Saito 44b7dbd2ee
Support jammy and amazonlinux2 for toolchain install (#397)
* Support Ubuntu 22.04 for toolchain download

* Support amazonlinux2 for toolchain install
2023-05-05 00:30:34 +09:00
Yuta Saito b79fe9a260
Update SwiftPM branch to 5.8 and fix build errors (#395)
* Update SwiftPM branch to 5.8 and fix build errors

* Make swift-format 5.8 happy :)

* Make swift-format 5.8 happy for Tests

* Fix wrong formatting

* Resolve AbsolutePath(validating:) rename warnings

* Fix wrong formatting

* Resolve remaining deprecation warnings

* Fix Linux build failure
2023-05-04 18:40:16 +09:00
Yuta Saito f2a83a28bb Bump version to 0.18.0, update `CHANGELOG.md` 2023-04-03 12:01:20 +00:00
Yuta Saito 8b73e3d4fc
Strip autolink custom section (#390) 2023-03-31 01:10:19 +09:00
Tatsuyuki Kobayashi 74b8ca6e1d
Fix carton sdk install on linux(aarch64) (#386)
Fix linux aarch64 install path
2022-10-16 13:46:21 +00:00
Tatsuyuki Kobayashi db91a617e9
Allow to save .swift-version even .swift-version is missing (#385)
Allow to save .swift-version even for the first time
2022-10-08 19:38:17 +09:00
Tatsuyuki Kobayashi 94691a349b
Fix SwiftPM dependency warning for template project (#384)
Fix not to use deprecated method
2022-10-03 15:23:26 +09:00
Yuta Saito 3a00a0d79b Bump version to 0.17.0, update `CHANGELOG.md` 2022-09-30 14:17:39 +00:00
Yuta Saito 2fe7118e51
Update default toolchain version to 5.7.1 (#383) 2022-09-29 23:31:48 +08:00
Yuta Saito daf152d93d
Update SwiftPM library version to 5.7 (#381) 2022-09-25 20:52:39 +09:00
noppefoxwolf bdb5d5944a
Use @main attributes (#378) 2022-09-14 19:38:59 +09:00
noppefoxwolf 2f462a4693
Ignore force_try swift-lint rule where in defer. (#379)
Update BrowserTestRunner.swift
2022-09-14 04:01:19 +00:00
Yuta Saito 9c0abbf013 Bump version to 0.16.1, update `CHANGELOG.md` 2022-07-22 14:21:51 +00:00
Yuta Saito 2fa2568a16
Exit non-zero status when test fail on browser (#370)
* Add crash test case

* Exit non-zero status when test fail

also handle JS exception
2022-07-19 01:28:40 +09:00
Yuta Saito 29a9b587b2 Bump version to 0.16.0, update `CHANGELOG.md` 2022-06-15 23:03:41 +09:00
Yuta Saito 646f1aef85
Headless test runner (#362)
* Add WebDriverClient for headless testing

* Launch new session with headless arg by default

* Add --headless option in carton test

* Improve logging message

* Apply formatter for WebDriverClient module

* Support MS Edge

* Add headless testing test

* Explicitly depend on NIOFoundationCompat

* Avoid public actor field as a 5.5 compiler crash workaround

* Add --headless description in README.md

* Update Sources/CartonCLI/Commands/Test.swift

Co-authored-by: Max Desiatov <max@desiatov.com>

* Apply suggestions from code review for wording

Co-authored-by: Max Desiatov <max@desiatov.com>

* Rename failedToFindDriver -> failedToFindWebDriver

* Rephrase diagnostic message

* Omit explicit internal keyword

* Remove unused goto.Response struct

* Add license header to Tests/WebDriverClientTests/WebDriverClientTests.swift

Co-authored-by: Max Desiatov <max@desiatov.com>

Co-authored-by: Max Desiatov <max@desiatov.com>
2022-06-10 16:42:20 +00:00
Geordie J eef2825f78
Add option to disable wasm optimizations (#359)
I am trying to implement an `esbuild` plugin that calls into `carton`. My plan was to call `carton bundle --debug` to get a quick development build and then extract that command's output for use in our esbuild project.

Unfortunately, `carton bundle` still runs `wasm-opt` even on a debug build, which takes 5-10s for our project. The only alternative I can see is `carton dev`, but that runs the dev server / watcher, which we don't want either for a one-off build.

Since changing the behaviour of `carton bundle --debug` to _not_ run `wasm-opt` may cause issues with backwards compatibility, @MaxDesiatov suggested we add a command line option `--wasm-optimizations {size, none}` instead, allowing users to specifically opt out of this behaviour.
2022-06-02 18:40:00 +01:00
Yuta Saito 820c2afab7
Add --bundle-path option to `carton test` (#358)
* Add --skip-build option to carton test to delegate building to users

* Add test case for --skip-build

* Rename --skip-build to --bundle-path to allow specifying binary path

* Update Sources/CartonCLI/Commands/Test.swift

Co-authored-by: Max Desiatov <max@desiatov.com>

* Rename --bundle-path to --prebuilt-test-bundle-path

* Update Sources/CartonCLI/Commands/Test.swift

Co-authored-by: Max Desiatov <max@desiatov.com>

Co-authored-by: Max Desiatov <max@desiatov.com>
2022-05-30 16:04:03 +00:00
Max Desiatov 7ef43954cc
Fix linter error in `Builder.swift` (#356) 2022-05-28 20:27:06 +09:00
Yuta Saito 25da29b475 Bump version to 0.15.3, update `CHANGELOG.md` 2022-05-25 00:17:25 +09:00
Yuta Saito c295a21df0
Stop limiting WS frame size to 16kb for large number of test suites (#353) 2022-05-24 07:30:42 +09:00
Carson Katri 7b4c35fc6a
Use standards mode in default index page (#351) 2022-05-23 16:08:47 +00:00
Max Desiatov 8b44aa18b5 Bump version to 0.15.2, update `CHANGELOG.md` 2022-05-23 16:07:28 +01:00
Max Desiatov 0e2e4cfdd8
Add missing check for Node.js entrypoint (#350)
Because of the lack of this check the entrypoint files weren't unpacked when missing on `carton test --environment node` runs.
2022-05-23 14:50:50 +00:00
Max Desiatov 4314a92adc Bump version to 0.15.1, update `CHANGELOG.md` 2022-05-23 10:47:13 +01:00
Max Desiatov b5680cbfb7
Fix symlinks not fully cleaned up in Node.js tests (#349)
`FileSystem.isDirectory` returns `false` when running it on broken symlinks, which breaks Node.js tests flow. We should be able to clean up all symlinks, even broken ones. Other we can't create new correct symlinks because broken symlinks already exist at those paths.
2022-05-23 10:37:12 +01:00
Max Desiatov 683e3e0759
Bump version to 0.15.0, update `CHANGELOG.md` (#348) 2022-05-20 15:27:53 +01:00
Max Desiatov 53bc06c23d
Fix watcher breakage on failed builds (#347)
After switching to `async`/`await` the value of `isBuildCurrentlyRunning` wasn't correctly reset, which led to issues. By resetting the variable in `defer` we guarantee that it will be reset even when errors are thrown.

Resolves #339.
2022-05-20 13:03:34 +00:00
Max Desiatov c834751074
Re-read custom `index.html` on updates (#342)
We were reading custom `index.html` only once on launch, which meant people had to restart `carton dev` every time they've updated `index.html` during the build process to see changes they've made.
2022-05-20 12:42:23 +00:00
Max Desiatov 1ba7dd5d82
Use JSKit runtime from SwiftPM resources (#335)
* Use JSKit runtime from SwiftPM resources

* Fix Node.js test runner

* Remove unused webpack npm packages

* Update Swift version in `.swiftformat`

* Fix browser and Node.js CJS/ESM handling

* Fix one of the tests, add CI time limit

* Use Tokamak `update-jskit` branch to fix tests

* Use latest Vapor with `.mjs` content-type fix

* Use dynamic import to detect JSKit presence

* Fix missing `runtimeConstructor` reference

* Update `StaticArchive.swift`

* Reduce the diff

* Address PR feedback

* Fix Node.js <-> JSKit integration test

* Update SwiftPM dependencies

* Fix comment typo in `testNode.js`

* Reuse `__stack_sanitizer` across entrypoints
2022-05-20 13:12:45 +01:00
Yuta Saito b9dab08e86
Fix JavaScriptBigIntSupport compatibility issue (#338)
* Refactoring the use of `DestinationEnvironment` and `Environment`

`Environment` shouldn't specify the concrete environment, but the type
of environments enough for build planning.

* Lower i64 imports only for WASI oriented things
2022-05-18 23:18:54 +09:00
Yuta Saito ad9f73ceb1
Embed static.zip in Swift code instead of downloading from remote (#334)
* Embed static.zip in Swift code instead of downloading from remote

* Make base64 decode logic failure

* Add rationale for the use of base64
2022-05-11 15:42:45 +00:00
Antonio Candinho 505a9b81a2
Add support for running tests using NodeJS (#328)
### 🎩 What is the goal?

Implement NodeJS as another test runner. 

### 📄 How is it being implemented?

In this PR, I include the following changes:

 - Create an abstraction for the different Test Runners (Wasmer, browser and now Node)
 - Implement the new Node test runner (quite similar to the Wasmer one)
 - Unify Javascript client code, so we can make sure we apply the same patches and load in the same way all the different targets
 - Create a new entry point for testing with node
 - Add that new entry point to the static bundle
 
### 👀 Any consideration?

The Node test runner does not use the TestsParser as it heavily impacts execution time. I will try to figure out what's going on later.
 
###  How can it be tested?

Testing is automated 🤖 . You can also check this in your own project by running:

```bash
carton test --environment node
```
2022-05-11 13:52:44 +00:00
Max Desiatov 7392e1bb17
Serve all available resources with `dev`/`bundle` (#330)
Resolves https://github.com/swiftwasm/carton/issues/175.

I initially thought we should parse `Package.swift` manifests of the whole dependency tree to collect paths to resources from them, but now I'm not even sure that SwiftPM provides an API for this.

Much simpler solution is to serve with `dev` and copy with `bundle` all directories with `.resources` suffixes in the build directory. I think it's quite impossible to stumble upon unrelated directories with this approach, while it still resolves the issue as intended, in my opinion.
2022-05-11 08:10:07 +01:00
Max Desiatov 8461f26f1b
Fix 5.6 template: use `executableTarget` (#325) 2022-05-03 13:59:47 +01:00
Max Desiatov 6e3dfe62cd
Set `compatibleJSKitVersion` to 0.14.0 2022-05-03 12:25:20 +01:00