Skip to content

Commit

Permalink
layers/meta-opentrons: add rust 1.71.1
Browse files Browse the repository at this point in the history
Or more specifically cargo and everything that depends on, since maturin
uses cargo.toml features that need a new version
  • Loading branch information
sfoster1 committed Dec 12, 2024
1 parent 6ca089c commit 3cfa6c8
Show file tree
Hide file tree
Showing 24 changed files with 4,419 additions and 0 deletions.
437 changes: 437 additions & 0 deletions layers/meta-opentrons/classes/rust-target-config.bbclass

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions layers/meta-opentrons/conf/distro/opentrons.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ PREFERRED_VERSION_vulkan-tools = "1.2.182.0"
PREFERRED_VERSION_vulkan-headers = "1.2.182.0"
PREFERRED_VERSION_vulkan-loader = "1.2.182.0"
PREFERRED_VERSION_python3-setuptools-rust = "1.10.2"
PREFERRED_VERSION_rust = "1.71.1"
PREFERRED_VERSION_rust-cross-canadian = "1.71.1"
PREFERRED_VERSION_libstd-rs = "1.71.1"
PREFERRED_VERSION_rust-llvm = "1.71.1"
PREFERRED_VERSION_cargo = "1.71.1"
PREFERRED_VERSION_cargo-native = "1.71.1"
PREFERRED_VERSION_cargo-c = "0.9.18"
PREFERRED_VERSION_rust-native = "1.71.1"
PREFERRED_VERSION_rust-llvm-native = "1.71.1"
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ S = "${WORKDIR}/maturin-${PV}"
CFLAGS:append = " -fdebug-prefix-map=${CARGO_HOME}=${TARGET_DBGSRC_DIR}/cargo_home"

DEPENDS += "\
python3-pip-native \
python3-setuptools-rust-native \
python3-semantic-version-native \
python3-setuptools-rust \
Expand Down
38 changes: 38 additions & 0 deletions layers/meta-opentrons/recipes-devtools/rust/README-rust.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Introduction

This provides the Rust compiler, tools for building packages (cargo), and
a few example projects.

## Building a rust package

When building a rust package in bitbake, it's usually easiest to build with
cargo using cargo.bbclass. If the package already has a Cargo.toml file (most
rust packages do), then it's especially easy. Otherwise you should probably
get the code building in cargo first.

Once your package builds in cargo, you can use
[cargo-bitbake](https://github.com/cardoe/cargo-bitbake) to generate a bitbake
recipe for it. This allows bitbake to fetch all the necessary dependent
crates, as well as a pegged version of the crates.io index, to ensure maximum
reproducibility. Once the Rust SDK support is added to oe-core, cargo-bitbake
may also be added to the SDK.

NOTE: You will have to edit the generated recipe based on the comments
contained within it

## Pitfalls

- TARGET_SYS _must_ be different from BUILD_SYS. This is due to the way Rust
configuration options are tracked for different targets. This is the reason
we use the Yocto triples instead of the native Rust triples. See rust-lang/cargo#3349.

## Dependencies

On the host:
- Any `-sys` packages your project might need must have RDEPENDs for
the native library.

On the target:
- Any `-sys` packages your project might need must have RDEPENDs for
the native library.

453 changes: 453 additions & 0 deletions layers/meta-opentrons/recipes-devtools/rust/cargo-c-crates.inc

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
SUMMARY = "cargo applet to build and install C-ABI compatible dynamic and static libraries."
HOMEPAGE = "https://crates.io/crates/cargo-c"
LICENSE = "MIT"
LIC_FILES_CHKSUM = " \
file://LICENSE;md5=384ed0e2e0b2dac094e51fbf93fdcbe0 \
"


SRC_URI = " \
git://github.com/lu-zero/cargo-c.git;branch=master;protocol=https \
file://0001-Add-Cargo.lock-file.patch \
"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.*)"

SRCREV = "4eaf39ebbbc9ab8f092adf487d5b53435511d619"
S = "${WORKDIR}/git"

inherit cargo cargo-update-recipe-crates pkgconfig native

DEPENDS = "openssl curl"

require ${BPN}-crates.inc

Loading

0 comments on commit 3cfa6c8

Please sign in to comment.