• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 20147226056

11 Dec 2025 08:58PM UTC coverage: 78.827% (-1.5%) from 80.293%
20147226056

push

github

web-flow
Forwarded the `style` and `complete-platform` args from pants.toml to PEX (#22910)

## Context

After Apple switched to the `arm64` architecture, some package
publishers stopped releasing `x86_64` variants of their packages for
`darwin`. As a result, generating a universal lockfile now fails because
no single package version is compatible with both `x86_64` and `arm64`
on `darwin`.

The solution is to use the `--style` and `--complete-platform` flags
with PEX. For example:
```
pex3 lock create \
    --style strict \
    --complete-platform 3rdparty/platforms/manylinux_2_28_aarch64.json \
    --complete-platform 3rdparty/platforms/macosx_26_0_arm64.json \
    -r 3rdparty/python/requirements_pyarrow.txt \
    -o python-pyarrow.lock
```

See the Slack discussion here:
https://pantsbuild.slack.com/archives/C046T6T9U/p1760098582461759

## Reproduction

* `BUILD`
```
python_requirement(
    name="awswrangler",
    requirements=["awswrangler==3.12.1"],
    resolve="awswrangler",
)
```
* Run `pants generate-lockfiles --resolve=awswrangler` on macOS with an
`arm64` CPU
```
pip: ERROR: Cannot install awswrangler==3.12.1 because these package versions have conflicting dependencies.
pip: ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
pip:  
pip:  The conflict is caused by:
pip:      awswrangler 3.12.1 depends on pyarrow<18.0.0 and >=8.0.0; sys_platform == "darwin" and platform_machine == "x86_64"
pip:      awswrangler 3.12.1 depends on pyarrow<21.0.0 and >=18.0.0; sys_platform != "darwin" or platform_machine != "x86_64"
pip:  
pip:  Additionally, some packages in these conflicts have no matching distributions available for your environment:
pip:      pyarrow
pip:  
pip:  To fix this you could try to:
pip:  1. loosen the range of package versions you've specified
pip:  2. remove package versions to allow pip to attempt to solve the dependency conflict
```

## Implementation
... (continued)

77 of 100 new or added lines in 6 files covered. (77.0%)

868 existing lines in 42 files now uncovered.

74471 of 94474 relevant lines covered (78.83%)

3.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/python/pants/backend/go/goals/check.py
1
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

UNCOV
4
from dataclasses import dataclass
×
5

UNCOV
6
from pants.backend.go.target_types import GoPackageSourcesField
×
UNCOV
7
from pants.backend.go.util_rules.build_opts import (
×
8
    GoBuildOptionsFromTargetRequest,
9
    go_extract_build_options_from_target,
10
)
UNCOV
11
from pants.backend.go.util_rules.build_pkg import build_go_package
×
UNCOV
12
from pants.backend.go.util_rules.build_pkg_target import (
×
13
    BuildGoPackageTargetRequest,
14
    setup_build_go_package_target_request,
15
)
UNCOV
16
from pants.core.goals.check import CheckRequest, CheckResult, CheckResults
×
UNCOV
17
from pants.engine.rules import collect_rules, concurrently, implicitly, rule
×
UNCOV
18
from pants.engine.target import FieldSet
×
UNCOV
19
from pants.engine.unions import UnionRule
×
UNCOV
20
from pants.util.logging import LogLevel
×
21

22

UNCOV
23
@dataclass(frozen=True)
×
UNCOV
24
class GoCheckFieldSet(FieldSet):
×
UNCOV
25
    required_fields = (GoPackageSourcesField,)
×
26

27

UNCOV
28
class GoCheckRequest(CheckRequest):
×
UNCOV
29
    field_set_type = GoCheckFieldSet
×
UNCOV
30
    tool_name = "go-compile"
×
31

32

UNCOV
33
@rule(desc="Check Go compilation", level=LogLevel.DEBUG)
×
UNCOV
34
async def check_go(request: GoCheckRequest) -> CheckResults:
×
35
    build_opts_for_field_sets = await concurrently(
×
36
        go_extract_build_options_from_target(
37
            GoBuildOptionsFromTargetRequest(field_set.address), **implicitly()
38
        )
39
        for field_set in request.field_sets
40
    )
41
    build_requests = await concurrently(
×
42
        setup_build_go_package_target_request(
43
            BuildGoPackageTargetRequest(field_set.address, build_opts=build_opts), **implicitly()
44
        )
45
        for field_set, build_opts in zip(request.field_sets, build_opts_for_field_sets)
46
    )
47
    invalid_requests = []
×
48
    valid_requests = []
×
49
    for fallible_request in build_requests:
×
50
        if fallible_request.request is None:
×
51
            invalid_requests.append(fallible_request)
×
52
        else:
53
            valid_requests.append(fallible_request.request)
×
54

55
    build_results = await concurrently(
×
56
        build_go_package(request, **implicitly()) for request in valid_requests
57
    )
58

59
    # NB: We don't pass stdout/stderr as it will have already been rendered as streaming.
60
    exit_code = next(
×
61
        (
62
            result.exit_code  # type: ignore[attr-defined]
63
            for result in (*build_results, *invalid_requests)
64
            if result.exit_code != 0  # type: ignore[attr-defined]
65
        ),
66
        0,
67
    )
68
    return CheckResults([CheckResult(exit_code, "", "")], checker_name=request.tool_name)
×
69

70

UNCOV
71
def rules():
×
UNCOV
72
    return [*collect_rules(), UnionRule(CheckRequest, GoCheckRequest)]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc