Closed japhb closed 1 year ago
Wow, I'm surprised this hasn't been noticed yet! That messaging is done with Supply
so I suppose its related to one of
https://github.com/ugexe/zef/blob/9779091b7997468257ce3037f8bc0e9c65d1f974/lib/Zef/Test.rakumod#L102-L108
https://github.com/ugexe/zef/blob/9779091b7997468257ce3037f8bc0e9c65d1f974/lib/Zef/CLI.rakumod#L1182-L1202
I think this was introduced with https://github.com/ugexe/zef/commit/f4c0ba9d09fe8a26445b3f00ec93d22620ae31f0 which cached loaded plugins (like the wrapper around prove
) such that the repository plugins didn't have to reload JSON for each query. However, for e.g. test plugins it seems to have exposed a bug in how the Suppliers used to pass messages are used/created - particularly the $.stdout / $.stderr
attributes of e.g. Zef::Service::Shell::prove
(which are provided by role Messenger { }
from lib/Zef.rakumod
). For instance, disabling that plugin loading caching like below results in the expected test output:
diff --git a/lib/Zef.rakumod b/lib/Zef.rakumod
index 4aebf7c..4971521 100644
--- a/lib/Zef.rakumod
+++ b/lib/Zef.rakumod
@@ -131,7 +131,7 @@ package Zef {
has $!list-plugins-lock = Lock.new;
method !list-plugins(@backends = @!backends) {
$!list-plugins-lock.protect: {
- return $!plugins if $!plugins.so;
+ #return $!plugins if $!plugins.so;
# @backends used to only be an array of hash. However now the ::Repository
# section of the config an an array of an array of hash and thus the logic
When zef is testing a module with multiple dependencies, that also need to be tested and installed, it will repeat every test message with the marker prefix for every dependency that has already been reached. For example, this is just one tiny part of the test output for
App::Rak::Complete
, from just after the Fetch and Extraction phases:Context
Note in the above snippet how every line of the testing output for each module is duplicated with not only its own prefix, but all previous modules' prefixes. This results in a quadratic test output and rapidly becomes nearly unreadable for large dependency trees.
Expected Behavior
Test output lines should only appear once each, with the correct distro name prefix.
Actual Behavior
See snippet in description.
Steps to Reproduce
Your Environment
Raku versions: many recent ones, including
v2022.12-763-g7e69a6de5
andv2022.12-1116-g500508664
Zef versions: several recent ones, includingv0.14.4
andv0.14.6
(currentlyHEAD
)