Skip to content

Commit e056fb1

Browse files
committed
Add evolution ideas page
1 parent eee2753 commit e056fb1

File tree

1 file changed

+205
-0
lines changed

1 file changed

+205
-0
lines changed

Documentation/EvolutionIdeas.md

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
# Swift Package Manager Evolution Ideas
2+
3+
This is a list of some evolution ideas for the package manager. Once the details
4+
of an idea are fleshed out and there is a full proposal, it can be scheduled for
5+
the swift-evolution process. It is important to note that not every idea on this
6+
list is guaranteed to become an official feature, and it all depends on where
7+
the design discussion leads us. Also, this is not meant to be an exhaustive
8+
feature list, if you have an idea for a feature that you think will be
9+
a valuable addition to the package manager, feel free to start a discussion
10+
about it.
11+
12+
If you're interested in participating in a particular evolution idea, please
13+
familarize yourself with the existing discussion on that topic and start
14+
participating in the discussion thread of that idea. If a thread doesn't exist
15+
for that idea, please start one with a [draft
16+
proposal](https://github.com/apple/swift-evolution/blob/master/proposal-templates/0000-swiftpm-template.md)
17+
that can be used as a starting point.
18+
19+
**Important Note**: This list is not in any particular order. I plan to keep
20+
this post updated but please let me know if you see something out-of-date.
21+
22+
# Mirror and Fork Support
23+
24+
You may want an easy way to mirror or fork specific packages in your package
25+
graph. This could be useful if you want to make a private customization to
26+
a package that you depend on, or even if you just want to override the origin
27+
repository of your packages so that you can fetch from a private mirror and not
28+
depend on the original repository always being there.
29+
30+
Thread: https://forums.swift.org/t/dependency-mirroring-and-forking/13902
31+
Bug: [SR-679](https://bugs.swift.org/browse/SR-679)
32+
33+
# Build Settings
34+
35+
Some packages require specific language or linker flags that SwiftPM doesn’t
36+
currently support, and some packages may desire other configurable properties as
37+
well. We want to have a real robust "build settings" model for adding these
38+
kinds of properties, potentially including including conditional settings and
39+
fine-grained control over what parts of the package use which property values.
40+
41+
Thread: N/A
42+
Bug: [SR-3948](https://bugs.swift.org/browse/SR-3948)
43+
44+
# Conditional Dependencies
45+
46+
Packages may want to use dependencies that they only use while testing the
47+
package. Such dependencies shouldn't take part in dependency resolution process
48+
when a package is being used as a dependency. This is also called test-only or
49+
development dependencies in other package managers. It is sometimes also
50+
required to declare platform-specific dependencies which should be only fetched
51+
when a package is being built for a certain platform. This is currently possible
52+
using `#if os` checks but it leads to two problems: 1) it forces
53+
a non-declarative syntax in the manifest file, and 2) it causes issues in
54+
maintaining the `Package.resolved` file as the dependency is added or removed
55+
depending on the platform.
56+
57+
Thread: N/A
58+
Bug: [SR-883](https://bugs.swift.org/browse/SR-883)
59+
60+
# Resource Support
61+
62+
The Swift package manager needs a story for how packages should specify their
63+
resources to include with products.
64+
65+
Thread: N/A
66+
Bug: [SR-2866](https://bugs.swift.org/browse/SR-2866)
67+
68+
# Extensible Build Tools
69+
70+
Many users want to incorporate a variety of build-time tools into their
71+
packages, whether to support a custom language or preprocessor, or to add their
72+
own documentation generator or linter. SwiftPM could add extensibility to
73+
support tools packages which could bring these steps to the build process. We
74+
expect this behavior to greatly enhance our capacity for building complex
75+
software packages.
76+
77+
One important thing for us to be careful about here is to make sure that all
78+
parts of the build process still clearly declare their inputs and outputs to
79+
SwiftPM, so that it can make sure that they behave correctly and perform well
80+
for incremental and parallel builds.
81+
82+
83+
Thread: https://forums.swift.org/t/package-manager-extensible-build-tools/10900
84+
Bug: N/A
85+
86+
# User-defined Template Support
87+
88+
It would be nice if users can hook into the init command to add custom templates
89+
that they frequently use.
90+
91+
Thread: N/A
92+
Bug: [SR-7837](https://bugs.swift.org/browse/SR-7837)
93+
94+
# Documentation Generation Support
95+
96+
We can leverage SourceKit to extract documentation information from Swift
97+
packages that can be further transformed into a developer consumable format like
98+
a static HTML website.
99+
100+
Thread: N/A
101+
Bug: N/A
102+
103+
# Tagging and Publishing support
104+
105+
Today you publish new versions of your package by tagging manually with git, and
106+
you use git directly to view your published tags. SwiftPM could help automate
107+
this process, performing any validation, housekeeping, or auxiliary tasks that
108+
might make sense as part of a streamlined and safe publication workflow.
109+
110+
Thread: N/A
111+
Bug: N/A
112+
113+
# Install/deploy Command
114+
115+
When you’re deploying the product of your package, whether to a server or your
116+
local system, it could be helpful for SwiftPM to provide support for automating
117+
that process. You may want to configure layout and library linkage aspects of
118+
your products for your specific deployment environment, record version
119+
information about what your products were built from, and otherwise leverage the
120+
context that SwiftPM has about your packages for a seamless deployment
121+
experience.
122+
123+
Thread: N/A
124+
Bug: N/A
125+
126+
# Performance Testing Support
127+
128+
Currently, SwiftPM has no support for running performance tests. We need to
129+
provide a way to specify performance tests for a package and to run them from
130+
the SwiftPM command-line tools.
131+
132+
[Here](https://github.com/aciidb0mb3r/swift-evolution/blob/pref-proposal/proposals/xxxx-package-manager-performance-testing.md) is a very old draft proposal that I haven't gotten around to post for discussion yet.
133+
134+
Thread: N/A
135+
Bug: [SR-1354](https://bugs.swift.org/browse/SR-1354)
136+
137+
# Support for External Testing Frameworks
138+
139+
Currently, SwiftPM only supports writing tests with help of XCTest testing
140+
framework. The community should be able to use any testing framework of their
141+
choice to test with SwiftPM. This feature will most likely depend on extensible
142+
build tools feature.
143+
144+
Thread: N/A
145+
Bug: N/A
146+
147+
# Package Index
148+
149+
SwiftPM plans to have a real index for Swift packages some day. In addition to
150+
defining a namespace for package names and providing easier package discovery,
151+
it could even support metrics for quality, such as automated test coverage
152+
statistics, or ways to evaluate the trustworthiness of packages that you’re
153+
considering using. This will be a large project.
154+
155+
Thread: N/A
156+
Bug: N/A
157+
158+
# Multi-Package Repository Support
159+
160+
Currently the package manager requires that each package live at the root of
161+
a Git repository. This means that you can't store multiple packages in the same
162+
repository, or develop packages which locate each other in a filesystem-relative
163+
manner without relying on Git. We need a proposal for how we would like to
164+
support this.
165+
166+
Thread: N/A
167+
Bug: [SR-3951](https://bugs.swift.org/browse/SR-3951)
168+
169+
# Cross-platform Sandboxing
170+
171+
Sandboxing is one way to help prevent `Package.swift` manifest evaluation and
172+
builds from escaping out into your system, either accidentally or deliberately.
173+
SwiftPM uses macOS's sandboxing technology already, but it would be great to
174+
bring this safety to other platforms.
175+
176+
Thread: N/A
177+
Bug: N/A
178+
179+
# Automatic Semantic Versioning
180+
181+
Automatically detecting what semantic version it looks like you should be
182+
publishing your changes with could be very helpful for package authors. SwiftPM
183+
could do this by analyzing the source code's API to see what has changed and
184+
whether the API is backwards-compatible, at least at compile time.
185+
186+
Thread: N/A
187+
Bug: N/A
188+
189+
# Machine-Editable Package.swift
190+
191+
We need an easy way to edit the Package.swift manifest from automated tools, for
192+
cases where you don't want users to have to update the Swift code directly. We
193+
think that it's possible to provide API to allow this, probably using
194+
[`SwiftSyntax`](https://github.com/apple/swift/tree/master/tools/SwiftSyntax).
195+
196+
Thread: N/A
197+
Bug: N/A
198+
199+
# SwiftPM Integration in Xcode
200+
201+
This is not part of the evolution ideas but it has frequently come up on the
202+
forums (albeit for the right reasons). Please see [this](https://forums.swift.org/t/swift-package-manager-3-0-project-status/3794/5)
203+
post if you haven't. It is important to understand that Xcode is **not** part of
204+
the Swift Open Source project and the future plans and timelines are not published
205+
in public. Please use Apple developer [forums](https://developer.apple.com/devforums/) or [bug reporter](https://developer.apple.com/bug-reporting/) for Xcode related discussions.

0 commit comments

Comments
 (0)