Skip to content

perry check --check-deps false positive: "compilation is guaranteed to succeed" despite unsupported codegen expressions #81

Description

@proggeramlug

Environment

  • perry 0.5.92
  • macOS arm64 (darwin 25.4.0)

Problem

perry check --check-deps <file> reports

All checks passed! - N file(s) checked
[OK] Compilation is guaranteed to succeed

but running perry compile on the same file immediately afterwards fails with perry-codegen Phase 2: expression ... not yet supported (see #78). The dependency-check claim is wrong: compilation is not guaranteed.

This breaks CI. Any pipeline that gates on perry check --check-deps passing will happily promote broken code.

Reproduction

Using the minimal repro from #78:

// minrepro.ts
function describe(v: unknown): string {
    if (Buffer.isBuffer(v)) {
        return 'buffer of length ' + v.length;
    }
    return typeof v;
}
$ perry check --check-deps minrepro.ts
Checking 1 file(s)...
Dependency checking enabled.

All checks passed! - 1 file(s) checked

[OK] Compilation is guaranteed to succeed

$ perry compile minrepro.ts -o /tmp/minrepro
# → Error compiling module 'minrepro.ts': lowering function 'describe':
#   perry-codegen Phase 2: expression BufferIsBuffer not yet supported
# → ld: error: linker command failed ...

Expected

Either:

  • check runs the codegen-lowering pass and reports unsupported expressions as hard failures, OR
  • the text softens to "Compilation may succeed" / "Type compatibility OK — codegen not verified".

Anything but "guaranteed to succeed" when it demonstrably does not.

Hit in real code

@perry/mysql's perry check --check-deps passed cleanly across all 60 modules; actual perry compile immediately hit #78. Spent ~20 min chasing link errors before realising the check was the wrong scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed defect or regressiontoolingDeveloper tooling, CI, tests, or release infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions