Commit Graph

36 Commits

Author SHA1 Message Date
Doug Goldstein
339cc787cc drop the old fetch behavior for pre Cargo 0.13.0
This behavior is flakey and doesn't work from Cargo 0.13.0 and newer
which aren't part of this repo anymore.
2016-12-07 08:52:03 -06:00
Doug Goldstein
d364837120 merge rust-vars and rust-triples to rust-common
Merge two bbclasses that were included in the same places so merge it
into one common file.
2016-12-05 10:55:14 -06:00
Doug Goldstein
846454281e classes/cargo: implement directory source redirection
Reworked the source redirection to use directory source redirection like
I've done for Gentoo. This allows us to specify all crate dependencies
in the bitbake SRC_URI and have Yocto fetch them down using our crate
fetcher and then Cargo will build without reaching out to the network.
2016-12-03 00:36:04 -06:00
Doug Goldstein
f87bb05414 classes/cargo: provide linker for BUILD_SYS
Ensure that we have a linker for the BUILD_SYS (Yocto) / HOST (Rust).
2016-11-30 20:57:05 -06:00
Doug Goldstein
1bf70b13a7 classes/cargo: revert to utilizing compiler/linker wrappers
Don't supply the linker arguments via rustflags and then mangle with the
RUSTFLAGS environment variable. This is also a parial reversion of
4e1bda643e and 5afc0cc471. These changes are reverted since it assumed
people would build with cargo and not directly with rustc. ref #116.
2016-11-30 20:57:04 -06:00
Doug Goldstein
20ac8ea888 classes/cargo: fix cargo target for linker override
We don't use the native Rust triples but instead use the Yocto triples
so we need to provide this override properly. This typo was introduced
in 5afc0cc471.
2016-11-30 20:57:04 -06:00
Doug Goldstein
a387a5fe8f classes/cargo: fix up target CFLAGS being passed to Rust
Firstly, HOST_CC_ARCH and TOOLCHAIN_OPTIONS are included in CC so them
being passed in are redundant now (due to the wrapper). The RUST_CFLAGS
variable doesn't need to be exported since its not actually used by
rustc/gcc-rs/cargo. Since its redundant and doesn't need to be exported,
remove it and simplify.
2016-11-30 20:57:04 -06:00
Doug Goldstein
689dfe8004 classes/cargo: fix up build CFLAGS being passed to Rust
Firstly, BUILD_CC_ARCH is included in BUILD_CC (hence why we actually
need a BUILD_CC wrapper because it produces the space), so its
redundant (now with the wrapper using BUILD_CC). The RUST_BUILD_CFLAGS
variable doesn't need to be exported since its not actually used by
rustc/gcc-rs/cargo. Since its redundant and doesn't need to be
exported remove it and simplify.
2016-11-30 20:57:04 -06:00
Doug Goldstein
864fe95722 classes: create proper compiler and linker wrappers
Rust builds (custom build.rs and gcc-rs users) expect to have the
compiler and the linker available to them as a single command with no
white space trailing. Yocto unfortunately does not conform to that. The
build compiler and linker almost always have a trailing space due to
how the variables are composed and the target compiler and linker are
almost always more than a single command. Then if you throw ccache into
the mix you'll get another command. As a result to handle all these
cases properly there need to be wrappers created. This change creates
wrappers for both build and target and both the linker and compiler.
This likely fixes #76.
2016-11-30 20:57:04 -06:00
Doug Goldstein
5afc0cc471 cargo.bbclass: ensure extra RUSTFLAGS are properly passed
The RUSTFLAGS env var overrides the rustflags specified in the cargo
config so we need to take anything passed in the environment variable
and put it in the config.
2016-11-23 14:15:17 -06:00
Doug Goldstein
4e1bda643e cargo.bbclass: supply linker and link-args via rustflags
Supply the linker and the linker args via rustflags which should make it
not necessary to specify them via target JSONs. We explicitly cannot use
the RUSTFLAGS environment variable do to the way cargo parses arguments
and passes them to rustc.
2016-11-23 13:59:05 -06:00
Doug Goldstein
c98312fd1d cargo.bbclass: don't export variables 2016-11-23 11:42:00 -06:00
Steven Walter
fbf59ed6a0 cargo.bbclass: replace with what was cargo_util.bbclass
The old cargo.bbclass had no users in meta-rust and had lots of
problems (not least of which was lots of duplicated lines with
cargo_util.bbclass).  Delete the old cargo.bbclass and replace it
entirely wiht cargo_util
2016-09-05 18:40:42 -04: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
Derek Straka
78e51cd7f4 Address parse errors while using getVar to calculate dependency information 2016-02-18 13:24:43 -05:00
Cody P Schafer
0ed55291b6 cargo: relocate config files to avoid clobber 2016-01-26 17:11:25 -05: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
eaa153d122 bump patches & versions 2015-02-27 09:35:59 -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
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
0035ec3172 tweak rust 2014-11-26 11:26:53 -05:00
Cody P Schafer
d91fa8700a cargo hacks 2014-11-25 15:23:17 -05:00
Cody P Schafer
4b75f09945 split rust.bbclass into rust & cargo classes 2014-11-21 12:11:28 -05:00