Skip to content

Commit 73d5691

Browse files
committed
update swift package
1 parent e68172f commit 73d5691

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

misc/bazel/workspace.bzl

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
22
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
33

4+
_swift_prebuilt_version = "swift-5.6-RELEASE.42271.54"
5+
_swift_sha_map = {
6+
"linux": "92b26fbbc45f812b0581385cc81470ab636fed9cff460052aa2173de765ddef4",
7+
"macos-x86_64": "b24f609c7868c1709e1e552e3b394664014e6a7f1e097522db80deb359bbcd2f",
8+
}
9+
10+
_swift_arch_map = {
11+
"linux": "linux",
12+
"macos-x86_64": "darwin_x86_64",
13+
}
14+
415
def codeql_workspace():
5-
for arch, repo_arch, sha256 in (
6-
("linux", "linux", "48e39228e49aa560f0c1e504c4f9d488e28278b31fedc8271ce4cf807d9f7791"),
7-
("darwin_x86_64", "macos-x86_64", "8f1e8e9cfb4391b3fbc0b90da548a7e660f302b1a8551e6640e8a944eb377028"),
8-
):
16+
for repo_arch, arch in _swift_arch_map.items():
17+
sha256 = _swift_sha_map[repo_arch]
18+
919
http_archive(
1020
name = "swift_prebuilt_%s" % arch,
11-
url = "https://github.com/dsp-testing/codeql-swift-artifacts/releases/download/swift-5.6-RELEASE.42271.49/swift-prebuilt-%s.zip" % repo_arch,
12-
build_file = "@ql//swift/extractor:BUILD.swift-prebuilt.bazel",
21+
url = "https://github.com/dsp-testing/codeql-swift-artifacts/releases/download/%s/swift-prebuilt-%s.zip" % (
22+
_swift_prebuilt_version,
23+
repo_arch,
24+
),
25+
build_file = "@codeql//swift/extractor:BUILD.swift-prebuilt.bazel",
1326
sha256 = sha256,
1427
)
1528

swift/extractor/BUILD.swift-prebuilt.bazel

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
cc_library(
22
name = "swift-llvm-support",
3-
srcs = glob([
4-
"libswiftAndLlvmSupportReal.a",
5-
"libswiftAndLlvmSupportReal.so",
6-
]),
3+
srcs = [
4+
"libCodeQLSwiftFrontendTool.a",
5+
] + select({
6+
"@platforms//os:linux": [
7+
"libCodeQLSwiftFrontendTool.so",
8+
],
9+
"@platforms//os:macos": [
10+
"libCodeQLSwiftFrontendTool.dylib",
11+
],
12+
}),
713
hdrs = glob(["include/**/*"]),
814
linkopts = [
915
"-lm",
1016
"-lz",
1117
] + select({
12-
"@platforms//os:macos": ["-lcurses"],
1318
"@platforms//os:linux": [
1419
"-luuid",
1520
"-lrt",
1621
"-lpthread",
17-
"-ltinfo",
1822
"-ldl",
1923
],
24+
"//conditions:default": [],
2025
}),
2126
strip_include_prefix = "include",
2227
visibility = ["//visibility:public"],

0 commit comments

Comments
 (0)