Skip to content

Commit

Permalink
rust toolchain & fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
steebchen committed Sep 19, 2024
1 parent 4afe768 commit 48c8e0a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ target/
.vscode/
.devcontainer/
.cargo/
artifacts/
12 changes: 6 additions & 6 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM rust:1.80.0-slim as chef
FROM rust:slim as chef

# Install libclang and other necessary tools
RUN apt-get update && \
apt-get install -y clang llvm-dev libclang-dev git libtool automake autoconf make curl

RUN apt-get install -y protobuf-compiler
apt-get install -y clang llvm-dev libclang-dev git libtool automake autoconf make curl protobuf-compiler && \
rm -rf /var/lib/apt/lists/*

# Verify and set LIBCLANG_PATH environment variable
RUN find /usr -name "libclang.so*" && \
export LIBCLANG_PATH=$(find /usr -name "libclang.so*" | head -n 1 | xargs dirname)

RUN rustup install 1.79.0
COPY rust-toolchain.toml .
RUN rustup install $(cat rust-toolchain.toml | grep channel | cut -d' ' -f3 | tr -d '"')
RUN rustup component add cargo clippy rust-docs rust-std rustc rustfmt

RUN cargo install cargo-chef
Expand All @@ -27,7 +27,7 @@ WORKDIR /app
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
RUN cargo build --release --bins
RUN cargo build --release --bins # pre-cache some stuff

# Build application
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Build binaries
run: |
docker build -t build -f .github/Dockerfile .
docker run --rm -v $(pwd)/artifacts:/artifacts build /bin/sh -c "cp -r /app/artifacts/* /artifacts"
docker run --rm -v "$(pwd)/artifacts:/artifacts" build /bin/sh -c "cp -r /app/artifacts/* /artifacts"
- name: Build and push docker image
uses: docker/build-push-action@v3
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ justfile
spawn-and-move-db
types-test-db
examples/spawn-and-move/manifests/saya/**

artifacts/

0 comments on commit 48c8e0a

Please sign in to comment.