A working example of multi targets compilation for Rust using Github Actions.

Overview

rust-cross-compile-example

Rust

A working example of multi targets compilation for Rust using Github Actions.

It compiles a hello world example in Rust using Github Actions to the following architectures:

  • Windows x86_64
  • MacOSX x86_64
  • Linux x86_64, both GNU and Musl libc
  • Linux ARMV6 (for Raspberry Pi 1), both GNU and Musl libc
  • Linux ARMV7 (for Raspberry Pi 2 and up), both GNU and Musl libc
  • Linux ARM64 (mostly for cheaper servers like AWS EC2 t4g line), both GNU and Musl libc

Windows and MacOSX do not actually use cross-compilation and just launch jobs on Windows and MacOSX runners respectively as this is way less painful than trying to compile from Linux. All Linux targets are created from x86_64 Ubuntu runners using true cross-compilation and without relying on Docker. Builds are run in parallel.

See the workflow configuration file.

You check that the binaries the workflow produces are valid in the release page or you can fork this repository. In that case the workflow should run automatically and you will get the same result.

You might also like...
Rust library to scan files and expand multi-file crates source code as a single tree

syn-file-expand This library allows you to load full source code of multi-file crates into a single syn::File. Features: Based on syn crate. Handling

Rust port of the official Windows Driver Samples on Github. Leverages windows-drivers-rs

Rust Driver Samples This is a Rust port of the driver samples from the original Windows Driver Samples on Github. The repository provides examples and

A small utility for tracking the change in opening and closing of issues in a GitHub repo

A small utility for tracking the change in opening and closing of issues in a GitHub repo. This tool can be used to build visualizations for issue triage over time with the hope of motivating closing more issues than are opened.

mdTranslation is a utility to prepare multi-lingual Markdown documents.

mdTranslation is a utility to prepare multi-lingual Markdown documents. There's also a mdBook preprocessor called mdbook-translation for

Crate of GitHub’s collection of gitignores, embedded, automatically updated

Gitignores GitHub’s collection of gitignores, embedded, automatically updated. API documentation. Public Domain via CC0-1.0 (same as source data). MSR

Incremental, multi-version remote backup tool for block devices.

bsync Incremental, multi-version remote backup tool for block devices. The on-disk backup format is a SQLite database and I've been dogfooding this on

Make the github cli even better with fuzzy finding
Make the github cli even better with fuzzy finding

github-repo-clone (grc) Github Repo Clone is a command line utility written in rust that leverages the power of fuzzy finding with the github cli Usag

 Northstar is a horizontally scalable and multi-tenant Kubernetes cluster provisioner and orchestrator
Northstar is a horizontally scalable and multi-tenant Kubernetes cluster provisioner and orchestrator

Northstar Northstar is a horizontally scalable and multi-tenant Kubernetes cluster provisioner and orchestrator. Explore the docs » View Demo · Report

A timer based on a multi-time wheel structure

wheel-timer2 A timer based on a multi-time wheel structure This library uses a multi-layered time wheel structure. When a task is added to the wheel,

Comments
  • Document what needs to be changed in the workflow yml

    Document what needs to be changed in the workflow yml

    Line 60 NAME: rust-cross-compile-example needs to be changed to the name of your project. It would be good if this was documented, since it may be hard to figure out otherwise.

    opened by Roenbaeck 1
  • Deprecation warnings

    Deprecation warnings

    Deprecation warnings have started to show up when you run this workflow. See for example: https://github.com/Roenbaeck/unstruct/actions/runs/3470972855

    opened by Roenbaeck 0
Releases(0.2.0)
Owner
Nicolas Vanhoren
Web & Full Stack Developer
Nicolas Vanhoren
A safe sync/async multi-producer, multi-consumer channel

Loole A safe async/sync multi-producer multi-consumer channel. Producers can send and consumers can receive messages asynchronously or synchronously:

Mahdi Shojaee 50 Oct 6, 2023
Dyadic rationals for `no_std` targets

dyadic ?? Dyadic rationals for no_std targets.

Vitaly Domnikov 2 Dec 16, 2021
IDX is a Rust crate for working with RuneScape .idx-format caches.

This image proudly made in GIMP License Licensed under GNU GPL, Version 3.0, (LICENSE-GPL3 or https://choosealicense.com/licenses/gpl-3.0/) Contributi

Ceikry 5 May 27, 2022
Rust libraries for working with GPT (GUID Partition Table) disk data

gpt-disk-rs no_std libraries related to GPT (GUID Partition Table) disk data. There are three Rust packages in this repository: uguid The uguid packag

Google 25 Dec 24, 2022
A Rust utility library, making easier by taking the hassle out of working. :octocat:

reddish A Rust utility library, making easier by taking the hassle out of working. Usage Add this to your Cargo.toml: [dependencies] reddish = "0.2.0"

Rogério Araújo 12 Jan 21, 2023
Toolkit for working with scripts used by REDengine in Cyberpunk 2077.

redscript Toolkit for working with scripts used by REDengine in Cyberpunk 2077. Currently includes a compiler, a decompiler and a disassembler. usage

jac3km4 268 Jan 6, 2023
Estimate the amount of time spent working on a Git repository

jikyuu (時給) A tool to estimate the amount of time spent working on a Git repository. It is a direct port of git-hours, written in Node.js, because the

null 18 Nov 16, 2022
Cargo wrapper for working with Webassembly wasi(x).

cargo-wasix A cargo subcommand that wraps regular cargo commands for compiling Rust code to wasix, a superset of Websassembly wasi with additional fun

WASIX 19 Jun 12, 2023
The point of this anchor project is to serve as a starter kit or example to compose with mango-v3 using anchor.

The point of this anchor project is to serve as a starter kit or example to compose with mango-v3 using anchor. It currently provides 2 examples and various inline todos on how to extend this.

null 26 Oct 10, 2022
A fast, multi-threaded line counting utility written in Rust.

xloc A fast, multi-threaded line counting utility written in Rust. What is xloc A drop in replacement for bash's wc -l. Your project has x lines of co

null 1 Nov 15, 2021