Skip to content

Migrated pcre2 surface is module-private; jit-unsupported contract test needs a pub API #662

Closed

Description

@ehartford

The pcre2 migration emitted every function/constant non-pub (lib/std/re/pcre2_jit_compile.w: 0 pub of 10 fns; PCRE2_ERROR_* in defs.w also private). Cross-module use inside lib/std/re works via the std-implementation tier, but external code cannot reach any of it.

The selfhost case 'pcre2-jit-no-support' exercised the jit-unsupported error contract (PCRE2_ERROR_NULL / PCRE2_ERROR_JIT_UNSUPPORTED returns) from an external fixture — which only ever compiled because the pre-#660 pattern-binding corruption silently disabled visibility checks for it. After #660 the privacy diagnostics fire correctly, and the case has been converted to guard the privacy enforcement instead (build/selfhost.w bs_check_pcre2_jit_no_support).

To re-test the jit contract properly, the migrator should classify the pcre2 public API (per pcre2.h exports) as pub during migration — per the no-hand-patches rule, that is a migrator fix + re-migration, not an edit to lib/std/re/*.w. Then the case can be restored to its original 'run' form.

Activity

  1. ehartford commented on Aug 31, 2026

    @ehartford
    ContributorAuthor

    Triage re-scope 2026-08-31: the #880 re-migration made the pcre2 surface pub (defs.w PCRE2_ERROR_* and the jit fns), so the privacy premise is gone. Remaining scope: restore bs_check_pcre2_jit_no_support to its original 'run' form with the fixture body in unsafe { }, and DELETE the privacy-guard variant — its 'is private to module' assertion no longer matches and will go red on the next selfhost lane (1cbcece adapted only the object-symbol fixture).

  2. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-10-25, with v0.15.3.0 (main a261b65): done. The re-scoped work landed: bs_check_pcre2_jit_no_support (build/selfhost.w) builds the fixture against the migrated surface (pub unsafe fn) and runs it to exit 0; the privacy-guard variant is gone (the comment there records the history).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions