96
96
- name : Install zig and cargo-zigbuild
97
97
run : pip3 install ziglang==0.11.0 cargo-zigbuild==0.17.1
98
98
99
+ - name : Force Cargo to create the target directory
100
+ # Run `cargo clean` with an empty package name to force it to create the target directory
101
+ # This fails because there is no package with an empty name, but the target directory is created
102
+ # See https://github.com/rust-lang/cargo/issues/12441
103
+ # This is needed because `cargo-zigbuild` sometimes (wrongly) creates the target directory
104
+ # See https://github.com/rust-cross/cargo-zigbuild/issues/165
105
+ run : cargo clean -p '' --target ${{ matrix.arch }}-unknown-linux-gnu || true
106
+
99
107
- name : Build the binary
100
108
run : |
101
109
cargo zigbuild \
@@ -163,6 +171,14 @@ jobs:
163
171
- name : Download the macOS SDK
164
172
run : curl -L "https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz" | tar -J -x -C /opt
165
173
174
+ - name : Force Cargo to create the target directory
175
+ # Run `cargo clean` with an empty package name to force it to create the target directory
176
+ # This fails because there is no package with an empty name, but the target directory is created
177
+ # See https://github.com/rust-lang/cargo/issues/12441
178
+ # This is needed because `cargo-zigbuild` sometimes (wrongly) creates the target directory
179
+ # See https://github.com/rust-cross/cargo-zigbuild/issues/165
180
+ run : cargo clean -p '' --target ${{ matrix.arch }}-apple-darwin || true
181
+
166
182
- name : Build the binary
167
183
run : |
168
184
cargo zigbuild \
@@ -172,13 +188,6 @@ jobs:
172
188
--features dist \
173
189
-p mas-cli
174
190
175
- - name : Create CACHEDIR.TAG files
176
- # This is a workaround for `cargo-zigbuild` not creating the CACHEDIR.TAG files
177
- # https://github.com/rust-cross/cargo-zigbuild/issues/165
178
- run : |
179
- touch target/CACHEDIR.TAG
180
- touch target/${{ matrix.arch }}-apple-darwin/CACHEDIR.TAG
181
-
182
191
- name : Download the artifacts
183
192
184
193
with :
0 commit comments