Move rust from meta-rust to oe-core
Subsystems (2)
cover Move rust from meta-rust to oe-core
I moved the Rust support from meta-rust to oe-core.
As you'd expect, it's still building rust-hello-world for all qemus (except riscv64 which may never have worked). Rust-hello-world runs for me on qemu:
x86-64, arm, arm64
It may run on other machines but that's what I've tested so far.
We need a list of meta-rust issues that should be resolved in order to get the code accepted in oe-core. I opened an issue to track that:
https://github.com/meta-rust/meta-rust/issues/251
but there haven't been any comments yet. I'd rather track issues in github than in the YP Bugzilla:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=12675
Here, in no particular order, are some of
the defects that I believe need to be fixed:
1. build system is assumed to be linux-x86_64
https://github.com/meta-rust/meta-rust/issues/23
2. Make rust-native build in parallel (it's very slow!) (meta-rust issue/PR to be created by Randy)
3. Document developer workflows such as cargo-bitbake.
4. Build offline ( BB_NO_NETWORK = '1' )
5. make rust-hello-world install for qemuriscv64
https://github.com/meta-rust/meta-rust/issues/252
6. ... build rustc and cargo for target (nice to have, only).
https://github.com/meta-rust/meta-rust/issues/81
7. Bootstrap from C as an option?
See: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12675#c2
8. Update librsvg to latest (2.46) which uses rust.
What have I missed?
I'll work on several of these defects but I'll likely need help from people with more Rust experience.
../Randy
Randy MacLeod (3):
Add libgit2, libssh2 from meta-oe for rust
meta-rust: move code to oe-core from meta-rust layer
rust: mv README.md to recipes-devtools/rust/README-rust.md
meta/classes/cargo.bbclass | 70 +++ meta/classes/cargo_common.bbclass | 98 ++++ meta/classes/crate-fetch.bbclass | 13 + meta/classes/rust-bin.bbclass | 149 +++++ meta/classes/rust-common.bbclass | 144 +++++ meta/classes/rust.bbclass | 45 ++ .../distro/include/rust_security_flags.inc | 7 + meta/conf/layer.conf | 2 + meta/lib/crate.py | 149 +++++ .../cargo-1.34.2/0001-Disable-http2.patch | 29 + .../cargo-1.36.0/0001-Disable-http2.patch | 31 ++ .../cargo-1.37.0/0001-Disable-http2.patch | 29 + meta/recipes-devtools/cargo/cargo.inc | 43 ++ meta/recipes-devtools/cargo/cargo_1.34.2.bb | 8 + meta/recipes-devtools/cargo/cargo_1.36.0.bb | 8 + meta/recipes-devtools/cargo/cargo_1.37.0.bb | 8 + meta/recipes-devtools/rust/README-rust.md | 69 +++ meta/recipes-devtools/rust/libstd-rs.inc | 31 ++ .../recipes-devtools/rust/libstd-rs_1.34.2.bb | 8 + .../recipes-devtools/rust/libstd-rs_1.36.0.bb | 8 + .../recipes-devtools/rust/libstd-rs_1.37.0.bb | 8 + meta/recipes-devtools/rust/rust-cross.inc | 52 ++ .../rust/rust-cross_1.34.2.bb | 3 + .../rust/rust-cross_1.36.0.bb | 3 + .../rust/rust-cross_1.37.0.bb | 3 + meta/recipes-devtools/rust/rust-llvm.inc | 62 +++ ...-llvm-allow-env-override-of-exe-path.patch | 32 ++ .../recipes-devtools/rust/rust-llvm_1.34.2.bb | 16 + .../recipes-devtools/rust/rust-llvm_1.36.0.bb | 16 + .../recipes-devtools/rust/rust-llvm_1.37.0.bb | 16 + .../rust/rust-snapshot-1.34.2.inc | 24 + .../rust/rust-snapshot-1.36.0.inc | 24 + .../rust/rust-snapshot-1.37.0.inc | 24 + .../rust/rust-source-1.34.2.inc | 11 + .../rust/rust-source-1.36.0.inc | 11 + .../rust/rust-source-1.37.0.inc | 11 + meta/recipes-devtools/rust/rust.inc | 509 ++++++++++++++++++ meta/recipes-devtools/rust/rust_1.34.2.bb | 12 + meta/recipes-devtools/rust/rust_1.36.0.bb | 12 + meta/recipes-devtools/rust/rust_1.37.0.bb | 12 + .../rust-hello-world/rust-hello-world_git.bb | 13 + meta/recipes-example/rustfmt/rustfmt_0.8.0.bb | 67 +++ .../recipes-support/libgit2/libgit2_0.27.8.bb | 25 + meta/recipes-support/libssh2/libssh2_1.8.2.bb | 27 + scripts/build.sh | 19 + scripts/cleanup-env.sh | 14 + scripts/containerize.sh | 54 ++ scripts/fetch.sh | 103 ++++ scripts/publish-build-cache.sh | 13 + scripts/setup-env.sh | 12 + 50 files changed, 2157 insertions(+) create mode 100644 meta/classes/cargo.bbclass create mode 100644 meta/classes/cargo_common.bbclass create mode 100644 meta/classes/crate-fetch.bbclass create mode 100644 meta/classes/rust-bin.bbclass create mode 100644 meta/classes/rust-common.bbclass create mode 100644 meta/classes/rust.bbclass create mode 100644 meta/conf/distro/include/rust_security_flags.inc create mode 100644 meta/lib/crate.py create mode 100644 meta/recipes-devtools/cargo/cargo-1.34.2/0001-Disable-http2.patch create mode 100644 meta/recipes-devtools/cargo/cargo-1.36.0/0001-Disable-http2.patch create mode 100644 meta/recipes-devtools/cargo/cargo-1.37.0/0001-Disable-http2.patch create mode 100644 meta/recipes-devtools/cargo/cargo.inc create mode 100644 meta/recipes-devtools/cargo/cargo_1.34.2.bb create mode 100644 meta/recipes-devtools/cargo/cargo_1.36.0.bb create mode 100644 meta/recipes-devtools/cargo/cargo_1.37.0.bb create mode 100644 meta/recipes-devtools/rust/README-rust.md create mode 100644 meta/recipes-devtools/rust/libstd-rs.inc create mode 100644 meta/recipes-devtools/rust/libstd-rs_1.34.2.bb create mode 100644 meta/recipes-devtools/rust/libstd-rs_1.36.0.bb create mode 100644 meta/recipes-devtools/rust/libstd-rs_1.37.0.bb create mode 100644 meta/recipes-devtools/rust/rust-cross.inc create mode 100644 meta/recipes-devtools/rust/rust-cross_1.34.2.bb create mode 100644 meta/recipes-devtools/rust/rust-cross_1.36.0.bb create mode 100644 meta/recipes-devtools/rust/rust-cross_1.37.0.bb create mode 100644 meta/recipes-devtools/rust/rust-llvm.inc create mode 100644 meta/recipes-devtools/rust/rust-llvm/0002-llvm-allow-env-override-of-exe-path.patch create mode 100644 meta/recipes-devtools/rust/rust-llvm_1.34.2.bb create mode 100644 meta/recipes-devtools/rust/rust-llvm_1.36.0.bb create mode 100644 meta/recipes-devtools/rust/rust-llvm_1.37.0.bb create mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.34.2.inc create mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.36.0.inc create mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.37.0.inc create mode 100644 meta/recipes-devtools/rust/rust-source-1.34.2.inc create mode 100644 meta/recipes-devtools/rust/rust-source-1.36.0.inc create mode 100644 meta/recipes-devtools/rust/rust-source-1.37.0.inc create mode 100644 meta/recipes-devtools/rust/rust.inc create mode 100644 meta/recipes-devtools/rust/rust_1.34.2.bb create mode 100644 meta/recipes-devtools/rust/rust_1.36.0.bb create mode 100644 meta/recipes-devtools/rust/rust_1.37.0.bb create mode 100644 meta/recipes-example/rust-hello-world/rust-hello-world_git.bb create mode 100644 meta/recipes-example/rustfmt/rustfmt_0.8.0.bb create mode 100644 meta/recipes-support/libgit2/libgit2_0.27.8.bb create mode 100644 meta/recipes-support/libssh2/libssh2_1.8.2.bb create mode 100755 scripts/build.sh create mode 100755 scripts/cleanup-env.sh create mode 100755 scripts/containerize.sh create mode 100755 scripts/fetch.sh create mode 100755 scripts/publish-build-cache.sh create mode 100755 scripts/setup-env.sh
Signature · 1 line
2.22.0
RFC PATCH 1/3 Add libgit2, libssh2 from meta-oe for rust
--- .../recipes-support/libgit2/libgit2_0.27.8.bb | 25 +++++++++++++++++ meta/recipes-support/libssh2/libssh2_1.8.2.bb | 27 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 meta/recipes-support/libgit2/libgit2_0.27.8.bb create mode 100644 meta/recipes-support/libssh2/libssh2_1.8.2.bb
meta/recipes-support/libgit2/libgit2_0.27.8.bb new file +25 -0
@@ -0,0 +1,25 @@ +SUMMARY = "the Git linkable library" +HOMEPAGE = "http://libgit2.github.com/" +LICENSE = "GPL-2.0-with-GCC-exception & MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=3f2cd5d3cccd71d62066ba619614592b" + +DEPENDS = "curl openssl zlib libssh2 libgcrypt" + +SRC_URI = "git://github.com/libgit2/libgit2.git;branch=maint/v0.27" +#v0.27.8 +SRCREV = "2882803ca2b2cdedd069746422155a23fdd002b2" + +S = "${WORKDIR}/git" + +inherit cmake + +EXTRA_OECMAKE = "\ + -DTHREADSAFE=ON \ + -DBUILD_CLAR=OFF \ + -DSHA1_TYPE="builtin" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DBUILD_EXAMPLES=OFF \ + -DLIB_INSTALL_DIR=${libdir} \ +" + +BBCLASSEXTEND = "native"
meta/recipes-support/libssh2/libssh2_1.8.2.bb new file +27 -0
@@ -0,0 +1,27 @@ +SUMMARY = "A client-side C library implementing the SSH2 protocol" +HOMEPAGE = "http://www.libssh2.org/" +SECTION = "libs" + +DEPENDS = "zlib" + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=c5cf34fc0acb44b082ef50ef5e4354ca" + +SRC_URI = "http://www.libssh2.org/download/${BP}.tar.gz" + +SRC_URI[md5sum] = "616efd99af3d9ef731a26bed6cee9593" +SRC_URI[sha256sum] = "088307d9f6b6c4b8c13f34602e8ff65d21c2dc4d55284dfe15d502c4ee190d67" + +inherit autotools pkgconfig + +EXTRA_OECONF += "\ + --with-libz \ + --with-libz-prefix=${STAGING_LIBDIR} \ + " + +# only one of openssl and gcrypt could be set +PACKAGECONFIG ??= "openssl" +PACKAGECONFIG[openssl] = "--with-openssl --with-libssl-prefix=${STAGING_LIBDIR},--without-openssl,openssl" +PACKAGECONFIG[gcrypt] = "--with-libgcrypt --with-libgcrypt-prefix=${STAGING_EXECPREFIXDIR},--without-libgcrypt,libgcrypt" + +BBCLASSEXTEND = "native"
Signature · 1 line
2.22.0
RFC PATCH 2/3 meta-rust: move code to oe-core from meta-rust layer
In reply to Randy MacLeodRust is becoming more widely used so move the
meta-rust layer. Taken from meta-rust at commit:
11aed43 cargo-1.37.0: fix patch fuzz
--- meta/classes/cargo.bbclass | 70 +++ meta/classes/cargo_common.bbclass | 98 ++++ meta/classes/crate-fetch.bbclass | 13 + meta/classes/rust-bin.bbclass | 149 +++++ meta/classes/rust-common.bbclass | 144 +++++ meta/classes/rust.bbclass | 45 ++ .../distro/include/rust_security_flags.inc | 7 + meta/conf/layer.conf | 2 + meta/lib/crate.py | 149 +++++ .../cargo-1.34.2/0001-Disable-http2.patch | 29 + .../cargo-1.36.0/0001-Disable-http2.patch | 31 ++ .../cargo-1.37.0/0001-Disable-http2.patch | 29 + meta/recipes-devtools/cargo/cargo.inc | 43 ++ meta/recipes-devtools/cargo/cargo_1.34.2.bb | 8 + meta/recipes-devtools/cargo/cargo_1.36.0.bb | 8 + meta/recipes-devtools/cargo/cargo_1.37.0.bb | 8 + meta/recipes-devtools/rust/libstd-rs.inc | 31 ++ .../recipes-devtools/rust/libstd-rs_1.34.2.bb | 8 + .../recipes-devtools/rust/libstd-rs_1.36.0.bb | 8 + .../recipes-devtools/rust/libstd-rs_1.37.0.bb | 8 + meta/recipes-devtools/rust/rust-cross.inc | 52 ++ .../rust/rust-cross_1.34.2.bb | 3 + .../rust/rust-cross_1.36.0.bb | 3 + .../rust/rust-cross_1.37.0.bb | 3 + meta/recipes-devtools/rust/rust-llvm.inc | 62 +++ ...-llvm-allow-env-override-of-exe-path.patch | 32 ++ .../recipes-devtools/rust/rust-llvm_1.34.2.bb | 16 + .../recipes-devtools/rust/rust-llvm_1.36.0.bb | 16 + .../recipes-devtools/rust/rust-llvm_1.37.0.bb | 16 + .../rust/rust-snapshot-1.34.2.inc | 24 + .../rust/rust-snapshot-1.36.0.inc | 24 + .../rust/rust-snapshot-1.37.0.inc | 24 + .../rust/rust-source-1.34.2.inc | 11 + .../rust/rust-source-1.36.0.inc | 11 + .../rust/rust-source-1.37.0.inc | 11 + meta/recipes-devtools/rust/rust.inc | 509 ++++++++++++++++++ meta/recipes-devtools/rust/rust_1.34.2.bb | 12 + meta/recipes-devtools/rust/rust_1.36.0.bb | 12 + meta/recipes-devtools/rust/rust_1.37.0.bb | 12 + .../rust-hello-world/rust-hello-world_git.bb | 13 + meta/recipes-example/rustfmt/rustfmt_0.8.0.bb | 67 +++ scripts/build.sh | 19 + scripts/cleanup-env.sh | 14 + scripts/containerize.sh | 54 ++ scripts/fetch.sh | 103 ++++ scripts/publish-build-cache.sh | 13 + scripts/setup-env.sh | 12 + 47 files changed, 2036 insertions(+) create mode 100644 meta/classes/cargo.bbclass create mode 100644 meta/classes/cargo_common.bbclass create mode 100644 meta/classes/crate-fetch.bbclass create mode 100644 meta/classes/rust-bin.bbclass create mode 100644 meta/classes/rust-common.bbclass create mode 100644 meta/classes/rust.bbclass create mode 100644 meta/conf/distro/include/rust_security_flags.inc create mode 100644 meta/lib/crate.py create mode 100644 meta/recipes-devtools/cargo/cargo-1.34.2/0001-Disable-http2.patch create mode 100644 meta/recipes-devtools/cargo/cargo-1.36.0/0001-Disable-http2.patch create mode 100644 meta/recipes-devtools/cargo/cargo-1.37.0/0001-Disable-http2.patch create mode 100644 meta/recipes-devtools/cargo/cargo.inc create mode 100644 meta/recipes-devtools/cargo/cargo_1.34.2.bb create mode 100644 meta/recipes-devtools/cargo/cargo_1.36.0.bb create mode 100644 meta/recipes-devtools/cargo/cargo_1.37.0.bb create mode 100644 meta/recipes-devtools/rust/libstd-rs.inc create mode 100644 meta/recipes-devtools/rust/libstd-rs_1.34.2.bb create mode 100644 meta/recipes-devtools/rust/libstd-rs_1.36.0.bb create mode 100644 meta/recipes-devtools/rust/libstd-rs_1.37.0.bb create mode 100644 meta/recipes-devtools/rust/rust-cross.inc create mode 100644 meta/recipes-devtools/rust/rust-cross_1.34.2.bb create mode 100644 meta/recipes-devtools/rust/rust-cross_1.36.0.bb create mode 100644 meta/recipes-devtools/rust/rust-cross_1.37.0.bb create mode 100644 meta/recipes-devtools/rust/rust-llvm.inc create mode 100644 meta/recipes-devtools/rust/rust-llvm/0002-llvm-allow-env-override-of-exe-path.patch create mode 100644 meta/recipes-devtools/rust/rust-llvm_1.34.2.bb create mode 100644 meta/recipes-devtools/rust/rust-llvm_1.36.0.bb create mode 100644 meta/recipes-devtools/rust/rust-llvm_1.37.0.bb create mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.34.2.inc create mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.36.0.inc create mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.37.0.inc create mode 100644 meta/recipes-devtools/rust/rust-source-1.34.2.inc create mode 100644 meta/recipes-devtools/rust/rust-source-1.36.0.inc create mode 100644 meta/recipes-devtools/rust/rust-source-1.37.0.inc create mode 100644 meta/recipes-devtools/rust/rust.inc create mode 100644 meta/recipes-devtools/rust/rust_1.34.2.bb create mode 100644 meta/recipes-devtools/rust/rust_1.36.0.bb create mode 100644 meta/recipes-devtools/rust/rust_1.37.0.bb create mode 100644 meta/recipes-example/rust-hello-world/rust-hello-world_git.bb create mode 100644 meta/recipes-example/rustfmt/rustfmt_0.8.0.bb create mode 100755 scripts/build.sh create mode 100755 scripts/cleanup-env.sh create mode 100755 scripts/containerize.sh create mode 100755 scripts/fetch.sh create mode 100755 scripts/publish-build-cache.sh create mode 100755 scripts/setup-env.sh
meta/classes/cargo.bbclass new file +70 -0
@@ -0,0 +1,70 @@ +## +## Purpose: +## This class is used by any recipes that are built using +## Cargo. + +inherit cargo_common + +# the binary we will use +CARGO = "cargo" + +# We need cargo to compile for the target +BASEDEPENDS_append = " cargo-native" + +# Ensure we get the right rust variant +DEPENDS_append_class-target = " virtual/${TARGET_PREFIX}rust ${RUSTLIB_DEP}" +DEPENDS_append_class-native = " rust-native" + +# Cargo only supports in-tree builds at the moment +B = "${S}" + +# In case something fails in the build process, give a bit more feedback on +# where the issue occured +export RUST_BACKTRACE = "1" + +RUSTFLAGS ??= "" +BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}" +CARGO_BUILD_FLAGS = "-v --target ${HOST_SYS} ${BUILD_MODE}" + +# This is based on the content of CARGO_BUILD_FLAGS and generally will need to +# change if CARGO_BUILD_FLAGS changes. +BUILD_DIR = "${@['release', 'debug'][d.getVar('DEBUG_BUILD') == '1']}" +CARGO_TARGET_SUBDIR="${HOST_SYS}/${BUILD_DIR}" +oe_cargo_build () { + export RUSTFLAGS="${RUSTFLAGS}" + export RUST_TARGET_PATH="${RUST_TARGET_PATH}" + bbnote "cargo = $(which ${CARGO})" + bbnote "rustc = $(which ${RUSTC})" + bbnote "${CARGO} build ${CARGO_BUILD_FLAGS} $@" + "${CARGO}" build ${CARGO_BUILD_FLAGS} "$@" +} + +cargo_do_compile () { + oe_cargo_fix_env + oe_cargo_build +} + +cargo_do_install () { + local have_installed=false + for tgt in "${B}/target/${CARGO_TARGET_SUBDIR}/"*; do + case $tgt in + *.so|*.rlib) + install -d "${D}${rustlibdir}" + install -m755 "$tgt" "${D}${rustlibdir}" + have_installed=true + ;; + *) + if [ -f "$tgt" ] && [ -x "$tgt" ]; then + install -d "${D}${bindir}" + install -m755 "$tgt" "${D}${bindir}" + have_installed=true + fi + ;; + esac + done + if ! $have_installed; then + die "Did not find anything to install" + fi +} + +EXPORT_FUNCTIONS do_compile do_install
meta/classes/cargo_common.bbclass new file +98 -0
98 lines not on this page · raw message
meta/classes/crate-fetch.bbclass new file +13 -0
@@ -0,0 +1,13 @@ +# +# crate-fetch class +# +# Registers 'crate' method for Bitbake fetch2. +# +# Adds support for following format in recipe SRC_URI: +# crate://<packagename>/<version> +# + +python () { + import crate + bb.fetch2.methods.append( crate.Crate() ) +}
meta/classes/rust-bin.bbclass new file +149 -0
149 lines not on this page · raw message
meta/classes/rust-common.bbclass new file +144 -0
144 lines not on this page · raw message
meta/classes/rust.bbclass new file +45 -0
45 lines not on this page · raw message
meta/conf/distro/include/rust_security_flags.inc new file +7 -0
@@ -0,0 +1,7 @@ +# Build errors with PIE options enabled +SECURITY_CFLAGS_pn-rust-native = "${SECURITY_NO_PIE_CFLAGS}" +SECURITY_CFLAGS_pn-rust-cross-${TARGET_ARCH} = "${SECURITY_NO_PIE_CFLAGS}" +SECURITY_CFLAGS_pn-rust = "${SECURITY_NO_PIE_CFLAGS}" +SECURITY_CFLAGS_pn-rust-llvm = "${SECURITY_NO_PIE_CFLAGS}" + +SECURITY_LDFLAGS_pn-rust-cross-arm = " -lssp_nonshared -lssp"
meta/conf/layer.conf +2 -0
@@ -98,3 +98,5 @@ SSTATE_EXCLUDEDEPS_SYSROOT += ".*->autoconf-archive-native" # We need to keep bitbake tools in PATH PATH := "${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}:${HOSTTOOLS_DIR}" + +require conf/distro/include/rust_security_flags.inc
meta/lib/crate.py new file +149 -0
149 lines not on this page · raw message
meta/recipes-devtools/cargo/cargo-1.34.2/0001-Disable-http2.patch new file +29 -0
@@ -0,0 +1,29 @@ +From 44cf21036646e4849e9f8566db7decb7da917394 Mon Sep 17 00:00:00 2001 +From: Johan Anderholm <[email protected]> +Date: Sun, 27 Jan 2019 10:19:00 +0100 +Subject: [PATCH] Disable http2 + +http2 requires that curl is build with nghttp2 which in turn depends on +many dependencies and ultimately a dependency loop in the case of +curl-native. As long as multiplexing is disabled in cargo this should +be fine. + +Upstream-Status: Inappropriate + +--- + Cargo.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Cargo.toml b/Cargo.toml +index 8238380861d9..ced1defea459 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -24,7 +24,7 @@ bytesize = "1.0" + crates-io = { path = "src/crates-io", version = "0.23" } + crossbeam-utils = "0.6" + crypto-hash = "0.3.1" +-curl = { version = "0.4.19", features = ['http2'] } ++curl = { version = "0.4.19" } + curl-sys = "0.4.15" + env_logger = "0.6.0" + pretty_env_logger = { version = "0.3", optional = true }
meta/recipes-devtools/cargo/cargo-1.36.0/0001-Disable-http2.patch new file +31 -0
@@ -0,0 +1,31 @@ +From 42e65192b6f7520b7a05924856e00600961f6758 Mon Sep 17 00:00:00 2001 +From: Johan Anderholm <[email protected]> +Date: Sun, 27 Jan 2019 10:19:00 +0100 +Subject: [PATCH] Disable http2 + +http2 requires that curl is build with nghttp2 which in turn depends on +many dependencies and ultimately a dependency loop in the case of +curl-native. As long as multiplexing is disabled in cargo this should +be fine. + +Upstream-Status: Inappropriate +--- + Cargo.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Cargo.toml b/Cargo.toml +index c3fcacf5..bd6ec50b 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -24,7 +24,7 @@ bytesize = "1.0" + crates-io = { path = "src/crates-io", version = "0.25" } + crossbeam-utils = "0.6" + crypto-hash = "0.3.1" +-curl = { version = "0.4.21", features = ['http2'] } ++curl = { version = "0.4.21" } + curl-sys = "0.4.18" + env_logger = "0.6.0" + pretty_env_logger = { version = "0.3", optional = true } +-- +2.11.0 +
meta/recipes-devtools/cargo/cargo-1.37.0/0001-Disable-http2.patch new file +29 -0
@@ -0,0 +1,29 @@ +From 0e2384133664ebeb548b782ad763c3a627c1bc66 Mon Sep 17 00:00:00 2001 +From: Johan Anderholm <[email protected]> +Date: Sun, 27 Jan 2019 10:19:00 +0100 +Subject: [PATCH] Disable http2 + +http2 requires that curl is build with nghttp2 which in turn depends on +many dependencies and ultimately a dependency loop in the case of +curl-native. As long as multiplexing is disabled in cargo this should +be fine. + +Upstream-Status: Inappropriate + +--- + src/tools/cargo/Cargo.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Cargo.toml b/Cargo.toml +index d15aa2513..ba9c77d25 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -24,7 +24,7 @@ bytesize = "1.0" + crates-io = { path = "crates/crates-io", version = "0.26" } + crossbeam-utils = "0.6" + crypto-hash = "0.3.1" +-curl = { version = "0.4.21", features = ['http2'] } ++curl = { version = "0.4.21" } + curl-sys = "0.4.18" + env_logger = "0.6.0" + pretty_env_logger = { version = "0.3", optional = true }
meta/recipes-devtools/cargo/cargo.inc new file +43 -0
43 lines not on this page · raw message
meta/recipes-devtools/cargo/cargo_1.34.2.bb new file +8 -0
@@ -0,0 +1,8 @@ +require recipes-devtools/rust/rust-source-${PV}.inc +require recipes-devtools/rust/rust-snapshot-${PV}.inc +require cargo.inc + +LIC_FILES_CHKSUM += " \ + file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \ + file://LICENSE-THIRD-PARTY;md5=892ea68b169e69cfe75097fc38a15b56 \ +"
meta/recipes-devtools/cargo/cargo_1.36.0.bb new file +8 -0
@@ -0,0 +1,8 @@ +require recipes-devtools/rust/rust-source-${PV}.inc +require recipes-devtools/rust/rust-snapshot-${PV}.inc +require cargo.inc + +LIC_FILES_CHKSUM += " \ + file://LICENSE-APACHE;md5=71b224ca933f0676e26d5c2e2271331c \ + file://LICENSE-THIRD-PARTY;md5=f257ad009884cb88a3a87d6920e7180a \ +"
meta/recipes-devtools/cargo/cargo_1.37.0.bb new file +8 -0
@@ -0,0 +1,8 @@ +require recipes-devtools/rust/rust-source-${PV}.inc +require recipes-devtools/rust/rust-snapshot-${PV}.inc +require cargo.inc + +LIC_FILES_CHKSUM += " \ + file://LICENSE-APACHE;md5=71b224ca933f0676e26d5c2e2271331c \ + file://LICENSE-THIRD-PARTY;md5=f257ad009884cb88a3a87d6920e7180a \ +"
meta/recipes-devtools/rust/libstd-rs.inc new file +31 -0
@@ -0,0 +1,31 @@ +SUMMARY = "Rust standard libaries" +HOMEPAGE = "http://www.rust-lang.org" +SECTION = "devel" +LICENSE = "MIT | Apache-2.0" + +RUSTLIB_DEP = "" +inherit cargo + +DEPENDS_append_libc-musl = " libunwind" +# Needed so cargo can find libbacktrace +RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so" + +S = "${RUSTSRC}/src/libstd" + +CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'" + +do_compile_prepend () { + export CARGO_TARGET_DIR="${B}" + # For Rust 1.13.0 and newer + export RUSTC_BOOTSTRAP="1" +} + +do_install () { + mkdir -p ${D}${rustlibdir} + + # With the incremental build support added in 1.24, the libstd deps directory also includes dependency + # files that get installed. Those are really only needed to incrementally rebuild the libstd library + # itself and don't need to be installed. + rm -f ${B}/${TARGET_SYS}/${BUILD_DIR}/deps/*.d + cp ${B}/${TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir} +}
meta/recipes-devtools/rust/libstd-rs_1.34.2.bb new file +8 -0
@@ -0,0 +1,8 @@ +require rust-source-${PV}.inc +require libstd-rs.inc + +LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0" + +CARGO_FEATURES ?= "panic-unwind backtrace" + +CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
meta/recipes-devtools/rust/libstd-rs_1.36.0.bb new file +8 -0
@@ -0,0 +1,8 @@ +require rust-source-${PV}.inc +require libstd-rs.inc + +LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0" + +CARGO_FEATURES ?= "panic-unwind backtrace" + +CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
meta/recipes-devtools/rust/libstd-rs_1.37.0.bb new file +8 -0
@@ -0,0 +1,8 @@ +require rust-source-${PV}.inc +require libstd-rs.inc + +LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0" + +CARGO_FEATURES ?= "panic-unwind backtrace" + +CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
meta/recipes-devtools/rust/rust-cross.inc new file +52 -0
52 lines not on this page · raw message
meta/recipes-devtools/rust/rust-cross_1.34.2.bb new file +3 -0
@@ -0,0 +1,3 @@ +require rust-cross.inc +require rust-source-${PV}.inc +
meta/recipes-devtools/rust/rust-cross_1.36.0.bb new file +3 -0
@@ -0,0 +1,3 @@ +require rust-cross.inc +require rust-source-${PV}.inc +
meta/recipes-devtools/rust/rust-cross_1.37.0.bb new file +3 -0
@@ -0,0 +1,3 @@ +require rust-cross.inc +require rust-source-${PV}.inc +
meta/recipes-devtools/rust/rust-llvm.inc new file +62 -0
62 lines not on this page · raw message
meta/recipes-devtools/rust/rust-llvm/0002-llvm-allow-env-override-of-exe-path.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 7111770e8290082530d920e120995bf81431b0aa Mon Sep 17 00:00:00 2001 +From: Martin Kelly <[email protected]> +Date: Fri, 19 May 2017 00:22:57 -0700 +Subject: [PATCH 12/18] llvm: allow env override of exe path + +When using a native llvm-config from inside a sysroot, we need llvm-config to +return the libraries, include directories, etc. from inside the sysroot rather +than from the native sysroot. Thus provide an env override for calling +llvm-config from a target sysroot. + +Signed-off-by: Martin Kelly <[email protected]> +Signed-off-by: Khem Raj <[email protected]> +--- + tools/llvm-config/llvm-config.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -226,6 +226,13 @@ Typical components:\n\ + + /// Compute the path to the main executable. + std::string GetExecutablePath(const char *Argv0) { ++ // Hack for Yocto: we need to override the root path when we are using ++ // llvm-config from within a target sysroot. ++ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); ++ if (Sysroot != nullptr) { ++ return Sysroot; ++ } ++ + // This just needs to be some symbol in the binary; C++ doesn't + // allow taking the address of ::main however. + void *P = (void *)(intptr_t)GetExecutablePath;
meta/recipes-devtools/rust/rust-llvm_1.34.2.bb new file +16 -0
@@ -0,0 +1,16 @@ +require rust-source-${PV}.inc +require rust-llvm.inc + +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c6b766a4e85dd28301eeed54a6684648" + +do_install_prepend () { + # the install does a sed on this without installing the file + # we don't need it for anything + mkdir -p "${D}/usr/share/llvm/cmake" + touch "${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake" +} + +do_install_append () { + # we don't need any of this stuff to build Rust + rm -rf "${D}/usr/lib/cmake" +}
meta/recipes-devtools/rust/rust-llvm_1.36.0.bb new file +16 -0
@@ -0,0 +1,16 @@ +require rust-source-${PV}.inc +require rust-llvm.inc + +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c6b766a4e85dd28301eeed54a6684648" + +do_install_prepend () { + # the install does a sed on this without installing the file + # we don't need it for anything + mkdir -p "${D}/usr/share/llvm/cmake" + touch "${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake" +} + +do_install_append () { + # we don't need any of this stuff to build Rust + rm -rf "${D}/usr/lib/cmake" +}
meta/recipes-devtools/rust/rust-llvm_1.37.0.bb new file +16 -0
@@ -0,0 +1,16 @@ +require rust-source-${PV}.inc +require rust-llvm.inc + +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c6b766a4e85dd28301eeed54a6684648" + +do_install_prepend () { + # the install does a sed on this without installing the file + # we don't need it for anything + mkdir -p "${D}/usr/share/llvm/cmake" + touch "${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake" +} + +do_install_append () { + # we don't need any of this stuff to build Rust + rm -rf "${D}/usr/lib/cmake" +}
meta/recipes-devtools/rust/rust-snapshot-1.34.2.inc new file +24 -0
@@ -0,0 +1,24 @@ +## This is information on the rust-snapshot (binary) used to build our current release. +## snapshot info is taken from rust/src/stage0.txt +## TODO: find a way to add additional SRC_URIs based on the contents of an +## earlier SRC_URI. +RS_VERSION = "1.33.0" + +RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" +RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" +CARGO_VERSION = "0.34.0" +CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" + +SRC_URI += " \ + https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.gz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.gz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.gz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + " + +# TODO: Add hashes for other architecture toolchains as well. Make a script? +SRC_URI[rustc-snapshot-x86_64.md5sum] = "c1ec989c1965dce754dda1e54274a68c" +SRC_URI[rustc-snapshot-x86_64.sha256sum] = "54a342f718b712d8a17fd7878ebd37d22a82ebc70b59c421168cd4153fd04c2b" +SRC_URI[rust-std-snapshot-x86_64.md5sum] = "d573c5bd3a965c973734c1606968a91e" +SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "661c2ba717ae1502f002b4c6e7aeb8941685c7ea8fe7ac26ed9ede26f615b7af" +SRC_URI[cargo-snapshot-x86_64.md5sum] = "de0e635afa9bf495cefecea476bfce36" +SRC_URI[cargo-snapshot-x86_64.sha256sum] = "4795ae5ca3bb8c7c83ca338676bb02b670efa1eb474e346284b629dc872bcce8"
meta/recipes-devtools/rust/rust-snapshot-1.36.0.inc new file +24 -0
@@ -0,0 +1,24 @@ +## This is information on the rust-snapshot (binary) used to build our current release. +## snapshot info is taken from rust/src/stage0.txt +## TODO: find a way to add additional SRC_URIs based on the contents of an +## earlier SRC_URI. +RS_VERSION = "1.35.0" + +RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" +RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" +CARGO_VERSION = "0.36.0" +CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" + +SRC_URI += " \ + https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + " + +# TODO: Add hashes for other architecture toolchains as well. Make a script? +SRC_URI[rustc-snapshot-x86_64.md5sum] = "47ea78f6b3f68e30f24b9c94e465d6bd" +SRC_URI[rustc-snapshot-x86_64.sha256sum] = "5d6dc216ba429ddf3a1657e70f3e5e380549b546fe56de897677a11d72aa4e07" +SRC_URI[rust-std-snapshot-x86_64.md5sum] = "348ec23ca8e47fc65079bc80e63cca5f" +SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "ccff05d0e2d88499505b10f8e33e8b1645df057f918edc81f8acb0fcee9f90b2" +SRC_URI[cargo-snapshot-x86_64.md5sum] = "93a375e771f3d9b3a139e612dd4730ee" +SRC_URI[cargo-snapshot-x86_64.sha256sum] = "ab5a6ff1947463dbd2477ca5dac2012494dae821112098ae0c54add652adfdc3"
meta/recipes-devtools/rust/rust-snapshot-1.37.0.inc new file +24 -0
@@ -0,0 +1,24 @@ +## This is information on the rust-snapshot (binary) used to build our current release. +## snapshot info is taken from rust/src/stage0.txt +## TODO: find a way to add additional SRC_URIs based on the contents of an +## earlier SRC_URI. +RS_VERSION = "1.36.0" + +RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" +RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" +CARGO_VERSION = "0.37.0" +CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" + +SRC_URI += " \ + https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + " + +# TODO: Add hashes for other architecture toolchains as well. Make a script? +SRC_URI[rustc-snapshot-x86_64.md5sum] = "ec27794c94cc1df1a0a69f7244a09176" +SRC_URI[rustc-snapshot-x86_64.sha256sum] = "fff0158da6f5af2a89936dc3e0c361077c06c2983eb310615e02f81ebbde1416" +SRC_URI[rust-std-snapshot-x86_64.md5sum] = "b71a6fd6f44527c3bf09584e89ad8958" +SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "ce8e12684b568a8a4f7d346a743383429849cf3f028f5712ad3d3e31590c8db3" +SRC_URI[cargo-snapshot-x86_64.md5sum] = "8c661276a0da7a1aa48affbe33b347e6" +SRC_URI[cargo-snapshot-x86_64.sha256sum] = "d20fa121951339d5492cf8862f8a7af59efc99d18f3c27b95ab6d4658b6a7d67"
meta/recipes-devtools/rust/rust-source-1.34.2.inc new file +11 -0
@@ -0,0 +1,11 @@ +SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust" + +SRC_URI[rust.md5sum] = "7c85e6a60dda740295f7e004a1fb15e1" +SRC_URI[rust.sha256sum] = "c69a4a85a1c464368597df8878cb9e1121aae93e215616d45ad7d23af3052f56" + +# later versions of rust change the directory that they unextract to +RUSTSRC = "${WORKDIR}/rustc-${PV}-src" +# set this as our default +S = "${RUSTSRC}" + +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
meta/recipes-devtools/rust/rust-source-1.36.0.inc new file +11 -0
@@ -0,0 +1,11 @@ +SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust" + +SRC_URI[rust.md5sum] = "78ffc0b029aaed216b45c3fe24747d46" +SRC_URI[rust.sha256sum] = "f51645b9f787af4a5d94db17f6af39db0c55980ed24fe366cad55b57900f8f2d" + +# later versions of rust change the directory that they unextract to +RUSTSRC = "${WORKDIR}/rustc-${PV}-src" +# set this as our default +S = "${RUSTSRC}" + +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
meta/recipes-devtools/rust/rust-source-1.37.0.inc new file +11 -0
@@ -0,0 +1,11 @@ +SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust" + +SRC_URI[rust.md5sum] = "ee6300b1d7e5767115492915c4c0d8ef" +SRC_URI[rust.sha256sum] = "10abffac50a729cf74cef6dd03193a2f4647541bd19ee9281be9e5b12ca8cdfd" + +# later versions of rust change the directory that they unextract to +RUSTSRC = "${WORKDIR}/rustc-${PV}-src" +# set this as our default +S = "${RUSTSRC}" + +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
meta/recipes-devtools/rust/rust.inc new file +509 -0
509 lines not on this page · raw message
meta/recipes-devtools/rust/rust_1.34.2.bb new file +12 -0
@@ -0,0 +1,12 @@ +require rust.inc +require rust-source-${PV}.inc +require rust-snapshot-${PV}.inc + +DEPENDS += "rust-llvm (=${PV})" + +# Otherwise we'll depend on what we provide +INHIBIT_DEFAULT_RUST_DEPS_class-native = "1" +# We don't need to depend on gcc-native because yocto assumes it exists +PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust" + +BBCLASSEXTEND = "native"
meta/recipes-devtools/rust/rust_1.36.0.bb new file +12 -0
@@ -0,0 +1,12 @@ +require rust.inc +require rust-source-${PV}.inc +require rust-snapshot-${PV}.inc + +DEPENDS += "rust-llvm (=${PV})" + +# Otherwise we'll depend on what we provide +INHIBIT_DEFAULT_RUST_DEPS_class-native = "1" +# We don't need to depend on gcc-native because yocto assumes it exists +PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust" + +BBCLASSEXTEND = "native"
meta/recipes-devtools/rust/rust_1.37.0.bb new file +12 -0
@@ -0,0 +1,12 @@ +require rust.inc +require rust-source-${PV}.inc +require rust-snapshot-${PV}.inc + +DEPENDS += "rust-llvm (=${PV})" + +# Otherwise we'll depend on what we provide +INHIBIT_DEFAULT_RUST_DEPS_class-native = "1" +# We don't need to depend on gcc-native because yocto assumes it exists +PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust" + +BBCLASSEXTEND = "native"
meta/recipes-example/rust-hello-world/rust-hello-world_git.bb new file +13 -0
@@ -0,0 +1,13 @@ +inherit cargo + +SRC_URI = "git://github.com/jmesmon/rust-hello-world.git;protocol=https" +SRCREV="e0fa23f1a3cb1eb1407165bd2fc36d2f6e6ad728" +LIC_FILES_CHKSUM="file://COPYRIGHT;md5=e6b2207ac3740d2d01141c49208c2147" + +SUMMARY = "Hello World by Cargo for Rust" +HOMEPAGE = "https://github.com/jmesmon/rust-hello-world" +LICENSE = "MIT | Apache-2.0" + +S = "${WORKDIR}/git" + +BBCLASSEXTEND = "native"
meta/recipes-example/rustfmt/rustfmt_0.8.0.bb new file +67 -0
67 lines not on this page · raw message
scripts/build.sh new file +19 -0
@@ -0,0 +1,19 @@ +#!/bin/bash + +# Grab the MACHINE from the environment; otherwise, set it to a sane default +export MACHINE="${MACHINE-qemux86-64}" + +# What to build +BUILD_TARGETS="\ + rustfmt \ + " + +die() { + echo "$*" >&2 + exit 1 +} + +rm -f build/conf/bblayers.conf || die "failed to nuke bblayers.conf" +rm -f build/conf/local.conf || die "failed to nuke local.conf" + +./scripts/containerize.sh bitbake ${BUILD_TARGETS} || die "failed to build"
scripts/cleanup-env.sh new file +14 -0
@@ -0,0 +1,14 @@ +#!/bin/bash -x + +sudo fuser -m `pwd`/build + +# Only attempt to unmount if the directory is already mounted +if mountpoint -q `pwd`/build; then + sudo umount `pwd`/build +fi + +sudo fuser -m `pwd`/build + +ps -ef + +exit 0
scripts/containerize.sh new file +54 -0
54 lines not on this page · raw message
scripts/fetch.sh new file +103 -0
103 lines not on this page · raw message
scripts/publish-build-cache.sh new file +13 -0
@@ -0,0 +1,13 @@ +#!/bin/bash -x + +if [[ $# -lt 1 ]]; then + echo "No Yocto branch specified, defaulting to master" + echo "To change this pass a Yocto branch name as an argument to this script" +fi +branch=${1-master} + +rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress build/downloads [email protected]:/srv/yocto-cache/ + +rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress build/sstate-cache [email protected]:/srv/yocto-cache/${branch}/ + +exit 0
scripts/setup-env.sh new file +12 -0
@@ -0,0 +1,12 @@ +#!/bin/bash -e + +mkdir -p build + +total_mem=`grep MemTotal /proc/meminfo | awk '{print $2}'` + +# Only have the slaves with large amounts of RAM mount the tmpfs +if [ "$total_mem" -ge "67108864" ]; then + sudo mount -t tmpfs -o size=64G,mode=755,uid=${UID} tmpfs build +fi + +exit 0
Signature · 1 line
2.22.0
RFC PATCH 3/3 rust: mv README.md to recipes-devtools/rust/README-rust.md
In reply to Randy MacLeodImport the meta-rust/README.md but relocate and rename it.
--- meta/recipes-devtools/rust/README-rust.md | 69 +++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 meta/recipes-devtools/rust/README-rust.md
meta/recipes-devtools/rust/README-rust.md new file +69 -0
@@ -0,0 +1,69 @@ +## Introduction + +This OpenEmbedded layer provides the rust compiler, tools for building packages +(cargo), and a few example projects. + +## What works: + + - Building `rust-native` and `cargo-native` + - Building Rust based projects with Cargo for the TARGET + - e.g. `rustfmt` which is used by the CI system + - `-buildsdk` and `-crosssdk` packages + +## What doesn't: + + - Using anything but x86_64 as the build environment + - rust (built for target) issue #81 + +## What's untested: + + - cargo (built for target) + +## 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. + +NOTE: You will have to edit the generated recipe based on the comments +contained within it + +## TODO + +## 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. + +## Maintainer(s) & Patch policy + +Open a Pull Request. + +The master branch supports the latest master of poky. When poky creates releases, we will create a branch with the same name as the poky release. This release branch should always work with that poky release. Note that these release branches will typically be less tested than the master branch. + +All new patches against rust, rust-llvm, and cargo must have referenced +upstream issues or PRs opened or an explanation why the patch cannot be +upstreamed. This cooresponds to the OpenEmbedded policy for other meta layers. + +More info can be seen on the wiki. + +## Copyright + +MIT OR Apache-2.0 - Same as rust +
Signature · 1 line
2.22.0
Quoted 19 lines · Randy MacLeod
I moved the Rust support from meta-rust to oe-core.
As you'd expect, it's still building rust-hello-world for all qemus (except riscv64 which may never have worked). Rust-hello-world runs for me on qemu:
x86-64, arm, arm64It may run on other machines but that's what I've tested so far.
We need a list of meta-rust issues that should be resolved in order to get the code accepted in oe-core. I opened an issue to track that:
https://github.com/meta-rust/meta-rust/issues/251but there haven't been any comments yet. I'd rather track issues in github than in the YP Bugzilla:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=12675Here, in no particular order, are some of
the defects that I believe need to be fixed:
Quoted 7 lines
1. build system is assumed to be linux-x86_64
https://github.com/meta-rust/meta-rust/issues/232. Make rust-native build in parallel (it's very slow!) (meta-rust issue/PR to be created by Randy)
3. Document developer workflows such as cargo-bitbake.
Is there consensus on how libraries should be handled in general for various ecosystems?
Precedent with C, Python and Perl are recipes for each library, but vendoring seems to be a popular option now.
There are also related topics like how to provide security support for vendored libraries - this is the main reason why vendored libraries shipped by upstream are rarely used by distributions in the C ecosystem.
Quoted 4 lines
4. Build offline (
BB_NO_NETWORK= '1' )5. make rust-hello-world install for qemuriscv64
https://github.com/meta-rust/meta-rust/issues/252
LLVM in meta-rust is too old for RISC-V.
Using an own LLVM recipe might makes sense for an external layer, but in oe-core the llvm recipe that is already there should be used instead of another copy of LLVM.
Quoted 7 lines
6. ... build rustc and cargo for target (nice to have, only).
https://github.com/meta-rust/meta-rust/issues/817. Bootstrap from C as an option?
See: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12675#c28. Update librsvg to latest (2.46) which uses rust.
2.44 built for me a few months ago with meta-rust.
Quoted 2 lines
What have I missed?
...
9. Ensure that there are no non-optional dependencies on the target librsvg since users will build for targets not supported by Rust. The one in webkitgtk seems to be optional or obsolete.
10. Review the whole contents of the layer.
There are several things where I hope there are better solutions, and I expect that what will land in oe-core will look quite different from the current meta-rust.
See item 5 above for an example.
Quoted 2 lines
../Randy
...
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 26 lines · Adrian Bunk
Quoted 25 lines · Randy MacLeod
I moved the Rust support from meta-rust to oe-core.
As you'd expect, it's still building rust-hello-world for all qemus (except riscv64 which may never have worked). Rust-hello-world runs for me on qemu:
x86-64, arm, arm64It may run on other machines but that's what I've tested so far.
We need a list of meta-rust issues that should be resolved in order to get the code accepted in oe-core. I opened an issue to track that:
https://github.com/meta-rust/meta-rust/issues/251 but there haven't been any comments yet. I'd rather track issues in github than in the YP Bugzilla: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12675Here, in no particular order, are some of
the defects that I believe need to be fixed:1. build system is assumed to be linux-x86_64
https://github.com/meta-rust/meta-rust/issues/232. Make rust-native build in parallel (it's very slow!) (meta-rust issue/PR to be created by Randy)
Quoted 7 lines
Quoted 1 line
3. Document developer workflows such as cargo-bitbake.
Is there consensus on how libraries should be handled in general for various ecosystems?
Precedent with C, Python and Perl are recipes for each library, but vendoring seems to be a popular option now.
I'm not sure what vendoring means here.
I assume that you don't want the list of crates to be part of package FOO's SRC_URI but instead want recipes for each crate. For languages that do dynamic module linking by default, this saves storage space, build time and maintenance. Rust is not such a language by default but I need to learn more about it's dynamic linking support: https://doc.rust-lang.org/reference/linkage.html
I'm not sure if storage would be duplicated with the cargo class managing downloads for Rust packages. I'll check on that. Separate recipes would be significantly more work but we certainly need to understand how to fix a bug in one crate and have that applied to all N users of the crate without modifying N recipes.
Doug Goldstein, wrote most of cargo-bitbake,
so it would be good to hear his point of view.
FYI: Cargo-bitbake ( https://github.com/cardoe/cargo-bitbake ) is a "cargo extension that can generate BitBake recipes
utilizing the classes from meta-rust"
There is a 'simple' example in:
https://github.com/cardoe/cargo-bitbake/blob/master/README.md
Quoted 4 lines
There are also related topics like how to provide security support for vendored libraries - this is the main reason why vendored libraries shipped by upstream are rarely used by distributions in the C ecosystem.
Yes, we need to have a plan for security and bug fixes. Of course Rust is largely impervious to such 20th century problems. (mostly joking!)
Quoted 7 lines
Quoted 5 lines
4. Build offline (
BB_NO_NETWORK= '1' )5. make rust-hello-world install for qemuriscv64
https://github.com/meta-rust/meta-rust/issues/252LLVM in meta-rust is too old for RISC-V.
Right.
I'm away Thursday to Sunday but
I'll work on a fix for that when I'm back.
Quoted 4 lines
Using an own LLVM recipe might makes sense for an external layer, but in oe-core the llvm recipe that is already there should be used instead of another copy of LLVM.
I agree that the goal should be to have a single llvm package but it's an upstream Rust decision. I did look at the differences between the 'forks' and they are significant. The good news is that the llvm-rust code is maintained on it's own branch with the master branch being pristine so it's possible that we could use the rust repo to save on download time and storage and have the different recipes checkout their respective branches until the unification takes place.
See: https://github.com/llvm/llvm-project/branches
Quoted 10 lines
Quoted 8 lines
6. ... build rustc and cargo for target (nice to have, only).
https://github.com/meta-rust/meta-rust/issues/817. Bootstrap from C as an option?
See: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12675#c28. Update librsvg to latest (2.46) which uses rust.
2.44 built for me a few months ago with meta-rust.
Can you share the recipe so I can use it and update it to 2.46?
Quoted 7 lines
Quoted 3 lines
What have I missed?
...9. Ensure that there are no non-optional dependencies on the target librsvg since users will build for targets not supported by Rust. The one in webkitgtk seems to be optional or obsolete.
I don't understand what you are referring to. Perhaps a link to a line in your 2.44 recipe, would help.
Good point about Rust's more limited target support:
https://forge.rust-lang.org/release/platform-support.html
To get started in oe-core, we just need to fix riscv64 it seems.
To deal with such targets, we'd keep the old version of librsvg around for a while longer. That could cascade into several packages with duplicate versions in oe-core so it may be best handled with a separate layer.
Quoted 6 lines
10. Review the whole contents of the layer.
There are several things where I hope there are better solutions, and I expect that what will land in oe-core will look quite different from the current meta-rust.
See item 5 above for an example.
Yes, if we require separate bitbake recipes for each package that would require significant changes to the current layer.
Thanks,
../Randy
Quoted 7 lines
Quoted 3 lines
../Randy
...cu
Adrian
Signature · 2 lines
# Randy MacLeod # Wind River Linux
Quoted 10 lines · Randy MacLeod
Quoted 1 line · Adrian Bunk
On Mon, Sep 23, 2019 at 10:45:05PM -0400, Randy MacLeod wrote:
...
Quoted 3 lines
There are also related topics like how to provide security support for vendored libraries - this is the main reason why vendored libraries shipped by upstream are rarely used by distributions in the C ecosystem.
Yes, we need to have a plan for security and bug fixes. Of course Rust is largely impervious to such 20th century problems. (mostly joking!)
vendor/ in the librsvg 2.46.0 tarball are 145 crates (157 MB). vendor/ in the rust 1.37.0 tarball are 350 crates (308 MB).
Quoted 9 lines
...
Quoted 4 lines
Quoted 2 lines
5. make rust-hello-world install for qemuriscv64
https://github.com/meta-rust/meta-rust/issues/252LLVM in meta-rust is too old for RISC-V.
Right.
I'm away Thursday to Sunday but
I'll work on a fix for that when I'm back.
It needs LLVM 9, plus RISC-V support that is not yet in upstream Rust.
Not sure whether the latter requires more than just a target definition, but this will likely just work if you wait a few months.
Quoted 7 lines
...
Quoted 3 lines
Using an own LLVM recipe might makes sense for an external layer, but in oe-core the llvm recipe that is already there should be used instead of another copy of LLVM.
I agree that the goal should be to have a single llvm package but it's an upstream Rust decision.
For upstream it is better to have an own copy of LLVM, but for a distribution it can be beneficial to avoid having mesa/rust/clang/... each shipping and building own copies of LLVM.
Quoted 1 line
I did look at the differences between the 'forks' and they are significant.
In Debian Rust uses the same LLVM as everything else.
Quoted 4 lines
...
Quoted 1 line
2.44 built for me a few months ago with meta-rust.
Can you share the recipe so I can use it and update it to 2.46?
Attached, the only other noteworthy change was that upstream removed rsvg-view.
Quoted 4 lines
...
Quoted 3 lines
Quoted 2 lines
What have I missed?
...
Quoted 8 lines
Quoted 3 lines
9. Ensure that there are no non-optional dependencies on the target librsvg since users will build for targets not supported by Rust. The one in webkitgtk seems to be optional or obsolete.
...
To deal with such targets, we'd keep the old version of librsvg around for a while longer. That could cascade into several packages with duplicate versions in oe-core so it may be best handled with a separate layer.
This sounds unsustainable, similar to meta-gplv2.
Right now the only dependencies on librsvg in oe-core are webkitgtk (unused, I'll submit a patch removing it after the Yocto 3.0 branching) and an optional dependency in gstreamer1.0-plugins-bad, so likely no problem at the moment.
But with software like bzip2 also moving to Rust this is something that that might need continued attention.
There are people submitting patches for e.g. big endian arm to OE, and there is value in ensuring that OE stays usable for such usecases.
Quoted 8 lines
Quoted 5 lines
10. Review the whole contents of the layer.
There are several things where I hope there are better solutions, and I expect that what will land in oe-core will look quite different from the current meta-rust.
See item 5 above for an example.Yes, if we require separate bitbake recipes for each package that would require significant changes to the current layer.
This is not about specific issues.
There are plenty of other cases like for example rust.inc being the wrong place for OE target -> LLVM target mappings in oe-core, if they are needed at all.
Quoted 3 lines
Thanks,
../Randy
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seedmeta/recipes-gnome/librsvg/librsvg/0001-Auto-detect-Bsymbolic-fixes-configure-on-macOS.patch deleted +0 -35
@@ -1,35 +0,0 @@ -From b99891e31eb6ce550e7e1cb2ca592095b3050a93 Mon Sep 17 00:00:00 2001 -From: Brion Vibber <[email protected]> -Date: Sun, 25 Feb 2018 18:42:36 -0800 -Subject: Auto-detect -Bsymbolic, fixes configure on macOS - -The -Bsymbolic linker option is ELF-specific, and was breaking -configure on macOS unless --disable-Bsymbolic was explicitly passed. - -Switching the behavior from requiring -Bsymbolic to be available -by default to just warning and continuing on without. - -Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/211 - -Upstream-Status: Backport -Signed-off-by: Adrian Bunk <[email protected]> ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 15b26b2d..9f8dce29 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -216,7 +216,7 @@ AM_CONDITIONAL([ENABLE_PIXBUF_LOADER],[test "$enable_pixbuf_loader" = "yes"]) - AC_ARG_ENABLE([Bsymbolic], - [AS_HELP_STRING([--disable-Bsymbolic], - [disable linking with -Bsymbolic])], -- [],[enable_Bsymbolic=yes]) -+ [enable_Bsymbolic=no],[enable_Bsymbolic=auto]) - - BSYMBOLIC_LDFLAG= - if test "$enable_Bsymbolic" != "no"; then --- -2.20.1 -
meta/recipes-gnome/librsvg/librsvg/gtk-option.patch deleted +0 -60
60 lines not on this page · raw message
meta/recipes-gnome/librsvg/librsvg_2.44.14.bb renamed from meta/recipes-gnome/librsvg/librsvg_2.40.20.bb +5 -11
@@ -2,32 +2,26 @@ SUMMARY = "Library for rendering SVG files" HOMEPAGE = "http://ftp.gnome.org/pub/GNOME/sources/librsvg/" BUGTRACKER = "https://bugzilla.gnome.org/" -RECIPE_NO_UPDATE_REASON = "Versions from 2.41.0 requires Rust compiler to build it" - LICENSE = "LGPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ - file://rsvg.h;beginline=3;endline=24;md5=20b4113c4909bbf0d67e006778302bc6" + file://librsvg/rsvg.h;beginline=3;endline=24;md5=20b4113c4909bbf0d67e006778302bc6" SECTION = "x11/utils" DEPENDS = "cairo gdk-pixbuf glib-2.0 libcroco libxml2 pango" BBCLASSEXTEND = "native" -inherit gnomebase gtk-doc pixbufcache upstream-version-is-even gobject-introspection +inherit gnomebase gtk-doc pixbufcache upstream-version-is-even gobject-introspection cargo -SRC_URI += "file://gtk-option.patch \ - file://0001-Auto-detect-Bsymbolic-fixes-configure-on-macOS.patch \ -" +SRC_URI[archive.md5sum] = "7570d139148f3554fa60fb2a0ecfc4f8" +SRC_URI[archive.sha256sum] = "6a85a7868639cdd4aa064245cc8e9d864dad8b8e9a4a8031bb09a4796bc4e303" -SRC_URI[archive.md5sum] = "4949d313b0c5d9161a5c259104af5568" -SRC_URI[archive.sha256sum] = "cff4dd3c3b78bfe99d8fcfad3b8ba1eee3289a0823c0e118d78106be6b84c92b" +CARGO_DISABLE_BITBAKE_VENDORING = "1" CACHED_CONFIGUREVARS = "ac_cv_path_GDK_PIXBUF_QUERYLOADERS=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" PACKAGECONFIG ??= "gdkpixbuf" # The gdk-pixbuf loader PACKAGECONFIG[gdkpixbuf] = "--enable-pixbuf-loader,--disable-pixbuf-loader,gdk-pixbuf-native" -# GTK+ test application (rsvg-view) -PACKAGECONFIG[gtk] = "--with-gtk3,--without-gtk3,gtk+3" do_install_append() { # Loadable modules don't need .a or .la on Linux
Signature · 1 line
2.17.1