Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: Build static binaries #599

Merged
merged 1 commit into from
Aug 23, 2024
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
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
Loading