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

[SM-1444] Fix Windows GNU Builds #1053

Merged
merged 8 commits into from
Sep 19, 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
12 changes: 11 additions & 1 deletion .github/workflows/build-rust-cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,23 @@ jobs:
- name: Add build architecture
run: rustup target add ${{ matrix.settings.target }}

# Build Rust for musl
- name: Build Rust for - ${{ matrix.settings.target }}
michalchecinski marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ contains(matrix.settings.target, 'musl') }}
env:
RUSTFLAGS: "-D warnings"
run: cargo zigbuild -p bitwarden-c --target ${{ matrix.settings.target }} --release

# Build Rust for windows-gnu
- name: Build Rust for - ${{ matrix.settings.target }}
michalchecinski marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ !contains(matrix.settings.target, 'musl') }}
if: ${{ matrix.settings.target == 'x86_64-pc-windows-gnu' }}
env:
RUSTFLAGS: "-D warnings"
run: cargo build -p bitwarden-c --target ${{ matrix.settings.target }} --profile=release-windows

# Build Rust for !musl && !windows-gnu
- name: Build Rust for - ${{ matrix.settings.target }}
if: ${{ !contains(matrix.settings.target, 'musl') && matrix.settings.target != 'x86_64-pc-windows-gnu' }}
env:
RUSTFLAGS: "-D warnings"
MACOSX_DEPLOYMENT_TARGET: "10.14" # allows using new macos runner versions while still supporting older systems
Expand All @@ -79,3 +88,4 @@ jobs:
name: libbitwarden_c_files-${{ matrix.settings.target }}
path: |
target/${{ matrix.settings.target }}/release/*bitwarden_c*
target/${{ matrix.settings.target }}/release-windows/*bitwarden_c*
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ opt-level = 1
[profile.release]
lto = "thin"
codegen-units = 1

# Turn off LTO on release mode for windows
# This is a workaround until this is fixed: https://github.com/rustls/rustls-platform-verifier/issues/141
[profile.release-windows]
inherits = "release"
lto = "off"

# Stripping the binary reduces the size by ~30%, but the stacktraces won't be usable anymore.
# This is fine as long as we don't have any unhandled panics, but let's keep it disabled for now
# strip = true
Loading