-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Swift: upgrade extractor to support Swift 5.8.1 #13458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
396b576
75684ee
b9c4ade
c945d65
93b9115
17111c9
2daa001
526f6cd
c080cba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| - uses: ./.github/actions/fetch-codeql | ||
| - id: query-cache | ||
| uses: ./.github/actions/cache-query-compilation | ||
|
|
||
| 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, _)) | ||
| } |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.