Skip to content

Commit

Permalink
[Call-by-name] swift backend migration (#21064)
Browse files Browse the repository at this point in the history
Auto-migrated, followed by a manual removal of `implicitly` calls.
  • Loading branch information
sureshjoshi authored Jun 19, 2024
1 parent 96c644e commit c0244b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion docs/notes/2.23.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ The "Provided by" information in the documentation now correctly reflects the pr

### New call-by-name syntax for @rules

Pants has a new mechanism for `@rule` invocation in backends. In this release the `cc` backend was migrated to use this new mechanism. There should not be any user-visible effects, but please be on the lookout for any unusual bugs or error messages.
Pants has a new mechanism for `@rule` invocation in backends. In this release the following backends were migrated to use this new mechanism. There should not be any user-visible effects, but please be on the lookout for any unusual bugs or error messages.
- `cc`
- `swift`

## Full Changelog

Expand Down
7 changes: 3 additions & 4 deletions src/python/pants/backend/swift/goals/tailor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
PutativeTargets,
PutativeTargetsRequest,
)
from pants.engine.fs import PathGlobs, Paths
from pants.engine.internals.selectors import Get
from pants.engine.intrinsics import path_globs_to_paths
from pants.engine.rules import Rule, collect_rules, rule
from pants.engine.target import Target
from pants.engine.unions import UnionRule
Expand All @@ -38,8 +37,8 @@ async def find_putative_targets(
req: PutativeSwiftTargetsRequest,
all_owned_sources: AllOwnedSources,
) -> PutativeTargets:
all_swift_files = await Get(
Paths, PathGlobs, req.path_globs(*(f"*{ext}" for ext in SWIFT_FILE_EXTENSIONS))
all_swift_files = await path_globs_to_paths(
req.path_globs(*(f"*{ext}" for ext in SWIFT_FILE_EXTENSIONS))
)
unowned_swift_files = set(all_swift_files.files) - set(all_owned_sources)
classified_unowned_swift_files = classify_source_files(unowned_swift_files)
Expand Down

0 comments on commit c0244b2

Please sign in to comment.