Skip to content

LIT tests fail on macOS version mismatch due to linker warning breaking CHECK-NEXT directives #2391

@sengthai

Description

@sengthai

Context
When using a Catalyst build from an older macOS version on a newer macOS, or vice versa, the test suite fails due to a linker warning being injected into the output stream:
ld: warning: object file (/private/var/folders/m4/asd321/T/lit-t/circuit/circuit.o) was built for newer 'macOS' version (26.0) than being linked (15.5)
This warning breaks tests that use CHECK-NEXT directives, which strictly verify that output appears on consecutive lines. The unexpected warning line causes a mismatch.

Steps to Reproduce

  • Build Catalyst on macOS version X
  • Run the test suite on macOS version Y (where X ≠ Y)
  • Observe test failures due to the linker warning breaking CHECK-NEXT checks

Expected Behavior
Tests should pass regardless of minor macOS version differences, as the linker warning does not affect functionality.
Proposed Solution
Relax the strict CHECK-NEXT directives to CHECK where appropriate. This allows intermediate lines (like system warnings) to appear without breaking the test assertions.
For example, change:
# CHECK-NEXT: [DIAGNOSTICS] Running capture
to:
# CHECK: [DIAGNOSTICS] Running capture

Actually Behavior

.
.
.
ld: warning: object file (/private/var/folders/m4/hymm68011xs1pk3zqv3bb2yc0000gr/T/lit-tmp-vj80pa5a/circuitb1whf74a/circuit.o) was built for newer 'macOS' version (26.0) than being linked (15.5)
^

Input file: <stdin>
Check file: catalyst/frontend/test/lit/test_instrumentation_console.py

-dump-input=help explains the following input dump.

Input was:
<<<<<<
         1: [DIAGNOSTICS] Running pre_compilation walltime: 0.007 ms cputime: 0.005 ms  
         2: [DIAGNOSTICS] Running capture walltime: 146.097 ms cputime: 112.563 ms programsize: 47 lines 
         3: [DIAGNOSTICS] Running generate_ir walltime: 47.462 ms cputime: 32.68 ms programsize: 49 lines 
         4: ld: warning: object file (/private/var/folders/m4/hymm68011xs1pk3zqv3bb2yc0000gr/T/lit-tmp-vj80pa5a/circuitb1whf74a/circuit.o) was built for newer 'macOS' version (26.0) than being linked (15.5) 
         5: [DIAGNOSTICS] Running compile walltime: 1018.729 ms cputime: 43.132 ms programsize: 129 lines 
next:51     !~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                  error: match on wrong line
         6: [DIAGNOSTICS] Running run walltime: 52.037 ms cputime: 38.046 ms  
         7: [DIAGNOSTICS] > Total pre_compilation walltime: 0.015 ms cputime: 0.012 ms  
         8: [DIAGNOSTICS] > Total capture walltime: 34.807 ms cputime: 31.292 ms programsize: 47 lines 
         9: [DIAGNOSTICS] > Total generate_ir walltime: 5.791 ms cputime: 5.244 ms programsize: 49 lines 
        10: ld: warning: object file (/private/var/folders/m4/hymm68011xs1pk3zqv3bb2yc0000gr/T/lit-tmp-vj80pa5a/circuitqnb9fw2u/circuit.o) was built for newer 'macOS' version (26.0) than being linked (15.5) 
         .
         .
         .
>>>>>>```


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