# Allow SPM to specify a toolchain dependency

**URL:** <https://forums.swift.org/t/allow-spm-to-specify-a-toolchain-dependency/59810>\
**Category:** Discussion\
**Created:** [August 22, 2022, 2:30pm UTC](https://forums.swift.org/t/allow-spm-to-specify-a-toolchain-dependency/59810 "2022-08-22T14:30:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![taylorswift](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/taylorswift/32/43413_2.png) [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Post date:** [August 22, 2022, 2:30pm UTC](https://forums.swift.org/t/allow-spm-to-specify-a-toolchain-dependency/59810/1 "2022-08-22T14:30:22Z")

</div>

i quite often find myself running into one of the following scenarios:

1. i upgrade my toolchain, but forget to upgrade the toolchain tag for a dependency like [`swift-syntax`](https://github.com/apple/swift-syntax/tree/main/Examples). the package compiles without problems.

2. i add an SPM sourcegen plugin to my project. i upgrade my toolchain, but forget to upgrade the toolchain tag for the SPM plugin. when i run the plugin, **it formats my sources according to the wrong version of swift for my compiler**.

3. i add an SPM plugin to my library project. **the downstream users of my library can no longer consume the library** , because the plugin dependency is specified as a branch (as it must, for toolchain compatibility) and not a semantic version, even though the plugin dependency is not transitive.

at this point, i feel like SPM really needs a “toolchain” dependency kind, which is non-transitive and can accept a toolchain tag such as `swift-DEVELOPMENT-SNAPSHOT-yyyy-mm-dd-h`.

```swift
.package(url: "https://github.com/apple/swift-markdown", 
    swift: "swift-DEVELOPMENT-SNAPSHOT-2022-08-15-a")

```

this would be separate from `// swift-tools-version:` which is coarser and usually for me lags the actual toolchain by 2 or 3 minor swift versions.

what do you think?
