mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1237366 - Import rust-build docker source. r=ted
Import the contents of https://github.com/rillian/rust-build/ commit 120714dd661fc8979011d1edd717042ce66f98f7.
This commit is contained in:
parent
414fbb1d64
commit
134c774d20
28
testing/docker/rust-build/Dockerfile
Normal file
28
testing/docker/rust-build/Dockerfile
Normal file
@ -0,0 +1,28 @@
|
||||
FROM quay.io/rillian/rust-buildbot
|
||||
MAINTAINER Ralph Giles <giles@mozilla.com>
|
||||
|
||||
# Update base.
|
||||
RUN yum upgrade -y
|
||||
RUN yum clean all
|
||||
|
||||
# Install tooltool directly from github.
|
||||
RUN mkdir /builds
|
||||
ADD https://raw.githubusercontent.com/mozilla/build-tooltool/master/tooltool.py /build/tooltool.py
|
||||
RUN chmod +rx /build/tooltool.py
|
||||
|
||||
# Add build scripts.
|
||||
ADD checkout-sources.sh build.sh /build/
|
||||
RUN chmod +x /build/*
|
||||
|
||||
# Create user for doing the build.
|
||||
ENV USER worker
|
||||
ENV HOME /home/${USER}
|
||||
|
||||
RUN useradd -d ${HOME} -m ${USER}
|
||||
|
||||
# Set up the user's tree
|
||||
WORKDIR ${HOME}
|
||||
|
||||
# Invoke our build scripts by default, but allow other commands.
|
||||
USER ${USER}
|
||||
CMD /build/checkout-sources.sh && /build/build.sh
|
2
testing/docker/rust-build/Makefile
Normal file
2
testing/docker/rust-build/Makefile
Normal file
@ -0,0 +1,2 @@
|
||||
all: Dockerfile checkout-sources.sh build.sh
|
||||
docker build -t rust-build .
|
2
testing/docker/rust-build/README.md
Normal file
2
testing/docker/rust-build/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
This is a docker script for building rust toolchains for
|
||||
use in Mozilla's build clusters.
|
37
testing/docker/rust-build/build.sh
Normal file
37
testing/docker/rust-build/build.sh
Normal file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash -vex
|
||||
|
||||
set -x -e
|
||||
|
||||
: WORKSPACE ${WORKSPACE:=/home/worker}
|
||||
|
||||
CORES=$(nproc || grep -c ^processor /proc/cpuinfo || sysctl -n hw.ncpu)
|
||||
|
||||
set -v
|
||||
|
||||
# Configure and build rust.
|
||||
OPTIONS="--enable-rpath --enable-llvm-static-stdcpp --disable-docs"
|
||||
M32="i686-unknown-linux-gnu"
|
||||
M64="x86_64-unknown-linux-gnu"
|
||||
|
||||
mkdir -p ${WORKSPACE}/rust-build
|
||||
pushd ${WORKSPACE}/rust-build
|
||||
mkdir -p ${M32}
|
||||
pushd ${M32}
|
||||
${WORKSPACE}/rust/configure --prefix=${PWD}/../rustc --build=${M32} ${OPTIONS}
|
||||
make -j ${CORES}
|
||||
popd
|
||||
mkdir -p ${M64}
|
||||
pushd ${M64}
|
||||
${WORKSPACE}/rust/configure --prefix=${PWD}/../rustc --build=${M64} ${OPTIONS}
|
||||
make -j ${CORES}
|
||||
make install
|
||||
popd
|
||||
# Copy 32 bit stdlib into the install directory for cross support.
|
||||
cp -r ${M32}/${M32}/stage2/lib/rustlib/${M32} rustc/lib/rustlib/
|
||||
popd
|
||||
|
||||
# Package the toolchain for upload.
|
||||
pushd ${WORKSPACE}/rust-build
|
||||
tar cvJf rustc.tar.xz rustc/*
|
||||
/build/tooltool.py add --visibility=public rustc.tar.xz
|
||||
popd
|
15
testing/docker/rust-build/checkout-sources.sh
Normal file
15
testing/docker/rust-build/checkout-sources.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash -vex
|
||||
|
||||
set -x -e
|
||||
|
||||
# Inputs, with defaults
|
||||
|
||||
: RUST_REPOSITORY ${RUST_REPOSITORY:=https://github.com/rust-lang/rust}
|
||||
: RUST_BRANCH ${RUST_BRANCH:=stable}
|
||||
|
||||
: WORKSPACE ${WORKSPACE:=/home/worker}
|
||||
|
||||
set -v
|
||||
|
||||
# Check out rust sources
|
||||
git clone $RUST_REPOSITORY -b $RUST_BRANCH ${WORKSPACE}/rust
|
Loading…
Reference in New Issue
Block a user