Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 734590
Summary: | Refactor JNI libraries for Fedora 16+ . . . | ||
---|---|---|---|
Product: | [Retired] Dogtag Certificate System | Reporter: | Matthew Harmsen <mharmsen> |
Component: | JNI | Assignee: | Matthew Harmsen <mharmsen> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Ben Levenson <benl> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 9.0 | CC: | alee, aph, ayoung, cfu, dbhole, dpal, hicham.haouari, jdennis, jmagne, mharmsen, mizdebsk, nhosoi, nicolas.mailhot, nkinder, patrickm, pingou, rmeggins, sochotni |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | 665576 | Environment: | |
Last Closed: | 2019-01-30 13:47:16 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 665576 | ||
Bug Blocks: | 665426 | ||
Attachments: |
Description
Matthew Harmsen
2011-08-30 20:17:26 UTC
(In reply to comment #38) > So I decided to bite the bullet and did changes that will break things I am > sure: > > %_jnidir is now %_libdir/java > %_javajnidir is new addition for noarch jars using arch-specific bits from > %_jnidir > > build-classpath has been changed to resolve from this new directory as well. > Maven is also resolving from _jnidir and _javajnidir (it didn't before). > > This change will break builds and in a few cases patches will need to be > created to fix them. I've tested with osutil. I had to fix cmake-> > - "${CMAKE_INSTALL_PREFIX}/lib/java" > + "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/java" > > And that was it. I would be really interested how many things broke because of > these changes. > > If we can make this work (which I believe shouldn't be that hard), we can > modify our current guidelines to reflect these changes. In next 2 weeks I'll go > through packages that have files in /usr/lib/java and rebuild them, and also > look at packages that depend on these. I won't be around much because of > holidays for next few days, so if anyone would look into it before me: great! QUESTION: So, using 'osutil' with your proposed 'cmake' change as an example for Fedora 16 and later, are you expecting "Layout A", "Layout B", "Layout C", "Layout D", or something else? Original Layout: 32-bit: /usr/lib/java/osutil.jar -> /usr/lib/osutil/osutil.jar /usr/lib/osutil/ /usr/lib/osutil/libosutil.so /usr/lib/osutil/osutil-2.0.1.jar /usr/lib/osutil/osutil.jar -> osutil-2.0.1.jar 64-bit: /usr/lib/java/osutil.jar -> /usr/lib64/osutil/osutil.jar /usr/lib64/osutil/ /usr/lib64/osutil/libosutil.so /usr/lib64/osutil/osutil-2.0.1.jar /usr/lib64/osutil/osutil.jar -> osutil-2.0.1.jar Layout A (identical for 32-bit; relocates jar symlink for 64-bit; no java code changes): 32-bit: /usr/lib/java/osutil.jar -> /usr/lib/osutil/osutil.jar /usr/lib/osutil/ /usr/lib/osutil/libosutil.so /usr/lib/osutil/osutil-2.0.1.jar /usr/lib/osutil/osutil.jar -> osutil-2.0.1.jar 64-bit: /usr/lib64/java/osutil.jar -> /usr/lib64/osutil/osutil.jar /usr/lib64/osutil/ /usr/lib64/osutil/libosutil.so /usr/lib64/osutil/osutil-2.0.1.jar /usr/lib64/osutil/osutil.jar -> osutil-2.0.1.jar Layout B (replaces jar symlink with jar; relocates jar for 64-bit; removes versioned jar + jar symlink; no java code changes): 32-bit: /usr/lib/java/osutil.jar /usr/lib/osutil/ /usr/lib/osutil/libosutil.so 64-bit: /usr/lib64/java/osutil.jar /usr/lib64/osutil/ /usr/lib64/osutil/libosutil.so Layout C (adds javajnidir symlink; replaces jar symlink with jar; relocates jar for 64-bit; removes versioned jar + jar symlink; no java code changes): 32-bit: /usr/share/java-jni/osutil.jar -> /usr/lib/osutil/osutil.jar /usr/lib/java/osutil.jar /usr/lib/osutil/ /usr/lib/osutil/libosutil.so 64-bit: /usr/share/java-jni/osutil.jar -> /usr/lib64/osutil/osutil.jar /usr/lib64/java/osutil.jar /usr/lib64/osutil/ /usr/lib64/osutil/libosutil.so Layout D (adds javajnidir symlink; relocates jar symlink for 64-bit; removes versioned jar; replaces jar symlink with jar; no java code changes): 32-bit: /usr/share/java-jni/osutil.jar -> /usr/lib/osutil/osutil.jar /usr/lib/java/osutil.jar -> /usr/lib/osutil/osutil.jar /usr/lib/osutil/ /usr/lib/osutil/libosutil.so /usr/lib/osutil/osutil.jar 64-bit: /usr/share/java-jni/osutil.jar -> /usr/lib64/osutil/osutil.jar /usr/lib64/java/osutil.jar -> /usr/lib64/osutil/osutil.jar /usr/lib64/osutil/ /usr/lib64/osutil/libosutil.so /usr/lib64/osutil/osutil.jar Stanislav Ochotnicky 2011-08-31 05:29:23 EDT Since %{_javajnidir} (/usr/share/java-jni/) is supposed to be used for jar files that use JNI jars and they are not using JNI themselves and are architecture agnostic, options C and D are not good. That's because osutil.jar directly uses JNI calls. It should therefore place jar file into %{_jnidir} (/usr/lib[64]/java). I like option B better because it has less clutter, but both A and B could be used, depending on the wishes of maintainer. That's because they both keep multilib OK. Personally I'd prefer B since it has less work for packager I'd say (no symlinks to deal with). Does this make sense at all? Best example of javajnidir I've seen is jansi-native package. The package has 2 jars: one is completely noarch, the other contains *so file inside. But the noarch jar is still useless without the arch jar. FYI I later found out it was enough to do: -%cmake -DBUILD_OSUTIL:BOOL=ON .. +%cmake -DBUILD_OSUTIL:BOOL=ON -DJAVA_LIB_INSTALL_DIR=%{_jnidir} .. when building osutil to fix jar placing. (In reply to comment #40) > Since %{_javajnidir} (/usr/share/java-jni/) is supposed to be used for jar > files that use JNI jars and they are not using JNI themselves and are > architecture agnostic, options C and D are not good. That's because osutil.jar > directly uses JNI calls. > > It should therefore place jar file into %{_jnidir} (/usr/lib[64]/java). I like > option B better because it has less clutter, but both A and B could be used, > depending on the wishes of maintainer. That's because they both keep multilib > OK. Personally I'd prefer B since it has less work for packager I'd say (no > symlinks to deal with). > B is fine -- this means that these legacy packages will not use %{_javajnidir} at all -- and hopefully everything will work -- although I think that I may need to alter some wrappers that we use for some of our command line tools to perform the search correctly, as I believe that these may not use "build-classpath". > Does this make sense at all? Best example of javajnidir I've seen is > jansi-native package. The package has 2 jars: one is completely noarch, the > other contains *so file inside. But the noarch jar is still useless without the > arch jar. > > FYI I later found out it was enough to do: > -%cmake -DBUILD_OSUTIL:BOOL=ON .. > +%cmake -DBUILD_OSUTIL:BOOL=ON -DJAVA_LIB_INSTALL_DIR=%{_jnidir} .. > > when building osutil to fix jar placing. Awesome. This is far more elegant and easier to implement. Copying nhosoi, nkinder, and rmeggins on this bug, as their 'classpath' to "jss4.jar" may need to be modified (i. e. - search "/usr/lib64/java/jss4.jar" prior to "/usr/lib/java/jss4.jar" to support the new 64-bit location of this JNI jar). This will be the location of the 64-bit JSS JNI jar file starting with Fedora 16. 389-console doesn't have any paths anymore on Fedora - instead, we use the %jpackage_script provided by the jpackage-utils package. We just pass in the names of the jar files like this: %jpackage_script com.netscape.management.client.console.Console "" "" jss4.jar:ldapjdk.jar:idm-console-base.jar:idm-console-mcc.jar:idm-console-mcc_%{consolelang}.jar:idm-console-nmclf.jar:idm-console-nmclf_%{consolelang}.jar %{name} true And let jpackage worry about any paths, etc. I'm assuming that jpackage knows how to set the correct path for jss4.jar (In reply to comment #4) > 389-console doesn't have any paths anymore on Fedora - instead, we use the > %jpackage_script provided by the jpackage-utils package. We just pass in the > names of the jar files like this: > > %jpackage_script com.netscape.management.client.console.Console "" "" > jss4.jar:ldapjdk.jar:idm-console-base.jar:idm-console-mcc.jar:idm-console-mcc_%{consolelang}.jar:idm-console-nmclf.jar:idm-console-nmclf_%{consolelang}.jar > %{name} true > > And let jpackage worry about any paths, etc. I'm assuming that jpackage knows > how to set the correct path for jss4.jar Correct -- you have no work to do then, because 'jpackage-utils' was changed to account for this change on Fedora 16. Created attachment 522835 [details]
Relocated "jss4.jar" JNI jar file . . .
Created attachment 522836 [details]
Relocated "osutil.jar" JNI jar file . . .
Created attachment 522837 [details]
Building "tomcatjss.jar" using relocated JNI jar files . . .
Created attachment 522838 [details]
Relocated "symkey.jar" JNI jar file and building PKI using relocated JNI jar files . . .
Comment on attachment 522838 [details]
Relocated "symkey.jar" JNI jar file and building PKI using relocated JNI jar files . . .
Addresses:
- dogtag-pki-theme
- pki-core
- pki-console
- pki-kra
- pki-ocsp
- pki-tks
Created attachment 522842 [details]
The "tomcat6-sysd" script used for testing on "goofy-vm12.dsdev.sjc.redhat.com"
Created attachment 522843 [details]
The "tomcat6" script used for testing on "goofy-vm12.dsdev.sjc.redhat.com"
# cd osutil # fedpkg commit [master 2127e2b] Bugzilla Bug #734590 - Refactor JNI libraries for Fedora 16+ . . . Committer: Matthew Harmsen <mharmsen.redhat.com> Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly: git config --global user.name "Your Name" git config --global user.email you If the identity used for this commit is wrong, you can fix it with: git commit --amend --author='Your Name <you>' 1 files changed, 20 insertions(+), 2 deletions(-) # git push Counting objects: 5, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 630 bytes, done. Total 3 (delta 2), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/osutil.git 9b795b7..2127e2b master -> master # cd tomcatjss # svn status | grep -v ^$ | grep -v ^P | grep -v ^X | grep -v ^? M tomcatjss.spec M build_tomcatjss M build.xml # svn commit Sending build.xml Sending build_tomcatjss Sending tomcatjss.spec Transmitting file data ... Committed revision 185. TIP: # cd pki # svn status | grep -v ^$ | grep -v ^P | grep -v ^X | grep -v ^? M scripts/compose_pki_tks_packages M scripts/compose_pki_console_packages M scripts/compose_pki_ocsp_packages M scripts/compose_pki_kra_packages M scripts/compose_dogtag_pki_theme_packages M scripts/compose_pki_core_packages M base/java-tools/src/CMakeLists.txt M base/java-tools/templates/pretty_print_cert_command_wrapper.in M base/java-tools/templates/pretty_print_crl_command_wrapper.in M base/java-tools/templates/pki_java_command_wrapper.in M base/symkey/src/CMakeLists.txt M base/symkey/src/com/netscape/symkey/CMakeLists.txt M base/ca/src/CMakeLists.txt M base/common/src/CMakeLists.txt M base/silent/src/CMakeLists.txt M base/setup/pkicommon.pm M base/tks/src/CMakeLists.txt M base/console/src/CMakeLists.txt M base/console/templates/pki_console_wrapper M base/ocsp/src/CMakeLists.txt M base/kra/src/CMakeLists.txt M base/util/src/CMakeLists.txt M specs/dogtag-pki-theme.spec M specs/pki-core.spec M specs/pki-kra.spec M specs/pki-tks.spec M specs/pki-console.spec M specs/pki-ocsp.spec M CMakeLists.txt # svn commit Sending CMakeLists.txt Sending base/ca/src/CMakeLists.txt Sending base/common/src/CMakeLists.txt Sending base/console/src/CMakeLists.txt Sending base/console/templates/pki_console_wrapper Sending base/java-tools/src/CMakeLists.txt Sending base/java-tools/templates/pki_java_command_wrapper.in Sending base/java-tools/templates/pretty_print_cert_command_wrapper.in Sending base/java-tools/templates/pretty_print_crl_command_wrapper.in Sending base/kra/src/CMakeLists.txt Sending base/ocsp/src/CMakeLists.txt Sending base/setup/pkicommon.pm Sending base/silent/src/CMakeLists.txt Sending base/symkey/src/CMakeLists.txt Sending base/symkey/src/com/netscape/symkey/CMakeLists.txt Sending base/tks/src/CMakeLists.txt Sending base/util/src/CMakeLists.txt Sending scripts/compose_dogtag_pki_theme_packages Sending scripts/compose_pki_console_packages Sending scripts/compose_pki_core_packages Sending scripts/compose_pki_kra_packages Sending scripts/compose_pki_ocsp_packages Sending scripts/compose_pki_tks_packages Sending specs/dogtag-pki-theme.spec Sending specs/pki-console.spec Sending specs/pki-core.spec Sending specs/pki-kra.spec Sending specs/pki-ocsp.spec Sending specs/pki-tks.spec Transmitting file data ............................. Committed revision 2197. Should this bug be closed? Is there smth expected from Java SIG for it ? Please either let us know what Java SIG is needed for or drop the block on FE-JAVASIG or close directly. (In reply to Alexander Kurtakov from comment #17) > Should this bug be closed? > Is there smth expected from Java SIG for it ? > Please either let us know what Java SIG is needed for or drop the block on > FE-JAVASIG or close directly. Alexander, From the perspective of development, there is nothing more to do for this bug once it was set to MODIFIED. Since the JNI locations changed back to the way they were prior to this change, and all packages have been re-spun for Fedora 19. -- Matt Removing block on FE-JAVASIG as there is nothing to do for Fedora Java SIG. |