Skip to content

Commit

Permalink
Build more combinations of statically linked binary
Browse files Browse the repository at this point in the history
This change adjusts our 'Build' workflow to build not just the "regular"
version of the program but also one with readline support included. We
switch over from using musl libc to glibc, because we need to link
against the distribution provided libreadline.a archive, which includes
references to glibc itself.
  • Loading branch information
d-e-s-o committed Sep 13, 2024
1 parent 6fcc032 commit 7b009b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,31 @@ on:

jobs:
build:
name: Build statically linked binary
name: Build notnow${{ matrix.suffix }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- suffix: ""
args: ""
- suffix: "-readline"
args: "--features=readline"
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install musl-tools
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
- run: |
cargo install --bin=notnow --path=. --root=. --target x86_64-unknown-linux-musl
- name: Build notnow
env:
READLINE_STATIC: 1
READLINE_LIB_DIR: /usr/lib/x86_64-linux-gnu/
RUSTFLAGS: -C target-feature=+crt-static
run: |
sudo apt-get install libreadline-dev
cargo install --bin=notnow --path=. --root=. --target x86_64-unknown-linux-gnu ${{ matrix.args }}
strip bin/notnow
- uses: actions/upload-artifact@v4
with:
name: notnow
name: notnow${{ matrix.suffix }}
path: bin/notnow
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ version = "0.2"
version = "0.1.3"

[dependencies.rline]
version = "0.3"
version = "0.3.2"
optional = true

[dependencies.serde]
Expand Down

0 comments on commit 7b009b9

Please sign in to comment.