Bug#1039607: libjansi-java: causes maven to always output escape character

tony mancill tmancill at debian.org
Sat Apr 6 19:17:10 BST 2024


On Sat, Apr 06, 2024 at 11:09:07AM +0200, Emmanuel Bourg wrote:
> Le 05/01/2024 à 07:22, tony mancill a écrit :
> 
> > However, for the short-term, I believe we can achieve the desired
> > behavior and fix the issue for most use cases by
> > 
> > 1. Patching the mvn wrapper script in our maven package to set
> > jansi.mode=force (and thus colorize output) unless the --batch-mode
> > option is provided.
> > 
> > 2. Moving forward with the current jansi package in experimental.
> > 
> > That restores the desired --batch-mode behavior but maintains
> > colorized output by default and during Debian package builds.
> > 
> > Would that be acceptable?
> 
> Hi Tony,
> 
> Was this plan fully implemented? Maven builds from the command line and
> inside pbuilder are no longer colorized currently.

Hi Emmanuel,

The uploads of src:maven and src:jansi were completed in mid-February.
I ended up not uploading the change to maven-debian-helper in
experimental because I didn't think it was necessary.

mvn on the command-line produced colorized output by default on my
system and in clean unstable and trixie chroots (attached screenshot).
If that's not working for you, then let me know.  Perhaps more work is
needed on the patch in src:maven.

However, I'm not seeing colorized output on my system during sbuild, so
there are still something amiss.  I notice that "--batch-mode" is being
explicitly passed to the maven invocation via this code [1], which
explains that behavior.

>   dh_auto_build -O--buildsystem=maven
>        /usr/lib/jvm/default-java/bin/java -noverify -cp /usr/share/maven/boot/plexus-classworlds-2.x.jar -Dmaven.home=/usr/share/maven -Dmaven.multiModuleProjectDirectory=/<<PKGBUILDDIR>> -Dclassworlds.conf=/etc/maven/m2-debian.conf -Dproperties.file.manual=/<<PKGBUILDDIR>>/debian/maven.properties org.codehaus.plexus.classworlds.launcher.Launcher -s/etc/maven/settings-debian.xml -Ddebian.dir=/<<PKGBUILDDIR>>/debian -Dmaven.repo.local=/<<PKGBUILDDIR>>/debian/maven-repo --batch-mode package -DskipTests -Dnotimestamp=true -Dlocale=en_US

I will have to look into why the tput (no longer?) succeeds during sbuild.
In fact, it's failing for plain `dpkg-buildpackage` in my terminal, even
though the following (negated condition) test generates output:

$ perl -e "if ((`tput colors 2>/dev/null` >= 8)) { print 'foo'; }"

So I think the issue is in maven-debian-helper and that the other
changes are working as expected.

You should be seeing colorized output on the terminal unless you
explicitly override it.  Let me know if you're seeing something else.

Thank you,
tony

[1] https://salsa.debian.org/java-team/maven-debian-helper/-/blob/c03c5403539eb4dc35947b35f51d72d74620637a/share/perl/maven.pm#L53-55
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mvn_screenshot.gif
Type: image/gif
Size: 77238 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-maintainers/attachments/20240406/2c6a32a6/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-maintainers/attachments/20240406/2c6a32a6/attachment-0001.sig>


More information about the pkg-java-maintainers mailing list