Skip to content

Commit

Permalink
Merge branch 'trivial-ci'
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakW committed Sep 12, 2019
2 parents 5bab3bc + 85b641a commit c97f516
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 11 deletions.
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# We build for x86_64 because the Python UI's CI still runs on x86_64 and we
# need to produce the library for that.
#
# We build for ARM only to sanity-check the build, so that we don't get caught
# out by arch-dependent features like atomics that might be missing on ARM.
# The resulting library can't be used owing to compiler snags; see Cargo.toml.
before_install:
# Some Rust libraries call out to libc6.
- sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
language: rust
rust:
- 1.34.2
cache: cargo
script:
# This is what we'll soon deploy and use in UI CI.
- cargo build --verbose --release
# Sanity-check only, no useful artefact.
- rustup target add --toolchain 1.34.2 arm-unknown-linux-gnueabihf
- RUSTFLAGS="-C linker=arm-linux-gnueabihf-gcc -C link-arg=-s" cargo build --verbose --release --target arm-unknown-linux-gnueabihf

deploy:
provider: releases # Github releases, that is
api_key: # Produced with the Travis Ruby gem.
secure: ZyenTygyNnsEMMOW/8AjrgBT/MrtsRGTr3V9rEt4ys2nRL2RoVOzzOfscELiCLRqAdd9O4Y/IlSa8eRxi1JGO7IG3OXVTTTOZb/c7e0iEtUrMgWNuBG0hiCBPJfglH5GQK17NumQTg4hSg+MAwpjs5OAxloGV1xvtMfOniWW01okPwMKp7cVMmnlrYsjTzhjqBXQuWkCmLNGx1MHSyukgf15qlBXK32zdcGSNTot7HA+D2zRjXPlFWKCefAmAvc86FoGLmS3YRUDsxdUI+IsYMcrXrd7UwgmkWwa9yuGcOG5eTUpSXZV1te5HuS0R64jP4/0/GFTiGUFRqUOAjjYMwEl32R99AiB8wdNh4g8rU/3z7NJjuUToVwUQWAz9jCkHbhqefFXPh+oQJdTaVQonu8ghrwuHoOuj55MBlEp5HyIBVqrEv67gYIjm37HXefG1TkrWMxkBEAW2YRmzQwtmiJs3McRyN/w+AjHfaSpVIv+ZFLdvrTC3j6gbh3S+/gKLgL5uDAdGuIUF8/cXGUNbR3QHQm+ljmkqxlsRhmUU+TdXNi6Bl/QGirT2ooVJ3mzeAIDtSZ5eCdKsyGaD9fFCwlB3VmNHvy26XEXdnjunMMmPNY4+dk+Rz73Nd0iFT7tSH6zihrJEOulcwXyMHQWa4YHnObHoVdIEfrxOEunqy0=
file: target/release/libbookindex.so
skip_cleanup: true
on:
repo: Bristol-Braille/canute-ui-rust
branch: master
tags: true # Github requires tags for anything but draft releases
40 changes: 29 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# It's slightly too early to upgrade the standard build env to buster.
# It's too many hoops to install a snapshots.d.o copy; would require an equivs for various new dependencies.
# (But if you wanted to try: a source of deb https://snapshot.debian.org/archive/debian/20180901T000000Z buster main
# gets you most of the way there; it just then wants several packages that older rustc didn't; probably ones that
# can be satisfied from stretch)
# So I figure we run with rustup for this. In which case we might as well use what buster does.
# Choice of Rust version:
#
# Generally I prefer Debian stable's stuff for, well, stability.
#
# Debian stretch's Rust is too ancient, and doesn't have Cargo.
#
# Some time needs to be given to upgrading the standard build env to Debian
# buster, but there are other problems competing for that time right now.
#
# There was no backport made to stretch, that I've seen.
#
# snapshots.d.o can sometimes work in place of backports, but it's a slog.
# https://snapshot.debian.org/archive/debian/20180901T000000Z gets you most of
# the way there but then wants several packages that older rustc didn't, and
# probably still won't have Cargo.
#
# So I figure we run with rustup for this. In which case we might as well use
# what buster does, to make that transition easy.
#
# To build me for ARM under Debian stretch:
#
Expand All @@ -16,12 +28,18 @@
# * download https://github.com/raspberrypi/tools and use
# `arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf` (ancient, but it's still
# what they use); works, and currently in use
# * mount a Raspbian image with GCC installed inside and run the link stage
# using that compiler under QEmu
# * Debian's gcc-arm-linux-gnueabihf has the above problem where its
# start-up uses ARMv7, so it links but crashes at runtime with an illegal
# instruction or something. But it's used for CI sanity-check builds.
# * use Debian's arm-linux-gnueabi-gcc (*not* the gnueabihf one); you can
# build a hello world with this, but a .so linked under Rust's instruction
# fails to be recognised as a loadable library (dl_open() looks at the ELF
# header and moves on, but LD_DEBUG reveals nothing about why)
# build a working hello world with this, but a .so linked under Rust's
# instruction fails to be recognised as a loadable library (dl_open()
# looks at the ELF header and moves on, but LD_DEBUG reveals nothing about
# why)
# * mount a Raspbian image with GCC installed inside and run the link stage
# using that compiler under QEmu; not tried
# * forcibly install Raspbian's compiler despite arch mismatch and run it
# under QEmu; not tried
# * you could just build natively on Raspbian, but I'd expect the build to
# be slow enough to obstruct development
# * Install rustup, ideally *not* by curl; see:
Expand Down

0 comments on commit c97f516

Please sign in to comment.