Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a rust layer with a full app build #1004

Draft
wants to merge 1 commit into
base: DO-2720
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/docker-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,21 @@ jobs:
name: Build libcorerust
runs-on: ${{ matrix.os }}
container:
image: radixdlt/build-layers:rust-v1
image: radixdlt/build-layers:rust-full-build
options: --user root
steps:
- name: Checkout
uses: RDXWorks-actions/checkout@main
- name: Setup rust toolchain
uses: RDXWorks-actions/[email protected]
- name: Setup rust cache
uses: RDXWorks-actions/rust-cache@master
with:
workspaces: core-rust
- name: Copy target directory
run: |
mv /app/core-rust/target ./core-rust/target
- name: Build
working-directory: core-rust
run: |
export PATH="$PATH:/root/.cargo/bin"
which cargo
rustup default 1.77
du -hs target
cargo build --profile=release
- name: Upload artifacts
uses: RDXWorks-actions/upload-artifact-v4@main
Expand Down
11 changes: 6 additions & 5 deletions docker/dockerfiles/rust.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ RUN apt-get update \
# We fix the version of Rust here to ensure that we can update it without having
# issues with the caching layers containing outdated versions which aren't compatible.
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup.sh \
&& sh rustup.sh -y --target 1.71.1-aarch64-unknown-linux-gnu 1.71.1-x86_64-unknown-linux-gnu --default-toolchain 1.77.2
&& sh rustup.sh -y --default-toolchain 1.77.2

RUN "$HOME/.cargo/bin/cargo" install sccache --version 0.7.4
ENV PATH="$PATH:/root/.cargo/bin"

ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine we still need the linkers for e.g. the ARM builds?

ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc
ENV RUSTC_WRAPPER=/root/.cargo/bin/sccache
COPY . .

RUN cd core-rust && \
cargo build --profile=release
Loading