The crate archives linked into each shipped binary: target deps only, so
build scripts, their deps and proc-macros (bindgen, cc, serde_derive),
which run at build time and are not shipped, are left out.
query_outputs reads the archives straight from third-party/BUCK, whose
http_archive targets are private: a query reaches them where a dep
cannot. Both files come from one run, because one texts/ serves both.
16ARCHIVES = "$(query_outputs 'kind(http_archive, deps({}, 1000, target_deps()))')"
18genrule( 19 name = "notices", 20 srcs = glob(["texts/**"]), 21 outs = { 22 "extension": ["THIRD-PARTY"], 23 "sidecar": ["THIRD-PARTY-sidecar"], 24 }, 25 cmd = " ".join([ 26 "$(exe :third-party-notices) generate $SRCDIR/texts", 27 "-- $OUT/THIRD-PARTY postjevsql postjevsql.so", 28 ARCHIVES.format("//crates/postjevsql:postjevsql"), 29 "-- $OUT/THIRD-PARTY-sidecar postjevsql-sidecar 'the postjevsql-sidecar binary'", 30 ARCHIVES.format("//crates/postjevsql-sidecar:cli"), 31 ]), 32) 33 34first_party_test( 35 name = "drift", 36 srcs = ["drift.rs"], 37 crate_root = "drift.rs", 38 env = { 39 "COMMITTED": "$(location //:third-party-notices)", 40 "COMMITTED_SIDECAR": "$(location //:third-party-notices-sidecar)", 41 "GENERATED": "$(location :notices[extension])", 42 "GENERATED_SIDECAR": "$(location :notices[sidecar])", 43 }, 44)
buck2 run //tools/third-party-notices:update rewrites the root
THIRD-PARTY and THIRD-PARTY-sidecar.