witty-crayon-22786
11/05/2021, 9:11 PMwitty-crayon-22786
11/05/2021, 9:11 PMhundreds-father-404
11/05/2021, 9:13 PMProcessCacheScope.ALWAYS
was a red herring
To debug, log the FallibleBuildGoPackageRequest
, right?witty-crayon-22786
11/05/2021, 9:14 PMwitty-crayon-22786
11/05/2021, 9:15 PMwitty-crayon-22786
11/05/2021, 9:16 PMhundreds-father-404
11/05/2021, 9:18 PMdiff --git a/pants.toml b/pants.toml
index 2c60b314d..f4effe200 100644
--- a/pants.toml
+++ b/pants.toml
@@ -51,7 +51,7 @@ pants_ignore.add = [
build_ignore.add = [
# Disable Go targets by default so Pants developers do not need Go installed.
- "testprojects/src/go/**",
+# "testprojects/src/go/**",
]
# NB: Users must still set `--remote-cache-{read,write}` to enable the remote cache.
diff --git a/src/python/pants/backend/go/util_rules/build_pkg.py b/src/python/pants/backend/go/util_rules/build_pkg.py
index 9839ce5d9..31dfa58a5 100644
--- a/src/python/pants/backend/go/util_rules/build_pkg.py
+++ b/src/python/pants/backend/go/util_rules/build_pkg.py
@@ -2,6 +2,7 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
+import logging
import os.path
from dataclasses import dataclass
@@ -21,6 +22,7 @@ from pants.util.frozendict import FrozenDict
from pants.util.logging import LogLevel
from pants.util.strutil import path_safe
+logger = logging.getLogger(__name__)
class BuildGoPackageRequest(EngineAwareParameter):
def __init__(
@@ -175,6 +177,7 @@ class BuiltGoPackage:
# (triggered by `FallibleBuiltGoPackage` subclassing `EngineAwareReturnType`).
@rule(desc="Compile with Go", level=LogLevel.DEBUG)
async def build_go_package(request: BuildGoPackageRequest) -> FallibleBuiltGoPackage:
+ <http://logger.info|logger.info>(request.import_path)
maybe_built_deps = await MultiGet(
Get(FallibleBuiltGoPackage, BuildGoPackageRequest, build_request)
for build_request in request.direct_dependencies
diff --git a/testprojects/src/go/pants_test/bar/bar.go b/testprojects/src/go/pants_test/bar/bar.go
index 1f590eb92..bf7a686e3 100644
--- a/testprojects/src/go/pants_test/bar/bar.go
+++ b/testprojects/src/go/pants_test/bar/bar.go
@@ -7,5 +7,6 @@ func GenUuid() string {
}
func Quote(s string) string {
+ x := "foo"
return ">> " + s + " <<"
}
❯ ./pants check testprojects/src/go::
14:17:56.06 [INFO] main
14:17:56.36 [INFO] <http://github.com/pantsbuild/pants/testprojects/src/go/pants_test/bar|github.com/pantsbuild/pants/testprojects/src/go/pants_test/bar>
14:17:56.36 [INFO] <http://github.com/pantsbuild/pants/testprojects/src/go/pants_test|github.com/pantsbuild/pants/testprojects/src/go/pants_test>
14:17:56.36 [INFO] <http://github.com/google/uuid|github.com/google/uuid>
hundreds-father-404
11/05/2021, 9:23 PMwitty-crayon-22786
11/05/2021, 9:24 PMhundreds-father-404
11/05/2021, 9:25 PMCompleted: Compile with Go - <http://github.com/pantsbuild/pants/testprojects/src/go/pants_test|github.com/pantsbuild/pants/testprojects/src/go/pants_test> failed (exit code 1).
Dependency failed to compile: <http://github.com/pantsbuild/pants/testprojects/src/go/pants_test/bar|github.com/pantsbuild/pants/testprojects/src/go/pants_test/bar>
witty-crayon-22786
11/05/2021, 9:26 PMwitty-crayon-22786
11/05/2021, 9:26 PMwitty-crayon-22786
11/05/2021, 9:27 PMwitty-crayon-22786
11/05/2021, 9:27 PMwitty-crayon-22786
11/05/2021, 9:28 PMhundreds-father-404
11/05/2021, 9:28 PMError
witty-crayon-22786
11/05/2021, 9:28 PMcheck
will still report a line per roothundreds-father-404
11/05/2021, 9:28 PMcheck
only reports for the entire compilerwitty-crayon-22786
11/05/2021, 9:28 PMWe could add special casing that it wasn’t attempted? Like log at debug level, rather thanÂsure: we already special case that though: https://github.com/pantsbuild/pants/blob/3874cd6f683692ac109f41a61eb26265d67f3696/src/python/pants/jvm/compile.py#L73-L85 … so expanding that to look at the error type and do nothing seems fine.Error
witty-crayon-22786
11/05/2021, 9:30 PMNack,Âit shouldn’t probably. just for the roots. pretty sure that’s the case for JVM only reports for the entire compilercheck
witty-crayon-22786
11/05/2021, 9:30 PMwitty-crayon-22786
11/05/2021, 9:31 PMhundreds-father-404
11/05/2021, 9:32 PMcheck
reports is the compiler name + error code. No std{out,err}.
If you say ./pants go check pkg:
and it fails due to a transitive dep, would you expect the results to explicitly mention pkg:
? Or it's enough to say that pkg/dep
had failed so the user can infer pkg
also failedwitty-crayon-22786
11/05/2021, 9:32 PMwitty-crayon-22786
11/05/2021, 9:32 PMhundreds-father-404
11/05/2021, 9:33 PMcheck
! Only our streaming of BuildGoPackageRequest
is per-targetwitty-crayon-22786
11/05/2021, 9:33 PMwitty-crayon-22786
11/05/2021, 9:33 PMhundreds-father-404
11/05/2021, 9:33 PMcheck ::
and a downstream dep fails to compile. Thanks!witty-crayon-22786
11/05/2021, 9:33 PMhundreds-father-404
11/05/2021, 9:34 PM