swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.7k stars 1.33k forks source link

[SR-1433] [SwiftPM] Enforce manifest strictness #5293

Open ddunbar opened 8 years ago

ddunbar commented 8 years ago
Previous ID SR-1433
Radar None
Original Reporter @ddunbar
Type Bug
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Package Manager | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 5476fbaaa6f239d3f1a53d63fc83392a

Issue 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":

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)

dschaefer2 commented 1 month ago

Some of our new thinking is around using WASM as an extension mechanism where we can run the manifest in an even tighter sandbox.