forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for installing on NixOS (rust-lang#1298)
* Also added dockerfiles for AL2, Ubuntu 22.04. Not in CI yet.
- Loading branch information
Showing
8 changed files
with
168 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright Kani Contributors | ||
# SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
# Note: this file is intended only for testing the kani release bundle | ||
|
||
FROM amazonlinux:2 | ||
RUN yum install -y gcc python3 python3-pip curl ctags tar gzip && \ | ||
curl -sSf https://sh.rustup.rs | sh -s -- -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
WORKDIR /tmp/kani | ||
COPY ./tests ./tests | ||
COPY ./kani-latest-x86_64-unknown-linux-gnu.tar.gz ./ | ||
# Very awkward glob (not regex!) to get `kani-verifier-*` and not `kani-verifier-*.crate` | ||
COPY ./target/package/kani-verifier-*[^e] ./kani-verifier | ||
#RUN cargo install --path ./kani-verifier | ||
#RUN cargo-kani setup --use-local-bundle ./kani-latest-x86_64-unknown-linux-gnu.tar.gz | ||
RUN cargo install kani-verifier | ||
RUN cargo-kani setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright Kani Contributors | ||
# SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
# Note: this file is intended only for testing the kani release bundle | ||
|
||
FROM nixos/nix | ||
RUN nix-channel --update | ||
WORKDIR /tmp/kani | ||
RUN echo $' \n\ | ||
with import <nixpkgs> {}; \n\ | ||
mkShell { \n\ | ||
packages = [ \n\ | ||
ctags \n\ | ||
curl \n\ | ||
gcc \n\ | ||
patchelf \n\ | ||
python310 \n\ | ||
python310Packages.pip \n\ | ||
rustup \n\ | ||
]; \n\ | ||
}' >> ./default.nix | ||
# we need to switch to nix-shell to get proper support for e.g. pip | ||
SHELL ["nix-shell", "--command"] | ||
ENTRYPOINT ["nix-shell"] | ||
RUN rustup toolchain add stable | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
WORKDIR /tmp/kani | ||
COPY ./tests ./tests | ||
COPY ./kani-latest-x86_64-unknown-linux-gnu.tar.gz ./ | ||
# Very awkward glob (not regex!) to get `kani-verifier-*` and not `kani-verifier-*.crate` | ||
COPY ./target/package/kani-verifier-*[^e] ./kani-verifier | ||
RUN cargo install --path ./kani-verifier | ||
RUN cargo-kani setup --use-local-bundle ./kani-latest-x86_64-unknown-linux-gnu.tar.gz | ||
|
||
# Temporary hack: nix-shell causes problems when trying to run these with 'docker run' | ||
# like we do for other tests, so we've imported these into the dockerfile for now | ||
# until everything can be replaced with 'self-test': | ||
# https://github.com/model-checking/kani/issues/1246 | ||
RUN cargo kani --version | ||
RUN (cd /tmp/kani/tests/cargo-kani/simple-lib && cargo kani) | ||
RUN (cd /tmp/kani/tests/cargo-kani/simple-visualize && cargo kani) | ||
RUN (cd /tmp/kani/tests/cargo-kani/build-rs-works && cargo kani) | ||
RUN cargo-kani setup --use-local-bundle ./kani-latest-x86_64-unknown-linux-gnu.tar.gz |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright Kani Contributors | ||
# SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
# Note: this file is intended only for testing the kani release bundle | ||
|
||
FROM ubuntu:22.04 | ||
ENV DEBIAN_FRONTEND=noninteractive \ | ||
DEBCONF_NONINTERACTIVE_SEEN=true | ||
RUN apt-get update && \ | ||
apt-get install -y python3 python3-pip curl universal-ctags && \ | ||
curl -sSf https://sh.rustup.rs | sh -s -- -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
WORKDIR /tmp/kani | ||
COPY ./tests ./tests | ||
COPY ./kani-latest-x86_64-unknown-linux-gnu.tar.gz ./ | ||
# Very awkward glob (not regex!) to get `kani-verifier-*` and not `kani-verifier-*.crate` | ||
COPY ./target/package/kani-verifier-*[^e] ./kani-verifier | ||
RUN cargo install --path ./kani-verifier | ||
RUN cargo-kani setup --use-local-bundle ./kani-latest-x86_64-unknown-linux-gnu.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters