Skip to content

Commit dc99192

Browse files
fmeum“Gowroji
authored and
“Gowroji
committed
Fix behavior of print() in module extensions
Previously, messages printed with `print()` didn't have the usual `DEBUG:` prefix. Fixes bazelbuild#14526 Closes bazelbuild#15795. PiperOrigin-RevId: 459052873 Change-Id: I1b75498d448aaae137dd63ea0a418572097bdac2
1 parent 06ca634 commit dc99192

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public void setRepositoryRemoteExecutor(RepositoryRemoteExecutor repositoryRemot
8686
this.repositoryRemoteExecutor = repositoryRemoteExecutor;
8787
}
8888

89+
@Nullable
8990
@Override
9091
public SkyValue compute(SkyKey skyKey, Environment env)
9192
throws SkyFunctionException, InterruptedException {
@@ -161,6 +162,7 @@ public SkyValue compute(SkyKey skyKey, Environment env)
161162
try (Mutability mu =
162163
Mutability.create("module extension", usagesValue.getExtensionUniqueName())) {
163164
StarlarkThread thread = new StarlarkThread(mu, starlarkSemantics);
165+
thread.setPrintHandler(Event.makeDebugPrintHandler(env.getListener()));
164166
ModuleExtensionContext moduleContext =
165167
createContext(env, usagesValue, starlarkSemantics, extension);
166168
threadContext.storeInThread(thread);

0 commit comments

Comments
 (0)