Skip to content

Commit

Permalink
wkdev-sdk: Install Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
dpino committed Sep 4, 2024
1 parent 57aaae2 commit 321b655
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
14 changes: 11 additions & 3 deletions images/wkdev_sdk/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ RUN ${APT_UPDATE} && \
${APT_INSTALL} apt-utils dialog libterm-readline-gnu-perl locales && \
${APT_UPGRADE} && ${APT_AUTOREMOVE}

# Add Rust environment.
ENV RUSTUP_HOME="/opt/rust" \
CARGO_HOME="/opt/rust" \
PATH="/root/.cargo/bin:${PATH}"

RUN rustup default stable && \
rustup component remove rust-docs && \
cargo install --root /usr/local --version 0.8.1 --locked sccache && \
cargo install --root /usr/local cargo-c && \
rm -rf /root/.cargo

# Disable exclusion of locales / translations / documentation (default in Ubuntu images)
RUN yes | /usr/local/sbin/unminimize

Expand Down Expand Up @@ -127,8 +138,5 @@ RUN export QT_VERSION=$(qmake6 -query QT_VERSION) && \
ln -s ${directory} ${directory}/${QT_VERSION} >/dev/null 2>&1 || true; \
done

# Build custom sccache version (the Ubuntu provided 0.7.7 package is broken)
RUN cargo install --root /usr/local --version 0.8.1 --locked sccache

# Switch back to interactive prompt, when using apt.
ENV DEBIAN_FRONTEND dialog
2 changes: 1 addition & 1 deletion images/wkdev_sdk/required_system_packages/04-devtools.lst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build-essential cmake ninja-build

# Build tools
icecc ccache cargo
icecc ccache rustup

# Debugging / profiling / tracing
valgrind rr perf-tools-unstable systemd-coredump
Expand Down
11 changes: 11 additions & 0 deletions scripts/container-only/.wkdev-init
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,16 @@ try_setup_permissions_jhbuild_directory() {

}

try_setup_permissions_rust_directory() {

echo ""

local rust_directory="/opt/rust"
echo "[12/13] Setup rust '${rust_directory}' directory permissions..."

chown --recursive "${container_user_name}:${container_group_name}" "${rust_directory}" &>/dev/null
}

try_firstrun_script() {
echo ""

Expand Down Expand Up @@ -259,6 +269,7 @@ run() {
try_setup_run_user_directory
try_setup_dockerenv_file
try_setup_permissions_jhbuild_directory
try_setup_permissions_rust_directory
try_firstrun_script

# Reset DEBIAN_FRONTEND again.
Expand Down

0 comments on commit 321b655

Please sign in to comment.