Skip to content

Commit 9fa75f9

Browse files
committed
Merge branch 'optimize-for-size'
2 parents e06b735 + ab950f7 commit 9fa75f9

24 files changed

Lines changed: 372 additions & 304 deletions

.github/workflows/rust.yml

Lines changed: 43 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -42,92 +42,58 @@ jobs:
4242
rust_project_path: src-rust
4343
rust_branch: nightly
4444

45-
build-c-libs:
45+
build-c-libs-linux:
46+
runs-on: ${{ matrix.os }}
4647
strategy:
48+
fail-fast: false
4749
matrix:
48-
include:
49-
- os: ubuntu-latest
50-
target: x86_64-unknown-linux-gnu
51-
features: "c_exports"
52-
- os: ubuntu-latest
53-
target: i686-unknown-linux-gnu
54-
features: "c_exports"
55-
- os: ubuntu-latest
56-
target: aarch64-unknown-linux-gnu
57-
features: "c_exports"
58-
- os: windows-latest
59-
target: x86_64-pc-windows-msvc
60-
features: "c_exports"
61-
- os: windows-latest
62-
target: i686-pc-windows-msvc
63-
features: "c_exports"
64-
- os: windows-latest
65-
target: aarch64-pc-windows-msvc
66-
features: "c_exports"
67-
- os: macos-latest
68-
target: x86_64-apple-darwin
69-
features: "c_exports"
70-
- os: macos-latest
71-
target: aarch64-apple-darwin
72-
features: "c_exports"
73-
- os: ubuntu-latest
74-
target: x86_64-unknown-linux-gnu
75-
features: "c_exports,size_opt"
76-
- os: ubuntu-latest
77-
target: i686-unknown-linux-gnu
78-
features: "c_exports,size_opt"
79-
- os: ubuntu-latest
80-
target: aarch64-unknown-linux-gnu
81-
features: "c_exports,size_opt"
82-
- os: windows-latest
83-
target: x86_64-pc-windows-msvc
84-
features: "c_exports,size_opt"
85-
- os: windows-latest
86-
target: i686-pc-windows-msvc
87-
features: "c_exports,size_opt"
88-
- os: windows-latest
89-
target: aarch64-pc-windows-msvc
90-
features: "c_exports,size_opt"
91-
- os: macos-latest
92-
target: x86_64-apple-darwin
93-
features: "c_exports,size_opt"
94-
- os: macos-latest
95-
target: aarch64-apple-darwin
96-
features: "c_exports,size_opt"
97-
- os: ubuntu-latest
98-
target: x86_64-unknown-linux-gnu
99-
features: "c_exports,size_opt,no_format"
100-
- os: ubuntu-latest
101-
target: i686-unknown-linux-gnu
102-
features: "c_exports,size_opt,no_format"
103-
- os: ubuntu-latest
104-
target: aarch64-unknown-linux-gnu
105-
features: "c_exports,size_opt,no_format"
106-
- os: windows-latest
107-
target: x86_64-pc-windows-msvc
108-
features: "c_exports,size_opt,no_format"
109-
- os: windows-latest
110-
target: i686-pc-windows-msvc
111-
features: "c_exports,size_opt,no_format"
112-
- os: windows-latest
113-
target: aarch64-pc-windows-msvc
114-
features: "c_exports,size_opt,no_format"
115-
- os: macos-latest
116-
target: x86_64-apple-darwin
117-
features: "c_exports,size_opt,no_format"
118-
- os: macos-latest
119-
target: aarch64-apple-darwin
120-
features: "c_exports,size_opt,no_format"
50+
os: [ubuntu-latest]
51+
target: [x86_64-unknown-linux-gnu, i686-unknown-linux-gnu, aarch64-unknown-linux-gnu]
52+
features: ["c_exports", "c_exports,size_opt", "c_exports,size_opt,no_format"]
53+
steps:
54+
- uses: actions/checkout@v3
55+
with:
56+
submodules: recursive
57+
- id: build-libs
58+
uses: Reloaded-Project/reloaded-project-configurations-rust/.github/actions/build-c-library@v1
59+
with:
60+
rust_project_path: src-rust
61+
target: ${{ matrix.target }}
62+
features: ${{ matrix.features }}
12163

64+
build-c-libs-macos:
12265
runs-on: ${{ matrix.os }}
123-
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
os: [macos-latest]
70+
target: [x86_64-apple-darwin, aarch64-apple-darwin]
71+
features: ["c_exports", "c_exports,size_opt", "c_exports,size_opt,no_format"]
12472
steps:
12573
- uses: actions/checkout@v3
12674
with:
12775
submodules: recursive
76+
- id: build-libs
77+
uses: Reloaded-Project/reloaded-project-configurations-rust/.github/actions/build-c-library@v1
78+
with:
79+
rust_project_path: src-rust
80+
target: ${{ matrix.target }}
81+
features: ${{ matrix.features }}
12882

83+
build-c-libs-windows:
84+
runs-on: ${{ matrix.os }}
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
os: [windows-latest]
89+
target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc, aarch64-pc-windows-msvc]
90+
features: ["c_exports,external_processes", "c_exports,size_opt,external_processes", "c_exports,size_opt,no_format,external_processes"]
91+
steps:
92+
- uses: actions/checkout@v3
93+
with:
94+
submodules: recursive
12995
- id: build-libs
130-
uses: Reloaded-Project/reloaded-project-configurations-rust/.github/actions/build-c-library@v1 # upgrade if needed
96+
uses: Reloaded-Project/reloaded-project-configurations-rust/.github/actions/build-c-library@v1
13197
with:
13298
rust_project_path: src-rust
13399
target: ${{ matrix.target }}
@@ -155,7 +121,7 @@ jobs:
155121
header_file: bindings_c.h
156122

157123
publish-artifacts:
158-
needs: ["build-c-headers", "build-c-libs", "test-wine", "test-native"]
124+
needs: ["build-c-headers", "build-c-libs-windows", "build-c-libs-linux", "build-c-libs-macos", "test-wine", "test-native"]
159125
# Publish only on tags
160126
if: startsWith(github.ref, 'refs/tags/')
161127
runs-on: ubuntu-latest

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ You can specify another process with `TargetProcess = someProcess` in `BufferAll
118118

119119
## Crate Features (Rust)
120120

121+
- `std`: [Enabled by Default] Enables use of standard library.
122+
- `external_processes`: Support external processes (windows only).
121123
- `no_format`: Disables formatting code in errors, saving ~8kB of space.
122124
- `size_opt`: Makes cold paths optimized for size instead of optimized for speed. [Requires 'nightly' Rust]
123125
- `c_exports` Provides C exports for the library.

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ Alternative overload also allows you to pass a 'context' variable.
250250

251251
### Crate Features (Rust)
252252

253+
- `std`: [Enabled by Default] Enables use of standard library.
254+
- `external_processes`: Support external processes (windows only).
253255
- `no_format`: Disables formatting code in errors, saving ~8kB of space.
254256
- `size_opt`: Makes cold paths optimized for size instead of optimized for speed. [Requires 'nightly' Rust]
255257
- `c_exports` Provides C exports for the library.

0 commit comments

Comments
 (0)