-
Notifications
You must be signed in to change notification settings - Fork 99
Cargo Build System + Nightly Updates #285
Changes from all commits
f784a66
2f15d44
4c0a79d
768882b
7ab9bb0
d4c8eb4
1d44560
99dad6f
2583c34
f8e4cc2
da021ac
5c05311
01265ce
986c6cb
ab15e3f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
/build/ | ||
/thirdparty/ | ||
.DS_Store | ||
Cargo.lock | ||
target | ||
.cargo | ||
*.o | ||
*.bin | ||
*.lst | ||
autom4te.cache |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
language: rust | ||
rust: nightly | ||
before_install: | ||
- sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded | ||
- sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/terry_guo-gcc-arm-embedded-precise.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" | ||
install: | ||
- sudo apt-get install gcc-arm-none-eabi | ||
- (mkdir -p ./thirdparty/rust) | ||
- (cd ./thirdparty/rust; wget -O rust.tar.gz https://github.com/rust-lang/rust/tarball/`rustc --version|awk '{sub(/\\(/, "", $3); print $3}'`; tar -zx --strip-components=1 -f rust.tar.gz) | ||
script: | ||
- rake build_all test | ||
- ./configure --host=arm-none-eabi | ||
- cargo build --target=$TARGET --verbose --features $PLATFORM | ||
after_script: | ||
- cargo test --lib --verbose | ||
- (cd ./platformtree; cargo build --verbose; cargo test --verbose) | ||
- (cd ./macro_platformtree; cargo build --verbose; cargo test --verbose) | ||
env: | ||
matrix: | ||
- PLATFORM=lpc17xx | ||
TARGET=thumbv7m-none-eabi | ||
- PLATFORM=k20 | ||
TARGET=thumbv7em-none-eabi | ||
- PLATFORM=stm32f4 | ||
TARGET=thumbv7em-none-eabi | ||
- PLATFORM=stm32l1 | ||
- PLATFORM=k20 | ||
TARGET=thumbv7m-none-eabi | ||
- PLATFORM=tiva_c | ||
TARGET=thumbv7em-none-eabi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
[package] | ||
name = "zinc" | ||
version = "0.1.0" | ||
authors = ["Zinc Developers <[email protected]>"] | ||
build = "build.rs" | ||
|
||
[lib] | ||
name = "zinc" | ||
crate-type = ["lib"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be rlib to avoid the Travis build error. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was also a bug for dylib not working in this case that is fixed in cargo upstream: rust-lang/cargo#1612. That being said, rlib is the proper thing to have here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bharrisau Actually, that's a bug in cargo with trying to link against syntax extensions while cross compiling for a target that doesn't support dylibs. See rust-lang/cargo#1612. It was fixed by rust-lang/cargo#1617 but something is wrong with the PR on windows right now. EDIT: Tested again just to confirm. -crate-type = ["lib"]
+crate-type = ["rlib"] Will not fix the travis builds. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Roger that. Looks like buildbot is broken holding up a few different Cargo PRs. |
||
|
||
[features] | ||
lpc17xx = [] | ||
stm32f4 = [] | ||
stm32l1 = [] | ||
k20 = [] | ||
tiva_c = [] | ||
|
||
[target.thumbv7m-none-eabi.dependencies.core] | ||
git = "https://github.com/hackndev/rust-libcore" | ||
|
||
[target.thumbv7em-none-eabi.dependencies.core] | ||
git = "https://github.com/hackndev/rust-libcore" | ||
|
||
[dependencies.ioreg] | ||
path = "./ioreg" | ||
|
||
[dependencies.rlibc] | ||
git = "https://github.com/mcoffin/rlibc" | ||
branch = "zinc" | ||
|
||
[dev-dependencies.platformtree] | ||
path = "./platformtree" | ||
|
||
[dev-dependencies.macro_platformtree] | ||
path = "./macro_platformtree" | ||
|
||
[[example]] | ||
name = "nothing" | ||
path = "examples/app_nothing.rs" | ||
|
||
[[example]] | ||
name = "blink" | ||
path = "examples/app_blink.rs" | ||
|
||
[[example]] | ||
name = "blink_k20" | ||
path = "examples/app_blink_k20.rs" | ||
|
||
[[example]] | ||
name = "blink_k20_isr" | ||
path = "examples/app_blink_k20_isr.rs" | ||
|
||
[[example]] | ||
name = "blink_pt" | ||
path = "examples/app_blink_pt.rs" | ||
|
||
[[example]] | ||
name = "blink_stm32f4" | ||
path = "examples/app_blink_stm32f4.rs" | ||
|
||
[[example]] | ||
name = "blink_stm32l1" | ||
path = "examples/app_blink_stm32l1.rs" | ||
|
||
[[example]] | ||
name = "blink_tiva_c" | ||
path = "examples/app_blink_tiva_c.rs" | ||
|
||
[[example]] | ||
name = "bluenrg_stm32l1" | ||
path = "examples/app_bluenrg_stm32l1.rs" | ||
|
||
[[example]] | ||
name = "dht22" | ||
path = "examples/app_dht22.rs" | ||
|
||
[[example]] | ||
name = "empty" | ||
path = "examples/app_empty.rs" | ||
|
||
[[example]] | ||
name = "lcd_tiva_c" | ||
path = "examples/app_lcd_tiva_c.rs" | ||
|
||
[[example]] | ||
name = "uart" | ||
path = "examples/app_uart.rs" | ||
|
||
[[example]] | ||
name = "uart_tiva_c" | ||
path = "examples/app_uart_tiva_c.rs" | ||
|
||
[[example]] | ||
name = "uart_stm32l1" | ||
path = "examples/app_uart_stm32l1.rs" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
STRIP=@STRIP@ | ||
OBJCOPY=@OBJCOPY@ | ||
OBJDUMP=@OBJDUMP@ | ||
|
||
CARGO_ROOT=@srcdir@ | ||
|
||
PLATFORM=@PLATFORM@ | ||
TARGET=@TARGET@ | ||
|
||
$(if $(value EXAMPLE_NAME),, \ | ||
$(error EXAMPLE_NAME must be set)) | ||
|
||
# Output directory | ||
OUT_DIR=$(CARGO_ROOT)/target/$(TARGET)/release | ||
EXAMPLE_DIR=$(OUT_DIR)/examples | ||
|
||
BIN_FILE=$(EXAMPLE_DIR)/$(EXAMPLE_NAME).bin | ||
LST_FILE=$(EXAMPLE_DIR)/$(EXAMPLE_NAME).lst | ||
EXAMPLE_FILE=$(EXAMPLE_DIR)/$(EXAMPLE_NAME) | ||
|
||
.PHONY: build clean listing $(EXAMPLE_FILE) | ||
|
||
build: $(BIN_FILE) | ||
|
||
clean: | ||
cargo clean | ||
|
||
listing: $(LST_FILE) | ||
|
||
# Target is PHONY so cargo can deal with dependencies | ||
$(EXAMPLE_FILE): | ||
cd $(CARGO_ROOT) | ||
cargo build --example $(EXAMPLE_NAME) --release --target=$(TARGET) --verbose --features $(PLATFORM) | ||
|
||
$(BIN_FILE): $(EXAMPLE_FILE) | ||
$(OBJCOPY) -O binary $< $@ | ||
|
||
$(LST_FILE): $(EXAMPLE_FILE) | ||
$(OBJDUMP) -D $< > $@ |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to also test on 1.0.0. This can be done easily with a list. For example, posborne/rust-sysfs-gpio@f080e9a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On 1.0.0, you can't enable unstable features afaik, and zinc makes pretty heavy use of some of them. Most notably, compiler plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good call. I thought I was running 1.0.0, but I guess that I am actually not based on how I compiled the source.