Skip to content

Handle MinGW targets in the default platform compiler-rt switch - #10917

Closed
Anton-4 wants to merge 1 commit into
mainfrom
fix-broken-main-mingw
Closed

Anton-4 wants to merge 1 commit into
mainfrom
fix-broken-main-mingw

Conversation

@Anton-4

@Anton-4 Anton-4 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Main broke because two independently-green PRs landed without either branch containing the other:

#10637 (fix/windows-abi-targets) added four MinGW variants to
RocTarget, and #10904 (fix/windows-shim-duplicate-compiler-rt) added
DefaultPlatformCompilerRtObjects.forTarget, an exhaustive switch over
RocTarget. The two touch different files, so git merged them cleanly
and Zig then rejected the switch:

src/cli/main.zig:704:16: error: switch must handle all possibilities
src/target/mod.zig:381:5: note: unhandled enumeration value: 'x64mingw'

Route the MinGW targets to the null arm alongside the MSVC Windows targets. null is correct rather than a placeholder object: no roc_default_compiler_rt.o is shipped under src/cli/targets/x64mingw or arm64mingw (only the glibc and musl targets carry one), and the caller turns null into rejectRunTargetNotExecutable, which is already how x64win and arm64win behave.

The v1 variants are unreachable here since defaultCpuTarget() folds x64v1mingw into x64mingw, but the switch is over the unnormalized enum so they still have to be listed, matching the surrounding arms.

Main broke because two independently-green PRs landed without either
branch containing the other:

  #10637 (fix/windows-abi-targets) added four MinGW variants to
  RocTarget, and #10904 (fix/windows-shim-duplicate-compiler-rt) added
  DefaultPlatformCompilerRtObjects.forTarget, an exhaustive switch over
  RocTarget. The two touch different files, so git merged them cleanly
  and Zig then rejected the switch:

    src/cli/main.zig:704:16: error: switch must handle all possibilities
    src/target/mod.zig:381:5: note: unhandled enumeration value: 'x64mingw'

Route the MinGW targets to the `null` arm alongside the MSVC Windows
targets. `null` is correct rather than a placeholder object: no
roc_default_compiler_rt.o is shipped under src/cli/targets/x64mingw or
arm64mingw (only the glibc and musl targets carry one), and the caller
turns `null` into rejectRunTargetNotExecutable, which is already how
x64win and arm64win behave.

The v1 variants are unreachable here since defaultCpuTarget() folds
x64v1mingw into x64mingw, but the switch is over the unnormalized enum
so they still have to be listed, matching the surrounding arms.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011571s4BMwoV9qAgcx4JyP9
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR restores the exhaustive default-platform compiler-rt target switch after MinGW targets were added.

  • Routes x64 and ARM64 MinGW targets to the existing no-compiler-rt path.
  • Handles normalized and v1 MinGW variants consistently with other unsupported runtime targets.

Confidence Score: 5/5

The PR appears safe to merge because it completes the exhaustive target switch and preserves the existing MinGW build path.

MinGW compiler-rt objects are not generated, MinGW run requests are rejected before this lookup, and MinGW artifact builds use a separate object-selection path.

Important Files Changed

Filename Overview
src/cli/main.zig Adds all four MinGW enum variants to the compiler-rt switch's null arm, resolving the build failure without changing supported MinGW artifact construction.

Reviews (1): Last reviewed commit: "Handle MinGW targets in the default plat..." | Re-trigger Greptile

@Anton-4

Anton-4 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #10918

@Anton-4 Anton-4 closed this Aug 24, 2026
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