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

pantsbuild / pants / 26260209689

21 May 2026 11:59PM UTC coverage: 75.453% (-15.7%) from 91.156%
26260209689

Pull #23365

github

web-flow
Merge 5fe873b58 into 7ea655ba0
Pull Request #23365: uv.lock -> pex optimization

5 of 16 new or added lines in 1 file covered. (31.25%)

10118 existing lines in 378 files now uncovered.

54669 of 72454 relevant lines covered (75.45%)

2.31 hits per line

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

90.32
/src/python/pants/backend/go/util_rules/implicit_linker_deps.py
1
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
1✔
5

6
from pants.backend.go.util_rules.build_pkg import required_built_go_package
1✔
7
from pants.backend.go.util_rules.build_pkg_target import BuildGoPackageRequestForStdlibRequest
1✔
8
from pants.backend.go.util_rules.link_defs import (
1✔
9
    ImplicitLinkerDependencies,
10
    ImplicitLinkerDependenciesHook,
11
)
12
from pants.engine.internals.native_engine import MergeDigests
1✔
13
from pants.engine.internals.selectors import concurrently
1✔
14
from pants.engine.intrinsics import merge_digests
1✔
15
from pants.engine.rules import collect_rules, implicitly, rule
1✔
16
from pants.engine.unions import UnionRule
1✔
17
from pants.util.frozendict import FrozenDict
1✔
18

19

20
class SdkImplicitLinkerDependenciesHook(ImplicitLinkerDependenciesHook):
1✔
21
    pass
1✔
22

23

24
@rule
1✔
25
async def provide_sdk_implicit_linker_dependencies(
1✔
26
    request: SdkImplicitLinkerDependenciesHook,
27
) -> ImplicitLinkerDependencies:
28
    # Build implicit linker deps.
29
    # All binaries link to `runtime`.
30
    implicit_deps_import_paths: set[str] = {"runtime"}
1✔
31
    # TODO: External linking mode forces an import of runtime/cgo.
32
    # TODO: On ARM with GOARM=5, it forces an import of math, for soft floating point.
33
    if request.build_opts.with_race_detector:
1✔
UNCOV
34
        implicit_deps_import_paths.add("runtime/race")
×
35
    if request.build_opts.with_msan:
1✔
36
        implicit_deps_import_paths.add("runtime/msan")
×
37
    if request.build_opts.with_asan:
1✔
38
        implicit_deps_import_paths.add("runtime/asan")
×
39
    # TODO: Building for coverage in Go 1.20+ forces an import of runtime/coverage.
40

41
    built_implicit_linker_deps = await concurrently(
1✔
42
        required_built_go_package(
43
            **implicitly(
44
                BuildGoPackageRequestForStdlibRequest(
45
                    dep_import_path, build_opts=request.build_opts
46
                )
47
            ),
48
        )
49
        for dep_import_path in implicit_deps_import_paths
50
    )
51

52
    implicit_dep_digests = []
1✔
53
    import_paths_to_pkg_a_files: dict[str, str] = {}
1✔
54
    for built_implicit_linker_dep in built_implicit_linker_deps:
1✔
55
        import_paths_to_pkg_a_files.update(built_implicit_linker_dep.import_paths_to_pkg_a_files)
1✔
56
        implicit_dep_digests.append(built_implicit_linker_dep.digest)
1✔
57

58
    digest = await merge_digests(MergeDigests(implicit_dep_digests))
1✔
59

60
    return ImplicitLinkerDependencies(
1✔
61
        digest=digest,
62
        import_paths_to_pkg_a_files=FrozenDict(import_paths_to_pkg_a_files),
63
    )
64

65

66
def rules():
1✔
67
    return (
1✔
68
        *collect_rules(),
69
        UnionRule(ImplicitLinkerDependenciesHook, SdkImplicitLinkerDependenciesHook),
70
    )
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