{"id":15994667,"url":"https://github.com/taiki-e/setup-cross-toolchain-action","last_synced_at":"2025-04-06T05:16:41.129Z","repository":{"id":43687230,"uuid":"461571383","full_name":"taiki-e/setup-cross-toolchain-action","owner":"taiki-e","description":"GitHub Action for setup toolchains for cross compilation and cross testing for Rust.","archived":false,"fork":false,"pushed_at":"2025-03-20T18:34:40.000Z","size":281,"stargazers_count":41,"open_issues_count":8,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T03:11:04.422Z","etag":null,"topics":["github-actions","rust"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taiki-e.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"taiki-e"}},"created_at":"2022-02-20T18:01:46.000Z","updated_at":"2025-03-20T18:34:44.000Z","dependencies_parsed_at":"2023-09-23T14:23:20.623Z","dependency_job_id":"2dca89bb-4307-4fb3-ac69-c71628948db4","html_url":"https://github.com/taiki-e/setup-cross-toolchain-action","commit_stats":{"total_commits":87,"total_committers":1,"mean_commits":87.0,"dds":0.0,"last_synced_commit":"093e4e825b850e3675eda6166cf41b16b2b0cac9"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fsetup-cross-toolchain-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fsetup-cross-toolchain-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fsetup-cross-toolchain-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fsetup-cross-toolchain-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taiki-e","download_url":"https://codeload.github.com/taiki-e/setup-cross-toolchain-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247436286,"owners_count":20938533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","rust"],"created_at":"2024-10-08T07:09:44.667Z","updated_at":"2025-04-06T05:16:41.048Z","avatar_url":"https://github.com/taiki-e.png","language":"Shell","funding_links":["https://github.com/sponsors/taiki-e"],"categories":[],"sub_categories":[],"readme":"# setup-cross-toolchain-action\n\n[![release](https://img.shields.io/github/release/taiki-e/setup-cross-toolchain-action?style=flat-square\u0026logo=github)](https://github.com/taiki-e/setup-cross-toolchain-action/releases/latest)\n[![github actions](https://img.shields.io/github/actions/workflow/status/taiki-e/setup-cross-toolchain-action/ci.yml?branch=main\u0026style=flat-square\u0026logo=github)](https://github.com/taiki-e/setup-cross-toolchain-action/actions)\n\nGitHub Action for setup toolchains for cross compilation and cross testing for Rust.\n\n- [Usage](#usage)\n  - [Inputs](#inputs)\n  - [Example workflow: Basic usage](#example-workflow-basic-usage)\n  - [Example workflow: Multiple targets](#example-workflow-multiple-targets)\n  - [Example workflow: Doctest](#example-workflow-doctest)\n  - [Example workflow: Tier 3 targets](#example-workflow-tier-3-targets)\n- [Platform Support](#platform-support)\n  - [Linux (GNU)](#linux-gnu)\n  - [Linux (musl)](#linux-musl)\n  - [Linux (uClibc)](#linux-uclibc)\n  - [Android](#android)\n  - [FreeBSD](#freebsd)\n  - [NetBSD](#netbsd)\n  - [illumos](#illumos)\n  - [WASI](#wasi)\n  - [Windows (MinGW)](#windows-mingw)\n  - [Windows (LLVM MinGW)](#windows-llvm-mingw)\n  - [Windows (MSVC)](#windows-msvc)\n  - [macOS](#macos)\n  - [Mac Catalyst](#mac-catalyst)\n- [Compatibility](#compatibility)\n- [Related Projects](#related-projects)\n- [License](#license)\n\n## Usage\n\n### Inputs\n\n| Name     | Required | Description   | Type   | Default        |\n| -------- |:--------:| ------------- | ------ | -------------- |\n| target   | **✓**    | Target triple | String |                |\n| runner   |          | Test runner   | String |                |\n\n### Example workflow: Basic usage\n\n```yaml\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Install Rust\n        run: rustup update stable\n      - name: Install cross-compilation tools\n        uses: taiki-e/setup-cross-toolchain-action@v1\n        with:\n          target: aarch64-unknown-linux-gnu\n      # setup-cross-toolchain-action sets the `CARGO_BUILD_TARGET` environment variable,\n      # so there is no need for an explicit `--target` flag.\n      - run: cargo test --verbose\n      # `cargo run` also works.\n      - run: cargo run --verbose\n      # You can also run the cross-compiled binaries directly (via binfmt).\n      - run: ./target/aarch64-unknown-linux-gnu/debug/my-app\n```\n\n### Example workflow: Multiple targets\n\n```yaml\njobs:\n  test:\n    strategy:\n      matrix:\n        target:\n          - aarch64-unknown-linux-gnu\n          - riscv64gc-unknown-linux-gnu\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Install Rust\n        run: rustup update stable\n      - name: Install cross-compilation tools\n        uses: taiki-e/setup-cross-toolchain-action@v1\n        with:\n          target: ${{ matrix.target }}\n      - run: cargo test --verbose\n```\n\n### Example workflow: Doctest\n\n```yaml\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Install Rust\n        run: rustup update nightly \u0026\u0026 rustup default nightly\n      - name: Install cross-compilation tools\n        uses: taiki-e/setup-cross-toolchain-action@v1\n        with:\n          target: aarch64-unknown-linux-gnu\n      - run: cargo test --verbose -Z doctest-xcompile\n```\n\nCross-testing of doctest is currently available only on nightly.\nIf you want to use stable and nightly in the same matrix, you can use the `DOCTEST_XCOMPILE` environment variable set by this action to enable doctest only in nightly.\n\n```yaml\njobs:\n  test:\n    strategy:\n      matrix:\n        rust:\n          - stable\n          - nightly\n        target:\n          - aarch64-unknown-linux-gnu\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Install Rust\n        run: rustup update ${{ matrix.rust }} \u0026\u0026 rustup default ${{ matrix.rust }}\n      - name: Install cross-compilation tools\n        uses: taiki-e/setup-cross-toolchain-action@v1\n        with:\n          target: ${{ matrix.target }}\n      # On nightly and `-Z doctest-xcompile` is available,\n      # `$DOCTEST_XCOMPILE` is `-Zdoctest-xcompile`.\n      #\n      # On stable, `$DOCTEST_XCOMPILE` is not set.\n      # Once `-Z doctest-xcompile` is stabilized, the corresponding flag\n      # will be set to `$DOCTEST_XCOMPILE` (if it is available).\n      - run: cargo test --verbose $DOCTEST_XCOMPILE\n```\n\n### Example workflow: Tier 3 targets\n\n```yaml\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Install Rust\n        run: rustup update nightly \u0026\u0026 rustup default nightly\n      - name: Install cross-compilation tools\n        uses: taiki-e/setup-cross-toolchain-action@v1\n        with:\n          target: aarch64_be-unknown-linux-gnu\n      - run: cargo test --verbose -Z build-std\n```\n\nCross-compilation of tier 3 targets currently requires nightly to build std.\nIf you want to use tier 1/2 and tier 3 in the same matrix, you can use the `BUILD_STD` environment variable set by this action to use `-Z build-std` only for tier 3 targets.\n\n```yaml\njobs:\n  test:\n    strategy:\n      matrix:\n        target:\n          - aarch64-unknown-linux-gnu\n          - aarch64_be-unknown-linux-gnu\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Install Rust\n        run: rustup update nightly \u0026\u0026 rustup default nightly\n      - name: Install cross-compilation tools\n        uses: taiki-e/setup-cross-toolchain-action@v1\n        with:\n          target: ${{ matrix.target }}\n      # If target is tier 3, `$BUILD_STD` is `-Zbuild-std`.\n      # Otherwise, `$BUILD_STD` is not set.\n      #\n      # Once `Z build-std` is stabilized, the corresponding flag\n      # will be set to `$BUILD_STD` (if it is available).\n      - run: cargo test --verbose $BUILD_STD\n```\n\n## Platform Support\n\n### Linux (GNU)\n\n| C++ | test |\n| --- | ---- |\n| ✓ (libstdc++) [1] | ✓    |\n\n[1] Except for loongarch64-unknown-linux-gnu\n\n**Supported targets:**\n\n| target | host | runner | note |\n| ------ | ---- | ------ | ---- |\n| `aarch64-unknown-linux-gnu`            | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | native (default, aarch64 host only), qemu-user |       |\n| `aarch64_be-unknown-linux-gnu`         | Ubuntu (18.04,        22.04),        Debian (10, 11, 12) [2] | qemu-user | tier3 |\n| `arm-unknown-linux-gnueabi`            | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user |       |\n| `armeb-unknown-linux-gnueabi`          | Ubuntu (18.04,        22.04),        Debian (10, 11, 12) [3] | qemu-user | tier3 |\n| `armv5te-unknown-linux-gnueabi`        | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user |       |\n| `armv7-unknown-linux-gnueabi`          | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user |       |\n| `armv7-unknown-linux-gnueabihf`        | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | native (default, aarch64 host only), qemu-user |       |\n| `i586-unknown-linux-gnu`               | Ubuntu (18.04, 20.04, 22.04, 24.04) [1]                      | native (x86_64 host only), qemu-user (default) | [7]   |\n| `i686-unknown-linux-gnu`               | Ubuntu (18.04, 20.04, 22.04, 24.04) [1]                      | native (default, x86_64 host only), qemu-user  | [7]   |\n| `loongarch64-unknown-linux-gnu`        | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [4] | qemu-user | experimental |\n| `mips-unknown-linux-gnu`               | Ubuntu (18.04,        22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user | tier3 [6] |\n| `mips64-unknown-linux-gnuabi64`        | Ubuntu (18.04,        22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user | tier3 |\n| `mips64el-unknown-linux-gnuabi64`      | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user | tier3 |\n| `mipsel-unknown-linux-gnu`             | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user | tier3 [6] |\n| `mipsisa32r6-unknown-linux-gnu`        | Ubuntu               (22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user | tier3 |\n| `mipsisa32r6el-unknown-linux-gnu`      | Ubuntu        (20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user | tier3 |\n| `mipsisa64r6-unknown-linux-gnuabi64`   | Ubuntu               (22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user | tier3 |\n| `mipsisa64r6el-unknown-linux-gnuabi64` | Ubuntu        (20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user | tier3 |\n| `powerpc-unknown-linux-gnu`            | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user |       |\n| `powerpc64-unknown-linux-gnu`          | Ubuntu (18.04,        22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user |       |\n| `powerpc64le-unknown-linux-gnu`        | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user |       |\n| `riscv32gc-unknown-linux-gnu`          | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [5] | qemu-user |       |\n| `riscv64gc-unknown-linux-gnu`          | ubuntu (18.04,        22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user |       |\n| `s390x-unknown-linux-gnu`              | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user |       |\n| `sparc-unknown-linux-gnu`              | Ubuntu (18.04,        22.04, 24.04), Debian (10,     12) [1] | qemu-user | tier3, experimental |\n| `sparc64-unknown-linux-gnu`            | Ubuntu (18.04,        22.04, 24.04), Debian (10, 11, 12) [1] | qemu-user |       |\n| `thumbv7neon-unknown-linux-gnueabihf`  | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | native (default, aarch64 host only), qemu-user |       |\n| `x86_64-unknown-linux-gnu`             | Ubuntu (18.04, 20.04, 22.04, 24.04), Debian (10, 11, 12) [1] | native (default, x86_64 host only), qemu-user  |       |\n\n[1] GCC 7, glibc 2.27 for Ubuntu 18.04. [GCC 9](https://packages.ubuntu.com/en/focal/gcc), [glibc 2.31](https://packages.ubuntu.com/en/focal/libc6-dev) for Ubuntu 20.04. [GCC 11](https://packages.ubuntu.com/en/jammy/gcc), [glibc 2.35](https://packages.ubuntu.com/en/jammy/libc6-dev) for Ubuntu 22.04. [GCC 13](https://packages.ubuntu.com/en/noble/gcc), [glibc 2.39](https://packages.ubuntu.com/en/noble/libc6-dev) for Ubuntu 24.04. [GCC 8](https://packages.debian.org/en/buster/gcc), [glibc 2.28](https://packages.debian.org/en/buster/libc6-dev) for Debian 10. [GCC 10](https://packages.debian.org/en/bullseye/gcc), [glibc 2.31](https://packages.debian.org/en/bullseye/libc6-dev) for Debian 11. [GCC 12](https://packages.debian.org/en/bookworm/gcc), [glibc 2.36](https://packages.debian.org/en/bookworm/libc6-dev) for Debian 12.\u003cbr\u003e\n[2] GCC 10, glibc 2.31\u003cbr\u003e\n[3] GCC 7, glibc 2.25\u003cbr\u003e\n[4] GCC 14, glibc 2.40\u003cbr\u003e\n[5] GCC 11, glibc 2.33\u003cbr\u003e\n[6] [Since nightly-2023-07-05](https://github.com/rust-lang/compiler-team/issues/648), mips{,el}-unknown-linux-gnu requires release mode for building std.\u003cbr\u003e\n[7] Not fully supported with containers.\u003cbr\u003e\n\n\u003c!-- omit in toc --\u003e\n#### \u003ca name=\"qemu-user-runner\"\u003e\u003c/a\u003eqemu-user runner\n\nThe current default QEMU version is 9.2.\n\nYou can select/pin the version by using `qemu` input option, or `@` syntax in `runner` input option (if both are set, the latter is preferred). For example:\n\n```yaml\n- uses: taiki-e/setup-cross-toolchain-action@v1\n  with:\n    target: aarch64-unknown-linux-gnu\n    qemu: '7.2'\n```\n\n```yaml\n- uses: taiki-e/setup-cross-toolchain-action@v1\n  with:\n    target: aarch64-unknown-linux-gnu\n    runner: qemu@8.1\n```\n\n### Linux (musl)\n\n| libc | GCC | C++ | test |\n| ---- | --- | --- | ---- |\n| musl 1.2.3 / 1.1.24 [1] | 9 | ? (libstdc++) | ✓ |\n\n[1] [1.2 on Rust 1.71+](https://github.com/rust-lang/rust/pull/107129), otherwise 1.1. 1.1 toolchain is with a patch that fixes CVE-2020-28928.\u003cbr\u003e\n\n**Supported targets:**\n\n| target | host | runner | note |\n| ------ | ---- | ------ | ---- |\n| `aarch64-unknown-linux-musl`       | x86_64/aarch64 Linux | native (default, aarch64 host only), qemu-user |       |\n| `arm-unknown-linux-musleabi`       | x86_64 Linux | qemu-user |       |\n| `arm-unknown-linux-musleabihf`     | x86_64 Linux | qemu-user |       |\n| `armv5te-unknown-linux-musleabi`   | x86_64 Linux | qemu-user |       |\n| `armv7-unknown-linux-musleabi`     | x86_64 Linux | qemu-user |       |\n| `armv7-unknown-linux-musleabihf`   | x86_64/aarch64 Linux | native (default, aarch64 host only), qemu-user |       |\n| `i586-unknown-linux-musl`          | x86_64 Linux | native (x86_64 host only), qemu-user (default) |       |\n| `i686-unknown-linux-musl`          | x86_64 Linux | native (default, x86_64 host only), qemu-user  |       |\n| `powerpc64le-unknown-linux-musl`   | x86_64 Linux | qemu-user |       |\n| `riscv64gc-unknown-linux-musl`     | x86_64 Linux | qemu-user |       |\n| `x86_64-unknown-linux-musl`        | x86_64 Linux | native (default, x86_64 host only), qemu-user |       |\n\n(Other linux-musl targets supported by [rust-cross-toolchain](https://github.com/taiki-e/rust-cross-toolchain#linux-musl) may also work, although this action's CI has not tested them.)\n\nFor the `qemu-user` runner, see [\"qemu-user runner\" section for linux-gnu targets](#qemu-user-runner).\n\n### Linux (uClibc)\n\n| libc | GCC | C++ | test |\n| ---- | --- | --- | ---- |\n| uClibc-ng 1.0.34 | 10.2.0 | ✓ (libstdc++) | ✓ |\n\n**Supported targets:**\n\n| target | host | runner | note |\n| ------ | ---- | ------ | ---- |\n| `armv5te-unknown-linux-uclibceabi` | x86_64 Linux | qemu-user | tier3 |\n| `armv7-unknown-linux-uclibceabi`   | x86_64 Linux | qemu-user | tier3 |\n| `armv7-unknown-linux-uclibceabihf` | x86_64 Linux | qemu-user | tier3 |\n| `mips-unknown-linux-uclibc`        | x86_64 Linux | qemu-user | tier3 [1] |\n| `mipsel-unknown-linux-uclibc`      | x86_64 Linux | qemu-user | tier3 [1] |\n\n[1] mips{,el}-unknown-linux-uclibc requires release mode for building std.\u003cbr\u003e\n\nFor the `qemu-user` runner, see [\"qemu-user runner\" section for linux-gnu targets](#qemu-user-runner).\n\n### Android\n\n| Clang | C++ | test |\n| ----- | --- | ---- |\n| 14 | ✓ (libc++) | ✓ |\n\n**Note:** By making use of these targets you accept the [Android SDK License](https://developer.android.com/studio/terms)\n\n**Supported targets:**\n\n| target | api level | host | runner | note |\n| ------ | --------- | ---- | ------ | ---- |\n| `aarch64-linux-android`         | 21 (default), 22-24, 26-33 [1] | x86_64 Linux | qemu-user                   |       |\n| `arm-linux-androideabi`         | 21 / 19 [2] (default), 21-24, 26-33 [1] | x86_64 Linux | qemu-user                   |       |\n| `armv7-linux-androideabi`       | 21 / 19 [2] (default), 21-24, 26-33 [1] | x86_64 Linux | qemu-user                   |       |\n| `i686-linux-android`            | 21 / 19 [2] (default), 21-24, 26-33 [1] | x86_64 Linux | native (default), qemu-user |       |\n| `thumbv7neon-linux-androideabi` | 21 / 19 [2] (default), 21-24, 26-33 [1] | x86_64 Linux | qemu-user                   |       |\n| `x86_64-linux-android`          | 21 (default), 22-24, 26-33 [1] | x86_64 Linux | native (default), qemu-user |       |\n\n[1] This action currently uses the API level 24 system image, so `cargo test` and `cargo run` may not work on API level 26+.\u003cbr\u003e\n[2] [21 on Rust 1.82+](https://github.com/rust-lang/rust/pull/120593), otherwise 19.\u003cbr\u003e\n\nYou can select/pin the API level version by using `@` syntax in `target` option. For example:\n\n```yaml\n- uses: taiki-e/setup-cross-toolchain-action@v1\n  with:\n    target: arm-linux-androideabi@21\n```\n\nFor the `qemu-user` runner, see [\"qemu-user runner\" section for linux-gnu targets](#qemu-user-runner).\n\n### FreeBSD\n\n| C++ | test |\n| --- | ---- |\n| ✓ (libc++) | |\n\n**Supported targets:**\n\n| target | version | host | note |\n| ------ | ------- | ---- | ---- |\n| `aarch64-unknown-freebsd` | 12.4 (default), 13.4, 14.1 | Ubuntu, Debian [1] | tier3 |\n| `i686-unknown-freebsd`    | 12.4 (default), 13.4, 14.1 | Ubuntu, Debian [1] |       |\n| `x86_64-unknown-freebsd`  | 12.4 (default), 13.4, 14.1 | Ubuntu, Debian [1] |       |\n\n[1] Clang 13 for Ubuntu 18.04, otherwise Clang 15.\u003cbr\u003e\n\n(Other FreeBSD targets supported by [rust-cross-toolchain](https://github.com/taiki-e/rust-cross-toolchain#freebsd) may also work, although this action's CI has not tested them.)\n\nYou can select/pin the OS version by using `@` syntax in `target` option. For example:\n\n```yaml\n- uses: taiki-e/setup-cross-toolchain-action@v1\n  with:\n    target: x86_64-unknown-freebsd@14\n```\n\nOnly specifying a major version is supported.\n\n### NetBSD\n\n| GCC | C++ | test |\n| --- | --- | ---- |\n| 7.5.0 | ✓ (libstdc++) | |\n\n**Supported targets:**\n\n| target | version | host | note |\n| ------ | ------- | ---- | ---- |\n| `aarch64-unknown-netbsd` | 9.4 (default), 10.1          | x86_64 Linux | tier3 |\n| `x86_64-unknown-netbsd`  | 9.4 (default [1]), 8.2, 10.1 | x86_64 Linux |       |\n\n[1] [9 on Rust 1.67+](https://github.com/rust-lang/rust/pull/103709), otherwise 8.\u003cbr\u003e\n\n(Other NetBSD targets supported by [rust-cross-toolchain](https://github.com/taiki-e/rust-cross-toolchain#netbsd) may also work, although this action's CI has not tested them.)\n\nYou can select/pin the OS version by using `@` syntax in `target` option. For example:\n\n```yaml\n- uses: taiki-e/setup-cross-toolchain-action@v1\n  with:\n    target: x86_64-unknown-netbsd@10\n```\n\nOnly specifying a major version is supported.\n\n### illumos\n\n| libc | GCC | C++ | test |\n| ---- | --- | --- | ---- |\n| solaris 2.10 | 8.5.0 | ✓ (libstdc++) | |\n\n**Supported targets:**\n\n| target | host | note |\n| ------ | ---- | ---- |\n| `x86_64-unknown-illumos` | x86_64 Linux (any libc) | |\n\n### WASI\n\n| libc | Clang | C++ | test |\n| ---- | ----- | --- | ---- |\n| wasi-sdk 25 (wasi-libc 574b88d) | 19 | ? (libc++) | ✓ |\n\n**Supported targets:**\n\n| target | host | runner | note |\n| ------ | ---- | ------ | ---- |\n| `wasm32-wasip1`         | Linux | wasmtime |  |\n| `wasm32-wasip1-threads` | Linux | wasmtime |  |\n| `wasm32-wasip2`         | Linux | wasmtime | binfmt does not work due to `.wasm` file in this target is not marked as executable |\n| `wasm32-wasi`           | Linux | wasmtime | [Removed in Rust 1.84](https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html) |\n\n### Windows (MinGW)\n\n| C++ | test |\n| --- | ---- |\n| ✓ (libstdc++) | ✓ |\n\n**Supported targets:**\n\n| target | host | runner | note |\n| ------ | ---- | ------ | ---- |\n| `x86_64-pc-windows-gnu` | *Windows*, Ubuntu (22.04, 24.04), Debian (11, 12) [1] | native (Windows host) / wine (Linux host) |  |\n\n[1] [GCC 10](https://packages.ubuntu.com/en/jammy/gcc-mingw-w64-base), [MinGW-w64 8](https://packages.ubuntu.com/en/jammy/mingw-w64-x86-64-dev) for Ubuntu 22.04. [GCC 13](https://packages.ubuntu.com/en/noble/gcc-mingw-w64-base), [MinGW-w64 11](https://packages.ubuntu.com/en/noble/mingw-w64-x86-64-dev) for Ubuntu 24.04. [GCC 10](https://packages.debian.org/en/bullseye/gcc-mingw-w64-base), [MinGW-w64 8](https://packages.debian.org/en/bullseye/mingw-w64-x86-64-dev) for Debian 11. [GCC 12](https://packages.debian.org/en/bookworm/gcc-mingw-w64-base), [MinGW-w64 10](https://packages.debian.org/en/bookworm/mingw-w64-x86-64-dev) for Debian 12.\u003cbr\u003e\n\nOn Windows host, GitHub-provided Windows runners support cross-compile for other architectures or environments, so this action just runs `rustup target add` and/or sets some environment variables.\n\n(Other Windows targets may also work, although this action's CI has not tested them.)\n\nOn Linux host, this action installs MinGW toolchain and Wine.\n\n\u003c!-- omit in toc --\u003e\n#### \u003ca name=\"wine-runner\"\u003e\u003c/a\u003ewine runner\n\nThe current default Wine version is 10.0.\n\nYou can select/pin the version by using `wine` input option, or `@` syntax in `runner` input option (if both are set, the latter is preferred). For example:\n\n```yaml\n- uses: taiki-e/setup-cross-toolchain-action@v1\n  with:\n    target: x86_64-pc-windows-gnu\n    wine: '9.22'\n```\n\n```yaml\n- uses: taiki-e/setup-cross-toolchain-action@v1\n  with:\n    target: x86_64-pc-windows-gnu\n    runner: wine@9.22\n```\n\n### Windows (LLVM MinGW)\n\n| libc | Clang | C++ | test |\n| ---- | ----- | --- | ---- |\n| Mingw-w64 7c9cfe6 | 18 | ✓ (libc++) | ✓ |\n\n**Supported targets:**\n\n| target | host | runner | note |\n| ------ | ---- | ------ | ---- |\n| `aarch64-pc-windows-gnullvm` | Ubuntu (22.04, 24.04) | wine |  |\n| `i686-pc-windows-gnullvm` | Ubuntu (22.04, 24.04) | wine |  |\n| `x86_64-pc-windows-gnullvm` | Ubuntu (22.04, 24.04) | wine |  |\n\nFor the `wine` runner for {i686,x86_64}-pc-windows-gnullvm, see [\"wine runner\" section for windows-gnu targets](#wine-runner).\n\nThe `wine` runner for aarch64-pc-windows-gnullvm is AArch64 Wine running on qemu-user; specifying the Wine version is not yet supported, but the QEMU version can be specified by using `qemu` input option like Linux targets.\n\n### Windows (MSVC)\n\n| C++ | test |\n| --- | ---- |\n| ✓ | ✓ [1] |\n\n[1] Only x86/x86_64 targets.\u003cbr\u003e\n\n**Supported targets:**\n\n| target | host | runner | note |\n| ------ | ---- | ------ | ---- |\n| `aarch64-pc-windows-msvc` | *Windows* |        |  |\n| `i686-pc-windows-msvc`    | *Windows* | native |  |\n| `x86_64-pc-windows-msvc`  | *Windows* | native |  |\n| `i586-pc-windows-msvc`    | *Windows* | native | [Removed in Rust 1.87](https://github.com/rust-lang/rust/pull/137957) |\n\nGitHub-provided Windows runners support cross-compile for other architectures or environments, so this action just runs `rustup target add` and/or sets some environment variables.\n\n(Other Windows targets may also work, although this action's CI has not tested them.)\n\n### macOS\n\n| C++ | test |\n| --- | ---- |\n| ✓ | ✓ [1] |\n\n[1] For x86_64-apple-darwin all runners and for aarch64-apple-darwin only arm64 runners. (x86_64h-apple-darwin is also x86_64 but build-only because the CPU of GitHub-provided macOS runners is older than Haswell. If you use a large runner or self-hosted runner, you may be able to run the test.)\u003cbr\u003e\n\n**Supported targets:**\n\n| target | host | runner | note |\n| ------ | ---- | ------ | ---- |\n| `aarch64-apple-darwin` | *macOS* | native |       |\n| `x86_64-apple-darwin`  | *macOS* | native |       |\n| `x86_64h-apple-darwin` | *macOS* | native | tier3 |\n\nGitHub-provided macOS runners support cross-compile for other architectures or environments, so this action just runs `rustup target add` and/or sets some environment variables.\n\n(Other macOS targets may also work, although this action's CI has not tested them.)\n\n### Mac Catalyst\n\n| C++ | test |\n| --- | ---- |\n| ✓ | ✓ [1] |\n\n[1] For x86_64-apple-ios-macabi only x86_64 runners and for aarch64-apple-ios-macabi only arm64 runners.\u003cbr\u003e\n\n**Supported targets:**\n\n| target | host | runner | note |\n| ------ | ---- | ------ | ---- |\n| `aarch64-apple-ios-macabi` | *macOS* | native |       |\n| `x86_64-apple-ios-macabi`  | *macOS* | native |       |\n\nGitHub-provided macOS runners support cross-compile for other targets, so this action just runs `rustup target add` and/or sets some environment variables.\n\n## Compatibility\n\nThis action has been tested for GitHub-hosted runners (Ubuntu, macOS, Windows) and containers (Ubuntu, Debian).\n\nTo use this action in self-hosted runners or in containers, at least the following tools are required:\n\n- bash\n- rustup, cargo\n\nCurrently, when using this action with containers, `--privileged` option is required (due to binfmt).\n\n```yaml\ncontainer:\n  image: '...'\n  options: --privileged\n```\n\n## Related Projects\n\n- [rust-cross-toolchain]: Toolchains for cross compilation and cross testing for Rust.\n- [install-action]: GitHub Action for installing development tools (mainly from GitHub Releases).\n- [cache-cargo-install-action]: GitHub Action for `cargo install` with cache.\n- [create-gh-release-action]: GitHub Action for creating GitHub Releases based on changelog.\n- [upload-rust-binary-action]: GitHub Action for building and uploading Rust binary to GitHub Releases.\n- [checkout-action]: GitHub Action for checking out a repository. (Simplified actions/checkout alternative that does not depend on Node.js.)\n\n[cache-cargo-install-action]: https://github.com/taiki-e/cache-cargo-install-action\n[checkout-action]: https://github.com/taiki-e/checkout-action\n[create-gh-release-action]: https://github.com/taiki-e/create-gh-release-action\n[install-action]: https://github.com/taiki-e/install-action\n[rust-cross-toolchain]: https://github.com/taiki-e/rust-cross-toolchain\n[upload-rust-binary-action]: https://github.com/taiki-e/upload-rust-binary-action\n\n## License\n\nLicensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or\n[MIT license](LICENSE-MIT) at your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaiki-e%2Fsetup-cross-toolchain-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaiki-e%2Fsetup-cross-toolchain-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaiki-e%2Fsetup-cross-toolchain-action/lists"}