Skip to content

Commit

Permalink
override the curl-sys crate
Browse files Browse the repository at this point in the history
to include alexcrichton/curl-rust#137

But only for the targets affected by cross-rs#4

closes cross-rs#4
  • Loading branch information
Jorge Aparicio committed Dec 26, 2016
1 parent d1bc4b6 commit 038ecf4
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 15 deletions.
21 changes: 6 additions & 15 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,15 @@ main() {

cargo install --path .

# NOTE(case) japaric/cross#4
case $TARGET in
mips-unknown-linux-gnu | \
mips64-unknown-linux-gnuabi64 | \
powerpc64-unknown-linux-gnu)
;;
*)
td=$(mktemp -d)
td=$(mktemp -d)

git clone --depth 1 https://github.com/rust-lang/cargo $td
git clone --depth 1 https://github.com/rust-lang/cargo $td

pushd $td
cross build --target $TARGET
popd
pushd $td
cross build --target $TARGET
popd

rm -rf $td
;;
esac
rm -rf $td

# NOTE(s390x) japaric/cross#3
# NOTE(x86_64-musl) can't test compiler-builtins because that crate needs
Expand Down
3 changes: 3 additions & 0 deletions docker/mips-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM ubuntu:16.04

COPY override.sh /
RUN bash /override.sh curl-sys 0.3.6

COPY qemu.sh /
RUN bash /qemu.sh 2.8.0 mips

Expand Down
3 changes: 3 additions & 0 deletions docker/mips64-unknown-linux-gnuabi64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM ubuntu:16.04

COPY override.sh /
RUN bash /override.sh curl-sys 0.3.6

COPY qemu.sh /
RUN bash /qemu.sh 2.8.0 mips64

Expand Down
36 changes: 36 additions & 0 deletions docker/override.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
set -ex

main() {
local dependencies=(
ca-certificates
curl
)

apt-get update

apt-get install --no-install-recommends -y ${dependencies[@]}

mkdir -p /overrides /.cargo
echo "paths = [" > /.cargo/config

local pkg= vers=
while [ $# -gt 1 ]; do
pkg=$1
vers=$2
shift 2

mkdir /overrides/$pkg
curl -L https://japaric.github.io/cross/$pkg-v$vers.tar.gz | \
tar -C /overrides/$pkg -xz

echo "\"/overrides/$pkg\"," >> /.cargo/config
done

echo "]" >> /.cargo/config

apt-get purge --auto-remove -y ${dependencies[@]}

rm $0
}

main "${@}"
3 changes: 3 additions & 0 deletions docker/powerpc64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM ubuntu:16.04

COPY override.sh /
RUN bash /override.sh curl-sys 0.3.6

COPY qemu.sh /
RUN bash /qemu.sh 2.7.1 ppc64

Expand Down

0 comments on commit 038ecf4

Please sign in to comment.