23 Commits

Author SHA1 Message Date
Steven Walter
bedc4ad57c rust-llvm.inc: work around build race
The way LLVM builds its native utilities is not safe (it runs a
recursive cmake in the same work directory as the main instance).  To
prevent those instances from stepping on each other, we'll build the two
native utilities separately before starting the main build.

Fixes issue #143
2017-01-31 14:14:43 -05:00
Derek Straka
a506df4ba4 rust: update the cpu selection to use PACKAGE_ARCH to ensure older processors can run created executables when building targets that have newer features
Signed-off-by: Derek Straka <derek@asterius.io>
2017-01-04 17:15:55 -05:00
Doug Goldstein
067e5a7ffd fetch: fix check for local ref path
This is a fast case if the slave has a local checkout available so that
it doesn't have to do a full clone. The check unfortunately didn't take
into account all cases and failed on the new slave.

(cherry picked from commit d867f3d470)
2017-01-02 13:26:21 -06:00
Doug Goldstein
ef7228d76c README: swath of updates to reflect the current state
(cherry picked from commit f43eadc581)
2017-01-02 13:25:35 -06:00
Doug Goldstein
2879fc131d scripts/fetch: add missing die statement
Noticed this while the Yocto Project's git server was down for
maintenance.

(cherry picked from commit 247bb57c84)
2016-12-27 10:51:09 -06:00
Doug Goldstein
2c923bbd20 Merge pull request #131 from leon-anavi/krogoth
compiler-rt: fix toolchain / sdk installer

Ensures files are placed in the proper sub-packages. fixes #130.
2016-12-25 23:21:12 -06:00
Leon Anavi
fcbebdf58f compiler-rt: fix toolchain installer
Fix building a toolchain installer with bitbake
-c populate_sdk in packages compiler-rt,
compiler-rt-dev and compiler-rt-staticdev.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
2016-12-25 00:07:11 +02:00
Derek Straka
004d871505 Merge pull request #129 from cardoe/krogoth-merge
Merge branch 'morty' into krogoth
2016-12-11 19:05:01 -05:00
Doug Goldstein
b454d74256 Revert "libgit2: remove obsolete items from common inc"
This partially reverts commit b139bbc514.
We need to build libgit2 with -fPIC.
2016-12-08 14:35:16 -06:00
Doug Goldstein
270248fa9a Revert "libgit2: remove recipe that is now in meta-openembedded"
This reverts commit b2e6f98f3e. This
change is in open-embedded for morty but not for krogoth so we must keep
it.
2016-12-08 14:34:56 -06:00
Doug Goldstein
fe4131352d Revert "libssh2: remove recipe append that is now in meta-openembedded"
This reverts commit af571adabe. This
change is in meta-openembedded for morty but not for krogoth so we must
keep it.
2016-12-08 14:34:04 -06:00
Doug Goldstein
c7f56766dc Merge branch 'morty' into krogoth
Merges the changes in the morty branch into krogoth to get Rust 1.10.0
and Rust 1.12.1 into krogoth. Additionally this allows for Rust, Cargo
and any recipes to be built without internet access if they are defined
using cargo-bitbake. Fixes #87. Fixes #122.
2016-12-08 09:35:46 -06:00
Doug Goldstein
ef23c8f84b rust: strip whitespace from features
This whitespace in here causes rust to not be happy with the features
and throw warnings about a feature such as ' +sse3' being unsupported
when '+sse3' works just fine. Amazingly will cause rustc to abort when
you try to resolve the features to valid configs with the `--print` arg
to rustc.

(cherry picked from commit ce9949725c)
2016-11-08 19:51:55 -06:00
Derek Straka
c049bde288 Merge pull request #99 from cardoe/krogoth-ci
Jenkins CI
2016-10-31 12:04:16 -04:00
Doug Goldstein
985069709c change Yocto version to krogoth 2016-10-31 08:14:58 -05:00
Derek Straka
02b0de534d add Jenkinsfile to test each PR and branch commits
This includes a basic test that attempts to compile the rustfmt crate.
Ensures that the workspace is always removed at the end of the build. It
utilizes available caches to speed up the build process and parallelizes
the build across i386, x86_64, arm32, and arm64 targets.

Signed-off-by: Derek Straka <derek@asterius.io>
2016-10-31 08:14:53 -05:00
Doug Goldstein
9dc57a12be add a basic build script for testing
This script can be extended in the future but it uses the containerize
script to ensure we run inside of a working build environment. This
script can be extended to build additional targets for testing.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-10-30 11:47:20 -05:00
Doug Goldstein
ba25ff4945 add Yocto config files so we can build
So that we can use the meta-rust layer as the final layer with some
configuration (for the purposes of testing). These configs should be not
used by actual end users.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-10-30 11:47:13 -05:00
Doug Goldstein
6504a5747f helper script to fetch down dependent layers
meta-rust has some layers it depends on and this script ensures it
fetches them down appropriately so that the poky directory can be used
as the source.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-10-30 11:47:08 -05:00
Doug Goldstein
3605be79d0 containerize script for a Yocto build env
The containerize script fetches down a Docker container and wires up the
current directory inside so that you can use a known good environment
for compiling Yocto that has all the dependencies.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-10-30 11:47:03 -05:00
Doug Goldstein
8290aafe54 update case of OpenEmbedded to match upstream
(cherry picked from commit 3b954b38d1)
2016-10-03 08:19:26 -05:00
Derek Straka
565a332b3f Merge pull request #91 from meta-rust/fix-ssh-support
libgit2: add missing dependencies
2016-09-30 17:06:16 -04:00
Doug Goldstein
5975292b62 libgit2: add missing dependencies
Without these dependencies cargo is unable to fetch packages from SSH
based repos. This same fix is already upstream in meta-oe master at:
http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-support/libgit2/libgit2_0.24.1.bb
2016-09-30 15:13:55 -05:00
11 changed files with 68 additions and 30 deletions

2
Jenkinsfile vendored
View File

@@ -15,7 +15,7 @@ for (int i = 0; i < targets.size(); i++) {
sh "./scripts/setup-env.sh"
}
stage("fetch $machine") {
sh "GIT_LOCAL_REF_DIR=/srv/git-cache/ ./scripts/fetch.sh morty"
sh "GIT_LOCAL_REF_DIR=/srv/git-cache/ ./scripts/fetch.sh krogoth"
}
stage("build $machine") {
sh "MACHINE=${machine} ./scripts/build.sh"

View File

@@ -5,17 +5,19 @@ This OpenEmbedded layer provides the rust compiler, tools for building packages
## What works:
- Building rust-native, rust-cross, rust-hello-world, cargo-native
- 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
- Probably some of the untested things
- rust (built for target) issue #81
## What's untested:
- rust (built for target)
- cargo (built for target)
## Building a rust package
@@ -30,39 +32,24 @@ 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.
## Common issues when packaging things using cargo
You may run into errors similar to:
```
| src/lib.rs:12:1: 12:35 error: can't find crate for `ffi`
| src/lib.rs:12 extern crate "openssl-sys" as ffi;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Where a "-sys" crate (or other crate) is not found. These are typically caused
by a crate's Cargo.toml including triplet-specific dependencies and then using
the crate based on a feature (most often, `#[cfg(unix)]`). Until cargo and it's
ecosystem get their act together, you'll need to supply patches to the
misbehaving packages. See `recipies/cargo/cargo_*.bb` for an example of how to
do this.
NOTE: You will have to edit the generated recipe based on the comments
contained within it
## TODO
- -crosssdk and -buildsdk packages
- Upstream local rustc patches for libdir and bindir support
## Pitfalls
- TARGET_SYS _must_ be different from BUILD_SYS. This is due to the way configuration options are tracked for different targets.
- 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:
unknown
- Any `-sys` packages your project might need must have RDEPENDs for
the native library.
On the target:
unknown
- Any `-sys` packages your project might need must have RDEPENDs for
the native library.
## Maintainer(s) & Patch policy
@@ -74,6 +61,8 @@ 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

View File

@@ -0,0 +1,3 @@
require libgit2.inc
SRC_URI = "https://github.com/libgit2/libgit2/archive/v${PV}.tar.gz"

View File

@@ -0,0 +1,21 @@
SUMMARY = "the Git linkable library"
HOMEPAGE = "http://libgit2.github.com/"
LICENSE = "GPL-2.0-with-GCC-exception"
DEPENDS = "curl openssl zlib libssh2"
inherit cmake
# CLAR = tests, needs python-native
EXTRA_OECMAKE = "\
-DTHREADSAFE=ON \
-DBUILD_CLAR=OFF \
-DSHA1_TYPE="builtin" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_EXAMPLES=OFF \
"
CFLAGS_append .= " -fPIC"
BBCLASSEXTEND = "native"

View File

@@ -0,0 +1,4 @@
LIC_FILES_CHKSUM = "file://COPYING;md5=34197a479f637beb9e09e56893f48bc2"
SRC_URI[md5sum] = "3674ca2d40388b1175e25b6f5a3a82ad"
SRC_URI[sha256sum] = "60198cbb34066b9b5c1613d15c0479f6cd25f4aef42f7ec515cd1cc13a77fede"
require libgit2-release.inc

View File

@@ -0,0 +1,2 @@
# meta-oe/recipes-support/libssh2
BBCLASSEXTEND = "native"

View File

@@ -10,6 +10,12 @@ SRC_URI = "\
require rust-source-${PV}.inc
ALLOW_EMPTY_${PN} = "1"
# dev and staticdev should NOT depend on the binary package
RDEPENDS_${PN}-dev = ""
INSANE_SKIP_${PN}-dev = "staticdev"
S = "${WORKDIR}/rustc-${PV}/src/compiler-rt"
do_compile () {
@@ -28,3 +34,6 @@ do_install () {
mkdir -p ${D}${libdir}
cp triple/builtins/libcompiler_rt.a ${D}${libdir}/libcompiler-rt.a
}
FILES_${PN}-dev = ""
FILES_${PN}-staticdev = "${libdir}/*.a"

View File

@@ -6,8 +6,12 @@ LIC_FILES_CHKSUM = "file://src/compiler-rt/LICENSE.TXT;md5=bf24bca27049b52e97384
require rust.inc
require rust-source-${PV}.inc
ALLOW_EMPTY_${PN} = "1"
DEPENDS += "rust-llvm-native (=${PV})"
# dev and staticdev should NOT depend on the binary package
RDEPENDS_${PN}-dev = ""
INSANE_SKIP_${PN}-dev = "staticdev"
S = "${WORKDIR}/rustc-${PV}"
@@ -22,3 +26,6 @@ do_install () {
mkdir -p ${D}${libdir}
cp ${TARGET_SYS}/rt/libcompiler-rt.a ${D}${libdir}/libcompiler-rt.a
}
FILES_${PN}-dev = ""
FILES_${PN}-staticdev = "${libdir}/*.a"

View File

@@ -80,6 +80,8 @@ do_compile_prepend_class-target() {
}
do_compile() {
oe_runmake NATIVE_LIB_LLVMTABLEGEN
oe_runmake NativeLLVMConfig
oe_runmake
}

View File

@@ -177,7 +177,7 @@ def arch_to_rust_target_arch(arch):
# generates our target CPU value
def llvm_cpu(d):
cpu = d.getVar('TUNE_PKGARCH', True)
cpu = d.getVar('PACKAGE_ARCH', True)
target = d.getVar('TRANSLATED_TARGET_ARCH', True)
trans = {}

View File

@@ -40,10 +40,11 @@ update_repo() {
git fetch origin || die "unable to fetch ${uri}"
else
echo "Cloning '${path}'"
if [ -z "${GIT_LOCAL_REF_DIR}" ]; then
git clone ${uri} ${path} || die "unable to clone ${uri}"
if [ -d "${GIT_LOCAL_REF_DIR}" ]; then
git clone --reference ${GIT_LOCAL_REF_DIR}/`basename ${path}` \
${uri} ${path} || die "unable to clone ${uri}"
else
git clone --reference ${GIT_LOCAL_REF_DIR}/`basename ${path}` ${uri} ${path}
git clone ${uri} ${path} || die "unable to clone ${uri}"
fi
pushd ${path} > /dev/null
fi