diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6dbf836fe..f41c41ca4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -54,12 +54,6 @@ jobs: target: ${{ matrix.platform }}-${{ matrix.arch }} steps: - uses: actions/checkout@v3 - - name: Simulate itarget feature (Darwin) - if: matrix.platform == 'darwin' - run: python3 scripts/itarget.py ${{ matrix.rust-target }} - - name: Simulate itarget feature (Others) - if: matrix.platform != 'darwin' - run: python scripts/itarget.py ${{ matrix.rust-target }} - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 - name: rust toolchain @@ -76,6 +70,9 @@ jobs: run: | sudo apt-get update -y sudo apt-get install gcc-arm-linux-gnueabihf + - name: List Depenedencies + run: | + cargo tree -e features --target ${{ matrix.rust-target }} - name: Run Native Build shell: pwsh run: | @@ -106,16 +103,17 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: target: ${{ matrix.rust-target }} - - name: Simulate itarget feature - run: python scripts/itarget.py ${{ matrix.rust-target }} - name: Build cross image run: | docker build -t typst-ts/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ env: CROSS_DOCKER_IN_DOCKER: true - - name: Run Cross Build + - name: List Depenedencies run: | echo "docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project typst-ts/riscv64:latest cargo" + docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project typst-ts/riscv64:latest cargo tree -e features --target ${CARGO_TARGET} + - name: Run Cross Build + run: | docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project typst-ts/riscv64:latest cargo run --bin typst-ts-fontctl docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project typst-ts/riscv64:latest cargo build -p typst-ts-fontctl --release --target ${CARGO_TARGET} docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project typst-ts/riscv64:latest cargo build --manifest-path cli/Cargo.toml --release --target ${CARGO_TARGET} --bin typst-ts-cli @@ -143,16 +141,17 @@ jobs: RUSTFLAGS: '-C link-arg=-fuse-ld=lld -C target-feature=-crt-static' steps: - name: Install dependencies - run: apk add --no-cache git clang lld musl-dev npm python3 + run: apk add --no-cache git clang lld musl-dev npm - name: Checkout repository uses: actions/checkout@v3 - - name: Simulate itarget feature - run: python3 scripts/itarget.py alpine-x64 - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 - name: Configure git run: | git config --global --add safe.directory $PWD + - name: List Depenedencies + run: | + cargo tree -e features --target $RUST_TARGET - name: build binaries run: | cargo run --release --bin typst-ts-fontctl diff --git a/Cargo.lock b/Cargo.lock index 86164ea5a..df7c19cd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1345,10 +1345,11 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", "rustls", @@ -2753,11 +2754,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] @@ -4565,21 +4566,6 @@ dependencies = [ "windows-targets 0.48.1", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" diff --git a/Cargo.toml b/Cargo.toml index 2d9145b84..b49ee7dca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ homepage = "https://myriad-dreamin.github.io/typst.ts/" repository = "https://github.com/Myriad-Dreamin/typst.ts" [workspace] +resolver = "2" members = [ "cli", "core", diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index f2543623f..fc8338ab6 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -61,29 +61,20 @@ typst-ts-svg-exporter = { workspace = true, optional = true, features = [ typst-ts-core.workspace = true -# begin itarget-region -[target.'cfg(not(any(target_arch = "riscv64", target_arch = "wasm32", target = "aarch64-pc-windows-msvc")))'.dependencies] +[target.'cfg(not(any(target_arch = "riscv64", target_arch = "wasm32", all(target_os = "windows", target_arch = "aarch64"))))'.dependencies] reqwest = { version = "^0.11", default-features = false, features = [ "rustls-tls", "blocking", "multipart", ] } -[target.'cfg(target_arch = "riscv64")'.dependencies] +[target.'cfg(any(target_arch = "riscv64", all(target_os = "windows", target_arch = "aarch64")))'.dependencies] reqwest = { version = "^0.11", default-features = false, features = [ "native-tls", "blocking", "multipart", ] } -[target.aarch64-pc-windows-msvc.dependencies] -reqwest = { version = "^0.11", default-features = false, features = [ - "native-tls", - "blocking", - "multipart", -] } -# end itarget-region - [dev-dependencies] serde.workspace = true diff --git a/packages/renderer/Cargo.toml b/packages/renderer/Cargo.toml index 39496335d..8d92df221 100644 --- a/packages/renderer/Cargo.toml +++ b/packages/renderer/Cargo.toml @@ -38,6 +38,7 @@ web-sys = { workspace = true, features = [ "Window", "Blob", "ImageData", + "HtmlDivElement", ] } typst-ts-core.workspace = true diff --git a/scripts/itarget.py b/scripts/itarget.py deleted file mode 100644 index 3f314d26d..000000000 --- a/scripts/itarget.py +++ /dev/null @@ -1,33 +0,0 @@ -# `-Zfeatures=itarget` requires nightly rust, so we use this script -# to modify Cargo.toml. -# The script makes sure that the reqwest dependency is compiled -# with the correct TLS backend, so we does not have to use -# `-Zfeatures=itarget` (stable rust). - -import re -import sys - -def reqwest_template(use_tls): - return f"""reqwest = {{ version = "^0.11", default-features = false, features = [ - "{use_tls}", - "blocking", - "multipart", - ] }}""" - -def main(): - with open('compiler/Cargo.toml', 'r') as f: - content = f.read() - - if sys.argv[1] == 'aarch64-pc-windows-msvc' or sys.argv[1] == 'riscv64gc-unknown-linux-gnu': - tmpl = reqwest_template('native-tls') - else: - tmpl = reqwest_template('rustls-tls') - - content = re.sub(r'# begin itarget-region.*?# end itarget-region', tmpl, content, flags=re.DOTALL) - print(content) - - with open('compiler/Cargo.toml', 'w') as f: - f.write(content) - -if __name__ == '__main__': - main()