{"id":20446294,"url":"https://github.com/rust-embedded/meta-rust-bin","last_synced_at":"2025-04-04T07:03:43.835Z","repository":{"id":12182598,"uuid":"67194804","full_name":"rust-embedded/meta-rust-bin","owner":"rust-embedded","description":"Yocto layer for installing Rust toolchain from pre-built binaries","archived":false,"fork":false,"pushed_at":"2025-03-25T09:36:01.000Z","size":369,"stargazers_count":114,"open_issues_count":27,"forks_count":73,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-28T06:05:48.168Z","etag":null,"topics":["embedded","linux","meta-rust","rust","yocto","yocto-layer"],"latest_commit_sha":null,"homepage":null,"language":"BitBake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-embedded.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-09-02T06:04:55.000Z","updated_at":"2025-03-25T09:36:02.000Z","dependencies_parsed_at":"2024-03-23T15:35:08.252Z","dependency_job_id":"1900824d-c316-4fee-a47d-5bad1ade7045","html_url":"https://github.com/rust-embedded/meta-rust-bin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Fmeta-rust-bin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Fmeta-rust-bin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Fmeta-rust-bin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Fmeta-rust-bin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-embedded","download_url":"https://codeload.github.com/rust-embedded/meta-rust-bin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135138,"owners_count":20889420,"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":["embedded","linux","meta-rust","rust","yocto","yocto-layer"],"created_at":"2024-11-15T10:19:06.018Z","updated_at":"2025-04-04T07:03:43.818Z","avatar_url":"https://github.com/rust-embedded.png","language":"BitBake","readme":"meta-rust-bin\n=============\n\nAn OpenEmebdded/Yocto layer providing pre-built toolchains for the\n[Rust programming language](https://www.rust-lang.org).\n\n\u003c!-- toc --\u003e\n\n- [meta-rust-bin](#meta-rust-bin)\n  - [Basic Example](#basic-example)\n  - [Features](#features)\n    - [Use with Yocto Release 4.0 (kirkstone) and Above](#use-with-yocto-release-40-kirkstone-and-above)\n    - [Use with Yocto Release 3.4 (honister) and Above](#use-with-yocto-release-34-honister-and-above)\n  - [Advanced Features](#advanced-features)\n    - [Specifying Cargo Features](#specifying-cargo-features)\n    - [Using Components Individually](#using-components-individually)\n  - [Pre-built vs. Compiled](#pre-built-vs-compiled)\n  - [Adding Support for New Versions](#adding-support-for-new-versions)\n  - [Copyright](#copyright)\n\n\u003c!-- tocstop --\u003e\n\n\n## Basic Example\n\nA basic class for cargo-based executables is provided. The following is a\nsimple recipe called gpio_utils.bb that builds the [gpio-utils](https://github.com/rust-embedded/gpio-utils)\ncrate from branch master.\n\n```bitbake\nSUMMARY = \"GPIO Utilities\"\nHOMEPAGE = \"git://github.com/rust-embedded/gpio-utils\"\nLICENSE = \"MIT\"\n\ninherit cargo_bin\n\n# Enable network for the compile task allowing cargo to download dependencies\ndo_compile[network] = \"1\"\n\nSRC_URI = \"git://github.com/rust-embedded/gpio-utils.git;protocol=https;branch=master\"\nSRCREV=\"02b0658cd7e13e46f6b1a5de3fd9655711749759\"\nS = \"${WORKDIR}/git\"\nLIC_FILES_CHKSUM = \"file://LICENSE-MIT;md5=935a9b2a57ae70704d8125b9c0e39059\"\n```\n\nAs you can see, there is almost no overhead introduced from the `cargo_bin` class\nbeyond simply inheriting it. The `cargo_bin` class adds the appropriate Rust\ndependencies as well as default compile and install steps.\n\n\u003e **Warning**  \n\u003e In previous versions of `meta-rust-bin` the class `cargo` was used instead\n\u003e of `cargo_bin`. Follow this [guide](#updating-from-an-old-meta-rust-bin) if you\n\u003e are updating your `meta-rust-bin` layer from an old version.\n\n## Features\n\nCurrently supported:\n\n  * Current stable rust release (usually shortly after release) and several\n    previous releases, see [the versioned recipes](./recipes-devtools/rust/).\n  * x86 (32 and 64-bit), ARM (32 and 64-bit) build systems.\n  * All Linux architectures that Rust itself supports (Multiple flavors of:\n    x86, ARM, PPC, and MIPS)\n  * Statically-linked libstd, dynamically-linked system libraries (libc, libm,\n    etc)\n\nFuture:\n\n  * [ ] Building and installing `dev` and `staticdev` packages (i.e. allow build\n    and install of static and dynamic library builds).\n  * [ ] Debug builds with separated debug info to allow gdbserver usage.\n  * [ ] Running Rust/Cargo on target.\n  * [ ] Vendoring of Cargo dependencies (to better play with the Yocto offline\n    build model).\n  * [ ] Use of a shared libstd across all Rust packages on a target system\n    (provides space savings).\n  * [ ] Total static linking using MUSL.\n\n### Use with Yocto Release 4.0 (kirkstone) and Above\n\nFrom Yocto version 4.0 network access from tasks is disabled by default on\nkernels which support this feature (on most recent distros such as CentOS 8 and\nDebian 11 onwards). The task `do_compile` need to access the network because it\ndownloads dependencies, so add the following line to the recipe:\n\n```bitbake\ndo_compile[network] = \"1\"\n```\n\n### Updating from an old `meta-rust-bin`\n\nTo avoid conflicts with the offical Rust layer of Yocto, the class `cargo` of\n`meta-rust-bin` was renamed to `cargo_bin`.\n\nIf you are updating `meta-rust-bin` from an old version please make sure to\nupdate the inherited class of your recipe to `cargo_bin`.\n\nAfter the update it's safe to remove the previously used `BBMASK`:\n\n```bitbake\nBBMASK = \"poky/meta/recipes-devtools/rust\"\n```\n\n## Advanced Features\n\n### Specifying Cargo Features\n\nBecause Yocto is primarily used for embedded development, it is likely that\nprojects will have differing features based on whether the crate is run on the\nhardware or in development on a PC. Cargo features can be easily specified by\nadding a space-separated list of `CARGO_FEATURES` to the recipe:\n\n```bitbake\nCARGO_FEATURES = \"feature1 feature2\"\n```\n\n### Using Components Individually\n\nAlthough the `cargo` class is the easiest way to use this layer, the components\nit provides may also be used directly. To add the Rust compiler plus target and\nhost standard libraries to the environment, depend on or install `rust-bin`. To\nmanually install `cargo` depend on or install `cargo-bin`.\n\nNote that while there is nothing explicitly preventing the installation of Rust\non the target, it hasn't been tested and is likely not to work. Pull requests\nare welcome!\n\n\n## Pre-built vs. Compiled\n\nThis layer exists as a tradeoff against other options, e.g. the\n[meta-rust](https://github.com/meta-rust) project. Both exist to satisfy\ndifferent requirements.\n\nBecause this layer uses the upstream compiled versions of Rust and Cargo, it\nwill never be able to support architectures or options not supported by the\nRust team itself.\n\nAlso, because this layer uses pre-built Rust standard libraries, it is possible\nthat the standard libraries provided with this layer will be less efficient\nthan code produced by a custom-compiled standard library.\n\nHowever, using pre-built tools has advantages:\n\n  * Updating the layer to a new version of Rust is as easy as updating\n    checksums and file names, so new versions of Rust are available quickly.\n  * In almost all modern systems, it is faster to download the binaries than it\n    is to download source and build the Rust toolchain from scratch.\n  * Compatability across multiple versions of Yocto is maximized since only\n    basic, stable recipe features are used.\n  * Trivial support for all architectures supported by upstream Rust.\n\n## Adding Support for New Versions\n\nWhen a new version of rust is released, adding support for this new version can\nbe done by running `build-new-version.sh` as follows:\n\n    ./build-new-version.sh \u003cversion\u003e\n\nThis will create two new recipes:\n - recipes-devtools/rust/rust-bin-\u003cversion\u003e.bb\n - recipes-devtools/rust/cargo-bin-\u003cdate\u003e.bb\n\n Where the cargo version generated is the one packaged with the associated\n release of rust itself (using the published channel data consumed by other\n tools like rustup).\n\nFor latest nightly version:\n\n    ./build-new-version.sh nightly\n    \nFor specified nightly version:\n    \n    ./build-new-version.sh nightly 2019-07-08\n    \n\n## Copyright\n\n```\nCopyright (c) 2016, the meta-rust-bin authors.\n\nLicensed under the Apache License, Version 2.0 \u003cLICENSE-APACHE or\nhttp://www.apache.org/license/LICENSE-2.0\u003e or the MIT license\n\u003cLICENSE-MIT or http://opensource.org/licenses/MIT\u003e, at your\noption.  This file may not be copied, modified, or distributed\nexcept according to those terms.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-embedded%2Fmeta-rust-bin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-embedded%2Fmeta-rust-bin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-embedded%2Fmeta-rust-bin/lists"}