Commit Graph

282 Commits

Author SHA1 Message Date
Max Desiatov 64e9c97ddc
Mark all commands as implemented in `README.md` (#180)
Also update the `carton test` section.
2020-12-04 11:41:20 +00:00
Max Desiatov 646ce1c2e1
Bump versions of libraries in `Template.swift` (#182) 2020-12-04 11:41:01 +00:00
Max Desiatov 09a4e67e9e
Serve main bundle resources from root directory (#176)
This is required to make the `Image` view work as described in https://github.com/TokamakUI/Tokamak/pull/155#issuecomment-723677472.

* Demangle and print Firefox stacktraces in terminal

* Update the entrypoints archive URL, rename file

* Add missing newline to `ProcessRunner.swift`

* Remove redundant `console.log` call from `dev.js`

* Detect destination env from `User-Agent` header

* Silence linter in tests where it can't be avoided

* Add support for basic testing in browsers

* Add a browser message on finish, shut down server

* Serve main bundle resources from root directory

* Fix archive hashes, bump JSKit in TestApp to 0.9.0

* Add comments to clarify behavior

* Fix typo in doc comment in `Package.swift`
2020-12-01 16:20:46 +00:00
Max Desiatov ef402e71e8
Use FileDownloadDelegate from the AHC package (#171)
`FileDownloadDelegate` was introduced in https://github.com/swift-server/async-http-client/pull/275, which almost directly mirrors the implementation in `carton`. Now that it's available in a released version of AHC, let's delete some code here and replace it with the version from that package.
2020-12-01 11:05:15 +00:00
Max Desiatov 1c15282114
Bump JSKit, add support for testing in browsers (#173)
Resolves https://github.com/swiftwasm/carton/issues/42.

Also updates JavaScriptKit dependency to 0.9.0.

* Demangle and print Firefox stacktraces in terminal

* Update the entrypoints archive URL, rename file

* Add missing newline to `ProcessRunner.swift`

* Remove redundant `console.log` call from `dev.js`

* Detect destination env from `User-Agent` header

* Silence linter in tests where it can't be avoided

* Add support for basic testing in browsers

* Add a browser message on finish, shut down server

* Update JavaScriptKit to 0.9.0
2020-12-01 11:04:37 +00:00
Max Desiatov 66770cc009
Update dependencies (#179)
Co-authored-by: MaxDesiatov <MaxDesiatov@users.noreply.github.com>
2020-11-29 00:53:29 +00:00
Max Desiatov 64da926cea
Bump `defaultToolchainVersion` to 5.3.1 (#178)
* Bump defaultToolchainVersion to 5.3.1

* Bump version in Dockerfile
2020-11-28 11:25:17 +00:00
Max Desiatov 377aa7617a
Demangle and print Firefox stack traces in terminal (#162)
This currently supports only Firefox, parsing of stack traces for other browsers will be added in separate PRs.

Resolves a part of #26.

* Demangle and print Firefox stacktraces in terminal

* Update the entrypoints archive URL, rename file

* Add missing newline to `ProcessRunner.swift`

* Remove redundant `console.log` call from `dev.js`

* Detect destination env from `User-Agent` header

* Silence linter in tests where it can't be avoided

* Remove use of grey color in stacktrace output
2020-11-27 11:49:39 +00:00
Max Desiatov e6ec931070
Update dependencies (#172)
Co-authored-by: MaxDesiatov <MaxDesiatov@users.noreply.github.com>
2020-11-22 09:12:45 +00:00
Max Desiatov b56e3058c5
Reduce job frequency in `update-deps.yml` 2020-11-19 15:20:01 +00:00
Max Desiatov fd35bfd5df
Use peter-evans/create-pull-request@v3 in `update-deps.yml` 2020-11-18 13:25:18 +00:00
Max Desiatov bcf30a0a11
Update dependencies (#170)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-11-15 14:10:22 +00:00
Max Desiatov 90d072a889
Update release.yml 2020-11-09 14:36:15 +00:00
Max Desiatov abfaeb9a25
Bump version to 0.8.1, update `CHANGELOG.md` 2020-11-09 13:52:11 +00:00
Yuta Saito c9777ddf66
Add minimum deployment target in template (#165)
* Add minimum deployment target in template

* import TokamakDOM instead of Shim to avoid minimum deployment issue

* Bump initial Tokamak version 0.5.1
2020-11-09 22:36:17 +09:00
Yuta Saito c3bbfb38f3
Remove wabt-strip from log comment (#164) 2020-11-09 22:03:17 +09:00
Max Desiatov 5c6a3d0897
Update `release.yml` to use PAT 2020-11-09 11:24:35 +00:00
Max Desiatov e62b6adcf7
Bump version to 0.8.1, update `CHANGELOG.md` (#163) 2020-11-09 11:01:52 +00:00
Yuta Saito cc398196ff
Update Tokamak version used in init template (#160) 2020-11-09 18:48:21 +09:00
Friendly Helper Robot ff169be4aa
Update dependencies (#159)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-11-08 09:08:08 +00:00
Yuta Saito 8fdad38376
Add image source label (#161) 2020-11-08 18:07:30 +09:00
Max Desiatov 59bc8271d4
Bump version to 0.8.0, update `CHANGELOG.md` (#158)
* Bump version to 0.8.0, update `CHANGELOG.md`

* Fix subsection title formatting in CHANGELOG.md
2020-11-08 09:29:24 +09:00
Yuta Saito d13e7bad2e
Support system installed toolchain (#157)
* Support system installed toolchain

* Fix linux build

* Apply latest swiftformat

* Apply suggestions from code review

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

* Update Sources/SwiftToolchain/ToolchainResolver.swift

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

Co-authored-by: Max Desiatov <max@desiatov.com>
2020-11-07 21:29:00 +09:00
Yuta Saito b9702ea285
Remove wabt dependency (#156)
* Use WasmTransformer.stripCustomSections

* Remove wabt dependency
2020-11-06 23:51:10 +09:00
Yuta Saito 501274a72d
Use ghcr.io/swiftwasm/swift as base image (#154)
* Use ghcr.io/swiftwasm/swift as base image

* Drop swift- prefix for toolchain name

* Update default toolchain version
2020-11-06 22:14:10 +09:00
Max Desiatov ac97210433
Fix handling of test bundles with .wasm extension (#153)
After https://github.com/apple/swift-package-manager/pull/3013 was merged and cherry-picked for our 5.3 snapshots (starting with `wasm-5.3-SNAPSHOT-2020-11-02-a`), `carton test` needs to handle the `.wasm` extension in test products.
2020-11-05 21:34:59 +00:00
Max Desiatov 92d49f92d0
Round testing time to two decimal places (#152)
Currently test report outputs time as something like `0.17200000000000013s, estimated 1s`. This is not very readable, so maybe something like `0.17s` would be better?
2020-11-05 21:34:43 +00:00
Max Desiatov cbc04fb4f0
Build only test product and its deps for testing (#150)
Every Swift package with test targets has an implicit test product with `"\(package.name)PackageTests"` name. `swift build --build-tests` builds all products in a given package including the implicit test product. This doesn't work in situations where some of the products can't be compiled for Wasm, even when they are excluded with `condition: .when(platforms: [.macOS, .linux])` from test dependencies. This prevents tests from being built at all in such packages. OpenCombine is the primary victim of this problem.

Fortunately, the implicit test product can be accessed through the `--product` option passed to `swift build`. When using that option, only the test product and its dependencies are built. Products (and therefore their underlying targets) that aren't needed for tests are excluded from such builds. We should explicitly pass `--product` option to `swift build` instead of `--build-tests` in the `carton test` implementation to resolve the issue.

I've also added a new task to `tasks.json` that I previously used for testing `carton dev -v`.

`Dockerfile` has been updated to use the same toolchain as it does in `DefaultToolchain.swift`.

* Build only test product and its deps for testing

* Reuse product name interpolation

* Update `Dockerfile`
2020-11-02 13:52:33 +00:00
Max Desiatov 8f140d05f3
Apply formatting w/ latest version of SwiftFormat 2020-11-01 17:13:28 +00:00
Friendly Helper Robot a4b7f9f095
Update dependencies (#149)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-11-01 09:03:19 +00:00
Yuta Saito 0ee05ba7a9
Update toolchain and remove extra compiler flags (#147)
* Update toolchain version and remove extra compiler flags

* Ignore .swiftpm
2020-10-31 16:57:52 +09:00
Max Desiatov b1f01a437b
Fix handling of binaries with `.wasm` extension (#148)
Latest toolchains produce binaries with the `.wasm` extension which `carton` can't handle yet.
2020-10-30 16:50:59 +00:00
Carson Katri 1e286b4828
Pretty print `carton test` output (#144) 2020-10-28 11:06:55 -04:00
Yuta Saito 88a8e956f4
Stop using destination.json (#141)
* Remove unnecessary linker flags

* Remove destination json

* Import CoreFoundation explicitly to link it

* Remove Destination.swift model file

* Restore triple option

* Update default toolchain

* Workaround until https://github.com/swiftwasm/swift/pull/2097

* Revert "Workaround until https://github.com/swiftwasm/swift/pull/2097"

This reverts commit 285d2ae7aa.

* Update toolchain version

* Warn use of --destination

* Apply suggestions from code review

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

Co-authored-by: Max Desiatov <max@desiatov.com>
2020-10-28 19:57:28 +09:00
Max Desiatov 2e244f7999
Use Xcode 12.2 on macOS Big Sur (#145)
For some reason GHA Big Sur hosts no longer have Xcode 12.1 installed as evidenced by CI failures in #141 and #144. We can use Xcode 12.2 instead.
2020-10-27 10:36:45 +00:00
Carson Katri 91ea98fa5b
Fix error message output (#142) 2020-10-26 10:52:05 -04:00
Friendly Helper Robot 7c4b19cffb
Update dependencies (#143)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-10-25 19:51:27 +00:00
Yuta Saito f4564c5c42
Update JavaScriptKit version in TestApp (#140)
* Update JavaScriptKit version in TestApp

* Use new APIs
2020-10-24 15:52:02 +09:00
Max Desiatov 762a500640
Update .gitignore and .dockerignore for Homebrew 2020-10-22 19:19:06 +01:00
Max Desiatov 1c946ea2aa
Bump version to 0.7.1, update `CHANGELOG.md` 2020-10-22 17:59:04 +01:00
Max Desiatov ea810786d4
Make `checkAndLog` look in Xcode toolchains path 2020-10-22 17:58:38 +01:00
Max Desiatov 9d8a8a5a43
Add `release.yml` workflow with `brew bottle` 2020-10-22 17:05:28 +01:00
Max Desiatov 2f2b13ec6e
Bump version to 0.7.0, update `CHANGELOG.md` 2020-10-22 16:38:51 +01:00
Max Desiatov 566e3419e2
Bump JavaScriptKit to 0.8, stop checking revision (#139)
Other than a simple bump, we shouldn't check for the revision anymore. Now the recommended way to specify this dependency is only with a semantic version constraint.
2020-10-22 15:49:45 +01:00
Max Desiatov c3d108db10
Avoid repeated `loadingMessage` in `ProcessRunner` (#138)
Without this patch `ProcessRunner` output pollutes non-interactive terminals such as GitHub Actions logs, where `loadingMessage` value is printed multiple times in a row for every compiled file.
2020-10-22 15:49:20 +01:00
Max Desiatov 55013181aa
Add support for signed `.pkg` archives on macOS (#137)
`carton` can't install toolchains from `.pkg` archives at the moment, and the latest toolchain snapshots are distributed exclusively as signed `.pkg` for macOS.

Parts of `ToolchainManagement.swift` related to toolchain installation were moved to `ToolchainInstallation.swift`.

* Add support for signed `.pkg` archives on macOS

* Bump toolchain version to `2020-10-21`
2020-10-22 15:48:56 +01:00
Max Desiatov a889569373
Add Dockerfile, mention the Docker image in `README.md` (#136)
Resolves #119.

* Mention the Docker image in `README.md`

* Update .dockerignore

* Test Docker image building on CI

* Bring back the GitHub token to `swift.yml`
2020-10-22 10:58:16 +01:00
Max Desiatov 017a6323a9
Use sudo for deps script to fix Ubuntu 20.04 build 2020-10-21 14:39:45 +01:00
Max Desiatov 753f06ace8
Use Xcode 12.1 to fix Big Sur builds 2020-10-21 14:30:45 +01:00
Max Desiatov 4635766c61
Fix support for Ubuntu 20.04, use GHA for SwiftLint (#134)
Resolves #114.

As support for SwiftLint in Danger seems a bit buggy (causing duplicate warning comments sometimes), this PR calls SwiftLint through a separate action that displays warnings only in the PR diff and hopefully in better way.

* Add support for Ubuntu 20.04

* Refine formatting

* Move SwiftLint to a separate GitHub Action

* Fix linker warnings

* Remove `danger.yml` and `Dangerfile.swift`

* Remove `--strict` argument from `swiftlint.yml`

* Update README.md
2020-10-21 14:27:50 +01:00