-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A couple notes: 1. we shouldn't need to use build-lin-1, but our gccgo-vxworks toolchain requires libisl-0.22, which ubuntu-latest does not have. 2. we should be using windriver's vxworks gcc instead of our gccgo-vxworks toolchain since we don't need go support for this. both of these can be fixed in a future ticket. --------- Signed-off-by: Eric Lagergren <[email protected]>
- Loading branch information
1 parent
419dac2
commit 95d49f9
Showing
7 changed files
with
258 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[target.powerpc-wrs-vxworks] | ||
#linker = "lld" | ||
rustflags = [ | ||
"-Ctarget-cpu=e500", | ||
"-Crelocation-model=static", | ||
"-Ctarget-feature=-crt-static", | ||
"-Zdwarf-version=2", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: 'Setup build tools' | ||
description: 'Action for setting up build tools' | ||
inputs: | ||
gh-token: | ||
description: 'GitHub Access Token' | ||
required: true | ||
go-version: | ||
description: 'Go version' | ||
required: true | ||
default: 'stable' | ||
target: | ||
description: 'OS-arch target being compiled for (e.g., linux-arm64)' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install system dependencies | ||
run: | | ||
set -x | ||
lsb_release -a | ||
sudo apt-get update -y | ||
sudo apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
clang-12 \ | ||
clang-tools-12 \ | ||
cmake \ | ||
libc++-12-dev \ | ||
libc++abi-12-dev \ | ||
libclang-12-dev \ | ||
libclang1-12 \ | ||
llvm-12 \ | ||
llvm-12-dev \ | ||
lld-12 \ | ||
ninja-build | ||
echo "CC=$(which clang-12)" >> $GITHUB_ENV | ||
echo "CXX=$GITHUB_WORKSPACE/clang++12" >> $GITHUB_ENV | ||
echo "LD=$(which lld-12)" >> $GITHUB_ENV | ||
shell: bash | ||
if: ${{ matrix.os == 'self-hosted-linux-arm64' }} | ||
|
||
- name: Set up git | ||
run: | | ||
git config --global url."https://${{ inputs.gh-token }}@github.com/".insteadOf https://github.com/ | ||
echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Cache Rust | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
if: ${{ matrix.os != 'self-hosted-linux-arm64' }} | ||
|
||
- name: Install Rustup | ||
uses: spideroak-inc/setup-rust@fork | ||
# Various runners have a 64-bit kernel with a 32-bit userspace. | ||
# Setting rustup's default host to armv7 allows using the 32-bit executables. | ||
- name: Set rustup's host | ||
shell: bash | ||
run: rustup set default-host armv7-unknown-linux-gnueabihf | ||
if: ${{ matrix.os == 'self-hosted-linux-arm' }} | ||
- name: Verify toolchain | ||
shell: bash | ||
run: rustup show active-toolchain | ||
if: ${{ matrix.os == 'self-hosted-linux-arm' }} | ||
- name: cargo version | ||
shell: bash | ||
run: cargo --version --verbose | ||
- name: glibc version | ||
shell: bash | ||
run: ldd --version | ||
if: ${{ matrix.os == 'self-hosted-linux-arm' }} | ||
- name: Intall cargo-all-features | ||
run: cargo install --force cargo-all-features | ||
shell: bash | ||
if: ${{ inputs.target != 'vxworks-ppc' }} | ||
|
||
- name: Setup VxWorks Environment | ||
run: | | ||
rustup toolchain install nightly --component rust-src | ||
echo "RUSTUP_TOOLCHAIN=nightly" >> "$GITHUB_ENV" | ||
echo "CARGO_UNSTABLE_BUILD_STD=core,alloc" >> "$GITHUB_ENV" | ||
echo "CARGO_BUILD_TARGET=powerpc-wrs-vxworks" >> "$GITHUB_ENV" | ||
shell: bash | ||
if: ${{ inputs.target == 'vxworks-ppc' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: "Test and Build" | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
workflow_dispatch: | ||
|
||
env: | ||
REV: ${{ github.run_id }} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint-code: | ||
strategy: | ||
matrix: | ||
os: [ | ||
"macos-latest", | ||
"self-hosted-linux-arm", | ||
"self-hosted-linux-arm64", | ||
"ubuntu-latest", | ||
] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Clean temp files | ||
run: rm -rf ${{ github.workspace }}/_temp | ||
if: ${{ matrix.os == 'self-hosted-linux-arm' }} | ||
- uses: ./.github/actions/setup | ||
with: | ||
gh-token: ${{ secrets.CC_BUILD_TOKEN }} | ||
- name: Check formatting | ||
run: cargo fmt --all -- --check | ||
- name: Check code | ||
run: cargo check-all-features | ||
- name: Clippy | ||
run: cargo clippy -- -D warnings | ||
|
||
build: | ||
strategy: | ||
matrix: | ||
os: [ | ||
"macos-latest", | ||
"self-hosted-linux-arm", | ||
"self-hosted-linux-arm64", | ||
"ubuntu-latest", | ||
] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Clean temp files | ||
run: rm -rf ${{ github.workspace }}/_temp | ||
if: ${{ matrix.os == 'self-hosted-linux-arm' }} | ||
- uses: ./.github/actions/setup | ||
with: | ||
gh-token: ${{ secrets.CC_BUILD_TOKEN }} | ||
os: ${{ matrix.os }} | ||
- name: Build code | ||
run: cargo build --verbose --release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: "Build for VxWorks" | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
workflow_dispatch: | ||
|
||
env: | ||
REV: ${{ github.run_id }} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ | ||
"self-hosted-build-lin-1", | ||
] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
PPC: powerpc-wrs-vxworks | ||
PPC_LIB: ${{ github.workspace }}/powerpc-wrs-vxworks/14.0.0/powerpc-wrs-vxworks/lib/msoft-float | ||
PPC_BIN: ${{ github.workspace }}/powerpc-wrs-vxworks/14.0.0/bin | ||
X86: x86_64-linux-gnu | ||
X86_BIN: ${{ github.workspace }}/x86_64-linux-gnu/14.0.0/bin | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup | ||
with: | ||
gh-token: ${{ secrets.CC_BUILD_TOKEN }} | ||
target: "vxworks-ppc" | ||
# TODO: cache the toolchain | ||
- name: Download gccgo-vxworks | ||
uses: spideroak-inc/[email protected] | ||
with: | ||
workflow: main.yml | ||
workflow_conclusion: success | ||
check_artifacts: true | ||
search_artifacts: true | ||
branch: libtool | ||
name: ${{ env.PPC }}.tar.gz | ||
repo: spideroak-inc/gccgo-vxworks | ||
github_token: ${{ secrets.CC_BUILD_TOKEN }} | ||
- name: Extract gccgo-vxworks toolchain | ||
run: | | ||
tar -xzf ${{ env.PPC }}.tar.gz | ||
- name: Build | ||
env: | ||
TARGET_AR: ${{ env.PPC_BIN }}/${{ env.PPC }}-ar | ||
TARGET_CC: ${{ env.PPC_BIN }}/${{ env.PPC }}-gcc | ||
TARGET_CXX: ${{ env.PPC_BIN }}/${{ env.PPC }}-g++ | ||
TARGET_LD_LIBRARY_PATH: ${{ env.PPC_LIB }} | ||
TARGET_NM: ${{ env.PPC_BIN }}/${{ env.PPC }}-nm | ||
TARGET_RANLIB: ${{ env.PPC_BIN }}/${{ env.PPC }}-ranlib | ||
TARGET_STRIP: ${{ env.PPC_BIN }}/${{ env.PPC }}-strip | ||
run: cargo build --verbose --release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[toolchain] | ||
channel = "stable" | ||
components = ["rustfmt", "clippy"] | ||
profile = "minimal" |