Skip to content

doc-tests: the three fastify snippets cannot run under PERRY_NO_AUTO_OPTIMIZE — excluded to unblock the release gate (coverage gap) #8475

Description

@proggeramlug

Three doc-example snippets are COMPILE_FAIL in doc-tests, which gates the release:

  • docs/examples/getting-started/npm_packages.ts
  • docs/examples/stdlib/http/fastify_json.ts
  • docs/examples/stdlib/overview/snippets.ts

All three import 'fastify', and all three fail with the same deliberate hard error:

error: `import 'fastify'` is not supported with PERRY_NO_AUTO_OPTIMIZE: the prebuilt stdlib is
not compiled with `external-fastify-pump`, so fastify requests would never drain (the request
loop hangs).

This is a harness/config incompatibility, not a compiler bug. scripts/run_doc_tests.sh sets PERRY_NO_AUTO_OPTIMIZE=1 for host runs — a large speed win (~30–200 s saved per test, ~80% of doc-tests wall time) — and the guard in optimized_libs/driver.rs correctly refuses to build a fastify binary that would hang at runtime.

Note the guard keys on the environment variable alone; it does not inspect the archive. I verified that building perry-stdlib-static --features perry-stdlib/external-fastify-pump does not satisfy it, so "just enable the feature in the prebuild" is not a fix on its own.

Interim (PR #8476): exclude the three snippets from the no-auto run, on the same terms as stdlib/http/snippets.ts which is already excluded for a sibling reason. This unblocks the release gate. It is an explicit coverage gap — those three snippets are no longer verified by CI at all, and this issue exists to close it.

Proper fix, pick one:

  1. Second pass — have run_doc_tests.sh collect the fastify-importing snippets and run just those without PERRY_NO_AUTO_OPTIMIZE, paying the rebuild cost for three tests instead of losing coverage. Probably the best value.
  2. Self-describing skip — extend the harness's existing banner mechanism (// platforms:) with something like // requires: auto-optimize, so the constraint lives in the file rather than in a workflow string, and shows up as a reported SKIP rather than silence.
  3. Make the guard evidence-based — have it inspect the stdlib archive for the pump symbols instead of assuming from the env var, so a prebuild that does include external-fastify-pump is accepted. Combine with adding the feature to the doc-tests prebuild.

Option 2 also fixes a smaller wart: an exclusion in a workflow string is invisible to anyone reading the snippet, which is how this class stayed unnoticed while the full tier was dark.

Activity

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