Overloaded package manifest files

packagemanager

(Guillaume Lessard) #1

The package manager seems to allow multiple copies of the package manifest to be keyed by the tools version:

$ ls Package*.swift
Package.swift
Package@swift-4.2.swift
Package@swift-4.swift

I couldn't find this documented anywhere -- in fact I can't remember where I first saw it used.
Certainly, it doesn't play well with the swift package tools-version command.
Which behaviour is a bug?


(Ben Rimmington) #2

The version-specific manifests were proposed in SE-0135 and documented in Usage.md


(Guillaume Lessard) #3

I clearly missed that one. Thanks!

This being said, there is no word on the intended interaction between version-specific manifest files and swift package tools-version. It just doesn't do anything useful in that case. I rely on setting the tools version in my CI, so sadly it looks like I have to keep using a janky manifest with #if swift conditional compilation. (Now with 3 branches!)