Commit Graph

414 Commits

Author SHA1 Message Date
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
Max Desiatov cd7377fb49
Clarify `--environment` option for `carton test` in `README.md` (#333)
Resolves https://github.com/swiftwasm/carton/issues/322.
2022-05-11 14:40:15 +00:00
Max Desiatov fd11ff0140
Add `carton`/SwiftWasm/JSKit compat matrix to `README.md` (#332)
This should make it easier for people to use older versions if they'd like to.
2022-05-11 15:36:47 +01: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
Jed Fox 8790e10161
Update to v2 of Contributor Covenant in shared GitHub repo (#329) 2022-05-10 18:10:54 +00: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
Max Desiatov 0f3f39ebe3
Update SwiftPM dependencies (#324) 2022-05-01 11:22:03 +01:00
Max Desiatov 0b44e11222 Update entrypoint hashes and `static.zip` URL 2022-04-30 11:43:48 +01:00
Max Desiatov d7c4ebe693 Bump version to 0.14.2, update `CHANGELOG.md` 2022-04-30 11:17:53 +01:00
Francisco Javier Trujillo Mata 04cce448a3
Override clock_res_get function from wasi to fix memory issue (#323)
Applies the same patch that was done in the WasmTransformer repo. https://github.com/swiftwasm/WasmTransformer/blob/main/Fixtures/index.js#L4-L27
Closes #321.
2022-04-27 13:00:19 +01:00
Max Desiatov 5c4c1d8120
Update SwiftPM dependencies (#320) 2022-04-24 11:00:44 +03:00
Max Desiatov fc408b1832
Update SwiftPM dependencies (#319) 2022-04-17 11:38:21 +01:00
Max Desiatov b375fcd2d5
Remove broken job from `release.yml` 2022-04-12 13:11:32 +01:00
Max Desiatov 8a73ca9a87
Bump version to 0.14.1 and update `CHANGELOG.md` (#316) 2022-04-12 12:57:14 +01:00
Yuta Saito 1f2aeffcc8
Enable reactor model only when not building as a command (#314) 2022-04-11 10:20:21 +01:00
Max Desiatov 45ba9f6d3c
Update `ENV CARTON_DEFAULT_TOOLCHAIN` in `Dockerfile` 2022-04-10 16:40:08 +01:00
Max Desiatov 228044faf9
Use `5.6-focal` base image in `Dockerfile` 2022-04-10 15:13:47 +01:00
Max Desiatov d15c50738b
Fix typo, expand `CHANGELOG.md` 2022-04-10 13:03:59 +01:00
Max Desiatov 2fad66cba2
Update SwiftPM dependencies (#312) 2022-04-10 11:59:23 +01:00
Max Desiatov a03da05ee2
Bump version to 0.14.0, update `CHANGELOG.md` (#311) 2022-04-10 13:39:29 +09:00
Yuta Saito 9c4021d262
Several fixes for 5.6 toolchain (#310)
- Reactor model support
- Update sanitizer support object

This is required to resolve https://github.com/TokamakUI/Tokamak/pull/475
2022-04-09 13:37:34 +00:00
Max Desiatov 5e90f5d712
Clean up `commit-message` in `update-deps.yml` 2022-04-03 18:34:27 +01:00
Max Desiatov c2c4602ef8
Update SwiftPM dependencies (#309)
Co-authored-by: MaxDesiatov <MaxDesiatov@users.noreply.github.com>
2022-04-03 18:33:51 +01:00
Max Desiatov ee7b169df9
Describe `--debug-info` and `-Xswiftc` in `README.md` (#308)
New CLI options added in 0.13.0 weren't described in `README.md`, let's fix that.
2022-04-02 18:28:53 +01:00
Yuta Saito 40bd176799
Fix hunged watcher (#307)
Actor isolated methods must not block the current thread, so Vapor
server's start method is not compatible in Concurrency context.
2022-04-02 20:25:25 +09:00
Max Desiatov 409c78dd14
Bump version to 0.13.0, update `CHANGELOG.md` (#305)
Ideally we'd like to include new JSKit and SwiftWasm releases, but I think it makes more sense to wait for new JSKit release a bit more and to test things more thoroughly. Also, the watcher bug is still not fixed.

On the other hand, `--debug-info` has been highly requested by our users, so nothing prevents us from releasing 0.13.0 right now, and 0.14.0 with new JSKit/Tokamak and SwiftWasm 5.6 later.
2022-04-01 10:49:05 +01:00
Max Desiatov a15023d881
Bump JavaScriptKit dependency to 0.13.0 (#306) 2022-04-01 08:53:53 +01:00
Yuta Saito 32474ae19f
Don't strip custom sections when --debug-info (#304)
Since https://github.com/swiftwasm/carton/pull/301, carton started passing `--debuginfo` to wasm-opt, but it still strips all custom sections before it.
2022-03-31 17:10:52 +01:00
Max Desiatov 2079bc5c02
Clarify automated PR name for dependency updates 2022-03-31 11:32:37 +01:00
Max Desiatov f0f133095e
Update dependencies (#298)
- Dependency updates

Auto-generated by [create-pull-request][1]

[1]: https://github.com/peter-evans/create-pull-request
2022-03-31 11:32:00 +01:00
Max Desiatov 35043d7053
Add macOS 12 and Xcode 13.3 to CI matrix (#303)
There are issues with binding 0.0.0.0 address on macOS 12, I'm dropping the corresponding argument from tests in f24d39e8f8. Also seeing issues with Ubuntu 18.04, even though all tests seem to be passing. Dropping it as an old version from CI as well.
2022-03-31 10:48:53 +01:00
Yuta Saito 70081be442
Add --debug-info flag to carton bundle (#301) 2022-03-30 19:31:57 +09:00
yonihemi b89d7c79dd
Use libSwiftPM 5.6 to parse manifests (#302)
* Upgrade SwiftPM to 5.6. Use libSwiftPM to parse manifests.

* Use SwiftWasm's swiftc
2022-03-28 18:13:23 +08:00
Yuta Saito 4ca0cdf939
Add -Xswiftc option for each build commands (#300) 2022-03-20 12:14:35 +09:00
Max Desiatov 02e64225f8
Update dependencies (#297) 2022-02-27 10:13:37 +00:00
yonihemi f5b8e63abe
Fix crash for packages with `executableTarget` (#296)
* Infer executable targets' source folder

* Don't initialize FSWatch without watchable paths

* Update Sources/CartonKit/Server/Server.swift

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

* Update Sources/CartonKit/Server/Server.swift

Co-authored-by: Max Desiatov <max@desiatov.com>
2022-02-21 10:18:03 +00:00
yonihemi 7bd54d6c0c
Bump JavaScriptKit and Tokamak (#294) 2022-02-16 11:02:53 +00:00
Max Desiatov 09f967a68e
Update dependencies (#293)
Co-authored-by: MaxDesiatov <MaxDesiatov@users.noreply.github.com>
2022-02-13 19:49:32 +08:00
Max Desiatov fb95831a76
Update dependencies (#289) 2022-01-30 09:05:34 +00:00
Joe Cardenas 27e5e3eb08
Add libsqlite3-dev dependency (#288)
Fixes #287.

Not installed by default on all Ubuntu-based distributions.
2022-01-23 19:43:54 +00:00
Francisco Javier Trujillo Mata 4834b7afc4
Upgrade binaryen version to 105 (#286)
Also creating a variable for making upgrades easily in the future.

* Upgrade binaryen binary version

* Add trailing newline to `install_ubuntu_deps.sh`

Co-authored-by: Max Desiatov <max@desiatov.com>
2022-01-17 19:12:32 +00:00
Max Desiatov 74a49c1aa8
Use `async`/`await` and actors instead of Combine (#283)
This makes our codebase smaller by ~80 lines and arguably more readable. Also removes OpenCombine dependency.

* Use `async`/`await` and actors instead of Combine

* Remove OpenCombine dependency

* Fix progress animation not updated

* Stop building with Swift 5.4, clean up terminal output

* Update requirements in `README.md`

* Add `description` to `InvalidResponseCode`

* Fix Linux build error

* Rename `main.swift` to `Main.swift`

* Work around IR/TDB warnings

* Pass IR/TDB arguments correctly to `swift build`

* Support `async` process runner in `carton-release`

* Use Xcode 13.2.1 on macOS

* Pass TDB/IR flags to `swift test` as well

* Make `Install` command async

* Add doc comments, handle subsequent rebuilds
2022-01-17 09:04:44 +00:00
Max Desiatov 6c6e78eb0d
Update dependencies (#284)
- Dependency updates

Auto-generated by [create-pull-request][1]

[1]: https://github.com/peter-evans/create-pull-request
2022-01-16 10:15:42 +00:00
yonihemi 81e390e725
Statically link with `SwiftPMDataModel` library (#275)
Resolves #274.

* Statically link with `SwiftPMDataModel`

* Use 5.6 upstream branches in `Package.swift`

* Update Swift Argument Parser to 1.0.2

* Use latest SwiftPM 5.5

* Avoid copying non-existent `.so` in `Dockerfile`

Co-authored-by: Max Desiatov <max@desiatov.com>
2022-01-15 16:01:08 +00:00
Max Desiatov b0d53c286a
Build `main` Docker images on every push to `main` branch (#272)
This makes it possible to test latest `carton` Docker builds from the `main` branch.

* Attempt to push Docker image in `swift.yml`

* Update swift.yml

* Update swift.yml

* Push only a single tag

* Use secrets.PAT for GHCR login

* Move nightly tags to separate `docker.yml` workflow

* Rename `nightly` to `main`
2022-01-05 11:43:15 +00:00