Skip to content

Bootstrap job fails on macos-latest (GHC 9.12.4) due to linker error with SDK TBD files #12465

Closed

Description

@zlonast

Describe the bug

Bootstrap sources saved to /Users/runner/work/cabal/cabal/bootstrap-sources.tar.gz

Use these with the command:

bootstrap.py -w /Users/runner/.ghcup/ghc/9.12.4/bin/ghc-9.12.4 -s /Users/runner/work/cabal/cabal/bootstrap-sources.tar.gz

[1 of 2] Compiling Main             ( Setup.hs, /Users/runner/work/cabal/cabal/_build/dists/alex-3.5.4.2/setup/Main.o )
[2 of 2] Linking /Users/runner/work/cabal/cabal/_build/dists/alex-3.5.4.2/setup/Setup
ld: multiple errors: tapi error: malformed file
/Library/Developer/CommandLineTools/SDKs/MacOSX27.0.sdk/usr/lib/libSystem.B.tbd:4:20: error:
     error: unknown architecture
                       arm64e.x1-macos, arm64e.x1-maccatalyst ]
                       ^~~~~~~~~~~~~~~
     in '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libm.tbd'; tapi error: malformed file
  |
4 |                    arm64e.x1-macos, arm64e.x1-maccatalyst ]
  |                    ^

/Library/Developer/CommandLineTools/SDKs/MacOSX27.0.sdk/usr/lib/libiconv.2.tbd:4:20: error:
     error: unknown architecture
                       arm64e.x1-macos, arm64e.x1-maccatalyst ]
                       ^~~~~~~~~~~~~~~
     in '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libiconv.tbd'; tapi error: malformed file
  |
4 |                    arm64e.x1-macos, arm64e.x1-maccatalyst ]
  |                    ^

/Library/Developer/CommandLineTools/SDKs/MacOSX27.0.sdk/usr/lib/libffi.tbd:4:20: error:
     error: unknown architecture
                       arm64e.x1-macos, arm64e.x1-maccatalyst ]
                       ^~~~~~~~~~~~~~~
     in '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libffi.tbd'; tapi error: malformed file
  |
4 |                    arm64e.x1-macos, arm64e.x1-maccatalyst ]
  |                    ^

/Library/Developer/CommandLineTools/SDKs/MacOSX27.0.sdk/usr/lib/libSystem.B.tbd:4:20: error:
     error: unknown architecture
                       arm64e.x1-macos, arm64e.x1-maccatalyst ]
                       ^~~~~~~~~~~~~~~
     in '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd'
  |
4 |                    arm64e.x1-macos, arm64e.x1-maccatalyst ]
  |                    ^

clang: error: linker command failed with exit code 1 (use -v to see invocation)
ghc-9.12.4: Uncaught exception ghc-9.12.4-6f4d:GHC.Utils.Panic.GhcException:

`gcc' failed in phase `Linker'. (Exit code: 1)

While handling `gcc' failed in phase `Linker'. (Exit code: 1)

HasCallStack backtrace:
  throwIO, called at libraries/exceptions/src/Control/Monad/Catch.hs:347:12 in exceptions-0.10.12-3ae7:Control.Monad.Catch
  throwM, called at libraries/exceptions/src/Control/Monad/Catch.hs:872:84 in exceptions-0.10.12-3ae7:Control.Monad.Catch
  onException, called at compiler/GHC/Driver/Make.hs:2992:23 in ghc-9.12.4-6f4d:GHC.Driver.Make


DO NOT use this script if you have another recent cabal-install available.
This script is intended only for bootstrapping cabal-install on new
architectures.

To Reproduce
Steps to reproduce the behavior: https://github.com/haskell/cabal/actions/runs/38614163097/job/116848009687?pr=12460

Expected behavior
Bootstrap script successfully compiles dependencies (alex) and finishes cabal-install bootstrap.

System information

  • Operating system: macos-latest runner
  • GHC version: 9.12.4
  • cabal version: 3.18.1.0

Activity

  1. zlonast commented on Oct 16, 2026

    @zlonast
    CollaboratorAuthor

    Same problem: actions/runner-images#14940

    - name: Sync linker with macOS 27 SDK (actions/runner-images#14940)
      if: ${{ runner.os == 'macOS' }}
      run: sudo xcode-select -s /Library/Developer/CommandLineTools
    
  2. ulysses4ever commented on Oct 16, 2026

    @ulysses4ever
    Collaborator

    I’m not sure if this should be left open or not. After all #12468 is just a stop gap.

  3. andreasabel commented on Oct 17, 2026

    @andreasabel
    Member

    @ulysses4ever Thanks for the investigation and communication.

    On the Agda side, I am considering to use one of these workarounds (once I confirm them):

    Update: I could only confirm the first workaround: https://github.com/andreasabel/gha-test/actions/runs/39004738788/workflow#L36

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions