Skip to content
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
22 changes: 20 additions & 2 deletions swift/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_pkg//:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files")
load("@rules_pkg//:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files", "strip_prefix")
load("@rules_pkg//:install.bzl", "pkg_install")
load("//:defs.bzl", "codeql_platform")

Expand Down Expand Up @@ -39,9 +39,27 @@ pkg_files(
prefix = "tools/" + codeql_platform,
)

alias(
name = "swift-test-sdk",
actual = select({
"@bazel_tools//src/conditions:%s" % arch: "@swift_prebuilt_%s//:swift-test-sdk" % arch
for arch in ("linux", "darwin_x86_64", "darwin_arm64")
}),
)

pkg_files(
name = "swift-test-sdk-arch",
srcs = [":swift-test-sdk"],
prefix = "qltest/" + codeql_platform,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a copy-paste error? (namely, the qltest part)

Copy link
Contributor Author

@AlexDenisov AlexDenisov Apr 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's on purpose. This idea is inherited from C++ support, though I cannot see any other usage of qltest in other language packs.
@criemen do you have a better place in mind? I'm happy to change/move this part if needed.

UPD:

usage of qltest

as in "usage in the directory structure"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I misunderstood what the PR is doing. I cleared that up now, this looks good to me 👍

strip_prefix = strip_prefix.from_pkg(),
)

pkg_filegroup(
name = "extractor-pack-arch",
srcs = [":extractor"],
srcs = [
":extractor",
":swift-test-sdk-arch"
],
visibility = ["//visibility:public"],
)

Expand Down
11 changes: 11 additions & 0 deletions swift/extractor/BUILD.swift-prebuilt.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")

cc_library(
name = "swift-llvm-support",
srcs = [
Expand Down Expand Up @@ -26,3 +28,12 @@ cc_library(
strip_include_prefix = "include",
visibility = ["//visibility:public"],
)

pkg_files(
name = "swift-test-sdk",
srcs = glob([
"sdk/**/*",
]),
strip_prefix = strip_prefix.from_pkg(),
visibility = ["//visibility:public"],
)