Skip to content
Merged
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
36 changes: 36 additions & 0 deletions .github/workflows/build_riscv_rva23.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build RISC V RVA23 via x86 cross-compile

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build image
run: podman build -t odorobo-builder:rva23 .
- name: Build binaries
run: podman run --rm -v ${{ github.workspace }}:/code -w /code odorobo-builder:rva23 cargo build --release --verbose
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: odorobo_riscv_rva23
path: |
target/riscv64a23-unknown-linux-gnu/release/odorobo-agent
target/riscv64a23-unknown-linux-gnu/release/odoroboctl
11 changes: 9 additions & 2 deletions .github/workflows/rust.yml → .github/workflows/build_x86.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust
name: Build x86

on:
push:
Expand All @@ -17,6 +17,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
run: cargo build --verbose --release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: odorobo_x86
path: |
target/release/odorobo-agent
target/release/odoroboctl
- name: Run tests
run: cargo test --verbose
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dev
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/

# AI Slop
# Anyone who uses LLMs for slop gets to keep their own slop context.
Expand Down
15 changes: 15 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM alpine:3.23.3
RUN apk add \
bash \
gcc \
musl-dev \
rustup \
zig
RUN rustup-init \
--profile minimal \
--target riscv64a23-unknown-linux-gnu \
-y
ENV CARGO_BUILD_TARGET="riscv64a23-unknown-linux-gnu"
ENV PATH="/root/.cargo/bin:$PATH"
ENV CC_riscv64a23_unknown_linux_gnu="/code/scripts/zig-cc-rva23.sh"
ENV CARGO_TARGET_RISCV64A23_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C linker=scripts/zig-cc-rva23.sh"
17 changes: 17 additions & 0 deletions scripts/zig-cc-rva23.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail

# A script for cargo to use as the C compiler and linker when building RVA23
# binaries. This links them using zig cc.

args=()
for arg in "$@"; do
case "$arg" in
--target=riscv64-unknown-linux-gnu)
;;
*)
args+=("$arg")
;;
esac
done
exec zig cc -target riscv64-linux-gnu "${args[@]}"
Loading