From 82b27813766b6ae38602769a1166024cdc191260 Mon Sep 17 00:00:00 2001 From: Tom Brow Date: Wed, 28 Oct 2026 18:56:35 -0700 Subject: [PATCH] fix(mobile): rebuild buzz_secp256k1 when vendored headers change (#8664) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #8654, from [Kalvin's review note](https://github.com/block/buzz/pull/8654#discussion_r4407146414). `native_toolchain_c`'s `CBuilder` registers only the listed C sources (and files under `includes`) as build-hook dependencies. The `buzz_secp256k1` hook lists four sources and no headers, so after an initial build a header-only vendor update (for example `src/modules/schnorrsig/main_impl.h`) could reuse the old library in incremental app and test builds. The hook now also registers every `.h` file under the vendored tree. It does not add include paths, so compilation is unchanged. ### Validation - With the change, editing the content of `third_party/secp256k1/src/modules/schnorrsig/main_impl.h` makes the next `dart test` rebuild `libbuzz_secp256k1.dylib`. Without it, the library is reused unchanged. - The hook output now lists all 62 vendored headers as dependencies. - Package tests pass (27). buzz-review-completed (Codex and security review clean; agent verification above; build-only change, no app behavior to test) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Tom Brow Co-authored-by: Claude Opus 5.5 --- mobile/packages/buzz_secp256k1/hook/build.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mobile/packages/buzz_secp256k1/hook/build.dart b/mobile/packages/buzz_secp256k1/hook/build.dart index ed0dd621b9..d7f7cd2eea 100644 --- a/mobile/packages/buzz_secp256k1/hook/build.dart +++ b/mobile/packages/buzz_secp256k1/hook/build.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:code_assets/code_assets.dart'; import 'package:hooks/hooks.dart'; import 'package:native_toolchain_c/native_toolchain_c.dart'; @@ -31,5 +33,14 @@ void main(List args) async { 'COMB_TEETH': '6', }, ).run(input: input, output: output); + // CBuilder tracks only the listed sources, so a header-only vendor update + // would otherwise reuse a stale library in incremental builds. + output.dependencies.addAll( + Directory.fromUri(input.packageRoot.resolve('$_vendor/')) + .listSync(recursive: true) + .whereType() + .where((file) => file.path.endsWith('.h')) + .map((file) => file.uri), + ); }); }