Skip to content

Commit

Permalink
Getting started adding SwiftBuild rspm dep
Browse files Browse the repository at this point in the history
Seeing the following error when running this `bazelisk build @swiftpkg_swift_build//:SwiftBuild.rspm`:

```terminal
error: ambiguous implicit access level for import of 'TSCBasic'; it is imported as 'private' elsewhere
    |        `- note: silence these warnings by adopting the upcoming feature 'InternalImportsByDefault'
```
  • Loading branch information
maxwellE committed Feb 12, 2025
1 parent 8eacfbf commit f060701
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ MODULE.bazel.lock
**/*.xcodeproj/rules_xcodeproj/lib

user.bazelrc

.build
18 changes: 18 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,21 @@ use_repo(
"com_github_pointfreeco_swift_custom_dump",
"com_github_pointfreeco_xctest_dynamic_overlay",
)

bazel_dep(name = "rules_swift_package_manager", version = "0.45.0")

swift_deps = use_extension(
"@rules_swift_package_manager//:extensions.bzl",
"swift_deps",
)
swift_deps.from_package(
declare_swift_deps_info = True,
resolved = "//:Package.resolved",
swift = "//:Package.swift",
)
use_repo(
swift_deps,
"swift_deps_info", # This is generated by the ruleset.`.
"swift_package",
"swiftpkg_swift_build",
)
78 changes: 78 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"originHash" : "82a11290152c6d64c4cac15c48dad04b7732cdeaa2049c7d103485dd8bdd0825",
"pins" : [
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
"version" : "1.5.0"
}
},
{
"identity" : "swift-build",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swiftlang/swift-build.git",
"state" : {
"branch" : "main",
"revision" : "6cf6a44a6ead4c353dcda5993b4e89b72f14ea47"
}
},
{
"identity" : "swift-crypto",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-crypto.git",
"state" : {
"revision" : "9f95b4d033a4edd3814b48608db3f2ca90c7218b",
"version" : "3.7.0"
}
},
{
"identity" : "swift-driver",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-driver.git",
"state" : {
"branch" : "main",
"revision" : "9b83358b87efbd2b0811eef38ee12ab3306e5f7f"
}
},
{
"identity" : "swift-llbuild",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-llbuild.git",
"state" : {
"branch" : "main",
"revision" : "31959bebb0a86a02d60daf2d1cec817795a37a04"
}
},
{
"identity" : "swift-system",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-system.git",
"state" : {
"revision" : "c8a44d836fe7913603e246acab7c528c2e780168",
"version" : "1.4.0"
}
},
{
"identity" : "swift-toolchain-sqlite",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swiftlang/swift-toolchain-sqlite",
"state" : {
"revision" : "bb8321a7eea3830af401a1501c7c8cc27ded6793",
"version" : "1.0.2"
}
},
{
"identity" : "swift-tools-support-core",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-tools-support-core.git",
"state" : {
"branch" : "main",
"revision" : "bd9e2de5fdada4a0249de3be88f9ad95fe8511f6"
}
}
],
"version" : 3
}
10 changes: 10 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// swift-tools-version: 6.0

import PackageDescription

let package = Package(
name: "rules_xcodeproj",
dependencies: [
.package(url: "https://github.com/swiftlang/swift-build.git", branch: "main")
]
)
1 change: 1 addition & 0 deletions tools/lib/ToolCommon/src/BuildMode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ArgumentParser
public enum BuildMode: String, ExpressibleByArgument {
case xcode
case bazel
// case proxy
}

extension BuildMode {
Expand Down

0 comments on commit f060701

Please sign in to comment.