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