swiftlang / swift-package-manager

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

[SR-12816] SwiftPM makes excessive use of localFileSystem #4548

Open DougGregor opened 4 years ago

DougGregor commented 4 years ago
Previous ID SR-12816
Radar rdar://problem/63228761
Original Reporter @DougGregor
Type Bug
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Package Manager | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 21cdaa69e8e455354383b9e23c9b8050

Issue Description:

A search in the SwiftPM code base shows that there are a significant number of references to localFileSystem (294 at the time of this writing). Outside of tests or executables, SwiftPM should be using the FileSystem instance it was provided rather than localFileSystem, the latter of which breaks the abstraction.

There are also a number of places where localFileSystem is used as a default argument. We should limit such uses to end-user-facing parts of the library, or even eliminate them entirely, because it's harder to audit callers for missing-but-intended arguments.

DougGregor commented 4 years ago

@swift-cicreate