The `Package.swift` file is intended to follow a somewhat rigid file format, and not just be free form Swift code.
In particular, the design goal was that there be a "leading package specifier":
let package = Package(...)
which is Swift code using the PackageDescription APIs, but which can also be mechanically edited. Our intention was to use the Swift AST to parse/type check the code, but then write a new validation pass on the AST to enforce that it followed the conventions which we could mechanically edit.
The hope is that once we had these pieces we could also load the leading package specification from the manifest without needing to execute any code.
We need to implement this latter part of the design, currently we just compile and execute the manifest using the Swift interpreter (which JITs under the covers)
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Package Manager | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 5476fbaaa6f239d3f1a53d63fc83392aIssue Description:
The `Package.swift` file is intended to follow a somewhat rigid file format, and not just be free form Swift code.
In particular, the design goal was that there be a "leading package specifier":
which is Swift code using the PackageDescription APIs, but which can also be mechanically edited. Our intention was to use the Swift AST to parse/type check the code, but then write a new validation pass on the AST to enforce that it followed the conventions which we could mechanically edit.
The hope is that once we had these pieces we could also load the leading package specification from the manifest without needing to execute any code.
We need to implement this latter part of the design, currently we just compile and execute the manifest using the Swift interpreter (which JITs under the covers)