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

pantsbuild / pants / 25443604553

06 May 2026 03:05PM UTC coverage: 92.879% (-0.04%) from 92.915%
25443604553

push

github

web-flow
[pants_ng] Scaffolding for a pants_ng mode. (#23319)

In this mode the command line is parsed as an
NG invocation, and dispatched appropriately.

Of course at the moment there are no
implementations to dispatch to. That will follow.

This does expose a new option, `pants_ng` to users. 
There is a big warning not to set it, but we're not trying
to hide that we're working on a new thing, so I am
comfortable with this.

25 of 76 new or added lines in 9 files covered. (32.89%)

1294 existing lines in 76 files now uncovered.

92234 of 99306 relevant lines covered (92.88%)

4.05 hits per line

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

93.55
/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
4✔
5

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

19

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

23

24
@rule
4✔
25
async def provide_sdk_implicit_linker_dependencies(
4✔
26
    request: SdkImplicitLinkerDependenciesHook,
27
) -> ImplicitLinkerDependencies:
28
    # Build implicit linker deps.
29
    # All binaries link to `runtime`.
30
    implicit_deps_import_paths: set[str] = {"runtime"}
4✔
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:
4✔
UNCOV
34
        implicit_deps_import_paths.add("runtime/race")
1✔
35
    if request.build_opts.with_msan:
4✔
36
        implicit_deps_import_paths.add("runtime/msan")
×
37
    if request.build_opts.with_asan:
4✔
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(
4✔
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 = []
4✔
53
    import_paths_to_pkg_a_files: dict[str, str] = {}
4✔
54
    for built_implicit_linker_dep in built_implicit_linker_deps:
4✔
55
        import_paths_to_pkg_a_files.update(built_implicit_linker_dep.import_paths_to_pkg_a_files)
4✔
56
        implicit_dep_digests.append(built_implicit_linker_dep.digest)
4✔
57

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

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

65

66
def rules():
4✔
67
    return (
4✔
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