Skip to content

Commit

Permalink
try with pkg-config
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw committed Jun 6, 2024
1 parent 248e63a commit 2e03912
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 9 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ jobs:
env:
# These are some environment variables that configure the build so that the binary size is reduced.
# Inspiration was taken from this blog: https://arusahni.net/blog/2020/03/optimizing-rust-binary-size.html
# They're only enable it on main and releases.
# They only enable it on main and releases.

# Enable Link Time Optimization (LTO) for our release builds. This increases link time but drastically reduces
# binary size.
CARGO_PROFILE_RELEASE_LTO: ${{ needs.metadata.outputs.optimize-build }}

# Use a single code gen unit, this effectively disables parallel linking but ensures that everything is linked
# Use a single code gen unit. This effectively disables parallel linking but ensures that everything is linked
# together in a single unit which reduces the file-size at the cost of link time.
# Default for a release build is 16
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: ${{ needs.metadata.outputs.optimize-build && 1 || 16 }}
Expand All @@ -73,11 +73,6 @@ jobs:
with:
activate-environment: true

- name: Use static CRT on Windows
shell: bash
run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}"
if: endsWith(matrix.target, 'windows-msvc')

- name: Rust cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84
with:
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ tempfile = "3.10.1"
[dev-dependencies]
async-std = "1.12.0"
rstest = "0.21.0"

[target.'x86_64-pc-windows-msvc']
rustflags = ["-C", "target-feature=+crt-static"]
32 changes: 32 additions & 0 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ test = "cargo test"
rust = "1.77.2"
openssl = "3.*"

[target.linux.activation]
scripts = ["activate-openssl.sh"]
# [target.linux.activation]
# scripts = ["activate-openssl.sh"]
# TODO: once https://github.com/prefix-dev/pixi/issues/1481 is fixed, replace with
# [activation.env]
# OPENSSL_DIR = "$CONDA_PREFIX"

[target.linux.dependencies]
compilers = ">=1.7.0"
pkg-config = "*"

[feature.test.dependencies]
conda = "*"
Expand Down

0 comments on commit 2e03912

Please sign in to comment.