Skip to content

Commit

Permalink
Fix static linking with git2's C libraries.
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinWise committed Feb 13, 2022
1 parent 3857e5e commit e5d0155
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 0 additions & 5 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@
#rustflags = ["-C", "link-arg=-fuse-ld=lld"]
#[target.aarch64-unknown-linux-gnu]
#rustflags = ["-C", "link-arg=-fuse-ld=lld"]

# Statically link the MSVC C Runtime on Windows, so the EXEs can run without
# installing the C Runtime DLL.
#[target.'cfg(all(target_env = "msvc"))']
#rustflags = ["-C", "target-feature=+crt-static"]
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ jobs:
use-cross: false

steps:

# Build all crates with a statically linked MSVCRT. Specifically crates
# that use `cc` in their build scripts (like libgit2-sys), will detect this
# and compile objects appropriatly. If there is a way to put this into a
# Cargo config file some where, let me know. .cargo/config did not work.
- name: Statically link MSVCRT
shell: bash
if: matrix.os == 'windows'
run: |
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v2

Expand Down

0 comments on commit e5d0155

Please sign in to comment.