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
8 changes: 8 additions & 0 deletions swift/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ pkg_runfiles(
prefix = "tools/" + codeql_platform,
)

pkg_filegroup(
name = "resource-dir-arch",
srcs = ["//swift/third_party/swift-llvm-support:swift-resource-dir"],
prefix = "resource-dir/" + codeql_platform,
visibility = ["//visibility:public"],
)

pkg_files(
name = "swift-test-sdk-arch",
srcs = ["//swift/third_party/swift-llvm-support:swift-test-sdk"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the test-sdk still required? can't the resource-dir replace the need for the separate sdk? In case the answer is yes, this can probably wait the follow-up PRs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not 100% sure, so decided to keep it as is for now, Happy to look into it separately.

Expand All @@ -76,6 +83,7 @@ pkg_filegroup(
srcs = [
":extractor",
":swift-test-sdk-arch",
":resource-dir-arch",
] + select({
"@platforms//os:linux": [
":incompatible-os",
Expand Down
8 changes: 4 additions & 4 deletions swift/actions/build-and-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ runs:
mkdir -p bazel-cache/{repository,disk}
echo build --repository_cache=bazel-cache/repository --disk_cache=bazel-cache/disk > local.bazelrc
echo test --test_output=errors >> local.bazelrc
- name: Print unextracted entities
shell: bash
run: |
bazel run //swift/extractor/print_unextracted
# - name: Print unextracted entities
# shell: bash
# run: |
# bazel run //swift/extractor/print_unextracted
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is only used internally, and now it started failing due to some missing dylibs. We'll fix it later.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this still even works as expected, but agreed, we can look at it later

- uses: ./swift/actions/share-extractor-pack
- name: Build Swift extractor
shell: bash
Expand Down
10 changes: 2 additions & 8 deletions swift/actions/run-integration-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ runs:
using: composite
steps:
- uses: ./swift/actions/share-extractor-pack
- name: Get Swift version
id: get_swift_version
shell: bash
run: |
VERSION=$(swift/extractor-pack/tools/*/extractor --version | awk '/version/ { print $3 }')
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT
- uses: actions/setup-python@v4
with:
python-version-file: 'swift/.python-version'
- uses: swift-actions/setup-swift@da0e3e04b5e3e15dbc3861bd835ad9f0afe56296
- uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf
with:
swift-version: "${{steps.get_swift_version.outputs.version}}"
swift-version: "5.8"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

setup-swift doesn't support 5.8.1 yet, and it seems there is no need to match the exact version anymore.

- uses: ./.github/actions/fetch-codeql
- id: query-cache
uses: ./.github/actions/cache-query-compilation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
class Element extends @element {
string toString() { none() }
}

newtype TAddedUnspecifiedElement =
TNonExplicitClosureExprClosureBody(Element list, Element body) {
capture_list_exprs(list, body) and not explicit_closure_exprs(body)
}

module Fresh = QlBuiltins::NewEntity<TAddedUnspecifiedElement>;

class TNewElement = @element or Fresh::EntityId;

class NewElement extends TNewElement {
string toString() { none() }
}

query predicate new_unspecified_elements(NewElement u, string property, string error) {
unspecified_elements(u, property, error)
or
u = Fresh::map(TNonExplicitClosureExprClosureBody(_, _)) and
property = "closure_body" and
error = "while downgrading: closure_body not an @explicit_closure_expr"
}

query predicate new_unspecified_element_parents(NewElement u, Element parent) {
unspecified_element_parents(u, parent)
or
u = Fresh::map(TNonExplicitClosureExprClosureBody(parent, _))
}

query predicate new_capture_list_exprs(Element list, NewElement body) {
capture_list_exprs(list, body) and explicit_closure_exprs(body)
or
body = Fresh::map(TNonExplicitClosureExprClosureBody(list, _))
}
Loading