Skip to content

Commit d0d5d27

Browse files
authored
Merge pull request #690 from aciidb0mb3r/remove-pkg-symlinks
[Workspace] Elimiate creating symlinks in Packages/
2 parents 3930c75 + 47f66c5 commit d0d5d27

File tree

2 files changed

+1
-36
lines changed

2 files changed

+1
-36
lines changed

Sources/Commands/SwiftTool.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,8 @@ public class SwiftTool<Mode: Argument, OptionType: Options> {
146146
func loadPackage() throws -> PackageGraph {
147147
if options.enableNewResolver {
148148
let workspace = try getActiveWorkspace()
149-
150149
// Fetch and load the package graph.
151-
let graph = try workspace.loadPackageGraph()
152-
153-
// Create the legacy `Packages` subdirectory.
154-
try workspace.createPackagesDirectory(graph)
155-
156-
return graph
150+
return try workspace.loadPackageGraph()
157151
} else {
158152
// Create the packages directory container.
159153
let packagesDirectory = PackagesDirectory(root: try getPackageRoot(), manifestLoader: manifestLoader)

Sources/Commands/Workspace.swift

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -581,35 +581,6 @@ public class Workspace {
581581
try saveState()
582582
}
583583

584-
/// Create a `Packages` subdirectory.
585-
///
586-
/// For migration purposes, creates a "Packages" subdirectory matching the
587-
/// historical behavior of the package manager containing symlinks to the
588-
/// checkouts for each repository and version.
589-
//
590-
// FIXME: Eliminate this behavior.
591-
func createPackagesDirectory(_ graph: PackageGraph) throws {
592-
let packagesDirPath = rootPackagePath.appending(component: "Packages")
593-
594-
// Remove any existing packages directory.
595-
_ = try? removeFileTree(packagesDirPath)
596-
try makeDirectories(packagesDirPath)
597-
598-
// Create links for each versioned dependency.
599-
for package in graph.packages {
600-
if package == graph.rootPackage {
601-
continue
602-
}
603-
604-
let manifest = package.manifest
605-
let dependency = dependencyMap[RepositorySpecifier(url: manifest.url)]!
606-
if let version = dependency.currentVersion {
607-
let name = "\(manifest.package.name)-\(version)"
608-
try createSymlink(packagesDirPath.appending(component: name), pointingAt: manifest.path.parentDirectory, relative: true)
609-
}
610-
}
611-
}
612-
613584
/// Loads and returns the root manifest.
614585
private func loadRootManifest() throws -> Manifest {
615586
return try manifestLoader.load(packagePath: rootPackagePath, baseURL: rootPackagePath.asString, version: nil)

0 commit comments

Comments
 (0)