Skip to content

Commit 7748838

Browse files
committed
ts_ffi: don't generate tailscale.h on rust publish
Signed-off-by: Nathan Perry <nathan@tailscale.com> Change-Id: I3efd59754eb1acadea1652db7ac43cba6a6a6964
1 parent d5cf7d8 commit 7748838

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,5 @@ jobs:
208208
- name: Publish
209209
run: cargo ws publish --publish-as-is
210210
env:
211+
TS_FFI_BUILDRS_STRICT: 1
211212
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

ts_ffi/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ fn main() {
1111
.generate()
1212
.unwrap();
1313

14-
bindings.write_to_file("tailscale.h");
14+
// We're not supposed to generate anything outside of `OUT_DIR`, but it's useful
15+
// as a convenience. Turn it off with this var (for use with publish).
16+
if env::var("TS_FFI_BUILDRS_STRICT").is_err_and(|e| e == env::VarError::NotPresent) {
17+
bindings.write_to_file("tailscale.h");
18+
}
1519

1620
let out = env::var("OUT_DIR").unwrap();
1721
let out = PathBuf::from(out);

0 commit comments

Comments
 (0)