Skip to content

Commit 86720b0

Browse files
committed
refactor: remove image-toolchain dependency
1 parent 6990fe4 commit 86720b0

4 files changed

Lines changed: 21 additions & 44 deletions

File tree

.github/workflows/main.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ jobs:
5353
push: false
5454
load: true
5555
build-args: |
56-
TOOLCHAIN_REPOSITORY=${{ env.TOOLCHAIN_REPOSITORY }}
57-
TOOLCHAIN_VERSION=${{ env.TOOLCHAIN_VERSION }}
5856
KERNEL_VERSION=${{ env.KERNEL_VERSION }}
5957
KERNEL_TIMESTAMP=${{ env.KERNEL_TIMESTAMP }}
6058
IMAGE_KERNEL_VERSION=${{ env.IMAGE_KERNEL_VERSION }}
@@ -98,8 +96,6 @@ jobs:
9896
push: true
9997
load: false
10098
build-args: |
101-
TOOLCHAIN_REPOSITORY=${{ env.TOOLCHAIN_REPOSITORY }}
102-
TOOLCHAIN_VERSION=${{ env.TOOLCHAIN_VERSION }}
10399
KERNEL_VERSION=${{ env.KERNEL_VERSION }}
104100
KERNEL_TIMESTAMP=${{ env.KERNEL_TIMESTAMP }}
105101
IMAGE_KERNEL_VERSION=${{ env.IMAGE_KERNEL_VERSION }}

Dockerfile

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,37 @@
1414
# limitations under the License.
1515
#
1616

17-
ARG TOOLCHAIN_REPOSITORY=cartesi/toolchain
18-
ARG TOOLCHAIN_VERSION=latest
19-
FROM ${TOOLCHAIN_REPOSITORY}:${TOOLCHAIN_VERSION}
17+
FROM debian:trixie-20250811
2018

2119
ARG KERNEL_VERSION=0.0.0-ctsi-y
2220
ARG KERNEL_TIMESTAMP="Thu, 01 Jan 1970 00:00:00 +0000"
2321
ARG OPENSBI_VERSION=0.0.0-ctsi-y
2422

2523
ENV DEBIAN_FRONTEND=noninteractive
2624

27-
ENV OLDPATH=$PATH
28-
25+
ENV BASE=/opt/riscv
2926
ENV BUILD_BASE=$BASE/kernel
3027

28+
# install cross-compiler and build dependencies
29+
# ------------------------------------------------------------------------------
30+
RUN apt-get update && \
31+
DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \
32+
bc \
33+
bison \
34+
build-essential \
35+
flex \
36+
gcc-14-riscv64-linux-gnu=14.2.0-19cross1 \
37+
genext2fs \
38+
libc6-dev-riscv64-cross=2.41-11cross1 \
39+
rsync \
40+
xz-utils \
41+
&& \
42+
rm -rf /var/lib/apt/lists/*
43+
3144
# setup dirs
3245
# ------------------------------------------------------------------------------
3346
RUN \
47+
useradd developer && \
3448
mkdir -p ${BUILD_BASE}/artifacts && \
3549
chown -R developer:developer ${BUILD_BASE} && \
3650
chmod go+w ${BUILD_BASE}

Makefile

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515
#
1616

17-
.PHONY: all build download push run pull share copy clean checksum
17+
.PHONY: all build download push pull copy clean checksum
1818

1919
MAJOR := 0
2020
MINOR := 21
@@ -25,8 +25,6 @@ IMAGE_KERNEL_VERSION?= $(MAJOR).$(MINOR).$(PATCH)$(LABEL)
2525
UNAME:=$(shell uname)
2626

2727
TAG ?= devel
28-
TOOLCHAIN_REPOSITORY ?= cartesi/toolchain
29-
TOOLCHAIN_TAG ?= 0.17.0
3028

3129
DEP_DIR := dep
3230

@@ -36,8 +34,6 @@ KERNEL_SRCPATH := $(DEP_DIR)/linux-${KERNEL_VERSION}.tar.gz
3634
OPENSBI_VERSION ?= 1.3.1-ctsi-2
3735
OPENSBI_SRCPATH := $(DEP_DIR)/opensbi-${OPENSBI_VERSION}.tar.gz
3836

39-
CONTAINER_BASE := /opt/cartesi/kernel
40-
4137
IMG ?= cartesi/linux-kernel:$(TAG)
4238
BASE:=/opt/riscv
4339

@@ -53,14 +49,6 @@ ifneq ($(IMAGE_KERNEL_VERSION),)
5349
BUILD_ARGS += --build-arg IMAGE_KERNEL_VERSION=$(IMAGE_KERNEL_VERSION)
5450
endif
5551

56-
ifneq ($(TOOLCHAIN_REPOSITORY),)
57-
BUILD_ARGS += --build-arg TOOLCHAIN_REPOSITORY=$(TOOLCHAIN_REPOSITORY)
58-
endif
59-
60-
ifneq ($(TOOLCHAIN_TAG),)
61-
BUILD_ARGS += --build-arg TOOLCHAIN_VERSION=$(TOOLCHAIN_TAG)
62-
endif
63-
6452
ifneq ($(KERNEL_VERSION),)
6553
BUILD_ARGS += --build-arg KERNEL_VERSION=$(KERNEL_VERSION)
6654
endif
@@ -85,28 +73,11 @@ push:
8573
pull:
8674
docker pull $(IMG)
8775

88-
run:
89-
docker run --hostname toolchain-env -it --rm \
90-
-e USER=$$(id -u -n) \
91-
-e GROUP=$$(id -g -n) \
92-
-e UID=$$(id -u) \
93-
-e GID=$$(id -g) \
94-
-v `pwd`:$(CONTAINER_BASE) \
95-
-w $(CONTAINER_BASE) \
96-
$(IMG) $(CONTAINER_COMMAND)
97-
98-
run-as-root:
99-
docker run --hostname toolchain-env -it --rm \
100-
-v `pwd`:$(CONTAINER_BASE) \
101-
$(IMG) $(CONTAINER_COMMAND)
102-
10376
env:
10477
@echo KERNEL_VERSION="$(KERNEL_VERSION)"
10578
@echo KERNEL_TIMESTAMP="$(KERNEL_TIMESTAMP)"
10679
@echo IMAGE_KERNEL_VERSION="$(IMAGE_KERNEL_VERSION)"
10780
@echo OPENSBI_VERSION="$(OPENSBI_VERSION)"
108-
@echo TOOLCHAIN_REPOSITORY="$(TOOLCHAIN_REPOSITORY)"
109-
@echo TOOLCHAIN_VERSION="$(TOOLCHAIN_TAG)"
11081
@make -srf build.mk \
11182
KERNEL_VERSION=$(KERNEL_VERSION) \
11283
KERNEL_TIMESTAMP="$(KERNEL_TIMESTAMP)" \

build.mk

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
TOOLCHAIN_PREFIX := riscv64-cartesi-linux-gnu
1+
TOOLCHAIN_PREFIX := riscv64-linux-gnu
22

33
OPENSBI_DIR := work/opensbi
44
OPENSBI_BUILD_DIR := $(OPENSBI_DIR)/build
@@ -114,8 +114,4 @@ clone:
114114
git@github.com:cartesi/opensbi.git $(OPENSBI_DIR) || \
115115
cd $(OPENSBI_DIR) && git pull
116116

117-
run: IMG=cartesi/toolchain:devel
118-
run:
119-
$(MAKE) run IMG=$(IMG)
120-
121117
.PHONY: $(OPENSBI_BUILD_DIR)/Makefile $(LINUX_DIR)/vmlinux $(ARTIFACTS)

0 commit comments

Comments
 (0)