* 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>
* 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
* 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
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
`async-http-client` package is now pinned to 1.6.4, as 1.7.0 and later versions caused issues with toolchain downloads (see https://github.com/swift-server/async-http-client/issues/488 for more details).
I've also updated toolchain downloader code to bubble up download errors, which previously were hidden and made it very hard to diagnose these issues.
* Use SwiftWasm 5.5.0, bump version to 0.12.0
* Pin AHC to 1.8.0
* Pin AHC to 1.6.4, always remove downloaded archives
* Fix `defer` build issue
I've dropped support for Swift 5.2, and SwiftLint now requires Xcode 12.5.1, which is unavailable on macOS 10.15 with GitHub Actions. This makes it impossible to test with Swift 5.3 on CI, so I'm bumping the required version to Swift 5.4.
Resolves https://github.com/swiftwasm/carton/issues/262.
* Update dependencies, add support for SwiftWasm 5.5
* Bump dependencies in `.github/workflows/swift.yml`
* Add explicit dependency on `NIOFoundationCompat`
* Lower Splash version to 0.15 for Swift 5.3 compat
* Update DefaultToolchain.swift
* Update swift.yml
* Revert "Lower Splash version to 0.15 for Swift 5.3 compat"
This reverts commit 6e04a7f158.
* Require Swift 5.4 in `Package.swift`
* Update README.md
* Use older 5.5 snapshot, unblock tests on failure
* Update DefaultToolchain.swift
* Select correct CPU architecture when downloading
* Disable hanging test
* Use latest 5.5 toolchain
* Use 2021-11-16 snapshot of SwiftWasm 5.5
* Add missing linker flags, re-enable browser test
* Address PR feedback
Previously, the file we need to include with the build to enable the stack overflow sanitizer was written as a temporary file. This didn't happen though on watcher rebuilds with `carton dev` and caused crashes when a code line containing `try!` relying on this file to be present was executed.
I think it's easier and more efficient to bundle this file in the `static.zip` file that already includes our JS entrypoints. We require `static.zip` to be downloaded and unpacked successfully into `~/.carton/static` before every build anyway. It makes more sense to sense the sanitizer file in `~/.carton/static/so_sanitizer.wasm` and use that instead writing and deleting it at a temporary path on every build.
I've also updated the JSKit dependency and cleaned up some linter warnings by moving large tuple values into a separate `BuildDescription` type.
* Added tests for version and local
* Debugging versions tests on ci
* Added brew install for swiftenv
* Changed fetchAllSwiftVersions to return empty array if .swiftenv/versions doesnt exist
* Remove commented out code. Removed debug flag for versions test
* Removed swiftenv from Brewfile
Co-authored-by: thecb4 <cavelle@tehcb4.io>
* Use libSwiftPM instead of custom model types #120
* Update SwiftPM dependencies
* Add wrapper to handle discrepancy between encoded and decoded Manifest
* Try to fix 5.2 dependency resolving
* Try to fix 5.2 dependency resolving
Co-authored-by: Max Desiatov <max@desiatov.com>
* Added Dev tests and fixed hard coded paths, fixes#183
* Fixed Path dependency in 5.2 Package
* Removed mxcl/Path dependency
* Removed mxcl/Path dependency, Added confirmation of file existence in Init test
* Added sdk install head of init command test
* Moved carton sdk install to static setup method for tests
* Moved carton sdk install to static setup method for tests
* Moved carton sdk install to static setup method for tests
* Moved carton sdk install to static setup method for tests
* Moved carton sdk install to static setup method for tests
* changed order of actions for github automations to support testing
* modified test run to exclude release
* changed sdk install to run per test
* adjusted github workflows to create carton sdk folders
* adjusted github workflows to use /home/runner instead of root
* adjusted test to wait for sdk installation
* adjusted ubuntu tests for passing
* adjusted Dockerfile to run tests
* added tmate session for debugging
* Removed tmate session, added directory creation for carton sdk and sym link
* Adjusted order of commands for runner
* Fixed mkdir from worker to runner
* Added more terminal output for debugging
* Added more terminal output for debugging
* Added more terminal output for debugging
* Added more terminal output for debugging
* Added more terminal output for debugging
* Fixed hard coded paths
* Removed test investigation fixtures
* Removed test investigation fixtures
Co-authored-by: thecb4 <cavelle@tehcb4.io>
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`
`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.
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
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
* 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>
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.
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`
* 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>
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.
`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`
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
In the latest 5.3 toolchain all known issues with IndexStoreDB and SwiftPM support were resolved.
Resolves the second point of #42.
Thanks to this you no longer need to maintain `LinuxMain.swift` and `XCTestManifests.swift` files in your test suites, so these are deleted from the test app `Tests` directory.
`TestApp/.swift-version` is removed as it was mostly duplicating the default toolchain version. Downloads of recent toolchains is fixed now with the new `macos` tarball suffix that replaces `osx`. `TestApp/main.swift` is updated to make #127 easily reproducible.