Compare commits
26 Commits
add-more-c
...
morty
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5387107af | ||
|
|
505ba7a172 | ||
|
|
d464b3971e | ||
|
|
2973190c5c | ||
|
|
5c0fb2e6ed | ||
|
|
fe8cd1cd26 | ||
|
|
e487df7af6 | ||
|
|
57de9b5600 | ||
|
|
699f625a52 | ||
|
|
27d1887a1c | ||
|
|
7d53935f42 | ||
|
|
3898e8eef5 | ||
|
|
fd46706b70 | ||
|
|
46194288a2 | ||
|
|
02db49040f | ||
|
|
dd82264588 | ||
|
|
afb78a3088 | ||
|
|
94c31284cf | ||
|
|
1f86681678 | ||
|
|
02de815dfa | ||
|
|
2985fc9b12 | ||
|
|
b7b1b49752 | ||
|
|
7af0a17723 | ||
|
|
15dc2a986e | ||
|
|
38ba7ccf2e | ||
|
|
41c07421fc |
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@@ -24,6 +24,9 @@ for (int i = 0; i < targets.size(); i++) {
|
||||
echo "Caught: ${e}"
|
||||
throw e
|
||||
} finally {
|
||||
stage("push build cache $machine") {
|
||||
sh "./scripts/publish-build-cache.sh morty"
|
||||
}
|
||||
stage("cleanup $machine") {
|
||||
sh "./scripts/cleanup-env.sh"
|
||||
deleteDir()
|
||||
|
||||
39
README.md
39
README.md
@@ -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
|
||||
|
||||
@@ -83,10 +83,6 @@ oe_cargo_fix_env () {
|
||||
EXTRA_OECARGO_PATHS ??= ""
|
||||
|
||||
cargo_do_compile () {
|
||||
# prevent cargo from trying to fetch down new data
|
||||
mkdir -p "${WORKDIR}/cargo_home/registry/index/github.com-1ecc6299db9ec823"
|
||||
touch "${WORKDIR}/cargo_home/registry/index/github.com-1ecc6299db9ec823/.cargo-index-lock"
|
||||
|
||||
oe_cargo_fix_env
|
||||
oe_cargo_build
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ BB_DISKMON_DIRS = "\
|
||||
#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
|
||||
#file://.* file:///some/local/dir/sstate/PATH"
|
||||
|
||||
SSTATE_MIRRORS ?= "file://.* http://build-cache.asterius.io/sstate/PATH;downloadfilename=PATH \n"
|
||||
SSTATE_MIRRORS ?= "file://.* http://build-cache.asterius.io/morty/sstate-cache/PATH;downloadfilename=PATH \n"
|
||||
|
||||
SOURCE_MIRROR_URL ?= "http://build-cache.asterius.io/downloads/"
|
||||
INHERIT += "own-mirrors rm_work"
|
||||
|
||||
110
lib/crate.py
110
lib/crate.py
@@ -35,21 +35,6 @@ class Crate(Wget):
|
||||
|
||||
"""Class to fetch crates via wget"""
|
||||
|
||||
def _cargo_path(self, rootdir, component):
|
||||
# TODO: make this less brittle
|
||||
# This can go away entirely once we can build a cargo that supports source-replacement
|
||||
repo = "github.com-1ecc6299db9ec823"
|
||||
return os.path.join(rootdir, "cargo_home", "registry", component, repo)
|
||||
|
||||
def _cargo_src_path(self, rootdir):
|
||||
return self._cargo_path(rootdir, "src")
|
||||
|
||||
def _cargo_index_path(self, rootdir):
|
||||
return self._cargo_path(rootdir, "index")
|
||||
|
||||
def _cargo_cache_path(self, rootdir):
|
||||
return self._cargo_path(rootdir, "cache")
|
||||
|
||||
def _cargo_bitbake_path(self, rootdir):
|
||||
return os.path.join(rootdir, "cargo_home", "bitbake")
|
||||
|
||||
@@ -57,7 +42,7 @@ class Crate(Wget):
|
||||
"""
|
||||
Check to see if a given url is for this fetcher
|
||||
"""
|
||||
return ud.type in ['crate', 'crate-index']
|
||||
return ud.type in ['crate']
|
||||
|
||||
def recommends_checksum(self, urldata):
|
||||
return False
|
||||
@@ -69,8 +54,6 @@ class Crate(Wget):
|
||||
|
||||
if ud.type == 'crate':
|
||||
self._crate_urldata_init(ud, d)
|
||||
elif ud.type == 'crate-index':
|
||||
self._index_urldata_init(ud, d)
|
||||
|
||||
super(Crate, self).urldata_init(ud, d)
|
||||
|
||||
@@ -102,71 +85,15 @@ class Crate(Wget):
|
||||
|
||||
logger.debug(2, "Fetching %s to %s" % (ud.url, ud.parm['downloadfilename']))
|
||||
|
||||
def _index_urldata_init(self, ud, d):
|
||||
"""
|
||||
Sets up the download for the cargo index
|
||||
"""
|
||||
|
||||
# URL syntax is: crate-index://REV
|
||||
# break the URL apart by /
|
||||
parts = ud.url.split('/')
|
||||
if len(parts) != 4:
|
||||
raise bb.fetch2.ParameterError("Invalid URL: Must be crate-index://HOST/REV", ud.url)
|
||||
|
||||
# last field is the rev
|
||||
rev = parts[3]
|
||||
host = parts[2]
|
||||
|
||||
if host == 'crates.io':
|
||||
host = 'github.com/rust-lang/crates.io-index'
|
||||
|
||||
ud.url = "https://%s/archive/%s.tar.gz" % (host, rev)
|
||||
ud.parm['downloadfilename'] = 'cargo-index-%s.tar.gz' % rev
|
||||
ud.parm['name'] = "index"
|
||||
|
||||
logger.debug(2, "Fetching crate index %s" % ud.url)
|
||||
|
||||
def unpack(self, ud, rootdir, d):
|
||||
"""
|
||||
Uses the crate to build the necessary paths for cargo to utilize it
|
||||
"""
|
||||
if ud.type == 'crate-index':
|
||||
return self._index_unpack(ud, rootdir, d)
|
||||
elif ud.type == 'crate':
|
||||
if ud.type == 'crate':
|
||||
return self._crate_unpack(ud, rootdir, d)
|
||||
else:
|
||||
super(Crate, self).unpack(ud, rootdir, d)
|
||||
|
||||
def _index_unpack(self, ud, rootdir, d):
|
||||
"""
|
||||
Unpacks the index
|
||||
"""
|
||||
thefile = ud.localpath
|
||||
|
||||
cargo_index = self._cargo_index_path(rootdir)
|
||||
|
||||
cmd = "tar -xz --no-same-owner --strip-components 1 -f %s -C %s" % (thefile, cargo_index)
|
||||
|
||||
# change to the rootdir to unpack but save the old working dir
|
||||
save_cwd = os.getcwd()
|
||||
os.chdir(rootdir)
|
||||
|
||||
# ensure we've got these paths made
|
||||
bb.utils.mkdirhier(cargo_index)
|
||||
|
||||
# path it
|
||||
path = d.getVar('PATH', True)
|
||||
if path:
|
||||
cmd = "PATH=\"%s\" %s" % (path, cmd)
|
||||
bb.note("Unpacking %s to %s/" % (thefile, cargo_index))
|
||||
|
||||
ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True)
|
||||
|
||||
os.chdir(save_cwd)
|
||||
|
||||
if ret != 0:
|
||||
raise UnpackError("Unpack command %s failed with return value %s" % (cmd, ret), ud.url)
|
||||
|
||||
def _crate_unpack(self, ud, rootdir, d):
|
||||
"""
|
||||
Unpacks a crate
|
||||
@@ -184,8 +111,6 @@ class Crate(Wget):
|
||||
if pn == ud.parm.get('name'):
|
||||
cmd = "tar -xz --no-same-owner -f %s" % thefile
|
||||
else:
|
||||
self._crate_unpack_old_layout(ud, rootdir, d)
|
||||
|
||||
cargo_bitbake = self._cargo_bitbake_path(rootdir)
|
||||
|
||||
cmd = "tar -xz --no-same-owner -f %s -C %s" % (thefile, cargo_bitbake)
|
||||
@@ -222,34 +147,3 @@ class Crate(Wget):
|
||||
mdpath = os.path.join(bbpath, cratepath, mdfile)
|
||||
with open(mdpath, "w") as f:
|
||||
json.dump(metadata, f)
|
||||
|
||||
|
||||
def _crate_unpack_old_layout(self, ud, rootdir, d):
|
||||
"""
|
||||
Unpacks a crate in the old location that tried to emulate
|
||||
the Cargo registry layout.
|
||||
"""
|
||||
thefile = ud.localpath
|
||||
|
||||
cargo_src = self._cargo_src_path(rootdir)
|
||||
cargo_cache = self._cargo_cache_path(rootdir)
|
||||
|
||||
cmd = "tar -xz --no-same-owner -f %s -C %s" % (thefile, cargo_src)
|
||||
|
||||
# ensure we've got these paths made
|
||||
bb.utils.mkdirhier(cargo_cache)
|
||||
bb.utils.mkdirhier(cargo_src)
|
||||
|
||||
bb.note("Copying %s to %s/" % (thefile, cargo_cache))
|
||||
shutil.copy(thefile, cargo_cache)
|
||||
|
||||
# path it
|
||||
path = d.getVar('PATH', True)
|
||||
if path:
|
||||
cmd = "PATH=\"%s\" %s" % (path, cmd)
|
||||
bb.note("Unpacking %s to %s/" % (thefile, os.getcwd()))
|
||||
|
||||
ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True)
|
||||
|
||||
if ret != 0:
|
||||
raise UnpackError("Unpack command %s failed with return value %s" % (cmd, ret), ud.url)
|
||||
|
||||
@@ -8,11 +8,8 @@ LICENSE = "MIT | Apache-2.0"
|
||||
|
||||
DEPENDS = "openssl zlib libgit2 curl ca-certificates libssh2"
|
||||
|
||||
CARGO_INDEX_COMMIT = "6127fc24b0b6fe73fe4d339817fbf000b9a798a2"
|
||||
|
||||
SRC_URI = "\
|
||||
http://static-rust-lang-org.s3.amazonaws.com/cargo-dist/${CARGO_SNAPSHOT} \
|
||||
crate-index://crates.io/${CARGO_INDEX_COMMIT} \
|
||||
"
|
||||
|
||||
B = "${S}"
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
require cargo-snapshot.inc
|
||||
require cargo.inc
|
||||
|
||||
SRC_URI += " \
|
||||
git://github.com/rust-lang/cargo.git;protocol=https;name=cargo \
|
||||
file://0001-disable-cargo-snapshot-fetch.patch \
|
||||
file://0001-Never-update-the-registry-index.patch \
|
||||
crate://crates.io/advapi32-sys/0.1.2 \
|
||||
crate://crates.io/bufstream/0.1.1 \
|
||||
crate://crates.io/crossbeam/0.2.8 \
|
||||
crate://crates.io/docopt/0.6.78 \
|
||||
crate://crates.io/env_logger/0.3.2 \
|
||||
crate://crates.io/filetime/0.1.10 \
|
||||
crate://crates.io/flate2/0.2.13 \
|
||||
crate://crates.io/fs2/0.2.3 \
|
||||
crate://crates.io/glob/0.2.11 \
|
||||
crate://crates.io/hamcrest/0.1.0 \
|
||||
crate://crates.io/kernel32-sys/0.2.1 \
|
||||
crate://crates.io/libc/0.2.8 \
|
||||
crate://crates.io/log/0.3.5 \
|
||||
crate://crates.io/num_cpus/0.2.11 \
|
||||
crate://crates.io/regex/0.1.58 \
|
||||
crate://crates.io/rustc-serialize/0.3.18 \
|
||||
crate://crates.io/tar/0.4.5 \
|
||||
crate://crates.io/tempdir/0.3.4 \
|
||||
crate://crates.io/term/0.4.4 \
|
||||
crate://crates.io/toml/0.1.28 \
|
||||
crate://crates.io/url/1.1.0 \
|
||||
crate://crates.io/winapi/0.2.6 \
|
||||
crate://crates.io/semver/0.2.3 \
|
||||
crate://crates.io/regex-syntax/0.3.0 \
|
||||
crate://crates.io/utf8-ranges/0.1.3 \
|
||||
crate://crates.io/gcc/0.3.26 \
|
||||
crate://crates.io/unicode-normalization/0.1.2 \
|
||||
crate://crates.io/libz-sys/1.0.2 \
|
||||
crate://crates.io/rand/0.3.14 \
|
||||
crate://crates.io/user32-sys/0.1.2 \
|
||||
crate://crates.io/idna/0.1.0 \
|
||||
crate://crates.io/strsim/0.3.0 \
|
||||
crate://crates.io/matches/0.1.2 \
|
||||
crate://crates.io/cmake/0.1.16 \
|
||||
crate://crates.io/gdi32-sys/0.1.1 \
|
||||
crate://crates.io/bitflags/0.1.1 \
|
||||
crate://crates.io/unicode-bidi/0.2.3 \
|
||||
crate://crates.io/pkg-config/0.3.8 \
|
||||
crate://crates.io/winapi-build/0.1.1 \
|
||||
crate://crates.io/memchr/0.1.10 \
|
||||
crate://crates.io/pnacl-build-helper/1.4.10 \
|
||||
crate://crates.io/nom/1.2.2 \
|
||||
crate://crates.io/num/0.1.31 \
|
||||
crate://crates.io/uuid/0.2.3 \
|
||||
crate://crates.io/aho-corasick/0.5.1 \
|
||||
crate://crates.io/libressl-pnacl-sys/2.1.6 \
|
||||
crate://crates.io/miniz-sys/0.1.7 \
|
||||
crate://crates.io/openssl-sys/0.7.8 \
|
||||
crate://crates.io/url/0.5.10 \
|
||||
"
|
||||
# Compatible with Rust 1.10.0
|
||||
# https://static.rust-lang.org/dist/channel-rust-1.10.0.toml
|
||||
SRCREV_cargo = "259324cd8f9bb6e1068a3a2b77685e90fda3e3b6"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
LIC_FILES_CHKSUM ="\
|
||||
file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \
|
||||
file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
|
||||
file://LICENSE-THIRD-PARTY;md5=892ea68b169e69cfe75097fc38a15b56 \
|
||||
"
|
||||
|
||||
## curl-rust
|
||||
SRC_URI += "\
|
||||
git://github.com/carllerche/curl-rust.git;protocol=https;destsuffix=curl-rust;name=curl-rust \
|
||||
file://curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.patch;patchdir=../curl-rust \
|
||||
file://curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch;patchdir=../curl-rust \
|
||||
"
|
||||
|
||||
# 0.2.19 / -sys 0.1.34
|
||||
SRCREV_curl-rust = "45b8cb56fbed45f828f96bdd8c286b2b3a8a26cb"
|
||||
|
||||
SRCREV_FORMAT .= "_curl-rust"
|
||||
EXTRA_OECARGO_PATHS += "${WORKDIR}/curl-rust"
|
||||
|
||||
## ssh2-rs
|
||||
SRC_URI += "\
|
||||
git://github.com/alexcrichton/ssh2-rs.git;protocol=https;name=ssh2-rs;destsuffix=ssh2-rs \
|
||||
file://ssh2-rs/0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch;patchdir=../ssh2-rs \
|
||||
"
|
||||
|
||||
# 0.2.11 / -sys 0.1.37
|
||||
SRCREV_ssh2-rs = "ced77751cb780d0725a3411bd588c5a26ea79953"
|
||||
|
||||
SRCREV_FORMAT .= "_ssh2-rs"
|
||||
EXTRA_OECARGO_PATHS += "${WORKDIR}/ssh2-rs"
|
||||
|
||||
## git2-rs
|
||||
SRC_URI += "\
|
||||
git://github.com/alexcrichton/git2-rs.git;protocol=https;name=git2-rs;destsuffix=git2-rs \
|
||||
file://git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch;patchdir=../git2-rs \
|
||||
"
|
||||
|
||||
# 0.4.3 / -sys 0.4.2
|
||||
SRCREV_git2-rs = "cd14fc7801e70d3b26a4e7e5d94785af1f7e9e58"
|
||||
|
||||
SRCREV_FORMAT .= "_git2-rs"
|
||||
EXTRA_OECARGO_PATHS += "${WORKDIR}/git2-rs"
|
||||
85
recipes-devtools/cargo/cargo_0.16.0.bb
Normal file
85
recipes-devtools/cargo/cargo_0.16.0.bb
Normal file
@@ -0,0 +1,85 @@
|
||||
require cargo-snapshot.inc
|
||||
require cargo.inc
|
||||
|
||||
EXTRA_OECONF += "--cargo=${WORKDIR}/cargo-nightly-x86_64-unknown-linux-gnu/cargo/bin/cargo"
|
||||
|
||||
SRC_URI += " \
|
||||
git://github.com/rust-lang/cargo.git;protocol=https;name=cargo;branch=rust-1.15.1 \
|
||||
crate://crates.io/advapi32-sys/0.2.0 \
|
||||
crate://crates.io/aho-corasick/0.5.3 \
|
||||
crate://crates.io/bitflags/0.7.0 \
|
||||
crate://crates.io/bufstream/0.1.2 \
|
||||
crate://crates.io/cfg-if/0.1.0 \
|
||||
crate://crates.io/cmake/0.1.19 \
|
||||
crate://crates.io/crossbeam/0.2.10 \
|
||||
crate://crates.io/curl-sys/0.3.6 \
|
||||
crate://crates.io/curl/0.4.1 \
|
||||
crate://crates.io/docopt/0.6.86 \
|
||||
crate://crates.io/env_logger/0.3.5 \
|
||||
crate://crates.io/filetime/0.1.10 \
|
||||
crate://crates.io/flate2/0.2.14 \
|
||||
crate://crates.io/fs2/0.3.0 \
|
||||
crate://crates.io/gcc/0.3.39 \
|
||||
crate://crates.io/gdi32-sys/0.2.0 \
|
||||
crate://crates.io/git2-curl/0.7.0 \
|
||||
crate://crates.io/git2/0.6.3 \
|
||||
crate://crates.io/glob/0.2.11 \
|
||||
crate://crates.io/hamcrest/0.1.1 \
|
||||
crate://crates.io/idna/0.1.0 \
|
||||
crate://crates.io/kernel32-sys/0.2.2 \
|
||||
crate://crates.io/lazy_static/0.2.2 \
|
||||
crate://crates.io/libc/0.2.18 \
|
||||
crate://crates.io/libgit2-sys/0.6.5 \
|
||||
crate://crates.io/libssh2-sys/0.2.4 \
|
||||
crate://crates.io/libz-sys/1.0.10 \
|
||||
crate://crates.io/log/0.3.6 \
|
||||
crate://crates.io/matches/0.1.4 \
|
||||
crate://crates.io/memchr/0.1.11 \
|
||||
crate://crates.io/miniz-sys/0.1.7 \
|
||||
crate://crates.io/miow/0.1.3 \
|
||||
crate://crates.io/net2/0.2.26 \
|
||||
crate://crates.io/num-bigint/0.1.35 \
|
||||
crate://crates.io/num-complex/0.1.35 \
|
||||
crate://crates.io/num-integer/0.1.32 \
|
||||
crate://crates.io/num-iter/0.1.32 \
|
||||
crate://crates.io/num-rational/0.1.35 \
|
||||
crate://crates.io/num-traits/0.1.36 \
|
||||
crate://crates.io/num/0.1.36 \
|
||||
crate://crates.io/num_cpus/1.1.0 \
|
||||
crate://crates.io/openssl-probe/0.1.0 \
|
||||
crate://crates.io/openssl-sys/0.9.1 \
|
||||
crate://crates.io/openssl/0.9.1 \
|
||||
crate://crates.io/pkg-config/0.3.8 \
|
||||
crate://crates.io/psapi-sys/0.1.0 \
|
||||
crate://crates.io/rand/0.3.14 \
|
||||
crate://crates.io/regex-syntax/0.3.9 \
|
||||
crate://crates.io/regex/0.1.80 \
|
||||
crate://crates.io/rustc-serialize/0.3.21 \
|
||||
crate://crates.io/semver-parser/0.6.1 \
|
||||
crate://crates.io/semver/0.5.1 \
|
||||
crate://crates.io/strsim/0.5.1 \
|
||||
crate://crates.io/tar/0.4.9 \
|
||||
crate://crates.io/tempdir/0.3.5 \
|
||||
crate://crates.io/term/0.4.4 \
|
||||
crate://crates.io/thread-id/2.0.0 \
|
||||
crate://crates.io/thread_local/0.2.7 \
|
||||
crate://crates.io/toml/0.2.1 \
|
||||
crate://crates.io/unicode-bidi/0.2.3 \
|
||||
crate://crates.io/unicode-normalization/0.1.2 \
|
||||
crate://crates.io/url/1.2.3 \
|
||||
crate://crates.io/user32-sys/0.2.0 \
|
||||
crate://crates.io/utf8-ranges/0.1.3 \
|
||||
crate://crates.io/winapi-build/0.1.1 \
|
||||
crate://crates.io/winapi/0.2.8 \
|
||||
crate://crates.io/ws2_32-sys/0.2.1 \
|
||||
"
|
||||
|
||||
SRCREV_cargo = "6e0c18cccc8b0c06fba8a8d76486f81a792fb420"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
LIC_FILES_CHKSUM=" \
|
||||
file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \
|
||||
file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
|
||||
file://LICENSE-THIRD-PARTY;md5=892ea68b169e69cfe75097fc38a15b56 \
|
||||
"
|
||||
@@ -1,88 +0,0 @@
|
||||
From 27df8ab04275dfd715d1756fc517bb0323f1b210 Mon Sep 17 00:00:00 2001
|
||||
From: Steven Walter <stevenrwalter@gmail.com>
|
||||
Date: Fri, 2 Sep 2016 14:02:03 -0400
|
||||
Subject: [PATCH] Never update the registry index
|
||||
|
||||
Bitbake will fetch the index for us so that we needn't do network IO
|
||||
during a build
|
||||
---
|
||||
src/cargo/ops/cargo_run.rs | 2 +-
|
||||
src/cargo/sources/registry.rs | 34 +---------------------------------
|
||||
2 files changed, 2 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/src/cargo/ops/cargo_run.rs b/src/cargo/ops/cargo_run.rs
|
||||
index 6764118..379b98b 100644
|
||||
--- a/src/cargo/ops/cargo_run.rs
|
||||
+++ b/src/cargo/ops/cargo_run.rs
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::path::Path;
|
||||
|
||||
use ops::{self, CompileFilter};
|
||||
-use util::{self, CargoResult, process, ProcessError};
|
||||
+use util::{self, CargoResult, ProcessError};
|
||||
use core::Package;
|
||||
|
||||
pub fn run(manifest_path: &Path,
|
||||
diff --git a/src/cargo/sources/registry.rs b/src/cargo/sources/registry.rs
|
||||
index 614d654..a0c7fe6 100644
|
||||
--- a/src/cargo/sources/registry.rs
|
||||
+++ b/src/cargo/sources/registry.rs
|
||||
@@ -166,7 +166,6 @@ use std::path::{PathBuf, Path};
|
||||
|
||||
use curl::http;
|
||||
use flate2::read::GzDecoder;
|
||||
-use git2;
|
||||
use rustc_serialize::hex::ToHex;
|
||||
use rustc_serialize::json;
|
||||
use tar::Archive;
|
||||
@@ -174,7 +173,7 @@ use url::Url;
|
||||
|
||||
use core::{Source, SourceId, PackageId, Package, Summary, Registry};
|
||||
use core::dependency::{Dependency, DependencyInner, Kind};
|
||||
-use sources::{PathSource, git};
|
||||
+use sources::PathSource;
|
||||
use util::{CargoResult, Config, internal, ChainError, ToUrl, human};
|
||||
use util::{hex, Sha256, paths, Filesystem, FileLock};
|
||||
use ops;
|
||||
@@ -464,38 +463,7 @@ impl<'cfg> RegistrySource<'cfg> {
|
||||
|
||||
/// Actually perform network operations to update the registry
|
||||
fn do_update(&mut self) -> CargoResult<()> {
|
||||
- if self.updated {
|
||||
- return Ok(())
|
||||
- }
|
||||
- try!(self.checkout_path.create_dir());
|
||||
- let lock = try!(self.checkout_path.open_rw(Path::new(INDEX_LOCK),
|
||||
- self.config,
|
||||
- "the registry index"));
|
||||
- let path = lock.path().parent().unwrap();
|
||||
-
|
||||
- try!(self.config.shell().status("Updating",
|
||||
- format!("registry `{}`", self.source_id.url())));
|
||||
- let repo = try!(git2::Repository::open(path).or_else(|_| {
|
||||
- let _ = lock.remove_siblings();
|
||||
- git2::Repository::init(path)
|
||||
- }));
|
||||
-
|
||||
- // git fetch origin
|
||||
- let url = self.source_id.url().to_string();
|
||||
- let refspec = "refs/heads/*:refs/remotes/origin/*";
|
||||
-
|
||||
- try!(git::fetch(&repo, &url, refspec, &self.config).chain_error(|| {
|
||||
- internal(format!("failed to fetch `{}`", url))
|
||||
- }));
|
||||
-
|
||||
- // git reset --hard origin/master
|
||||
- let reference = "refs/remotes/origin/master";
|
||||
- let oid = try!(repo.refname_to_id(reference));
|
||||
- trace!("[{}] updating to rev {}", self.source_id, oid);
|
||||
- let object = try!(repo.find_object(oid, None));
|
||||
- try!(repo.reset(&object, git2::ResetType::Hard, None));
|
||||
self.updated = true;
|
||||
- self.cache.clear();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
From 7ae8ea6523c943cc819eadea011ce4f783e40764 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Wed, 3 Feb 2016 15:59:48 -0500
|
||||
Subject: [PATCH] disable cargo snapshot fetch
|
||||
|
||||
---
|
||||
Makefile.in | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index fadcb4b..a8da630 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -103,10 +103,6 @@ test-unit-$(1): $$(CARGO)
|
||||
endef
|
||||
$(foreach target,$(CFG_TARGET),$(eval $(call CARGO_TARGET,$(target))))
|
||||
|
||||
-$(TARGET_ROOT)/snapshot/bin/cargo$(X): $(S)src/snapshots.txt
|
||||
- $(CFG_PYTHON) $(S)src/etc/dl-snapshot.py $(CFG_BUILD)
|
||||
- touch $@
|
||||
-
|
||||
|
||||
# === Tests
|
||||
|
||||
--
|
||||
2.8.2
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
From 8f82cc69e50e7c8e48a2e20b7061483a28bd0d7f Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Sat, 12 Dec 2015 22:36:26 -0500
|
||||
Subject: [PATCH 1/2] curl-sys: avoid explicitly linking in openssl
|
||||
|
||||
linking libcurl with libssl is handled by pkg-config, not us
|
||||
This also allows non-blessed triples to work.
|
||||
---
|
||||
curl-sys/Cargo.toml | 38 --------------------------------------
|
||||
curl-sys/lib.rs | 2 --
|
||||
2 files changed, 40 deletions(-)
|
||||
|
||||
diff --git a/curl-sys/Cargo.toml b/curl-sys/Cargo.toml
|
||||
index 24bc4fa..dd56209 100644
|
||||
--- a/curl-sys/Cargo.toml
|
||||
+++ b/curl-sys/Cargo.toml
|
||||
@@ -19,42 +19,4 @@ path = "lib.rs"
|
||||
[dependencies]
|
||||
libz-sys = ">= 0"
|
||||
libc = "0.2"
|
||||
-
|
||||
-[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-
|
||||
-# Unix platforms use OpenSSL for now to provide SSL functionality
|
||||
-[target.i686-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.i586-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.i686-linux-android.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-unknown-linux-musl.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.arm-unknown-linux-gnueabihf.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.armv7-unknown-linux-gnueabihf.dependencies]
|
||||
openssl-sys = "0.7.0"
|
||||
-[target.arm-linux-androideabi.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.aarch64-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.powerpc-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.powerpc64-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.powerpc64le-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.i686-unknown-freebsd.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-unknown-freebsd.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-unknown-bitrig.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-unknown-openbsd.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-unknown-dragonfly.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
diff --git a/curl-sys/lib.rs b/curl-sys/lib.rs
|
||||
index 7990bd6..eb6c27a 100644
|
||||
--- a/curl-sys/lib.rs
|
||||
+++ b/curl-sys/lib.rs
|
||||
@@ -3,8 +3,6 @@
|
||||
extern crate libc;
|
||||
#[cfg(not(target_env = "msvc"))]
|
||||
extern crate libz_sys;
|
||||
-#[cfg(all(unix, not(target_os = "macos")))]
|
||||
-extern crate openssl_sys;
|
||||
|
||||
use libc::{c_void, c_int, c_char, c_uint, c_long};
|
||||
|
||||
--
|
||||
2.9.2
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
From eb23b1b6f749102e3db92b73a5e55ec6ad688524 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Sat, 12 Dec 2015 22:40:33 -0500
|
||||
Subject: [PATCH 2/2] remove per triple deps on openssl-sys
|
||||
|
||||
---
|
||||
Cargo.toml | 40 +---------------------------------------
|
||||
1 file changed, 1 insertion(+), 39 deletions(-)
|
||||
|
||||
diff --git a/Cargo.toml b/Cargo.toml
|
||||
index 5f6cf87..0c87156 100644
|
||||
--- a/Cargo.toml
|
||||
+++ b/Cargo.toml
|
||||
@@ -12,49 +12,11 @@ url = ">= 0.5, < 2.0"
|
||||
log = "0.3.0"
|
||||
libc = "0.2"
|
||||
curl-sys = { path = "curl-sys", version = "0.1.0" }
|
||||
+openssl-sys = "0.7.0"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.3.0"
|
||||
|
||||
-# Unix platforms use OpenSSL for now to provide SSL functionality
|
||||
-[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-
|
||||
-[target.i686-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.i586-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.i686-linux-android.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.x86_64-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.x86_64-unknown-linux-musl.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.arm-unknown-linux-gnueabihf.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.armv7-unknown-linux-gnueabihf.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.arm-linux-androideabi.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.aarch64-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.powerpc-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.powerpc64-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.powerpc64le-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.i686-unknown-freebsd.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.x86_64-unknown-freebsd.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.x86_64-unknown-bitrig.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.x86_64-unknown-openbsd.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.x86_64-unknown-dragonfly.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-
|
||||
[[test]]
|
||||
|
||||
name = "test"
|
||||
--
|
||||
2.9.2
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
From 308fd350907fba13f68dcdb8e48040582466cae6 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Sat, 12 Dec 2015 22:53:37 -0500
|
||||
Subject: [PATCH] libgit2-sys: avoid blessed triples
|
||||
|
||||
---
|
||||
libgit2-sys/Cargo.toml | 33 +--------------------------------
|
||||
1 file changed, 1 insertion(+), 32 deletions(-)
|
||||
|
||||
diff --git a/libgit2-sys/Cargo.toml b/libgit2-sys/Cargo.toml
|
||||
index 2395314..29000ef 100644
|
||||
--- a/libgit2-sys/Cargo.toml
|
||||
+++ b/libgit2-sys/Cargo.toml
|
||||
@@ -17,44 +17,13 @@ path = "lib.rs"
|
||||
libssh2-sys = { version = ">= 0", optional = true }
|
||||
libc = "0.2"
|
||||
libz-sys = ">= 0"
|
||||
+openssl-sys = "0.7.0"
|
||||
|
||||
[build-dependencies]
|
||||
pkg-config = "0.3"
|
||||
cmake = "0.1.2"
|
||||
gcc = "0.3"
|
||||
|
||||
-[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-
|
||||
-[target.i686-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.i586-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.x86_64-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.x86_64-unknown-linux-musl.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.aarch64-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.powerpc64-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.powerpc64le-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.arm-unknown-linux-gnueabihf.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.armv7-unknown-linux-gnueabihf.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.i686-unknown-freebsd.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.x86_64-unknown-freebsd.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.x86_64-unknown-bitrig.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.x86_64-unknown-openbsd.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-[target.x86_64-unknown-dragonfly.dependencies]
|
||||
-openssl-sys = "0.7.0"
|
||||
-
|
||||
[features]
|
||||
ssh = ["libssh2-sys"]
|
||||
https = []
|
||||
--
|
||||
2.9.2
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
From 65f07216c2c7a341cf13c35ecc1a781d7a489511 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Sat, 12 Dec 2015 22:44:14 -0500
|
||||
Subject: [PATCH] libssh2-sys: avoid explicitly linking in openssl
|
||||
|
||||
---
|
||||
libssh2-sys/Cargo.toml | 33 ---------------------------------
|
||||
libssh2-sys/lib.rs | 2 --
|
||||
2 files changed, 35 deletions(-)
|
||||
|
||||
diff --git a/libssh2-sys/Cargo.toml b/libssh2-sys/Cargo.toml
|
||||
index c4e006d..175be77 100644
|
||||
--- a/libssh2-sys/Cargo.toml
|
||||
+++ b/libssh2-sys/Cargo.toml
|
||||
@@ -19,39 +19,6 @@ libc = "0.2"
|
||||
[target."cfg(unix)".dependencies]
|
||||
openssl-sys = ">= 0"
|
||||
|
||||
-[target.i686-apple-darwin.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-apple-darwin.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.i686-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.i586-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.aarch64-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.powerpc64-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.powerpc64le-unknown-linux-gnu.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-unknown-linux-musl.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.arm-unknown-linux-gnueabihf.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.armv7-unknown-linux-gnueabihf.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.i686-unknown-freebsd.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-unknown-freebsd.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-unknown-dragonfly.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-unknown-bitrig.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-[target.x86_64-unknown-openbsd.dependencies]
|
||||
-openssl-sys = ">= 0"
|
||||
-
|
||||
[build-dependencies]
|
||||
pkg-config = "0.3"
|
||||
cmake = "0.1.2"
|
||||
diff --git a/libssh2-sys/lib.rs b/libssh2-sys/lib.rs
|
||||
index 02fd203..3ca1806 100644
|
||||
--- a/libssh2-sys/lib.rs
|
||||
+++ b/libssh2-sys/lib.rs
|
||||
@@ -4,8 +4,6 @@
|
||||
extern crate libc;
|
||||
|
||||
extern crate libz_sys;
|
||||
-#[cfg(unix)]
|
||||
-extern crate openssl_sys;
|
||||
|
||||
use libc::{c_int, size_t, c_void, c_char, c_long, c_uchar, c_uint, c_ulong};
|
||||
use libc::ssize_t;
|
||||
--
|
||||
2.8.2
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
From 3d850e1b1651a79085b994c12cdb78faa8271622 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ho=C3=A0ng=20=C4=90=E1=BB=A9c=20Hi=E1=BA=BFu?=
|
||||
<hdhoang@zahe.me>
|
||||
Date: Mon, 1 Dec 2014 11:48:14 +0700
|
||||
Subject: [PATCH] update to new io::FileType enum
|
||||
|
||||
---
|
||||
src/lib.rs | 32 ++++++++++++++++----------------
|
||||
1 file changed, 16 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/src/lib.rs b/src/lib.rs
|
||||
index 5e13b84..3e24ff2 100644
|
||||
--- a/src/lib.rs
|
||||
+++ b/src/lib.rs
|
||||
@@ -283,12 +283,12 @@ impl<W: Writer> Archive<W> {
|
||||
octal(&mut header.dev_major, 0i);
|
||||
|
||||
header.link[0] = match stat.kind {
|
||||
- io::TypeFile => b'0',
|
||||
- io::TypeDirectory => b'5',
|
||||
- io::TypeNamedPipe => b'6',
|
||||
- io::TypeBlockSpecial => b'4',
|
||||
- io::TypeSymlink => b'2',
|
||||
- io::TypeUnknown => b' ',
|
||||
+ io::FileType::RegularFile => b'0',
|
||||
+ io::FileType::Directory => b'5',
|
||||
+ io::FileType::NamedPipe => b'6',
|
||||
+ io::FileType::BlockSpecial => b'4',
|
||||
+ io::FileType::Symlink => b'2',
|
||||
+ io::FileType::Unknown => b' ',
|
||||
};
|
||||
|
||||
// Final step, calculate the checksum
|
||||
@@ -411,16 +411,16 @@ impl<'a, R> File<'a, R> {
|
||||
/// Classify the type of file that this entry represents
|
||||
pub fn classify(&self) -> io::FileType {
|
||||
match (self.header.is_ustar(), self.header.link[0]) {
|
||||
- (_, b'0') => io::TypeFile,
|
||||
- (_, b'1') => io::TypeUnknown, // need a hard link enum?
|
||||
- (_, b'2') => io::TypeSymlink,
|
||||
- (false, _) => io::TypeUnknown, // not technically valid...
|
||||
-
|
||||
- (_, b'3') => io::TypeUnknown, // character special...
|
||||
- (_, b'4') => io::TypeBlockSpecial,
|
||||
- (_, b'5') => io::TypeDirectory,
|
||||
- (_, b'6') => io::TypeNamedPipe,
|
||||
- (_, _) => io::TypeUnknown, // not technically valid...
|
||||
+ (_, b'0') => io::FileType::RegularFile,
|
||||
+ (_, b'1') => io::FileType::Unknown, // need a hard link enum?
|
||||
+ (_, b'2') => io::FileType::Symlink,
|
||||
+ (false, _) => io::FileType::Unknown, // not technically valid...
|
||||
+
|
||||
+ (_, b'3') => io::FileType::Unknown, // character special...
|
||||
+ (_, b'4') => io::FileType::BlockSpecial,
|
||||
+ (_, b'5') => io::FileType::Directory,
|
||||
+ (_, b'6') => io::FileType::NamedPipe,
|
||||
+ (_, _) => io::FileType::Unknown, // not technically valid...
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.0.4
|
||||
|
||||
28
recipes-devtools/rust/compiler-rt.inc
Normal file
28
recipes-devtools/rust/compiler-rt.inc
Normal file
@@ -0,0 +1,28 @@
|
||||
SUMMARY = "Rust compiler run-time"
|
||||
HOMEPAGE = "http://www.rust-lang.org"
|
||||
SECTION = "devel"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://src/compiler-rt/LICENSE.TXT;md5=bf24bca27049b52e9738451aa55771d4"
|
||||
|
||||
require rust.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"
|
||||
|
||||
DISABLE_STATIC = ""
|
||||
INHIBIT_DEFAULT_RUST_DEPS = "1"
|
||||
|
||||
do_compile () {
|
||||
oe_runmake ${TARGET_SYS}/rt/libcompiler-rt.a
|
||||
}
|
||||
|
||||
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"
|
||||
@@ -1,30 +0,0 @@
|
||||
SUMMARY = "Rust compiler run-time"
|
||||
HOMEPAGE = "http://www.rust-lang.org"
|
||||
SECTION = "devel"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=27b14ab4ce08d04c3a9a5f0ed7997362"
|
||||
|
||||
SRC_URI = "\
|
||||
https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust \
|
||||
"
|
||||
|
||||
require rust-source-${PV}.inc
|
||||
|
||||
S = "${WORKDIR}/rustc-${PV}/src/compiler-rt"
|
||||
|
||||
do_compile () {
|
||||
oe_runmake -C ${S} \
|
||||
ProjSrcRoot="${S}" \
|
||||
ProjObjRoot="${B}" \
|
||||
CC="${CC}" \
|
||||
AR="${AR}" \
|
||||
RANLIB="${RANLIB}" \
|
||||
CFLAGS="${CFLAGS}" \
|
||||
TargetTriple=${HOST_SYS} \
|
||||
triple-builtins
|
||||
}
|
||||
|
||||
do_install () {
|
||||
mkdir -p ${D}${libdir}
|
||||
cp triple/builtins/libcompiler_rt.a ${D}${libdir}/libcompiler-rt.a
|
||||
}
|
||||
@@ -1,24 +1,2 @@
|
||||
SUMMARY = "Rust compiler run-time"
|
||||
HOMEPAGE = "http://www.rust-lang.org"
|
||||
SECTION = "devel"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://src/compiler-rt/LICENSE.TXT;md5=bf24bca27049b52e9738451aa55771d4"
|
||||
|
||||
require rust.inc
|
||||
require compiler-rt.inc
|
||||
require rust-source-${PV}.inc
|
||||
|
||||
DEPENDS += "rust-llvm-native (=${PV})"
|
||||
|
||||
S = "${WORKDIR}/rustc-${PV}"
|
||||
|
||||
DISABLE_STATIC = ""
|
||||
INHIBIT_DEFAULT_RUST_DEPS = "1"
|
||||
|
||||
do_compile () {
|
||||
oe_runmake ${TARGET_SYS}/rt/libcompiler-rt.a
|
||||
}
|
||||
|
||||
do_install () {
|
||||
mkdir -p ${D}${libdir}
|
||||
cp ${TARGET_SYS}/rt/libcompiler-rt.a ${D}${libdir}/libcompiler-rt.a
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
From 69b65762ccdf459143fc273a39b0a0e0c6d8fe3e Mon Sep 17 00:00:00 2001
|
||||
From: Steven Walter <swalter@lexmark.com>
|
||||
Date: Mon, 2 May 2016 19:57:46 -0400
|
||||
Subject: [PATCH 01/11] Add config for musl-based arm builds
|
||||
|
||||
---
|
||||
mk/cfg/arm-unknown-linux-musleabi.mk | 26 ++++++++++++++++++++++++++
|
||||
1 file changed, 26 insertions(+)
|
||||
create mode 100644 mk/cfg/arm-unknown-linux-musleabi.mk
|
||||
|
||||
diff --git a/mk/cfg/arm-unknown-linux-musleabi.mk b/mk/cfg/arm-unknown-linux-musleabi.mk
|
||||
new file mode 100644
|
||||
index 0000000..2485bd9
|
||||
--- /dev/null
|
||||
+++ b/mk/cfg/arm-unknown-linux-musleabi.mk
|
||||
@@ -0,0 +1,26 @@
|
||||
+# arm-unknown-linux-musleabi configuration
|
||||
+CROSS_PREFIX_arm-unknown-linux-musleabi=arm-linux-musleabi-
|
||||
+CC_arm-unknown-linux-musleabi=gcc
|
||||
+CXX_arm-unknown-linux-musleabi=g++
|
||||
+CPP_arm-unknown-linux-musleabi=gcc -E
|
||||
+AR_arm-unknown-linux-musleabi=ar
|
||||
+CFG_LIB_NAME_arm-unknown-linux-musleabi=lib$(1).so
|
||||
+CFG_STATIC_LIB_NAME_arm-unknown-linux-musleabi=lib$(1).a
|
||||
+CFG_LIB_GLOB_arm-unknown-linux-musleabi=lib$(1)-*.so
|
||||
+CFG_LIB_DSYM_GLOB_arm-unknown-linux-musleabi=lib$(1)-*.dylib.dSYM
|
||||
+CFG_JEMALLOC_CFLAGS_arm-unknown-linux-musleabi := -D__arm__ $(CFLAGS)
|
||||
+CFG_GCCISH_CFLAGS_arm-unknown-linux-musleabi := -Wall -g -fPIC -D__arm__ $(CFLAGS)
|
||||
+CFG_GCCISH_CXXFLAGS_arm-unknown-linux-musleabi := -fno-rtti $(CXXFLAGS)
|
||||
+CFG_GCCISH_LINK_FLAGS_arm-unknown-linux-musleabi := -shared -fPIC -g
|
||||
+CFG_GCCISH_DEF_FLAG_arm-unknown-linux-musleabi := -Wl,--export-dynamic,--dynamic-list=
|
||||
+CFG_LLC_FLAGS_arm-unknown-linux-musleabi :=
|
||||
+CFG_INSTALL_NAME_arm-unknown-linux-musleabi =
|
||||
+CFG_EXE_SUFFIX_arm-unknown-linux-musleabi :=
|
||||
+CFG_WINDOWSY_arm-unknown-linux-musleabi :=
|
||||
+CFG_UNIXY_arm-unknown-linux-musleabi := 1
|
||||
+CFG_LDPATH_arm-unknown-linux-musleabi :=
|
||||
+CFG_RUN_arm-unknown-linux-musleabi=$(2)
|
||||
+CFG_RUN_TARG_arm-unknown-linux-musleabi=$(call CFG_RUN_arm-unknown-linux-musleabi,,$(2))
|
||||
+RUSTC_FLAGS_arm-unknown-linux-musleabi :=
|
||||
+RUSTC_CROSS_FLAGS_arm-unknown-linux-musleabi :=
|
||||
+CFG_GNU_TRIPLE_arm-unknown-linux-musleabi := arm-unknown-linux-musleabi
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
From 4290b8f28222824a558ac4471d26fe88b2889a5b Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Tue, 18 Nov 2014 14:52:56 -0500
|
||||
Subject: [PATCH 03/11] mk: for stage0, use RUSTFLAGS to override target libs
|
||||
dir
|
||||
|
||||
Setting HLIB specially for stage0 (and even more specially for windows)
|
||||
also affects the location we place TLIB. To keep the TLIBs we build in
|
||||
the place requested by configure, use '-L' and '--sysroot' to point
|
||||
stage0-rustc at the appropriate location.
|
||||
---
|
||||
mk/main.mk | 29 ++++++++++++-----------------
|
||||
1 file changed, 12 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/mk/main.mk b/mk/main.mk
|
||||
index c47020c..fcf1409 100644
|
||||
--- a/mk/main.mk
|
||||
+++ b/mk/main.mk
|
||||
@@ -403,32 +403,26 @@ define SREQ
|
||||
HROOT$(1)_H_$(3) = $(3)/stage$(1)
|
||||
HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
|
||||
|
||||
-ifeq ($$(CFG_WINDOWSY_$(3)),1)
|
||||
-# On Windows we always store host runtime libraries in the 'bin' directory because
|
||||
-# there's no rpath. Target libraries go under $CFG_LIBDIR_RELATIVE (usually 'lib').
|
||||
-HLIB_RELATIVE$(1)_H_$(3) = bin
|
||||
-TROOT$(1)_T_$(2)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)/rustlib/$(2)
|
||||
-# Remove the next 3 lines after a snapshot
|
||||
-ifeq ($(1),0)
|
||||
-RUSTFLAGS_STAGE0 += -L $$(TROOT$(1)_T_$(2)_H_$(3))/lib
|
||||
-endif
|
||||
-
|
||||
-else
|
||||
-
|
||||
-ifeq ($(1),0)
|
||||
-HLIB_RELATIVE$(1)_H_$(3) = lib
|
||||
-else
|
||||
HLIB_RELATIVE$(1)_H_$(3) = $$(CFG_LIBDIR_RELATIVE)
|
||||
-endif
|
||||
+
|
||||
TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2)
|
||||
|
||||
-endif
|
||||
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(HLIB_RELATIVE$(1)_H_$(3))
|
||||
|
||||
# Destinations of artifacts for target architectures
|
||||
TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin
|
||||
TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib
|
||||
|
||||
+# Don't trust stage0, be explicit about libraries
|
||||
+# TODO: rather than specifying sysroot, we really want to tell which libdir to
|
||||
+# use (ie: the dir containing 'rustlib'). This would allow us to avoid
|
||||
+# passing the '-L' options.
|
||||
+ifeq ($(1),0)
|
||||
+RUSTFLAGS_S_$(1)_T_$(2)_H_$(3) += --sysroot "$$(HROOT$(1)_H_$(3))" \
|
||||
+ -L "$$(TLIB$(1)_T_$(2)_H_$(3))"
|
||||
+endif
|
||||
+
|
||||
+
|
||||
# Preqrequisites for using the stageN compiler
|
||||
ifeq ($(1),0)
|
||||
HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3))
|
||||
@@ -536,6 +530,7 @@ STAGE$(1)_T_$(2)_H_$(3) := \
|
||||
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
|
||||
--cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
|
||||
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
|
||||
+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \
|
||||
$$(RUSTC_FLAGS_$(2))
|
||||
|
||||
endef
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
From 06b8c4bc8f7056d604d8ef4d699273cc1dd39025 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Tue, 18 Nov 2014 13:48:14 -0500
|
||||
Subject: [PATCH 04/11] mk: add missing CFG_LIBDIR_RELATIVE
|
||||
|
||||
---
|
||||
mk/grammar.mk | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/mk/grammar.mk b/mk/grammar.mk
|
||||
index 0d527bd..926f247 100644
|
||||
--- a/mk/grammar.mk
|
||||
+++ b/mk/grammar.mk
|
||||
@@ -11,8 +11,8 @@
|
||||
BG = $(CFG_BUILD_DIR)/grammar/
|
||||
SG = $(S)src/grammar/
|
||||
B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/
|
||||
-L = $(B)lib/rustlib/$(CFG_BUILD)/lib
|
||||
-LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/
|
||||
+L = $(B)$(CFG_LIBDIR_RELATIVE)/rustlib/$(CFG_BUILD)/lib
|
||||
+LD = $(CFG_BUILD)/stage2/$(CFG_LIBDIR_RELATIVE)/rustlib/$(CFG_BUILD)/lib/
|
||||
RUSTC = $(STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD))
|
||||
ifeq ($(CFG_OSTYPE),apple-darwin)
|
||||
FLEX_LDFLAGS=-ll
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From f7441b3080088d8131d106c59c3543b22c9e8211 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Wed, 3 Dec 2014 19:15:19 -0500
|
||||
Subject: [PATCH 06/11] std/thread_local: workaround for NULL __dso_handle
|
||||
|
||||
---
|
||||
src/libstd/thread/local.rs | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
|
||||
index 6b54ec8..5b41b75 100644
|
||||
--- a/src/libstd/thread/local.rs
|
||||
+++ b/src/libstd/thread/local.rs
|
||||
@@ -346,7 +346,7 @@ pub mod elf {
|
||||
#[linkage = "extern_weak"]
|
||||
static __cxa_thread_atexit_impl: *const libc::c_void;
|
||||
}
|
||||
- if !__cxa_thread_atexit_impl.is_null() {
|
||||
+ if !__cxa_thread_atexit_impl.is_null() && !__dso_handle.is_null() {
|
||||
type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8),
|
||||
arg: *mut u8,
|
||||
dso_handle: *mut u8) -> libc::c_int;
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
From a73a748cd73920380ae1f069be91ff833e99d003 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Mon, 2 Mar 2015 13:34:59 -0500
|
||||
Subject: [PATCH 07/11] mk/install: use disable-rewrite-paths
|
||||
|
||||
This stops the install scripts from doing work we've already handled.
|
||||
|
||||
Path rewriting is only useful for prepackaged binary installers.
|
||||
---
|
||||
mk/install.mk | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mk/install.mk b/mk/install.mk
|
||||
index d2e5449..e67650b 100644
|
||||
--- a/mk/install.mk
|
||||
+++ b/mk/install.mk
|
||||
@@ -12,7 +12,9 @@ RUN_INSTALLER = cd tmp/empty_dir && \
|
||||
sh ../../tmp/dist/$(1)/install.sh \
|
||||
--prefix="$(DESTDIR)$(CFG_PREFIX)" \
|
||||
--libdir="$(DESTDIR)$(CFG_LIBDIR)" \
|
||||
- --mandir="$(DESTDIR)$(CFG_MANDIR)"
|
||||
+ --mandir="$(DESTDIR)$(CFG_MANDIR)" \
|
||||
+ "$(MAYBE_DISABLE_VERIFY)" \
|
||||
+ --disable-rewrite-paths
|
||||
|
||||
install:
|
||||
ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
From 042a5df36597c2c6c23900667ae1b4299279092f Mon Sep 17 00:00:00 2001
|
||||
From: Steven Walter <swalter@lexmark.com>
|
||||
Date: Wed, 18 Nov 2015 08:33:26 -0500
|
||||
Subject: [PATCH 08/11] Allow overriding crate_hash with -C crate_hash
|
||||
|
||||
The current crate hash is not stable from run-to-run. This causes
|
||||
problems with bitbake; it needs a guarantee that every build with the
|
||||
same input will generate compatible output, otherwise sstate won't work.
|
||||
Using -C crate_hash, we can do that by using the bitbake input hash to
|
||||
determine the crate hash; the bitbake input hash will be stable, but
|
||||
still different for different rust recipes.
|
||||
---
|
||||
src/librustc/session/config.rs | 2 ++
|
||||
src/librustc_trans/back/link.rs | 12 +++++++++++-
|
||||
2 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
|
||||
index 6cd0ea9..f90398d 100644
|
||||
--- a/src/librustc/session/config.rs
|
||||
+++ b/src/librustc/session/config.rs
|
||||
@@ -585,6 +585,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
|
||||
"choose the code model to use (llc -code-model for details)"),
|
||||
metadata: Vec<String> = (Vec::new(), parse_list,
|
||||
"metadata to mangle symbol names with"),
|
||||
+ crate_hash: String = ("".to_string(), parse_string,
|
||||
+ "override crate hash with given value"),
|
||||
extra_filename: String = ("".to_string(), parse_string,
|
||||
"extra data to put in each output filename"),
|
||||
codegen_units: usize = (1, parse_uint,
|
||||
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
|
||||
index 222d447..e951476 100644
|
||||
--- a/src/librustc_trans/back/link.rs
|
||||
+++ b/src/librustc_trans/back/link.rs
|
||||
@@ -125,12 +125,22 @@ pub fn find_crate_name(sess: Option<&Session>,
|
||||
|
||||
}
|
||||
|
||||
+use std::hash::{Hasher, SipHasher};
|
||||
+use rustc::hir::svh::Svh;
|
||||
+
|
||||
pub fn build_link_meta<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
name: &str)
|
||||
-> LinkMeta {
|
||||
+ let crate_hash = if tcx.sess.opts.cg.crate_hash != "" {
|
||||
+ let mut state = SipHasher::new();
|
||||
+ state.write(tcx.sess.opts.cg.crate_hash.as_bytes());
|
||||
+ Svh::new(state.finish())
|
||||
+ } else {
|
||||
+ tcx.calculate_krate_hash()
|
||||
+ };
|
||||
let r = LinkMeta {
|
||||
crate_name: name.to_owned(),
|
||||
- crate_hash: tcx.calculate_krate_hash(),
|
||||
+ crate_hash: crate_hash,
|
||||
};
|
||||
info!("{:?}", r);
|
||||
return r;
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From 44ee7a68f44132ebe32ac486355945131c7a2b83 Mon Sep 17 00:00:00 2001
|
||||
From: Steven Walter <swalter@lexmark.com>
|
||||
Date: Wed, 18 Nov 2015 08:41:17 -0500
|
||||
Subject: [PATCH 09/11] mk/platform.mk: pass -C crate_hash to builds
|
||||
|
||||
bitbake recipe will export FORCE_CRATE_HASH
|
||||
---
|
||||
mk/platform.mk | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/mk/platform.mk b/mk/platform.mk
|
||||
index c264462..b959d59 100644
|
||||
--- a/mk/platform.mk
|
||||
+++ b/mk/platform.mk
|
||||
@@ -181,6 +181,7 @@ define CFG_MAKE_TOOLCHAIN
|
||||
AR_$(1)=$(CROSS_PREFIX_$(1))$(AR_$(1))
|
||||
LINK_$(1)=$(CROSS_PREFIX_$(1))$(LINK_$(1))
|
||||
RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(LINK_$(1))) \
|
||||
+ -C crate_hash=$(FORCE_CRATE_HASH) \
|
||||
-C ar=$$(call FIND_COMPILER,$$(AR_$(1))) $(RUSTC_CROSS_FLAGS_$(1))
|
||||
|
||||
RUSTC_FLAGS_$(1)=$$(RUSTC_CROSS_FLAGS_$(1)) $(RUSTC_FLAGS_$(1))
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
From 9c76c93de35fb45ed18e75827649e299d8c4e94e Mon Sep 17 00:00:00 2001
|
||||
From: Eduard Burtescu <edy.burt@gmail.com>
|
||||
Date: Sun, 14 Aug 2016 11:16:28 +0300
|
||||
Subject: [PATCH 11/11] Get rid of the .note interpretation of rustc dylib
|
||||
metadata.
|
||||
|
||||
---
|
||||
src/librustc_metadata/loader.rs | 41 ++++++++++++++++++-----------------------
|
||||
src/librustc_trans/base.rs | 13 ++++++++++---
|
||||
2 files changed, 28 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/src/librustc_metadata/loader.rs b/src/librustc_metadata/loader.rs
|
||||
index dc10391..9430b70 100644
|
||||
--- a/src/librustc_metadata/loader.rs
|
||||
+++ b/src/librustc_metadata/loader.rs
|
||||
@@ -875,34 +875,29 @@ fn get_metadata_section_imp(target: &Target, flavor: CrateFlavor, filename: &Pat
|
||||
}
|
||||
|
||||
pub fn meta_section_name(target: &Target) -> &'static str {
|
||||
+ // Historical note:
|
||||
+ //
|
||||
+ // When using link.exe it was seen that the section name `.note.rustc`
|
||||
+ // was getting shortened to `.note.ru`, and according to the PE and COFF
|
||||
+ // specification:
|
||||
+ //
|
||||
+ // > Executable images do not use a string table and do not support
|
||||
+ // > section names longer than 8 characters
|
||||
+ //
|
||||
+ // https://msdn.microsoft.com/en-us/library/windows/hardware/gg463119.aspx
|
||||
+ //
|
||||
+ // As a result, we choose a slightly shorter name! As to why
|
||||
+ // `.note.rustc` works on MinGW, that's another good question...
|
||||
+
|
||||
if target.options.is_like_osx {
|
||||
- "__DATA,__note.rustc"
|
||||
- } else if target.options.is_like_msvc {
|
||||
- // When using link.exe it was seen that the section name `.note.rustc`
|
||||
- // was getting shortened to `.note.ru`, and according to the PE and COFF
|
||||
- // specification:
|
||||
- //
|
||||
- // > Executable images do not use a string table and do not support
|
||||
- // > section names longer than 8 characters
|
||||
- //
|
||||
- // https://msdn.microsoft.com/en-us/library/windows/hardware/gg463119.aspx
|
||||
- //
|
||||
- // As a result, we choose a slightly shorter name! As to why
|
||||
- // `.note.rustc` works on MinGW, that's another good question...
|
||||
- ".rustc"
|
||||
+ "__DATA,.rustc"
|
||||
} else {
|
||||
- ".note.rustc"
|
||||
+ ".rustc"
|
||||
}
|
||||
}
|
||||
|
||||
-pub fn read_meta_section_name(target: &Target) -> &'static str {
|
||||
- if target.options.is_like_osx {
|
||||
- "__note.rustc"
|
||||
- } else if target.options.is_like_msvc {
|
||||
- ".rustc"
|
||||
- } else {
|
||||
- ".note.rustc"
|
||||
- }
|
||||
+pub fn read_meta_section_name(_target: &Target) -> &'static str {
|
||||
+ ".rustc"
|
||||
}
|
||||
|
||||
// A diagnostic function for dumping crate metadata to an output stream
|
||||
diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs
|
||||
index d4f0786..93c9d1a 100644
|
||||
--- a/src/librustc_trans/base.rs
|
||||
+++ b/src/librustc_trans/base.rs
|
||||
@@ -2523,10 +2523,17 @@ pub fn write_metadata<'a, 'tcx>(cx: &SharedCrateContext<'a, 'tcx>,
|
||||
};
|
||||
unsafe {
|
||||
llvm::LLVMSetInitializer(llglobal, llconst);
|
||||
- let name =
|
||||
+ let section_name =
|
||||
cx.tcx().sess.cstore.metadata_section_name(&cx.sess().target.target);
|
||||
- let name = CString::new(name).unwrap();
|
||||
- llvm::LLVMSetSection(llglobal, name.as_ptr())
|
||||
+ let name = CString::new(section_name).unwrap();
|
||||
+ llvm::LLVMSetSection(llglobal, name.as_ptr());
|
||||
+
|
||||
+ // Also generate a .section directive to force no
|
||||
+ // flags, at least for ELF outputs, so that the
|
||||
+ // metadata doesn't get loaded into memory.
|
||||
+ let directive = format!(".section {}", section_name);
|
||||
+ let directive = CString::new(directive).unwrap();
|
||||
+ llvm::LLVMSetModuleInlineAsm(cx.metadata_llmod(), directive.as_ptr())
|
||||
}
|
||||
return metadata;
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
From 0535c75086a9c170d8d4d99b3030d9136ea6e2c7 Mon Sep 17 00:00:00 2001
|
||||
From e9c6cf5d1a9bb7f50c5e98a660217062b510928b Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Tue, 18 Nov 2014 01:40:21 -0500
|
||||
Subject: [PATCH 02/11] Target: add default target.json path:
|
||||
Subject: [PATCH 1/3] Target: add default target.json path:
|
||||
$libdir/rust/targets
|
||||
|
||||
---
|
||||
src/librustc/session/config.rs | 6 +++---
|
||||
src/librustc/session/mod.rs | 8 ++++++--
|
||||
src/librustc_back/target/mod.rs | 13 +++++++++++--
|
||||
3 files changed, 20 insertions(+), 7 deletions(-)
|
||||
src/librustc_back/target/mod.rs | 12 ++++++++++--
|
||||
3 files changed, 19 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
|
||||
index da5555d..6cd0ea9 100644
|
||||
index 5e3c8bc..15fd763 100644
|
||||
--- a/src/librustc/session/config.rs
|
||||
+++ b/src/librustc/session/config.rs
|
||||
@@ -35,7 +35,7 @@ use getopts;
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use std::fmt;
|
||||
@@ -42,7 +42,7 @@ use std::hash::Hasher;
|
||||
use std::collections::hash_map::DefaultHasher;
|
||||
use std::collections::HashSet;
|
||||
use std::iter::FromIterator;
|
||||
-use std::path::PathBuf;
|
||||
+use std::path::{Path, PathBuf};
|
||||
|
||||
pub struct Config {
|
||||
pub target: Target,
|
||||
@@ -787,8 +787,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
|
||||
v
|
||||
@@ -1001,8 +1001,8 @@ pub fn build_configuration(sess: &Session,
|
||||
user_cfg
|
||||
}
|
||||
|
||||
-pub fn build_target_config(opts: &Options, sp: &Handler) -> Config {
|
||||
@@ -33,12 +33,12 @@ index da5555d..6cd0ea9 100644
|
||||
+ let target = match Target::search(sysroot, &opts.target_triple[..]) {
|
||||
Ok(t) => t,
|
||||
Err(e) => {
|
||||
panic!(sp.fatal(&format!("Error loading target specification: {}", e)));
|
||||
sp.struct_fatal(&format!("Error loading target specification: {}", e))
|
||||
diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs
|
||||
index 907241d..d0e3743 100644
|
||||
index 91765e6..29e5e5d 100644
|
||||
--- a/src/librustc/session/mod.rs
|
||||
+++ b/src/librustc/session/mod.rs
|
||||
@@ -470,13 +470,17 @@ pub fn build_session_(sopts: config::Options,
|
||||
@@ -575,13 +575,17 @@ pub fn build_session_(sopts: config::Options,
|
||||
codemap: Rc<codemap::CodeMap>,
|
||||
cstore: Rc<for<'a> CrateStore<'a>>)
|
||||
-> Session {
|
||||
@@ -59,19 +59,18 @@ index 907241d..d0e3743 100644
|
||||
let default_sysroot = match sopts.maybe_sysroot {
|
||||
Some(_) => None,
|
||||
diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs
|
||||
index 2163a8a..38607f0 100644
|
||||
index 351d469..3282dbd 100644
|
||||
--- a/src/librustc_back/target/mod.rs
|
||||
+++ b/src/librustc_back/target/mod.rs
|
||||
@@ -48,6 +48,8 @@ use serialize::json::Json;
|
||||
use std::default::Default;
|
||||
use std::io::prelude::*;
|
||||
use syntax::abi::Abi;
|
||||
+use std::borrow::ToOwned;
|
||||
@@ -51,6 +51,7 @@ use std::io::prelude::*;
|
||||
use syntax::abi::{Abi, lookup as lookup_abi};
|
||||
|
||||
use PanicStrategy;
|
||||
+use std::path::Path;
|
||||
|
||||
mod android_base;
|
||||
mod apple_base;
|
||||
@@ -477,12 +479,13 @@ impl Target {
|
||||
@@ -625,12 +626,13 @@ impl Target {
|
||||
///
|
||||
/// The error string could come from any of the APIs called, including
|
||||
/// filesystem access and JSON decoding.
|
||||
@@ -86,7 +85,7 @@ index 2163a8a..38607f0 100644
|
||||
|
||||
fn load_file(path: &Path) -> Result<Target, String> {
|
||||
let mut f = File::open(path).map_err(|e| e.to_string())?;
|
||||
@@ -513,8 +516,14 @@ impl Target {
|
||||
@@ -661,8 +663,14 @@ impl Target {
|
||||
.unwrap_or(OsString::new());
|
||||
|
||||
// FIXME 16351: add a sane default search path?
|
||||
@@ -103,5 +102,5 @@ index 2163a8a..38607f0 100644
|
||||
if p.is_file() {
|
||||
return load_file(&p);
|
||||
--
|
||||
2.7.4
|
||||
2.10.1 (Apple Git-78)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From bff536002eba2ed322d329d9022ccdc77da458a3 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Wed, 3 Dec 2014 19:15:19 -0500
|
||||
Subject: [PATCH 3/3] std/thread_local: workaround for NULL __dso_handle
|
||||
|
||||
---
|
||||
src/libstd/sys/unix/fast_thread_local.rs | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libstd/sys/unix/fast_thread_local.rs b/src/libstd/sys/unix/fast_thread_local.rs
|
||||
index 0c625e7..31e7146 100644
|
||||
--- a/src/libstd/sys/unix/fast_thread_local.rs
|
||||
+++ b/src/libstd/sys/unix/fast_thread_local.rs
|
||||
@@ -110,7 +110,7 @@ unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern fn(*mut u8)) {
|
||||
#[linkage = "extern_weak"]
|
||||
static __cxa_thread_atexit_impl: *const libc::c_void;
|
||||
}
|
||||
- if !__cxa_thread_atexit_impl.is_null() {
|
||||
+ if !__cxa_thread_atexit_impl.is_null() && !__dso_handle.is_null() {
|
||||
type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8),
|
||||
arg: *mut u8,
|
||||
dso_handle: *mut u8) -> libc::c_int;
|
||||
--
|
||||
2.10.1 (Apple Git-78)
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
From c7daec775a917d9e3017bc35ea7d88cc9418f181 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Mon, 2 Mar 2015 13:27:49 -0500
|
||||
Subject: [PATCH] add option to disable rewriting of install paths
|
||||
|
||||
This is intended for use by rust & cargo's `make install`, as in that
|
||||
case:
|
||||
|
||||
- these paths are typically built into the pre-install layout already
|
||||
- attempting to do the replacement will be incorrect subdirectory
|
||||
cases (ie: libdir=lib/foo)
|
||||
---
|
||||
install-template.sh | 21 ++++++++++++---------
|
||||
1 file changed, 12 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/install-template.sh b/install-template.sh
|
||||
index 042b955..4ecf430 100644
|
||||
--- a/install-template.sh
|
||||
+++ b/install-template.sh
|
||||
@@ -618,16 +618,18 @@ install_components() {
|
||||
# Decide the destination of the file
|
||||
local _file_install_path="$_dest_prefix/$_file"
|
||||
|
||||
- if echo "$_file" | grep "^lib/" > /dev/null
|
||||
- then
|
||||
- local _f="$(echo "$_file" | sed 's/^lib\///')"
|
||||
- _file_install_path="$CFG_LIBDIR/$_f"
|
||||
- fi
|
||||
+ if [ -n "${CFG_REWRITE_PATHS-}" ]; then
|
||||
+ if echo "$_file" | grep "^lib/" > /dev/null
|
||||
+ then
|
||||
+ local _f="$(echo "$_file" | sed 's/^lib\///')"
|
||||
+ _file_install_path="$CFG_LIBDIR/$_f"
|
||||
+ fi
|
||||
|
||||
- if echo "$_file" | grep "^share/man/" > /dev/null
|
||||
- then
|
||||
- local _f="$(echo "$_file" | sed 's/^share\/man\///')"
|
||||
- _file_install_path="$CFG_MANDIR/$_f"
|
||||
+ if echo "$_file" | grep "^share/man/" > /dev/null
|
||||
+ then
|
||||
+ local _f="$(echo "$_file" | sed 's/^share\/man\///')"
|
||||
+ _file_install_path="$CFG_MANDIR/$_f"
|
||||
+ fi
|
||||
fi
|
||||
|
||||
# Make sure there's a directory for it
|
||||
@@ -810,6 +812,7 @@ valopt mandir "$CFG_DESTDIR_PREFIX/share/man" "install man pages in PATH"
|
||||
opt ldconfig 1 "run ldconfig after installation (Linux only)"
|
||||
opt verify 1 "obsolete"
|
||||
flag verbose "run with verbose output"
|
||||
+opt rewrite-paths 1 "rewrite install paths for libdir & mandir"
|
||||
|
||||
if [ $HELP -eq 1 ]
|
||||
then
|
||||
--
|
||||
2.4.1
|
||||
|
||||
@@ -4,35 +4,19 @@ SECTION = "devel"
|
||||
LICENSE = "MIT | Apache-2.0"
|
||||
LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=43e1f1fb9c0ee3af66693d8c4fecafa8"
|
||||
|
||||
SRC_URI = "\
|
||||
https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust \
|
||||
"
|
||||
|
||||
require rust-source-${PV}.inc
|
||||
|
||||
S = "${WORKDIR}/rustc-${PV}"
|
||||
|
||||
CARGO_INDEX_COMMIT = "6127fc24b0b6fe73fe4d339817fbf000b9a798a2"
|
||||
|
||||
SRC_URI += "\
|
||||
crate://crates.io/gcc/0.3.26 \
|
||||
crate-index://crates.io/${CARGO_INDEX_COMMIT} \
|
||||
"
|
||||
|
||||
DEPENDS += "compiler-rt (=${PV})"
|
||||
|
||||
RUSTLIB_DEP = ""
|
||||
inherit cargo
|
||||
|
||||
# Needed so cargo can find libbacktrace
|
||||
RUSTFLAGS += "-L ${STAGING_LIBDIR}"
|
||||
|
||||
S = "${WORKDIR}/rustc-${PV}"
|
||||
|
||||
do_compile_prepend () {
|
||||
cd ${S}/src/rustc/std_shim
|
||||
export CARGO_TARGET_DIR="${B}"
|
||||
# For Rust 1.12.1 and lower
|
||||
export RUSTC_BOOTSTRAP_KEY="${RS_KEY}"
|
||||
# For Rust 1.13.0 and newer
|
||||
export RUSTC_BOOTSTRAP="1"
|
||||
}
|
||||
|
||||
do_install () {
|
||||
@@ -1,37 +1,11 @@
|
||||
SUMMARY = "Rust standard libaries"
|
||||
HOMEPAGE = "http://www.rust-lang.org"
|
||||
SECTION = "devel"
|
||||
LICENSE = "MIT | Apache-2.0"
|
||||
LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=43e1f1fb9c0ee3af66693d8c4fecafa8"
|
||||
|
||||
require rust-source-${PV}.inc
|
||||
|
||||
S = "${WORKDIR}/rustc-${PV}"
|
||||
|
||||
CARGO_INDEX_COMMIT = "6127fc24b0b6fe73fe4d339817fbf000b9a798a2"
|
||||
require libstd-rs.inc
|
||||
|
||||
SRC_URI += "\
|
||||
crate://crates.io/gcc/0.3.27 \
|
||||
crate-index://crates.io/${CARGO_INDEX_COMMIT} \
|
||||
"
|
||||
|
||||
# not necessary from Rust 1.15.x and newer as its built
|
||||
# as a cargo crate with libstd
|
||||
DEPENDS += "compiler-rt (=${PV})"
|
||||
|
||||
RUSTLIB_DEP = ""
|
||||
inherit cargo
|
||||
|
||||
# Needed so cargo can find libbacktrace
|
||||
RUSTFLAGS += "-L ${STAGING_LIBDIR}"
|
||||
|
||||
S = "${WORKDIR}/rustc-${PV}"
|
||||
|
||||
do_compile_prepend () {
|
||||
cd ${S}/src/rustc/std_shim
|
||||
export CARGO_TARGET_DIR="${B}"
|
||||
export RUSTC_BOOTSTRAP_KEY="${RS_KEY}"
|
||||
}
|
||||
|
||||
do_install () {
|
||||
mkdir -p ${D}${rustlibdir}
|
||||
cp ${B}/${TARGET_SYS}/release/deps/* ${D}${rustlibdir}
|
||||
}
|
||||
|
||||
19
recipes-devtools/rust/libstd-rs_1.15.1.bb
Normal file
19
recipes-devtools/rust/libstd-rs_1.15.1.bb
Normal file
@@ -0,0 +1,19 @@
|
||||
require rust-source-${PV}.inc
|
||||
require libstd-rs.inc
|
||||
|
||||
EXTRA_OECONF = "--disable-rustbuild"
|
||||
|
||||
CARGO_BUILD_FLAGS += "--features 'jemalloc panic-unwind'"
|
||||
|
||||
SRC_URI += "\
|
||||
crate://crates.io/cmake/0.1.18 \
|
||||
crate://crates.io/env_logger/0.3.5 \
|
||||
crate://crates.io/filetime/0.1.10 \
|
||||
crate://crates.io/gcc/0.3.40 \
|
||||
crate://crates.io/getopts/0.2.14 \
|
||||
crate://crates.io/libc/0.2.17 \
|
||||
crate://crates.io/log/0.3.6 \
|
||||
crate://crates.io/num_cpus/0.2.13 \
|
||||
crate://crates.io/rustc-serialize/0.3.19 \
|
||||
crate://crates.io/toml/0.1.30 \
|
||||
"
|
||||
@@ -1,6 +1,5 @@
|
||||
require rust.inc
|
||||
inherit cross
|
||||
require rust-source-${PV}.inc
|
||||
|
||||
# Otherwise we'll depend on what we provide
|
||||
INHIBIT_DEFAULT_RUST_DEPS = "1"
|
||||
@@ -1,50 +1,2 @@
|
||||
require rust.inc
|
||||
inherit cross
|
||||
require rust-cross.inc
|
||||
require rust-source-${PV}.inc
|
||||
|
||||
# Otherwise we'll depend on what we provide
|
||||
INHIBIT_DEFAULT_RUST_DEPS = "1"
|
||||
|
||||
# Unlike native (which nicely maps it's DEPENDS) cross wipes them out completely.
|
||||
# Generally, we (and cross in general) need the same things that native needs,
|
||||
# so it might make sense to take it's mapping. For now, though, we just mention
|
||||
# the bits we need explicitly.
|
||||
DEPENDS += "rust-llvm-native"
|
||||
DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc"
|
||||
DEPENDS += "rust-native"
|
||||
|
||||
PROVIDES = "virtual/${TARGET_PREFIX}rust"
|
||||
PN = "rust-cross-${TARGET_ARCH}"
|
||||
|
||||
# In the cross compilation case, rustc doesn't seem to get the rpath quite
|
||||
# right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't
|
||||
# include the '../../lib' (ie: relative path from cross_bindir to normal
|
||||
# libdir. As a result, we end up not being able to properly reference files in normal ${libdir}.
|
||||
# Most of the time this happens to work fine as the systems libraries are
|
||||
# subsituted, but sometimes a host system will lack a library, or the right
|
||||
# version of a library (libtinfo was how I noticed this).
|
||||
#
|
||||
# FIXME: this should really be fixed in rust itself.
|
||||
# FIXME: using hard-coded relative paths is wrong, we should ask bitbake for
|
||||
# the relative path between 2 of it's vars.
|
||||
HOST_POST_LINK_ARGS_append = " -Wl,-rpath=../../lib"
|
||||
BUILD_POST_LINK_ARGS_append = " -Wl,-rpath=../../lib"
|
||||
|
||||
# We need the same thing for the calls to the compiler when building the runtime crap
|
||||
TARGET_CC_ARCH_append = " --sysroot=${STAGING_DIR_TARGET}"
|
||||
|
||||
do_configure () {
|
||||
}
|
||||
|
||||
do_compile () {
|
||||
}
|
||||
|
||||
do_install () {
|
||||
mkdir -p ${D}${prefix}/${base_libdir_native}/rustlib
|
||||
cp ${WORKDIR}/targets/${TARGET_SYS}.json ${D}${prefix}/${base_libdir_native}/rustlib
|
||||
}
|
||||
|
||||
rust_cross_sysroot_preprocess() {
|
||||
sysroot_stage_dir ${D}${prefix}/${base_libdir_native}/rustlib ${SYSROOT_DESTDIR}${prefix}/${base_libdir_native}/rustlib
|
||||
}
|
||||
SYSROOT_PREPROCESS_FUNCS += "rust_cross_sysroot_preprocess"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
require rust-llvm.inc
|
||||
require rust-cross.inc
|
||||
require rust-source-${PV}.inc
|
||||
@@ -1,9 +1,9 @@
|
||||
SUMMARY = "LLVM compiler framework (packaged with rust)"
|
||||
LICENSE = "NCSA"
|
||||
|
||||
S = "${WORKDIR}/rustc-${PV}/src/llvm"
|
||||
S = "${RUSTSRC}/src/llvm"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=b99eb43c934ceebecab85c6b9b1a08be"
|
||||
|
||||
inherit cmake pythonnative
|
||||
|
||||
@@ -80,6 +80,8 @@ do_compile_prepend_class-target() {
|
||||
}
|
||||
|
||||
do_compile() {
|
||||
oe_runmake NATIVE_LIB_LLVMTABLEGEN
|
||||
oe_runmake NativeLLVMConfig
|
||||
oe_runmake
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
require rust-llvm.inc
|
||||
require rust-source-${PV}.inc
|
||||
require rust-llvm.inc
|
||||
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=43fdaa303c1c5589ad60f4ffc6a0b9ce"
|
||||
|
||||
|
||||
14
recipes-devtools/rust/rust-llvm_1.15.1.bb
Normal file
14
recipes-devtools/rust/rust-llvm_1.15.1.bb
Normal file
@@ -0,0 +1,14 @@
|
||||
require rust-source-${PV}.inc
|
||||
require rust-llvm.inc
|
||||
|
||||
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"
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
# Specifics for Rust 1.10.0
|
||||
|
||||
## snapshot info 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.9.0"
|
||||
RS_KEY = "e8edd0fd"
|
||||
|
||||
RUST_SNAPSHOT = "rustc-${RS_VERSION}-${RUST_BUILD_SYS}"
|
||||
|
||||
# These are x86_64-unknown-linux-gnu hashes, how can we add more?
|
||||
SRC_URI[rust-snapshot.md5sum] = "f1cf6d2fe15e4be18a08259f1540a4ae"
|
||||
SRC_URI[rust-snapshot.sha256sum] = "d0704d10237c66c3efafa6f7e5570c59a1d3fe5c6d99487540f90ebb37cd84c4"
|
||||
|
||||
SRC_URI[rust.md5sum] = "a48fef30353fc9daa70b484b690ce5db"
|
||||
SRC_URI[rust.sha256sum] = "a4015aacf4f6d8a8239253c4da46e7abaa8584f8214d1828d2ff0a8f56176869"
|
||||
|
||||
@@ -19,3 +19,7 @@ SRC_URI += "\
|
||||
SRC_URI[rust.md5sum] = "82db5a9cb9a051bf8ece2f5174cb273b"
|
||||
SRC_URI[rust.sha256sum] = "97913ae4cb255618aaacd1a534b11f343634b040b32656250d09d8d9ec02d3dc"
|
||||
|
||||
# later versions of rust change the directory that they unextract to
|
||||
RUSTSRC = "${WORKDIR}/rustc-${PV}"
|
||||
# set this as our default
|
||||
S = "${RUSTSRC}"
|
||||
|
||||
24
recipes-devtools/rust/rust-source-1.15.1.inc
Normal file
24
recipes-devtools/rust/rust-source-1.15.1.inc
Normal file
@@ -0,0 +1,24 @@
|
||||
# Specifics for Rust 1.15.1
|
||||
|
||||
## 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.14.0"
|
||||
|
||||
RUST_SNAPSHOT = "rustc-${RS_VERSION}-${RUST_BUILD_SYS}"
|
||||
|
||||
# These are x86_64-unknown-linux-gnu hashes, how can we add more?
|
||||
SRC_URI[rust-snapshot.md5sum] = "f178d9d6aad0f87c451f4b2f93170633"
|
||||
SRC_URI[rust-snapshot.sha256sum] = "0eeec4211aa872f24c220200a0c2b095bbfc9c0f737c1c5df2555967c8f36787"
|
||||
|
||||
SRC_URI += "\
|
||||
https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust \
|
||||
"
|
||||
SRC_URI[rust.md5sum] = "5bbfff5ef8857a73d120616546a7fd29"
|
||||
SRC_URI[rust.sha256sum] = "2e7daad418a830b45b977cd7ecf181b65f30f73df63ff36e124ea5fe5d1af327"
|
||||
|
||||
# later versions of rust change the directory that they unextract to
|
||||
RUSTSRC = "${WORKDIR}/rustc-${PV}-src"
|
||||
# set this as our default
|
||||
S = "${RUSTSRC}"
|
||||
@@ -10,8 +10,6 @@ SRC_URI = "\
|
||||
https://static.rust-lang.org/dist/${RUST_SNAPSHOT}.tar.gz;name=rust-snapshot \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/rustc-${PV}"
|
||||
|
||||
DEPENDS += "file-native"
|
||||
|
||||
# We generate local targets, and need to be able to locate them
|
||||
@@ -177,7 +175,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 = {}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
require rust.inc
|
||||
require rust-source-${PV}.inc
|
||||
|
||||
# overriden due to difference between 1.10.0 and 1.12.1
|
||||
DATA_LAYOUT[aarch64] = "e-m:e-i64:64-i128:128-n32:64-S128"
|
||||
|
||||
SRC_URI += " \
|
||||
file://rust-${PV}/0001-Add-config-for-musl-based-arm-builds.patch \
|
||||
file://rust-${PV}/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \
|
||||
file://rust-${PV}/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \
|
||||
file://rust-${PV}/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \
|
||||
file://rust-${PV}/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \
|
||||
file://rust-${PV}/0007-mk-install-use-disable-rewrite-paths.patch \
|
||||
file://rust-${PV}/0008-Allow-overriding-crate_hash-with-C-crate_hash.patch \
|
||||
file://rust-${PV}/0009-mk-platform.mk-pass-C-crate_hash-to-builds.patch \
|
||||
file://rust-${PV}/0011-Get-rid-of-the-.note-interpretation-of-rustc-dylib-m.patch \
|
||||
file://rust-installer-${PV}/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \
|
||||
"
|
||||
|
||||
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"
|
||||
18
recipes-devtools/rust/rust_1.15.1.bb
Normal file
18
recipes-devtools/rust/rust_1.15.1.bb
Normal file
@@ -0,0 +1,18 @@
|
||||
require rust.inc
|
||||
require rust-source-${PV}.inc
|
||||
|
||||
EXTRA_OECONF = "--disable-rustbuild"
|
||||
|
||||
SRC_URI += " \
|
||||
file://rust-${PV}/0001-Target-add-default-target.json-path-libdir-rust-targ.patch \
|
||||
file://rust-${PV}/0003-std-thread_local-workaround-for-NULL-__dso_handle.patch \
|
||||
"
|
||||
|
||||
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"
|
||||
@@ -1,7 +1,5 @@
|
||||
inherit cargo
|
||||
|
||||
CARGO_INDEX_COMMIT = "3b3994e099281c394a6a66604d1af6c0920e4c31"
|
||||
|
||||
SRC_URI = " \
|
||||
crate://crates.io/aho-corasick/0.5.1 \
|
||||
crate://crates.io/bitflags/0.5.0 \
|
||||
@@ -25,13 +23,7 @@ SRC_URI = " \
|
||||
crate://crates.io/winapi/0.2.6 \
|
||||
crate://crates.io/winapi-build/0.1.1 \
|
||||
crate://crates.io/rustfmt/0.4.0 \
|
||||
crate-index://crates.io/${CARGO_INDEX_COMMIT} \
|
||||
"
|
||||
SRC_URI[md5sum] = "7fc46357c9c5e72a3a1ec3630c8c7a05"
|
||||
SRC_URI[sha256sum] = "770c66dc845424a0c9a7f51b47d8de1e2605298da9b257ddde1d5be6fe01331f"
|
||||
SRC_URI[index.md5sum] = "79f10f436dbf26737cc80445746f16b4"
|
||||
SRC_URI[index.sha256sum] = "86114b93f1f51aaf0aec3af0751d214b351f4ff9839ba031315c1b19dcbb1913"
|
||||
|
||||
# rustfmt 0.5.0
|
||||
#LIC_FILES_CHKSUM=" \
|
||||
# file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
|
||||
|
||||
@@ -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
|
||||
|
||||
13
scripts/publish-build-cache.sh
Executable file
13
scripts/publish-build-cache.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
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 yocto-cache@build-cache.asterius.io:/srv/yocto-cache/
|
||||
|
||||
rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress build/sstate-cache yocto-cache@build-cache.asterius.io:/srv/yocto-cache/${branch}/
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user