Skip to content

Add support for SWIFTCI_USE_LOCAL_DEPS in swift-inspect #69744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions tools/swift-inspect/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
import class Foundation.ProcessInfo

let package = Package(
name: "swift-inspect",
products: [
.library(name: "SwiftInspectClient", type: .dynamic, targets: ["SwiftInspectClient"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.2"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
Expand All @@ -36,3 +34,11 @@ let package = Package(
name: "SymbolicationShims")
]
)

if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
package.dependencies += [
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.2"),
]
} else {
package.dependencies += [.package(path: "../../../swift-argument-parser")]
}
14 changes: 8 additions & 6 deletions utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1530,12 +1530,14 @@ function Install-HostToolchain() {
function Build-Inspect() {
$OutDir = Join-Path -Path $HostArch.BinaryCache -ChildPath swift-inspect

Build-SPMProject `
-Src $SourceCache\swift\tools\swift-inspect `
-Bin $OutDir `
-Arch $HostArch `
-Xcc "-I$SDKInstallRoot\usr\include\swift\SwiftRemoteMirror" -Xlinker "$SDKInstallRoot\usr\lib\swift\windows\$($HostArch.LLVMName)\swiftRemoteMirror.lib" `
-Xcc -Xclang -Xcc -fno-split-cold-code # Workaround https://github.com/llvm/llvm-project/issues/40056
Isolate-EnvVars {
$env:SWIFTCI_USE_LOCAL_DEPS=1
Build-SPMProject `
-Src $SourceCache\swift\tools\swift-inspect `
-Bin $OutDir `
-Arch $HostArch `
-Xcc "-I$SDKInstallRoot\usr\include\swift\SwiftRemoteMirror" -Xlinker "$SDKInstallRoot\usr\lib\swift\windows\$($HostArch.LLVMName)\swiftRemoteMirror.lib"
}
}

function Build-Format() {
Expand Down