Skip to content

Commit

Permalink
feat!: Update toolchain to v0.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vfusco committed Aug 12, 2023
1 parent 54ab8b8 commit 80c0e39
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 30 deletions.
50 changes: 27 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Build
on: [push]
env:
TOOLCHAIN_VERSION: 0.14.0
TOOLCHAIN_REPOSITORY: cartesi/toolchain
TOOLCHAIN_VERSION: 0.15.0
CACHE_DIR: /home/runner/work/image-rootfs/image-rootfs/cache
jobs:
build:
Expand All @@ -14,10 +15,9 @@ jobs:
volumes:
- /home/runner/work/cache:/usr/share/nginx/html
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.CI_TOKEN }}
fetch-depth: 0 # fetch tags

- name: Copy default Buildroot and Busybox config
Expand All @@ -40,25 +40,30 @@ jobs:
- name: Copy GitHub cache to nginx cache folder
run: if [ -d ${{ env.CACHE_DIR }} ]; then sudo mv ${{ env.CACHE_DIR }}/* /home/runner/work/cache; fi

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: ${{ secrets.DOCKER_ORGANIZATION }}/rootfs
images: |
ghcr.io/${{ github.repository_owner }}/rootfs
docker.io/${{ github.repository_owner }}/rootfs,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/tags/v') }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand All @@ -68,26 +73,26 @@ jobs:

- name: Build docker image
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64
tags: ${{ steps.docker_meta.outputs.tags }}
tags: cartesi/rootfs:devel
push: false
load: true
build-args: |
TOOLCHAIN_REPOSITORY=${{ secrets.DOCKER_ORGANIZATION }}/toolchain
TOOLCHAIN_REPOSITORY=${{ env.TOOLCHAIN_REPOSITORY }}
TOOLCHAIN_VERSION=${{ env.TOOLCHAIN_VERSION }}
ROOTFS_FILENAME=${{ env.ROOTFS_FILENAME }}
cache-from: type=gha,mode=max,scope=regular
cache-to: type=gha,scope=regular
cache-from: type=gha,scope=regular
cache-to: type=gha,mode=max,scope=regular

- name: Export rootfs.ext2 artifact
run: make copy IMG=`echo "${{ steps.docker_meta.outputs.tags }}" | head -1 | cut -d "," -f 1 | xargs`
run: make copy

- name: Export download cache
run: make copy-br2-dl-cache CACHE_DIR=${{ env.CACHE_DIR }} IMG=`echo "${{ steps.docker_meta.outputs.tags }}" | head -1 | cut -d "," -f 1 | xargs`
run: make copy-br2-dl-cache CACHE_DIR=${{ env.CACHE_DIR }}

- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -99,8 +104,7 @@ jobs:

- name: Push docker image
id: docker_push
uses: docker/build-push-action@v2
if: ${{ startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/develop') }}
uses: docker/build-push-action@v4
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
Expand All @@ -109,7 +113,7 @@ jobs:
push: true
load: false
build-args: |
TOOLCHAIN_REPOSITORY=${{ secrets.DOCKER_ORGANIZATION }}/toolchain
TOOLCHAIN_REPOSITORY=${{ env.TOOLCHAIN_REPOSITORY }}
TOOLCHAIN_VERSION=${{ env.TOOLCHAIN_VERSION }}
cache-from: type=gha,mode=max,scope=regular
cache-to: type=gha,scope=regular
cache-from: type=gha,scope=regular
cache-to: type=gha,mode=max,scope=regular
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

TAG ?= devel
TOOLCHAIN_DOCKER_REPOSITORY ?= cartesi/toolchain
TOOLCHAIN_TAG ?= 0.14.0
TOOLCHAIN_TAG ?= 0.15.0
NEW_TAG ?= latest
BUILDROOT_CONFIG ?= configs/default-buildroot-config
BUSYBOX_CONFIG ?= configs/default-busybox-fragment
RISCV_ARCH ?= rv64gc
RISCV_ABI ?= lp64d

ROOTFS_VERSION ?= v0.17.0
ROOTFS_VERSION ?= v0.18.0
ROOTFS_FILENAME ?= rootfs-$(ROOTFS_VERSION).ext2

CONTAINER_BASE := /opt/cartesi/rootfs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MACHINE_EMULATOR_TOOLS_LICENSE_FILES = LICENSE
MACHINE_EMULATOR_TOOLS_INSTALL_STAGING = NO

MACHINE_EMULATOR_TOOLS_CARGO_ENV = CC=$(TARGET_CC) CXX=$(TARGET_CXX) CFLAGS="-march=$(RISCV_ARCH) -mabi=$(RISCV_ABI)" RISCV_ARCH=$(RISCV_ARCH) RISCV_ABI=$(RISCV_ABI)
MACHINE_EMULATOR_TOOLS_CARGO_OPTS = -Z build-std=std,core,alloc,panic_abort,proc_macro --release
MACHINE_EMULATOR_TOOLS_CARGO_OPTS = --release

ifeq ($(BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_YIELD),y)
define BUILD_MACHINE_EMULATOR_TOOLS_YIELD
Expand Down Expand Up @@ -46,20 +46,20 @@ endif

ifeq ($(BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_ROLLUP_HTTP_SERVER),y)
define BUILD_MACHINE_EMULATOR_TOOLS_ROLLUP_HTTP_SERVER
$(MACHINE_EMULATOR_TOOLS_CARGO_ENV) cargo build $(MACHINE_EMULATOR_TOOLS_CARGO_OPTS) --target $(@D)/linux/rollup/http/rollup-http-server/$(RISCV_ARCH)-cartesi-linux-gnu.json --manifest-path $(@D)/linux/rollup/http/rollup-http-server/Cargo.toml
$(MACHINE_EMULATOR_TOOLS_CARGO_ENV) cargo build $(MACHINE_EMULATOR_TOOLS_CARGO_OPTS) --target riscv64gc-unknown-linux-gnu --manifest-path $(@D)/linux/rollup/http/rollup-http-server/Cargo.toml
endef
define INSTALL_MACHINE_EMULATOR_TOOLS_ROLLUP_HTTP_SERVER
$(INSTALL) -D -m 0755 $(@D)/linux/rollup/http/rollup-http-server/target/$(RISCV_ARCH)-cartesi-linux-gnu/release/rollup-http-server $(TARGET_DIR)/opt/cartesi/bin/rollup-http-server
$(INSTALL) -D -m 0755 $(@D)/linux/rollup/http/rollup-http-server/target/riscv64gc-unknown-linux-gnu/release/rollup-http-server $(TARGET_DIR)/opt/cartesi/bin/rollup-http-server
$(INSTALL) -D -m 0755 $(@D)/linux/utils/rollup-init $(TARGET_DIR)/opt/cartesi/bin/rollup-init
endef
endif

ifeq ($(BR2_PACKAGE_MACHINE_EMULATOR_TOOLS_ECHO_DAPP),y)
define BUILD_MACHINE_EMULATOR_TOOLS_ECHO_DAPP
$(MACHINE_EMULATOR_TOOLS_CARGO_ENV) cargo build $(MACHINE_EMULATOR_TOOLS_CARGO_OPTS) --target $(@D)/linux/rollup/http/echo-dapp/$(RISCV_ARCH)-cartesi-linux-gnu.json --manifest-path $(@D)/linux/rollup/http/echo-dapp/Cargo.toml
$(MACHINE_EMULATOR_TOOLS_CARGO_ENV) cargo build $(MACHINE_EMULATOR_TOOLS_CARGO_OPTS) --target riscv64gc-unknown-linux-gnu --manifest-path $(@D)/linux/rollup/http/echo-dapp/Cargo.toml
endef
define INSTALL_MACHINE_EMULATOR_TOOLS_ECHO_DAPP
$(INSTALL) -D -m 0755 $(@D)/linux/rollup/http/echo-dapp/target/$(RISCV_ARCH)-cartesi-linux-gnu/release/echo-dapp $(TARGET_DIR)/opt/cartesi/bin/echo-dapp
$(INSTALL) -D -m 0755 $(@D)/linux/rollup/http/echo-dapp/target/riscv64gc-unknown-linux-gnu/release/echo-dapp $(TARGET_DIR)/opt/cartesi/bin/echo-dapp
endef
endif

Expand Down

0 comments on commit 80c0e39

Please sign in to comment.