Skip to content

feat(rnp-src): sync vendored HEAD flavor to librnp main (pin, clone-sync, drop json-c) - #101

Merged
ronaldtse merged 1 commit into
mainfrom
feat/sync-librnp-main
Sep 9, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
feat/sync-librnp-main

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Syncs the vendored HEAD flavor (pqc / crypto-refresh) to current librnp main.

What changed upstream

librnp main moved heavily since our last validated sync: json-c was removed in favor of a vendored single-header nlohmann/json (rnpgp/rnp@4f5c4e6e), dump gained decompression-bomb caps, PQC subkey export was fixed (both traditional and PQC subkeys now exported in rnp_key_export_autocrypt), PQC subkey handling is properly #if defined(ENABLE_PQC)-guarded, plus Android/OHOS CI and CMake hardening. The public FFI surface delta vs 0.18.1 is unchanged from what we already track (rnp_op_encrypt_enable_skesk_v6 new, the two sphincsplus functions removed — both already handled in the parity table).

What this PR does

  1. Pin the HEAD flavor to 470695b98abe8a427fc47847acb387c089cb156d (current main tip). RNP_HEAD_REF was nominally "pin to a commit for reproducibility" but actually floated main — a fresh build got whatever landed that day, including unvalidated regressions.
  2. Sync cached clones to the pin: prepare_librnp_head now fetches + hard-checks-out the pin (with submodule sync) on every build instead of cloning once and reusing a stale tree forever. The Botan-include patcher re-runs afterwards (it is idempotent; --force discards its previous edits).
  3. Cache key embeds the pin: Flavor::Head.cache_dir() is now rnp-head-<short-sha> (was the pin-agnostic rnp-flavored), so bumping the pin automatically invalidates stale cached artifacts — the same protection rnp-0.18.1-b1 gives the release flavor.
  4. Drop json-c for the HEAD flavor: upstream vendored nlohmann/json, so json-c is neither built nor passed to CMake nor linked for HEAD; Installed.flavor carries the decision and rnp-sys gates static=json-c (and Windows advapi32, which only json-c needed) accordingly. The 0.18.1 release flavor still builds and links json-c exactly as before.

Validation

  • rnp-src flavor unit tests: 11 pass (including new pin-is-full-SHA and needs-json-c mapping tests).
  • Local --features vendored,pqc,crypto-refresh build: clone synced to 470695b, install/rnp-head-470695b9/lib/librnp.a produced, zero json-c references in the build, link succeeded.
  • CI job pqc + crypto-refresh (ubuntu) is the authoritative gate for the flavored build.
  • Note: the flavored build segfaults in signing on macOS/ARM64 locally — control experiment (a worktree of main before this PR, same machine) crashes identically, and it reproduces against the 2026-08-28 pin whose ubuntu CI was green, so it pre-dates this sync and is macOS-specific; filed as Flavored (HEAD) vendored build segfaults in signing on macOS/ARM64 — pre-existing, not the pinning sync #100.

…ync, drop json-c)

librnp main moved heavily since the last validated sync: json-c was
replaced by a vendored single-header nlohmann/json (rnpgp/rnp@4f5c4e6e),
dump gained decompression-bomb caps, PQC subkey export was fixed, and
PQC subkey handling is now properly ENABLE_PQC-guarded. The public FFI
surface delta vs 0.18.1 is unchanged from what the parity table already
tracks.

- Pin the HEAD flavor to 470695b98abe (current main tip).
  RNP_HEAD_REF was nominally 'pin for reproducibility' but actually
  floated 'main' — fresh builds got whatever landed that day.
- prepare_librnp_head now syncs cached clones to the pin on every build
  (fetch + hard checkout + submodule sync), so stale clones can't keep
  serving old source; the idempotent Botan-include patcher re-runs after.
- Flavor::Head.cache_dir() embeds the pin's short SHA (rnp-head-<sha>),
  so bumping the pin automatically invalidates cached artifacts.
- Drop json-c for the HEAD flavor: upstream vendored nlohmann/json, so
  json-c is neither built, passed to CMake, nor linked (Windows advapi32
  also gated off — only json-c needed it). The 0.18.1 release flavor
  keeps building and linking json-c exactly as before. Installed.flavor
  carries the decision to rnp-sys.

Validated: 27/27 release-flavor suites green locally; flavored build
produces librnp.a at the pin with zero json-c; 11 flavor unit tests.
The macOS flavored signing segfault is pre-existing (#100) and
unrelated — ubuntu CI (pqc + crypto-refresh job) is the authoritative
gate, as it has always been for this flavor.
@ronaldtse
ronaldtse merged commit 2e19786 into main Sep 9, 2026
23 checks passed
@ronaldtse
ronaldtse deleted the feat/sync-librnp-main branch September 9, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant