Merge branch 'sscache' into 'master'

Support build with sccache in podman

See merge request redox-os/redox!1605
This commit is contained in:
Jeremy Soller 2025-07-04 20:54:16 -06:00
commit 8b8ad13060
4 changed files with 25 additions and 3 deletions

@ -1 +1 @@
Subproject commit 1f238c0f912cab65079fc2681cb94fde90b27790
Subproject commit f7f69579e55e7c967e8205c2cb248fc9ef5310bf

View File

@ -31,6 +31,9 @@ HOST_CARGO=env -u RUSTUP_TOOLCHAIN -u CC -u TARGET cargo
REDOXFS_MKFS_FLAGS?=
## Set to 1 to enable Podman build, any other value will disable it
PODMAN_BUILD?=1
## Enable sccache to speed up cargo builds
## only do this by default if this is inside podman
SCCACHE_BUILD?=$(shell [ -f /run/.containerenv ] && echo 1 || echo 0)
## The containerfile to use for the Podman base image
CONTAINERFILE?=podman/redox-base-containerfile
@ -41,11 +44,18 @@ export REDOX_MAKE=make
ifneq ($(PODMAN_BUILD),1)
HOST_TARGET := $(shell env -u RUSTUP_TOOLCHAIN rustc -vV | grep host | cut -d: -f2 | tr -d " ")
ifneq ($(HOST_TARGET),x86_64-unknown-linux-gnu)
# The binary prefix is only built for x86_64 Linux hosts
$(info The binary prefix is only built for x86_64 Linux hosts)
PREFIX_BINARY=0
endif
endif
ifeq ($(SCCACHE_BUILD),1)
ifeq (,$(shell command -v sccache))
$(info sccache not found in PATH)
SCCACHE_BUILD=0
endif
endif
UNAME := $(shell uname)
ifeq ($(UNAME),Darwin)
FUMOUNT=umount
@ -112,6 +122,13 @@ RANLIB=$(GNU_TARGET)-gcc-ranlib
READELF=$(GNU_TARGET)-readelf
STRIP=$(GNU_TARGET)-strip
ifeq ($(SCCACHE_BUILD),1)
export CC_WRAPPER:=sccache
export RUSTC_WRAPPER:=$(CC_WRAPPER)
CC=$(CC_WRAPPER) $(GNU_TARGET)-gcc
CXX=$(CC_WRAPPER) $(GNU_TARGET)-g++
endif
## Rust cross compile variables
export AR_$(subst -,_,$(TARGET)):=$(AR)
export CC_$(subst -,_,$(TARGET)):=$(CC)

View File

@ -4,6 +4,11 @@
# in Podman after the image has been built
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
SCCACHE_PATH=https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-$(uname -m)-unknown-linux-musl.tar.gz
curl -sSL $SCCACHE_PATH | tar -xz -C ~/.cargo/bin --strip-components=1 --wildcards '*/sccache'
export RUSTC_WRAPPER=sccache
cargo +stable install --force --version 0.1.1 cargo-config
cargo +stable install --force --version 1.16.0 just
cargo +stable install --force --version 0.27.0 cbindgen

2
relibc

@ -1 +1 @@
Subproject commit 1550bb54b5eb5e13e31c311ae8c116e6b009831b
Subproject commit 84d410084571e456031f48650b75b1b2f628550d