Skip to content

Commit

Permalink
Linux: Build static binaries
Browse files Browse the repository at this point in the history
CMK-18811
  • Loading branch information
jherbel committed Aug 23, 2024
1 parent 6aa9290 commit 04c10f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/rcc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- run: rake build
- run: CGO_ENABLED=0 rake build
- run: rake test
- run: ldd build/linux64/rcc | grep "statically linked"
- uses: actions/cache/save@v4
with:
key: rcc-${{ env.RCC_TAG }}-${{ env.GO_VERSION }}-${{ env.RUBY_VERSION }}
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/robotmk_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,25 @@ jobs:
steps:
- uses: actions/checkout@v4

- run: sudo apt-get update
- run: sudo apt-get install -y musl-tools
- uses: actions-rust-lang/[email protected]
with:
target: x86_64-unknown-linux-gnu
target: x86_64-unknown-linux-musl
# By default, setup-rust-toolchain sets "-D warnings". As a side effect, the settings in
# .cargo/config.toml are ignored:
# https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags
# "There are four mutually exclusive sources of extra flags"
rustflags: ""

- run: cargo build --target=x86_64-unknown-linux-gnu --release
- run: cargo build --target=x86_64-unknown-linux-musl --release
- run: ldd target/x86_64-unknown-linux-musl/release/robotmk_scheduler | grep "statically linked"
- run: ldd target/x86_64-unknown-linux-musl/release/robotmk_agent_plugin | grep "statically linked"

- uses: actions/upload-artifact@v4
with:
name: rmk_linux64
path: |
target/x86_64-unknown-linux-gnu/release/robotmk_scheduler
target/x86_64-unknown-linux-gnu/release/robotmk_agent_plugin
target/x86_64-unknown-linux-musl/release/robotmk_scheduler
target/x86_64-unknown-linux-musl/release/robotmk_agent_plugin
if-no-files-found: error

0 comments on commit 04c10f6

Please sign in to comment.