swift-algorithms icon indicating copy to clipboard operation
swift-algorithms copied to clipboard

Can't build version 1.2.1 (Draft)

Open mredig opened this issue 9 months ago • 11 comments

I'm currently having trouble adding/building version 1.2.1 to my project. I tried using 1.2.0 and everything built fine.

Swift Algorithms version: 1.2.1 Swift version: swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1) / my Package.swift file is set to 5.9

Checklist

  • [ ] If possible, I've reproduced the issue using the main branch of this package
  • [x] I've searched for existing GitHub issues

Steps to Reproduce

Replace this paragraph with an explanation of how to reproduce the incorrect behavior. Include a simple code example, if possible.

Expected behavior

Compilation to work

Actual behavior

I get an error about importing _NumericShims.

(marked as a draft because I'm still doing a bit of troubleshooting, but I wanted to throw it out there in case I don't have time to get back to it)

mredig avatar Feb 18 '25 02:02 mredig

+1

davemess avatar Feb 19 '25 15:02 davemess

The same

larryonoff avatar Feb 20 '25 11:02 larryonoff

Same for us

hassila avatar Feb 21 '25 09:02 hassila

Ping @natecook1000

hassila avatar Feb 21 '25 09:02 hassila

For me the UI tests target fails to build. However, if I add “Algorithms” directly to the UI Tests target, the error is resolved. v 1.2.0 works fine.

vvbutko avatar Feb 21 '25 14:02 vvbutko

Could someone help me narrow this down to reproduce the issue? I'm not seeing this issue when including Algorithms in another package, with package versions 5.8 - 5.11 and 6.0 and both Swift 5 and Swift 6 language modes.

natecook1000 avatar Feb 25 '25 19:02 natecook1000

Hmm - It sounds like others might be using Xcode projects, but I'm using a swift package. I'm on Xcode Version 16.2 (16C5032a) and am running an M1 MacBook Air.

Are there any other environmental details that might help?

mredig avatar Feb 25 '25 19:02 mredig

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

import PackageDescription

let package = Package(
	name: "****INTERNAL****",
	platforms: [
		.macOS(.v12),
		.iOS(.v15),
	],
	products: [
		// Products define the executables and libraries a package produces, making them visible to other packages.
		.library(
			name: "****INTERNAL****",
			targets: ["****INTERNAL****"]),
		.library(
			name: "**INTERNAL2**",
			targets: ["**INTERNAL2**"]),
		.executable(
			name: "RegexUpdater",
			targets: ["RegexUpdater"]),
		.executable(
			name: "XMLSanitizer",
			targets: ["XMLSanitizer"]),
	],
	dependencies: [
		.package(url: "https://github.com/mredig/SwiftPizzaSnips.git", .upToNextMajor(from: "0.4.10")),
		.package(url: "[email protected]:getrembrand/****INTERNAL3****.git", .upToNextMajor(from: "0.3.1")),
		.package(url: "https://github.com/mredig/PizzaMacros.git", .upToNextMajor(from: "0.1.3")),
		.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMajor(from: "1.3.0")),
		.package(url: "https://github.com/apple/swift-collections.git", .upToNextMajor(from: "1.1.0")),
		.package(url: "https://github.com/mredig/Swiftwood.git", .upToNextMajor(from: "0.4.6")),
//		.package(url: "https://github.com/apple/swift-algorithms.git", "1.2.0"..<"1.2.1"), // this is how I pin to 1.2.0
		.package(url: "https://github.com/apple/swift-algorithms.git", .upToNextMajor(from: "1.2.1")),
	],
	targets: [
		// Targets are the basic building blocks of a package, defining a module or a test suite.
		// Targets can depend on other targets in this package and products from dependencies.
		.target(
			name: "****INTERNAL****",
			dependencies: [
				"SwiftPizzaSnips",
				"****INTERNAL3****",
				"PizzaMacros",
				.product(name: "Collections", package: "swift-collections"),
				"Swiftwood",
			],
			swiftSettings: [
				.enableUpcomingFeature("BareSlashRegexLiterals")
			]),
		.target(
			name: "**INTERNAL2**",
			dependencies: [
				"****INTERNAL****",
				"SwiftPizzaSnips",
				"****INTERNAL3****",
				.product(name: "Algorithms", package: "swift-algorithms"),
			],
			swiftSettings: [
				.enableUpcomingFeature("BareSlashRegexLiterals")
			]),
		.target(
			name: "TestResources",
			resources: [
				.copy("Resources")
			]),
		.executableTarget(
			name: "RegexUpdater",
			dependencies: [
				.product(name: "ArgumentParser", package: "swift-argument-parser"),
				"SwiftPizzaSnips",
			],
			swiftSettings: [
				.enableUpcomingFeature("BareSlashRegexLiterals")
			]),
		.executableTarget(
			name: "XMLSanitizer",
			dependencies: [
				.product(name: "ArgumentParser", package: "swift-argument-parser"),
				"SwiftPizzaSnips",
			],
			swiftSettings: [
				.enableUpcomingFeature("BareSlashRegexLiterals")
			]),
		.testTarget(
			name: "****INTERNAL****Tests",
			dependencies: [
				"****INTERNAL****",
				"SwiftPizzaSnips",
				"TestResources",
			],
			swiftSettings: [
				.enableUpcomingFeature("BareSlashRegexLiterals")
			]),
		.testTarget(
			name: "**INTERNAL2**Tests",
			dependencies: [
				"SwiftPizzaSnips",
				"**INTERNAL2**",
				"TestResources",
			],
			swiftSettings: [
				.enableUpcomingFeature("BareSlashRegexLiterals")
			]),
	]
)

Here's my Package.swift file - I was overly liberal in censoring internal components just to be safe, but if you need any information about them I could probably elaborate.

mredig avatar Feb 25 '25 20:02 mredig

Here's some of the Xcode report (again, overly censored cuz I'm paranoid):

Image

It continues on like this repeated for many files.

mredig avatar Feb 25 '25 20:02 mredig

Could someone help me narrow this down to reproduce the issue? I'm not seeing this issue when including Algorithms in another package, with package versions 5.8 - 5.11 and 6.0 and both Swift 5 and Swift 6 language modes.

Is there any other information you need I might be able to help with?

mredig avatar Mar 20 '25 05:03 mredig

+1 I’m also facing the same issue and am stuck at version 1.2.0.

fritzt0 avatar May 23 '25 16:05 fritzt0