From 73d5691d91e5b9a0fe0ef2a343ec2ea15d122048 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Wed, 13 Apr 2022 14:47:51 +0200 Subject: [PATCH] update swift package --- misc/bazel/workspace.bzl | 25 ++++++++++++++++------ swift/extractor/BUILD.swift-prebuilt.bazel | 17 +++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/misc/bazel/workspace.bzl b/misc/bazel/workspace.bzl index b3d41e39e97..df5ddc9e15f 100644 --- a/misc/bazel/workspace.bzl +++ b/misc/bazel/workspace.bzl @@ -1,15 +1,28 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") +_swift_prebuilt_version = "swift-5.6-RELEASE.42271.54" +_swift_sha_map = { + "linux": "92b26fbbc45f812b0581385cc81470ab636fed9cff460052aa2173de765ddef4", + "macos-x86_64": "b24f609c7868c1709e1e552e3b394664014e6a7f1e097522db80deb359bbcd2f", +} + +_swift_arch_map = { + "linux": "linux", + "macos-x86_64": "darwin_x86_64", +} + def codeql_workspace(): - for arch, repo_arch, sha256 in ( - ("linux", "linux", "48e39228e49aa560f0c1e504c4f9d488e28278b31fedc8271ce4cf807d9f7791"), - ("darwin_x86_64", "macos-x86_64", "8f1e8e9cfb4391b3fbc0b90da548a7e660f302b1a8551e6640e8a944eb377028"), - ): + for repo_arch, arch in _swift_arch_map.items(): + sha256 = _swift_sha_map[repo_arch] + http_archive( name = "swift_prebuilt_%s" % arch, - url = "https://github.com/dsp-testing/codeql-swift-artifacts/releases/download/swift-5.6-RELEASE.42271.49/swift-prebuilt-%s.zip" % repo_arch, - build_file = "@ql//swift/extractor:BUILD.swift-prebuilt.bazel", + url = "https://github.com/dsp-testing/codeql-swift-artifacts/releases/download/%s/swift-prebuilt-%s.zip" % ( + _swift_prebuilt_version, + repo_arch, + ), + build_file = "@codeql//swift/extractor:BUILD.swift-prebuilt.bazel", sha256 = sha256, ) diff --git a/swift/extractor/BUILD.swift-prebuilt.bazel b/swift/extractor/BUILD.swift-prebuilt.bazel index a86a141dd4a..09daff07f3d 100644 --- a/swift/extractor/BUILD.swift-prebuilt.bazel +++ b/swift/extractor/BUILD.swift-prebuilt.bazel @@ -1,22 +1,27 @@ cc_library( name = "swift-llvm-support", - srcs = glob([ - "libswiftAndLlvmSupportReal.a", - "libswiftAndLlvmSupportReal.so", - ]), + srcs = [ + "libCodeQLSwiftFrontendTool.a", + ] + select({ + "@platforms//os:linux": [ + "libCodeQLSwiftFrontendTool.so", + ], + "@platforms//os:macos": [ + "libCodeQLSwiftFrontendTool.dylib", + ], + }), hdrs = glob(["include/**/*"]), linkopts = [ "-lm", "-lz", ] + select({ - "@platforms//os:macos": ["-lcurses"], "@platforms//os:linux": [ "-luuid", "-lrt", "-lpthread", - "-ltinfo", "-ldl", ], + "//conditions:default": [], }), strip_include_prefix = "include", visibility = ["//visibility:public"],