Skip to content

Instantly share code, notes, and snippets.

@phansch
Last active October 28, 2018 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phansch/39baf111d6f5fa4c4c44b3ba8ab4f559 to your computer and use it in GitHub Desktop.
Save phansch/39baf111d6f5fa4c4c44b3ba8ab4f559 to your computer and use it in GitHub Desktop.
Trying to reproduce a 32bit Clippy crash https://github.com/rust-lang-nursery/rust-clippy/issues/3345
FROM i386/buildpack-deps:stretch
# The rustup installation code is taken from https://github.com/rust-lang-nursery/docker-rust/blob/master/1.30.0/stretch/Dockerfile
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.30.0
RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='0077ff9c19f722e2be202698c037413099e1188c0c233c12a2297bf18e9ff6e7' ;; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='f139e5be4ea2db7ff151c122f5d24af3c587c4fc74a7414e262cb34403278ad3' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='c7d5471e71a315134e7499af75eb177d1f574858f1c6b8e61b436702d671a4e2' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='909ce4e2d0c9bf60ba5a85426c38cceb5ae77979ab2b1e354e76b9851b5ec5ed' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.14.0/${rustArch}/rustup-init"; \
wget "$url"; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --default-host i686-unknown-linux-gnu --default-toolchain $RUST_VERSION; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
rustc --version; \
cargo --version
RUN rustup component add clippy-preview
RUN cargo clippy --version
# Check if Clippy was compiled for x86 or x64
# See https://forums.docker.com/t/support-for-32-bit-images-containers-on-64-bit-hosts/10010/3
RUN file `whereis cargo-clippy`
RUN git clone https://github.com/RustCrypto/utils.git && \
cd utils/byte-tools && \
git checkout 12b85f9a7f1f59fe835cef2d22a5015f3df9fd18 && \
cargo clippy
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty32"
script = <<-SCRIPT
echo I am provisioning...
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.29.2
source $HOME/.cargo/env
cargo --version
rustup --version
rustc --version
uname -a
rustup component add clippy-preview
cargo clippy --version
file `whereis cargo-clippy`
cat /proc/cpuinfo
sudo apt-get install git -y
git clone https://github.com/RustCrypto/utils.git
cd utils/byte-tools
git checkout 11d4a91bebe889b10f57ab1d6c4dce2e3c0d5095
cargo clippy
SCRIPT
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--longmode", "off"]
end
config.vm.provision "shell", inline: script
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment