Swift package support issue · Issue #99 · SolaWing/xcode-build-server · GitHub
Skip to content

Swift package support issue #99

Open

Description

@wvabrinskas

I'm attempting to run

xcode-build-server config -workspace /Users/williamvabrinskas/Documents/xcode/NumSwift/.swiftpm/xcode/package.xcworkspace -scheme NumSwift

In my swift package directory however I'm shown this error:

Traceback (most recent call last):
  File "/opt/homebrew/bin/xcode-build-server", line 114, in <module>
    main()
    ~~~~^^
  File "/opt/homebrew/bin/xcode-build-server", line 77, in main
    main(subcommand_argv())
    ~~~~^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/xcode-build-server/1.2.0/libexec/config/cmd.py", line 95, in main
    build_dir = output[0]["buildSettings"]["SYMROOT"]
                ~~~~~~^^^
IndexError: list index out of range

There technically isn't any "runnable" targets in a Swift package so maybe this error is correct, but I should still be able to Build without running and generate a config no?

Activity

  1. SolaWing commented on Aug 19, 2025

    @SolaWing
    Owner

    Swift Package Project is not a normal xcode project, and xcodebuild -showBuildSettings not works. you can choose following solutions:

    1. sourcekit-lsp already support Swift Package Project, so just use it, don't need buildServer.json. (manual build by swift build)
    2. if you still want to base on xcode project to build, newest head support specify build_root directly, just use --build_root instead of -workspace. eg: xcode-build-server --build_root /Users/<username>/Library/Developer/Xcode/DerivedData/<project_name>-<hash>.
    3. in version 1.2.0 on brew, you can use the same buildServer.json generated by 2, or you can copy other buildServer.json, can modify the build_root field.
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions