Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 27, 2025
1 parent 35f9f56 commit 73ffec2
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 135 deletions.
184 changes: 95 additions & 89 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,63 +24,69 @@ concurrency:
cancel-in-progress: true

jobs:
tidy:
uses: taiki-e/github-actions/.github/workflows/tidy.yml@main
permissions:
contents: read
pull-requests: write # for gh pr edit --add-assignee
repository-projects: read # for gh pr edit --add-assignee
secrets: inherit
# tidy:
# uses: taiki-e/github-actions/.github/workflows/tidy.yml@main
# permissions:
# contents: read
# pull-requests: write # for gh pr edit --add-assignee
# repository-projects: read # for gh pr edit --add-assignee
# secrets: inherit

build:
needs: tidy
# needs: tidy
strategy:
fail-fast: false
matrix:
include:
- target: linux-gnu
- target: linux-gnu
os: ubuntu-24.04-arm
- target: linux-musl
- target: linux-musl
os: ubuntu-24.04-arm
- target: linux-uclibc
- target: android
- target: freebsd
- target: freebsd
os: ubuntu-24.04-arm
- target: netbsd
- target: openbsd
- target: openbsd
os: ubuntu-24.04-arm
- target: dragonfly
- target: dragonfly
os: ubuntu-24.04-arm
# TODO: undefined reference to `__sysconf_xpg7'/'__xnet7_socket'
# - target: solaris
- target: illumos
- target: redox
# - target: fuchsia
- target: wasi
- target: wasi
os: ubuntu-24.04-arm
- target: emscripten
- target: emscripten
os: ubuntu-24.04-arm
- target: windows-gnu
- target: windows-gnu
os: ubuntu-24.04-arm
- target: none
- target: none
os: ubuntu-24.04-arm
# - target: linux-gnu
# os: ubuntu-24.04-arm
# - target: linux-musl
# - target: linux-musl
# os: ubuntu-24.04-arm
# - target: linux-uclibc
# - target: android
# - target: android
# os: ubuntu-24.04-arm
# - target: freebsd
# - target: freebsd
# os: ubuntu-24.04-arm
# - target: netbsd
# - target: openbsd
# - target: openbsd
# os: ubuntu-24.04-arm
# - target: dragonfly
# - target: dragonfly
# os: ubuntu-24.04-arm
# # TODO: undefined reference to `__sysconf_xpg7'/'__xnet7_socket'
# # - target: solaris
# # - target: solaris
# # os: ubuntu-24.04-arm
# - target: illumos
# - target: illumos
# os: ubuntu-24.04-arm
# - target: redox
# # - target: fuchsia
# - target: wasi
# - target: wasi
# os: ubuntu-24.04-arm
# - target: emscripten
# - target: emscripten
# os: ubuntu-24.04-arm
# - target: windows-gnu
# - target: windows-gnu
# os: ubuntu-24.04-arm
# - target: none
# - target: none
# os: ubuntu-24.04-arm
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
timeout-minutes: 150
permissions:
contents: read
packages: write # for push to ghcr
steps:
- uses: taiki-e/checkout-action@v1
- uses: taiki-e/github-actions/free-device-space@main
# - uses: taiki-e/github-actions/free-device-space@main
- uses: taiki-e/github-actions/setup-docker@main
with:
qemu: false
Expand All @@ -90,50 +96,50 @@ jobs:
if: github.repository_owner == 'taiki-e' && (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule')
- run: tools/build-docker.sh "${{ matrix.target }}"

manifest:
if: github.repository_owner == 'taiki-e' && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
needs: build
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
packages: write # for push to ghcr
steps:
- uses: taiki-e/checkout-action@v1
- run: |
docker login ghcr.io -u "${{ github.actor }}" --password-stdin <<<"${{ secrets.GITHUB_TOKEN }}"
printf 'PUSH_TO_GHCR=1\n' >>"${GITHUB_ENV}"
if: github.repository_owner == 'taiki-e' && (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule')
- run: tools/docker-manifest.sh
# manifest:
# if: github.repository_owner == 'taiki-e' && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
# needs: build
# runs-on: ubuntu-latest
# timeout-minutes: 60
# permissions:
# contents: read
# packages: write # for push to ghcr
# steps:
# - uses: taiki-e/checkout-action@v1
# - run: |
# docker login ghcr.io -u "${{ github.actor }}" --password-stdin <<<"${{ secrets.GITHUB_TOKEN }}"
# printf 'PUSH_TO_GHCR=1\n' >>"${GITHUB_ENV}"
# if: github.repository_owner == 'taiki-e' && (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule')
# - run: tools/docker-manifest.sh

codegen:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
pull-requests: write # for gh pr edit --add-assignee
repository-projects: read # for gh pr edit --add-assignee
steps:
- uses: taiki-e/checkout-action@v1
- uses: taiki-e/github-actions/install-rust@nightly
- run: tools/gen.sh
- name: Handle diff
id: diff
run: tools/ci/gen.sh
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main')
- run: git add -N . && git diff --exit-code
- id: create-pull-request
uses: peter-evans/create-pull-request@v7
with:
title: Update generated code
body: |
Auto-generated by CI using [create-pull-request](https://github.com/peter-evans/create-pull-request).
branch: update-generated-code
token: ${{ secrets.CREATE_PR_TOKEN }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
- name: Notify PR author by assigning PR
run: gh pr edit --add-assignee taiki-e "${PR_NUMBER:?}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
# codegen:
# runs-on: ubuntu-latest
# timeout-minutes: 60
# permissions:
# contents: read
# pull-requests: write # for gh pr edit --add-assignee
# repository-projects: read # for gh pr edit --add-assignee
# steps:
# - uses: taiki-e/checkout-action@v1
# - uses: taiki-e/github-actions/install-rust@nightly
# - run: tools/gen.sh
# - name: Handle diff
# id: diff
# run: tools/ci/gen.sh
# if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main')
# - run: git add -N . && git diff --exit-code
# - id: create-pull-request
# uses: peter-evans/create-pull-request@v7
# with:
# title: Update generated code
# body: |
# Auto-generated by CI using [create-pull-request](https://github.com/peter-evans/create-pull-request).
# branch: update-generated-code
# token: ${{ secrets.CREATE_PR_TOKEN }}
# if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
# - name: Notify PR author by assigning PR
# run: gh pr edit --add-assignee taiki-e "${PR_NUMBER:?}"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
# if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
12 changes: 6 additions & 6 deletions docker/linux-gnu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ RUN /test/test.sh gcc
# TODO(csky): error: unable to create target: 'No available targets are compatible with triple "csky-unknown-linux-gnuabiv2"'
# TODO(loongarch64):
# TODO(sparc-unknown-linux-gnu,clang): clang: error: unknown argument: '-mv8plus'
RUN <<EOF
case "${RUST_TARGET}" in
csky-* | loongarch64-* | sparc-*) ;;
*) /test/test.sh clang ;;
esac
EOF
# RUN <<EOF
# case "${RUST_TARGET}" in
# csky-* | loongarch64-* | sparc-*) ;;
# *) /test/test.sh clang ;;
# esac
# EOF
RUN touch -- /DONE

FROM test-base AS test
Expand Down
3 changes: 2 additions & 1 deletion docker/test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ export CARGO_NET_RETRY=10
export RUST_BACKTRACE=1
export RUSTUP_MAX_RETRIES=10
export RUST_TEST_THREADS=1 # TODO: set in entrypoint.sh? https://github.com/taiki-e/setup-cross-toolchain-action/issues/10
export RUSTFLAGS="${RUSTFLAGS:-} -D warnings --print link-args"
export RUSTFLAGS="${RUSTFLAGS:-} -D warnings --print link-args -C target-feature=+secure-plt"
export PATH="${HOME}/.cargo/bin:${PATH}"
touch /BUILD_STD

dpkg_arch=$(dpkg --print-architecture)
case "${RUST_TARGET}" in
Expand Down
79 changes: 40 additions & 39 deletions tools/target-list-shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,43 @@

# Linux (glibc)
linux_gnu_targets=(
aarch64-unknown-linux-gnu
# aarch64-unknown-linux-gnu_ilp32 # tier3
# aarch64_be-unknown-linux-gnu # tier3, TODO: https://github.com/BurntSushi/memchr/pull/162
# aarch64_be-unknown-linux-gnu_ilp32 # tier3
arm-unknown-linux-gnueabi
arm-unknown-linux-gnueabihf
armeb-unknown-linux-gnueabi # tier3
# armv4t-unknown-linux-gnueabi # tier3, rustc generate code for armv5t (probably needs to pass +v4t to llvm)
armv5te-unknown-linux-gnueabi
armv7-unknown-linux-gnueabi
armv7-unknown-linux-gnueabihf
csky-unknown-linux-gnuabiv2 # tier3
csky-unknown-linux-gnuabiv2hf # tier3
i586-unknown-linux-gnu
i686-unknown-linux-gnu
loongarch64-unknown-linux-gnu
# m68k-unknown-linux-gnu # tier3, build fail: https://github.com/rust-lang/rust/issues/89498
mips-unknown-linux-gnu # tier3
mips64-unknown-linux-gnuabi64 # tier3
mips64el-unknown-linux-gnuabi64 # tier3
mipsel-unknown-linux-gnu # tier3
mipsisa32r6-unknown-linux-gnu # tier3
mipsisa32r6el-unknown-linux-gnu # tier3
mipsisa64r6-unknown-linux-gnuabi64 # tier3
mipsisa64r6el-unknown-linux-gnuabi64 # tier3
# aarch64-unknown-linux-gnu
# # aarch64-unknown-linux-gnu_ilp32 # tier3
# # aarch64_be-unknown-linux-gnu # tier3, TODO: https://github.com/BurntSushi/memchr/pull/162
# # aarch64_be-unknown-linux-gnu_ilp32 # tier3
# arm-unknown-linux-gnueabi
# arm-unknown-linux-gnueabihf
# armeb-unknown-linux-gnueabi # tier3
# # armv4t-unknown-linux-gnueabi # tier3, rustc generate code for armv5t (probably needs to pass +v4t to llvm)
# armv5te-unknown-linux-gnueabi
# armv7-unknown-linux-gnueabi
# armv7-unknown-linux-gnueabihf
# csky-unknown-linux-gnuabiv2 # tier3
# csky-unknown-linux-gnuabiv2hf # tier3
# i586-unknown-linux-gnu
# i686-unknown-linux-gnu
# loongarch64-unknown-linux-gnu
# # m68k-unknown-linux-gnu # tier3, build fail: https://github.com/rust-lang/rust/issues/89498, maybe fixed in LLVM 20 https://github.com/llvm/llvm-project/issues/107939
# mips-unknown-linux-gnu # tier3
# mips64-unknown-linux-gnuabi64 # tier3
# mips64el-unknown-linux-gnuabi64 # tier3
# mipsel-unknown-linux-gnu # tier3
# mipsisa32r6-unknown-linux-gnu # tier3
# mipsisa32r6el-unknown-linux-gnu # tier3
# mipsisa64r6-unknown-linux-gnuabi64 # tier3
# mipsisa64r6el-unknown-linux-gnuabi64 # tier3
powerpc-unknown-linux-gnu
powerpc-unknown-linux-gnuspe # tier3
powerpc64-unknown-linux-gnu
powerpc64le-unknown-linux-gnu
riscv32gc-unknown-linux-gnu # tier3
riscv64gc-unknown-linux-gnu
s390x-unknown-linux-gnu
# sparc-unknown-linux-gnu # tier3, TODO: relocations in generic ELF (EM: 18)
sparc64-unknown-linux-gnu
thumbv7neon-unknown-linux-gnueabihf
x86_64-unknown-linux-gnu
x86_64-unknown-linux-gnux32
# powerpc64-unknown-linux-gnu
# powerpc64le-unknown-linux-gnu
# riscv32gc-unknown-linux-gnu # tier3
# riscv64gc-unknown-linux-gnu
# s390x-unknown-linux-gnu
# # sparc-unknown-linux-gnu # tier3, TODO: relocations in generic ELF (EM: 18)
# sparc64-unknown-linux-gnu
# thumbv7neon-unknown-linux-gnueabihf
# x86_64-unknown-linux-gnu
# x86_64-unknown-linux-gnux32
)
# Linux (musl)
linux_musl_targets=(
Expand Down Expand Up @@ -281,7 +281,8 @@ hurd_targets=(
)
# L4Re
l4re_targets=(
# x86_64-unknown-l4re-uclibc # tier3
# TODO: https://l4re.org/download/snapshots/toolchain/
x86_64-unknown-l4re-uclibc # tier3
)
# QNX Neutrino
nto_targets=(
Expand Down Expand Up @@ -361,15 +362,15 @@ vita_targets=(
)
# VxWorks
vxworks_targets=(
# aarch64-wrs-vxworks # tier3
aarch64-wrs-vxworks # tier3
# armv7-wrs-vxworks-eabihf # tier3
# i686-wrs-vxworks # tier3
# powerpc-wrs-vxworks # tier3
# powerpc-wrs-vxworks-spe # tier3
# powerpc64-wrs-vxworks # tier3
# riscv32-wrs-vxworks # tier3
# riscv64-wrs-vxworks # tier3
# x86_64-wrs-vxworks # tier3
riscv64-wrs-vxworks # tier3
x86_64-wrs-vxworks # tier3
)
xous_targets=(
# riscv32imac-unknown-xous-elf # tier3
Expand Down

0 comments on commit 73ffec2

Please sign in to comment.