Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 834036 - dev-java/commons-logging-1.2-r4[log4j] does not build Log4JLogger, which -r3 would build
Summary: dev-java/commons-logging-1.2-r4[log4j] does not build Log4JLogger, which -r3 ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Java team
URL:
Whiteboard:
Keywords: PullRequest, REGRESSION
Depends on:
Blocks:
 
Reported: 2022-02-25 16:18 UTC by Yuan Liao (Leo3418)
Modified: 2022-02-26 08:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-java/commons-logging-1.2-r4[log4j] build.log (commons-logging-1.2-r4.log,5.41 KB, text/plain)
2022-02-25 16:18 UTC, Yuan Liao (Leo3418)
Details
dev-java/commons-logging-1.2-r3[log4j] build.log (commons-logging-1.2-r3.log,5.11 KB, text/plain)
2022-02-25 16:19 UTC, Yuan Liao (Leo3418)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuan Liao (Leo3418) 2022-02-25 16:18:51 UTC
Created attachment 765815 [details]
dev-java/commons-logging-1.2-r4[log4j] build.log

Reverse dependencies of dev-java/commons-logging[log4j] will have a "cannot find symbol" compiler error when they use the org.apache.commons.logging.impl.Log4JLogger class and are built against commons-logging-1.2-r4.  The Log4JLogger class is present in the JARs built by commons-logging-1.2-r3[log4j], so this is a regression.

This is because, when the -r4 revision is being built, build.xml will emit a warning saying "Log4j 1.2 not found: Cannot Build Log4JLogger", even if the 'log4j' USE flag is enabled, and log4j-12-api is added to the classpath:

prepare:
     [echo] 
     [echo]     Log4j12: /usr/share/log4j-12-api-2/lib/log4j-12-api.jar:/usr/share/log4j-core-2/lib/log4j-core.jar
     [echo]     
     [echo]     
     [echo]     LogKit: /usr/share/avalon-logkit-2.0/lib/avalon-logkit.jar
     [echo]     Avalon-Framework: /usr/share/avalon-framework-4.2/lib/avalon-framework.jar
     [echo]     
    [mkdir] Created dir: /var/tmp/portage/dev-java/commons-logging-1.2-r4/work/commons-logging-1.2-src/target
    [mkdir] Created dir: /var/tmp/portage/dev-java/commons-logging-1.2-r4/work/commons-logging-1.2-src/target/classes
    [mkdir] Created dir: /var/tmp/portage/dev-java/commons-logging-1.2-r4/work/commons-logging-1.2-src/target/conf
    [mkdir] Created dir: /var/tmp/portage/dev-java/commons-logging-1.2-r4/work/commons-logging-1.2-src/target/tests

...

log4j12-warning:
     [echo] 
     [echo]     *** WARNING ***
     [echo]     Log4j 1.2 not found: Cannot Build Log4JLogger
     [echo]     

...

show-lib-presence:
     [echo] jdk.1.4.present=true
     [echo] log4j12.present=${log4j12.present}
     [echo] logkit.present=true
     [echo] avalon-framework.present=true

Note the 'log4j12.present=${log4j12.present}' printed in the 'show-lib-presence' task's output.

With -r3, the value of this property is 'true':

prepare:
     [echo] 
     [echo]     Log4j12: /usr/share/log4j/lib/log4j.jar
     [echo]     
     [echo]     
     [echo]     LogKit: /usr/share/avalon-logkit-2.0/lib/avalon-logkit.jar
     [echo]     Avalon-Framework: /usr/share/avalon-framework-4.2/lib/avalon-framework.jar
     [echo]     
    [mkdir] Created dir: /var/tmp/portage/dev-java/commons-logging-1.2-r3/work/commons-logging-1.2-src/target
    [mkdir] Created dir: /var/tmp/portage/dev-java/commons-logging-1.2-r3/work/commons-logging-1.2-src/target/classes
    [mkdir] Created dir: /var/tmp/portage/dev-java/commons-logging-1.2-r3/work/commons-logging-1.2-src/target/conf
    [mkdir] Created dir: /var/tmp/portage/dev-java/commons-logging-1.2-r3/work/commons-logging-1.2-src/target/tests

...

show-lib-presence:
     [echo] jdk.1.4.present=true
     [echo] log4j12.present=true
     [echo] logkit.present=true
     [echo] avalon-framework.present=true
Comment 1 Yuan Liao (Leo3418) 2022-02-25 16:19:25 UTC
Created attachment 765816 [details]
dev-java/commons-logging-1.2-r3[log4j] build.log
Comment 2 Larry the Git Cow gentoo-dev 2022-02-26 08:52:21 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de2db80524e6e55868462ac22d89c48ff37e341a

commit de2db80524e6e55868462ac22d89c48ff37e341a
Author:     Yuan Liao <liaoyuan@gmail.com>
AuthorDate: 2022-02-26 02:59:49 +0000
Commit:     Miroslav Šulc <fordfrog@gentoo.org>
CommitDate: 2022-02-26 08:48:25 +0000

    dev-java/commons-logging: Let build.xml accept log4j-12-api as Log4j 1.2
    
    Closes: https://bugs.gentoo.org/834036
    Signed-off-by: Yuan Liao <liaoyuan@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/24352
    Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>

 ...1.2-r4.ebuild => commons-logging-1.2-r5.ebuild} | 48 ++++++++++++++++++----
 1 file changed, 41 insertions(+), 7 deletions(-)