From 892bdc57ef8d630d12f1d1af914ab0960775d5d1 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sun, 3 Jul 2022 11:02:21 +0200 Subject: [PATCH] Fix behavior of `print()` in module extensions Previously, messages printed with `print()` didn't have the usual `DEBUG:` prefix. Fixes #14526 --- .../build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java b/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java index 8611b8bc08cd01..13c49de862799a 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java @@ -165,6 +165,7 @@ public SkyValue compute(SkyKey skyKey, Environment env) try (Mutability mu = Mutability.create("module extension", usagesValue.getExtensionUniqueName())) { StarlarkThread thread = new StarlarkThread(mu, starlarkSemantics); + thread.setPrintHandler(Event.makeDebugPrintHandler(env.getListener())); ModuleExtensionContext moduleContext = createContext(env, usagesValue, starlarkSemantics, extension); threadContext.storeInThread(thread);