Commit Graph

74 Commits

Author SHA1 Message Date
Doug Goldstein d947c2e40e cargo_util: simplified cargo bbclass for crates
The existing cargo class attempts to jump through a few hoops for
settings that are not necessarily with newer versions of cargo.
2016-07-12 16:33:02 -05:00
Doug Goldstein 85471f88e5 bitbake: add crate fetcher
This adds a handler for crate:// URLs and rewrites them to crates.io
https endpoint and handles properly unpacking the crate. This fixes #24.
2016-07-12 16:33:02 -05:00
Tyler Hall 310cc353a1 Put crate_hash and rpath in RUSTFLAGS for Cargo
RUSTFLAGS is used by Cargo and always passed to the compiler. Put our
non-standard crate_hash argument there because it is required for
reproducible builds.

Add the rpath option to avoid having to patch Cargo.toml for this and
remove the function that does so.

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
2016-07-11 15:15:04 -04:00
Tyler Hall 5b451ec4af classes/cargo: don't override PATCHTOOL
The referenced issue is fixed upstream

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
2016-07-11 15:15:00 -04:00
Tyler Hall 27ff9aea20 Move rust-bin fixups to rust.bbclass
This post-processing will need to be shared between rust-bin and
cargo-based recipes.

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
2016-07-11 15:14:57 -04:00
Tyler Hall 1f17e68d1e Move basic variables from rust-bin to rust class
rust-bin.bbclass now only contains what is necessary to build crates
using the rust compiler directly and rust.bbclass contains information
shared between rust-bin and cargo.

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
2016-07-11 15:14:53 -04:00
Steven Walter a74985c341 rust-bin.bbclass: allow to opt-out of prefer-dynamic
prefer-dynamic makes sense in many cases, but we needn't force recipes
to use it all the time.
2016-05-05 21:56:19 -04:00
Derek Straka 94daa39193 Remove the '--disable-static' in the EXTRA_OECONF for all rust-like recipes 2016-02-19 10:34:00 -05:00
Derek Straka a4d6b55448 Allow the fetch to complete before attempting to patch
Signed-off-by: Derek Straka <derek@asterius.io>
2016-02-18 17:23:36 -05:00
Derek Straka 78e51cd7f4 Address parse errors while using getVar to calculate dependency information 2016-02-18 13:24:43 -05:00
Cody P Schafer ce1881d08c rust: use a shared source location for all the packages needing the rustc source tree 2016-02-04 12:40:22 -05:00
Steven Walter 3a832dd439 rust: force crate hash to use bitbake input hash
This should eliminate the problems that have been seen when bitbake
rebuilds part of the rust stack (due to missing sstate) and ends up
getting hash mismatches.  Unlike rust's internally generated hash, ours
is guaranteed to be stable.
2016-02-03 11:30:56 -05:00
Tyler Hall 483334f02b rust: aarch64 support 2016-02-02 11:40:25 -05:00
Tyler Hall aaaeaeed3f rustlib: libdir may be different between build and host
With multilib, we may want to install under lib64 but the rust libraries
get published in the build sysroot under the libdir for the build
machine which is usually just lib. Support these being different.
2016-02-02 11:40:25 -05:00
Wes Lindauer 45d77b849f rust-bin.bbclass: Add empty do_configure
This prevents rust recipes that are missing clean rules from failing
when they are rebuilt.
2016-02-01 16:36:52 -05:00
Steven Walter ebe7fb0d8f rust-bin.bbclass: look for RUNPATH instead of RPATH
Poky 1.7 uses RPATH is now RUNPATH, so update our grep string appropriately.

Additionally, bitbake is having trouble with the automatic RDEPENDS on
rustlib.  Make it explicit for now.
2016-02-01 16:36:52 -05:00
Dan Dedrick 63cf611e65 rust-bin.bbclass: update path to cross output
poky 1.7 changes where it publishes cross output to so this recipe
needs to follow that. Unfortunately this path is defined in
cross.bbclass and we can't inherit that since we aren't cross.
2016-02-01 16:36:52 -05:00
Tyler Hall 302cca7529 rust-bin.bbclass: suffix rust libraries with -rs
Rust library names may have sonames that overlap with C/C++ libraries.
This causes bitbake to not be able to create the correct automatic
RDEPENDS between packages. The result is that dependencies may not get
automatically installed.

Add -rs to the file name and soname. The crate name remains the same,
and rust is not dependent on the file name to look up the crate inside
the library.
2016-02-01 16:36:52 -05:00
Tyler Hall 232d100c09 Add rand crate 2016-02-01 20:53:51 +00:00
Cody P Schafer 0ed55291b6 cargo: relocate config files to avoid clobber 2016-01-26 17:11:25 -05:00
Tyler Hall 8c83519133 rust-bin/rustlib: install with executable permission
Necessary for binaries and required to appease OE's automatic library
RDEPENDS.
2015-07-17 12:52:36 -04:00
Tyler Hall 06f6aeaa79 rust-bin: set soname of shared objects
Poky will fail to automatically create RDEPENDS on shared objects
lacking a SONAME in the ELF.
2015-07-17 12:52:36 -04:00
Tyler Hall 837000f68a rust-bin: common code for building libs
Libraries that overlap with the standard library must have explicit
extern declarations. Without something like pkg-config where the
libraries can publish this info, it's easiest to just hard-code the list
of troublesome libraries.
2015-07-17 12:52:36 -04:00
Tyler Hall 8a6f084c66 rust-bin: prefer-dynamic
We control static/dynamic by only making one or the other available.
Apparently the default of prefer static causes duplicate symbols for the
standard library.
2015-07-17 12:52:36 -04:00
Tyler Hall a91af9bbae Add rust-bin class
This provides more defaults that aren't required for compiling with
rustc, but standardize the output for inclusion in a distro.

Things like
- Where to install libraries
- Stripping rustc note sections
- Optimization by default
2015-07-17 12:52:36 -04:00
Cody P Schafer 6bcb69d4c0 cargo.bbclass: CARGO_TARGET_DIR gained a special meaning in cargo, rename to CARGO_TARGET_SUBDIR 2015-06-29 11:20:09 -04:00
Cody P Schafer 457ded34de cargo: supply a CARGO_HOME variable to keep cargo contained inside bitbake control 2015-05-26 12:06:27 -04:00
Cody P Schafer 5a09bd48bb rust-installer is naughty 2015-03-02 01:36:20 -05:00
Cody P Schafer eaa153d122 bump patches & versions 2015-02-27 09:35:59 -05:00
Cody P Schafer 70d0957e6d rust: switch to using _class-cross and _class-native variables to stop abusing the BBCLASSEXTEND system 2015-02-12 14:37:39 -05:00
Cody P Schafer f6a6687733 USE_LOCAL_RUST tweaks 2014-12-30 16:00:12 -05:00
Cody P Schafer de23af86c2 update readme to reflect current reality 2014-12-16 13:56:38 -05:00
Cody P Schafer c3b58fc4d6 internal-rust-native: correct inhibit 2014-12-16 13:43:25 -05:00
Cody P Schafer 23b9ac934e rust: use a different INHIBIT_DEFAULT*_DEPS to avoid hardcoding real DEFAULT_DEPS 2014-12-15 15:58:40 -05:00
Cody P Schafer c1cbe59991 cargo.bbclass: complain if nothing to install is found 2014-12-05 14:58:42 -05:00
Cody P Schafer 439790a703 cargo.bbclass: factor out more of the target binary path 2014-12-05 14:57:05 -05:00
Cody P Schafer 95b80b7bfe Exporting cargo breaks building cargo 2014-12-05 14:38:33 -05:00
Cody P Schafer 1e0047383e refactor cargo.bbclass for easier use when we are not directly driving cargo 2014-12-05 14:08:50 -05:00
Cody P Schafer e07cb2e6f2 cargo: more env vars for gcc-rs 2014-12-03 18:38:12 -05:00
Cody P Schafer 41824cb27a attempting to use a new cargo 2014-12-03 17:55:13 -05:00
Cody P Schafer 1d2b7f4f11 new cargo, rust tweaks, etc 2014-12-03 14:03:38 -05:00
Cody P Schafer a66a513686 cargo: proper CC/CFLAGS handling with HOST_* patch 2014-12-03 02:44:06 -05:00
Cody P Schafer 8cc784c414 remove some extra lines, question marks, and add another rpath 2014-12-02 23:07:17 -05:00
Cody P Schafer 3cf2b9e42c Rework ASSUME_PROVIDED and notes 2014-12-02 16:40:45 -05:00
Cody P Schafer 75deda4847 Tweak inhibit, move comment, update rustc ln 2014-12-02 16:33:00 -05:00
Cody P Schafer db7d1d0cd9 cargo: disable cargo dep by default 2014-12-02 14:07:19 -05:00
Cody P Schafer c42a9f51dd re-add older rust, disable newer by default, allow cargo dep to be disabled 2014-12-02 14:00:50 -05:00
Cody P Schafer e7917112b6 cargo-native builds 2014-12-01 11:06:00 -05:00
Cody P Schafer d45bd8f7a3 Disable gcc-rs hack, fixup rust-native deps 2014-11-26 13:27:32 -05:00
Cody P Schafer 0035ec3172 tweak rust 2014-11-26 11:26:53 -05:00