Skip to content

swift run xcodegen fails #1440

@417-72KI

Description

@417-72KI

I'm using XcodeGen as a package dependency like

// swift-tools-version:5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "Tools",
    platforms: [.macOS(.v12)],
    products: [],
    dependencies: [
        .package(url: "https://github.com/yonaskolb/XcodeGen", from: "2.38.0"),
    ],
    targets: []
)

and run by a command like

xcrun --sdk macosx swift run --package-path Tools xcodegen

Recently, running this command fails by compile error.

/path/to/project/.build/checkouts/XcodeGen/Sources/XcodeGenKit/PBXProjGenerator.swift:313:20: error: cannot assign to property: 'packages' is a get-only property
        pbxProject.packages = packageReferences.sorted { $0.key < $1.key }.map { $1 }
        ~~~~~~~~~~~^~~~~~~~
[269/272] Compiling XcodeGenKit InfoPlistGenerator.swift
/path/to/project/.build/checkouts/XcodeGen/Sources/XcodeGenKit/PBXProjGenerator.swift:313:20: error: cannot assign to property: 'packages' is a get-only property
        pbxProject.packages = packageReferences.sorted { $0.key < $1.key }.map { $1 }
        ~~~~~~~~~~~^~~~~~~~
[270/272] Compiling XcodeGenKit PBXProjGenerator.swift
/path/to/project/.build/checkouts/XcodeGen/Sources/XcodeGenKit/PBXProjGenerator.swift:313:20: error: cannot assign to property: 'packages' is a get-only property
        pbxProject.packages = packageReferences.sorted { $0.key < $1.key }.map { $1 }
        ~~~~~~~~~~~^~~~~~~~
[271/272] Compiling XcodeGenKit ProjectGenerator.swift
/path/to/project/.build/checkouts/XcodeGen/Sources/XcodeGenKit/PBXProjGenerator.swift:313:20: error: cannot assign to property: 'packages' is a get-only property
        pbxProject.packages = packageReferences.sorted { $0.key < $1.key }.map { $1 }
        ~~~~~~~~~~~^~~~~~~~

It seems to be something changed in PBXProject class.

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