Skip to content

Commit

Permalink
Link against musl instead of glibc (#19)
Browse files Browse the repository at this point in the history
Summary:
In order to run the binary a wider range of distributions this PR switches the libc library from glibc to musl.

Pull Request resolved: #19

Reviewed By: michalmuskala

Differential Revision: D42885109

Pulled By: VLanvin

fbshipit-source-id: c8c003bd3690396d2250ac747e3f19ccd547b867
  • Loading branch information
benjoe87 authored and facebook-github-bot committed Feb 2, 2023
1 parent 0b30b27 commit eb00781
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ jobs:
java: 'java11'
- name: Install Native Image Plugin
run: gu install native-image
- name: Install musl-tools for rust toolchain
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: musl-tools
version: 1.0
- name: Set up rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-musl
default: true
- name: Install OTP
uses: erlef/setup-beam@v1
with:
Expand All @@ -29,11 +36,11 @@ jobs:
- name: Assemble eqwalizer binary
run: "cd eqwalizer && native-image -H:IncludeResources=application.conf --no-server --no-fallback -jar target/scala-2.13/eqwalizer.jar eqwalizer"
- name: Test elp
run: "cd mini-elp && cargo test --workspace"
run: "cd mini-elp && cargo test --workspace --target x86_64-unknown-linux-musl"
- name: Assemble elp
run: "export ELP_EQWALIZER_PATH=$GITHUB_WORKSPACE/eqwalizer/eqwalizer && cd mini-elp && cargo build --release"
run: "export ELP_EQWALIZER_PATH=$GITHUB_WORKSPACE/eqwalizer/eqwalizer && cd mini-elp && cargo build --release --target x86_64-unknown-linux-musl"
- name: Add elp to path
run: 'echo "$GITHUB_WORKSPACE/mini-elp/target/release" >> $GITHUB_PATH'
run: 'echo "$GITHUB_WORKSPACE/mini-elp/target/x86_64-unknown-linux-musl/release" >> $GITHUB_PATH'
- name: Test eqwalizer
if: matrix.otp != '23.3'
run: 'cd eqwalizer && sbt test'
Expand Down
26 changes: 19 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ jobs:
java: 'java11'
- name: Install Native Image Plugin
run: gu install native-image
- name: Install musl-tools for rust toolchain
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: musl-tools
version: 1.0
- name: Set up rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-musl
- name: Install OTP
uses: erlef/setup-beam@v1
with:
Expand All @@ -25,11 +31,11 @@ jobs:
- name: Assemble eqwalizer binary
run: "cd eqwalizer && native-image -H:IncludeResources=application.conf --no-server --no-fallback -jar target/scala-2.13/eqwalizer.jar eqwalizer"
- name: Test elp
run: "cd mini-elp && cargo test --workspace"
run: "cd mini-elp && cargo test --workspace --target x86_64-unknown-linux-musl"
- name: Assemble elp
run: "export ELP_EQWALIZER_PATH=$GITHUB_WORKSPACE/eqwalizer/eqwalizer && cd mini-elp && cargo build --release"
run: "export ELP_EQWALIZER_PATH=$GITHUB_WORKSPACE/eqwalizer/eqwalizer && cd mini-elp && cargo build --release --target x86_64-unknown-linux-musl"
- name: Add elp to path
run: 'echo "$GITHUB_WORKSPACE/mini-elp/target/release" >> $GITHUB_PATH'
run: 'echo "$GITHUB_WORKSPACE/mini-elp/target/x86_64-unknown-linux-musl/release" >> $GITHUB_PATH'
- name: Test eqwalizer
run: 'cd eqwalizer && sbt test'
- name: Upload eqwalizer.jar
Expand All @@ -43,7 +49,7 @@ jobs:
name: eqwalizer
path: eqwalizer/eqwalizer
- name: Make elp-linux.tar.gz
run: 'tar -zcvf elp-linux.tar.gz -C mini-elp/target/release/ elp'
run: 'tar -zcvf elp-linux.tar.gz -C mini-elp/target/x86_64-unknown-linux-musl/release/ elp'
- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
id: get_release_url
Expand All @@ -70,10 +76,16 @@ jobs:
with:
graalvm: '22.1.0'
java: 'java11'
- name: Install musl-tools for rust toolchain
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: musl-tools
version: 1.0
- name: Set up rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-musl
- name: Install OTP
uses: erlef/setup-beam@v1
with:
Expand All @@ -90,11 +102,11 @@ jobs:
name: eqwalizer
path: eqwalizer
- name: Test elp
run: "cd mini-elp && cargo test --workspace"
run: "cd mini-elp && cargo test --workspace --target x86_64-unknown-linux-musl"
- name: Assemble elp
run: "export ELP_EQWALIZER_PATH=$GITHUB_WORKSPACE/eqwalizer/eqwalizer && cd mini-elp && cargo build --release"
run: "export ELP_EQWALIZER_PATH=$GITHUB_WORKSPACE/eqwalizer/eqwalizer && cd mini-elp && cargo build --release --target x86_64-unknown-linux-musl"
- name: Make elp-linux-otp-23.tar.gz
run: 'tar -zcvf elp-linux-otp-23.tar.gz -C mini-elp/target/release/ elp'
run: 'tar -zcvf elp-linux-otp-23.tar.gz -C mini-elp/target/x86_64-unknown-linux-musl/release/ elp'
- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
id: get_release_url
Expand Down

0 comments on commit eb00781

Please sign in to comment.