Skip to content

Commit

Permalink
Statically link black in CI/CD outputs as well as compiler output bin…
Browse files Browse the repository at this point in the history
…aries
  • Loading branch information
Ernest1338 committed Jan 21, 2025
1 parent 771242c commit 910a583
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,29 @@ jobs:
cd qbe
sudo make install
- name: Adding musl target
run: rustup target add x86_64-unknown-linux-musl

- name: Build Debug
run: cargo build --verbose
run: cargo build --target=aarch64-unknown-linux-musl --verbose

- name: Build Release
run: cargo build --release --verbose
run: cargo build --target=aarch64-unknown-linux-musl --release --verbose

- name: Run tests
run: cargo test --verbose

- name: Upload binary artifact
- name: Upload debug build
if: success()
uses: actions/upload-artifact@v3
with:
name: black-debug
path: target/x86_64-unknown-linux-musl/debug/black

- name: Upload release build
if: success()
uses: actions/upload-artifact@v3
with:
name: black-binary
path: target/release/black
name: black
path: target/x86_64-unknown-linux-musl/release/black

2 changes: 1 addition & 1 deletion src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ impl Compiler {

measure_time("CC execution", || {
let mut cc = Command::new("cc")
.args(["-x", "assembler", "-o", out_file_str, "-"])
.args(["-x", "assembler", "-static", "-o", out_file_str, "-"])
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.spawn()
Expand Down

0 comments on commit 910a583

Please sign in to comment.