Skip to content

Commit

Permalink
chore: bring in zig
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinblackman committed Mar 13, 2024
1 parent ea2a013 commit 5c2ac60
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
12 changes: 7 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ COPY .cargo/ /tmp/build-cache/.cargo

# Only install what is needed for general development.
WORKDIR /tmp/build-cache
RUN cargo install cargo-run-bin
RUN cargo bin committed --help
RUN cargo bin mise --help
RUN cargo cmd --help
RUN cargo nextest --help
COPY .bin/ /tmp/build-cache/
RUN ls -lsa /tmp/build-cache
RUN cargo install cargo-run-bin #bin
RUN cargo bin committed --help #bin
RUN cargo bin mise --help #bin
RUN cargo cmd --help #bin
RUN cargo nextest --help #bin
# RUN cargo insta --help
# RUN cargo deny --help
# RUN cargo watch --help
Expand Down
8 changes: 4 additions & 4 deletions .devcontainer/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ PROGDIR=$(dirname "$(readlink -f "$0")")
cd "$PROGDIR/.."

BUILD_ARCH="$1"
export EMPTY_GITHUB_TOKEN="$2"

(
cd tools/node
npm ci
)

echo "$EMPTY_GITHUB_TOKEN" | gh auth login --with-token
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu
rustup target add aarch64-unknown-linux-gnu
cargo install cargo-run-bin
cargo binstall --help
export CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu
export CC="$PROGDIR/zcc.sh"
cargo bin committed --help || echo ""
cargo bin mise --help || echo ""
cargo cmd --help || echo ""
cargo nextest --help || echo ""
cargo insta --help || echo ""
cargo deny --helpA || echo ""
cargo watch --help || echo ""
rm -rf .bin/*/cargo-binstall
find .bin

# echo "[BUILD] Building $BUILD_ARCH"
# tools/node/node_modules/.bin/devcontainer build --workspace-folder . --config ./.devcontainer/devcontainer-src.json --push --platform "linux/$BUILD_ARCH" --image-name ghcr.io/dustinblackman/devcontainer-oatmeal:latest-"$BUILD_ARCH"
echo "[BUILD] Building $BUILD_ARCH"
tools/node/node_modules/.bin/devcontainer build --workspace-folder . --config ./.devcontainer/devcontainer-src.json --push --platform "linux/$BUILD_ARCH" --image-name ghcr.io/dustinblackman/devcontainer-oatmeal:latest-"$BUILD_ARCH"
3 changes: 3 additions & 0 deletions .devcontainer/zcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

zig cc -target aarch64-linux "$@"
5 changes: 5 additions & 0 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ jobs:
with:
targets: aarch64-unknown-linux-gnu
- name: Build
env:
GH_TOKEN: ${{ github.token }}
run: |
sudo mkdir -p /usr/local/zig
curl -L https://ziglang.org/download/0.11.0/zig-linux-x86_64-0.11.0.tar.xz | sudo tar xz --strip-components=1 -C /usr/local/zig
export PATH="/usr/local/zig:$PATH"
./.devcontainer/build.sh ${{ matrix.arch }} ${{ secrets.EMPTY_GITHUB_TOKEN }}
# release:
Expand Down

0 comments on commit 5c2ac60

Please sign in to comment.