Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 179745 - tomcat-6* doesn't call java-pkg-2_pkg_setup
Summary: tomcat-6* doesn't call java-pkg-2_pkg_setup
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: William L. Thomson Jr. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-25 12:51 UTC by Petteri Räty (RETIRED)
Modified: 2007-05-25 14:39 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petteri Räty (RETIRED) gentoo-dev 2007-05-25 12:51:29 UTC
You need to call java-pkg-2_pkg_setup in pkg_setup or you will not get VM switching etc when the hooks are removed. It ends up dying:

compile:
    [javac] Compiling 954 source files to /var/tmp/portage/www-servers/tomcat-6.0.13-r1/work/apache-tomcat-6.0.13-src/output/classes
    [javac] javac: invalid target release: 1.5
    [javac] Usage: javac <options> <source files>
    [javac] where possible options include:

Also because you require >=1.5 please add the same version check to the init script in 6* as was already added to 5.5.
Comment 1 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-05-25 14:23:55 UTC
(In reply to comment #0)
> You need to call java-pkg-2_pkg_setup in pkg_setup or you will not get VM
> switching etc when the hooks are removed. 

Why did you modify 5.5.x and not 6.0.x? Please do not make any changes if you are only going to modify one, and leave the problem in others to be address later on.

  29 Apr 2007; Petteri Räty <betelgeuse@gentoo.org>
  tomcat-5.5.23-r1.ebuild:
  RDEPEND on dev-java/ant-core and call java-pkg-2_pkg_setup in pkg_setup.

Had you filed a bug about it then, I would have addressed both at once. Instead of one at a time. Guess this way is more efficient.

> Also because you require >=1.5 please add the same version check to the init
> script in 6* as was already added to 5.5.

I fail to see how that is necessary. It seems to me that type of logic should be in the build system or etc. java-config or etc should know if a package was built with a given version. If a person tries to drop the vm below the min version a package or packages were compiled against. The user get's an error. Maybe info telling them which packages won't work with the vm they selected.

Otherwise we will have to address this on a one on one basis across the board. Which can be done with applications via launchers and init scripts. But can't be done for libraries. So again it's a band aid on a bigger problem.

I did it to 5.5 since 5.5 can be compiled as 1.4 or 1.5 bytecode due to java5 flag. So people might do dumb stuff like set java5 and leave their system vm as 1.4 or etc. With Tomcat 6, that is not possible. Not to mention Tomcat 6.x only compiles to 1.5 bytecode. Since 1.6 is in ~arch and 1.5 is stable. I fail to see how this could ever be a problem.

Not to mention upstream clearly states Tomcat 6.x is meant to be run with >=1.5 jdk. So if someone is trying to run it on Gentoo with 1.4, or does by accident. They are doing really dumb stuff, and I would rather spend my time adding features for intelligent users. Than fail safes for people doing dumb stuff, or not paying attention to their env.


Comment 2 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-05-25 14:29:43 UTC
Added call, closing bug.
Comment 3 Petteri Räty (RETIRED) gentoo-dev 2007-05-25 14:39:32 UTC
(In reply to comment #1)
> 
> Why did you modify 5.5.x and not 6.0.x? Please do not make any changes if you
> are only going to modify one, and leave the problem in others to be address
> later on.
>

Yes I should have done both. Mistakes happen. I was fixing stuff as found by emerge-everything-java but I had 6* already installed so didn't bump into this one at that time.

> 
> I fail to see how that is necessary. It seems to me that type of logic should
> be in the build system or etc. java-config or etc should know if a package was
> built with a given version. If a person tries to drop the vm below the min
> version a package or packages were compiled against. The user get's an error.
> Maybe info telling them which packages won't work with the vm they selected.
>

Maybe it would be prudent to add a bash file in java-config that you can source in the init script and does takes care of showing the error if needed. That way all our server init scripts could make use of it. I opened bug 179755 for it.