Skip to content

SE-####: Allow deprecating package products - #10437

Draft
bkhouri wants to merge 1 commit into
mainfrom
bkhouri/t/main/allow-deprecating-package-products-foundation
Draft

SE-####: Allow deprecating package products#10437
bkhouri wants to merge 1 commit into
mainfrom
bkhouri/t/main/allow-deprecating-package-products-foundation

Conversation

@bkhouri

@bkhouri bkhouri commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Add a deprecated: parameter to the .library(...), .executable(...), and .plugin(...) factory methods on Product. The parameter accepts a Product.Deprecation value describing the deprecation.

Product.Deprecation is constructed through a single factory, .unsupported(message:replacement:), where the optional replacement: parameter points at the product a consumer should adopt instead. A replacement is either in the same package or in another package.

When any consumer package (or another product within the same package) depends on an unsupported product, SwiftPM emits a warning that includes the product name, the producing package's identity, the author-supplied message, and any replacement information declared by the producer. At a minimum, this has been plumbed through to swift package resolve, swift build and swift package dump-package.

@bkhouri

bkhouri commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci test

@@ -0,0 +1,6 @@
# SwiftPM 999.0 Release Notes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore (possibly-blocking): If this PR is merged after the official SE review period, move the documentation to the appropriate SwiftPM release notes section.

/// build time.
///
/// - Returns: A `Product` instance.
@available(_PackageDescription, introduced: 999.0)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore (possibly-blocking): If this PR is merged after the official SE review period, move the documentation to the appropriate SwiftPM release notes section.

/// - deprecated: An optional ``Product/Deprecation`` value describing the deprecation
/// state of the product.
/// - Returns: A `Product` instance.
@available(_PackageDescription, introduced: 999.0)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore (possibly-blocking): If this PR is merged after the official SE review period, move the documentation to the appropriate SwiftPM release notes section.

/// - deprecated: An optional ``Product/Deprecation`` value describing the deprecation
/// state of the product.
/// - Returns: A `Product` instance.
@available(_PackageDescription, introduced: 999.0)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore (possibly-blocking): If this PR is merged after the official SE review period, move the documentation to the appropriate SwiftPM release notes section.

@@ -0,0 +1,41 @@
// swift-tools-version:999.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore (possibly-blocking): If this PR is merged after the official SE review period, move the documentation to the appropriate SwiftPM release notes section.

@@ -0,0 +1,26 @@
// swift-tools-version:999.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore (possibly-blocking): If this PR is merged after the official SE review period, move the documentation to the appropriate SwiftPM release notes section.

@bkhouri

bkhouri commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci test self hosted windows

@bkhouri

bkhouri commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci test windows self hosted

@bkhouri
bkhouri force-pushed the bkhouri/t/main/allow-deprecating-package-products-foundation branch from a97a987 to bb71410 Compare August 21, 2026 20:12
@bkhouri

bkhouri commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci test

@bkhouri

bkhouri commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci test windows

@bkhouri

bkhouri commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci test

Add a `deprecated:` parameter to the `.library(...)`, `.executable(...)`,
and `.plugin(...)` factory methods on `Product`. The parameter accepts a
`Product.Deprecation` value describing the deprecation.

`Product.Deprecation` is constructed through a single factory,
`.unsupported(message:replacement:)`, where the optional `replacement:`
parameter points at the product a consumer should adopt instead. A
replacement is either in the same package or in another package.

When any consumer package (or another product within the same package)
depends on an unsupported product, SwiftPM emits a warning that includes
the product name, the producing package's identity, the author-supplied
message, and any replacement information declared by the producer.  At a
minimum, this has been plumbed through to `swift package resolve`,
`swift build` and `swift package dump-package`.
@bkhouri
bkhouri force-pushed the bkhouri/t/main/allow-deprecating-package-products-foundation branch from bb71410 to c0f6bdf Compare September 1, 2026 04:16
@bkhouri

bkhouri commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci test

@bkhouri

bkhouri commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci test windows

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant