Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.69k stars 12.39k forks source link

jing-trang should install dependent .jar files to build directory or symlink them #53099

Closed ujay68 closed 4 years ago

ujay68 commented 4 years ago

The jing-trang formula installs the files jing.jar and trang.jar to /usr/local/Cellar/jing-trang/20181222/libexec/build, and the dependent jars to /usr/local/Cellar/jing-trang/20181222/libexec/lib. However, jing.jar:META-INF/MANIFEST.MF sets a Class-Path that references the dependent jar files from that same directory, so they aren't found when jing.jar is launched as an executable jar file. This restricts jing's functionality and may lead to spurious errors, like because jing will be using Java's bundled and buggy XSLT processor instead of Saxon's. See, eg, https://github.com/relaxng/jing-trang/issues/257.

The formula should either install all .jar files to libexec/build or symlink all .jar files from libexec/lib to libexec/build.

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

$ brew config HOMEBREW_VERSION: 2.2.13 ORIGIN: https://github.com/Homebrew/brew.git HEAD: 3d9cf83fec45a75af61551f53d25383abe009d31 Last commit: 3 hours ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: 2a5aa6f9218fc8c50c8f1a9716ef5c2751552028 Core tap last commit: 71 minutes ago HOMEBREW_PREFIX: /usr/local HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.…/org.macosforge.xquartz:0 HOMEBREW_MAKE_JOBS: 8 CPU: octa-core 64-bit kabylake Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby Clang: 11.0 build 1103 Git: 2.26.0 => /usr/local/bin/git Curl: 7.64.1 => /usr/bin/curl Java: 11.0.6, 1.8.0_242 macOS: 10.15.4-x86_64 CLT: 11.0.33.17 Xcode: 11.4 XQuartz: 2.7.11 => /opt/X11

$ brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: You have unlinked kegs in your Cellar. Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run brew link on these: gnupg

What you were trying to do (and why)

Running Jing to do a Schematron validation (see https://github.com/relaxng/jing-trang/issues/257)

What happened (include command output)

Command output
ERROR:  'Namespace for prefix 't' has not been declared.'
fatal: exception "java.lang.RuntimeException" thrown: Namespace for prefix 't' has not been declared.  

What you expected to happen

The Schematron should have worked. It does if you symlink the dependent .jar files from the libexec/lib to the libexec/build folder.

Step-by-step reproduction instructions (by running brew install commands)

$ brew install jing-trang $ jing test.sch test.xml

SMillerDev commented 4 years ago

Shouldn't the classpath be updated to include the new (more logical) directory instead?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

ujay68 commented 4 years ago

Yes, one could update the classpath. However, this would mean to either modify the build instructions of the original jing-trang project or to patch the binaries jing.jar and trang.jar afterwards, specifically, the META-INF/MANIFEST.MF files inside. Not worth the effort, IMO. I think it would be much easier to just keep the directory layout of the original project, even if it isn't perfect.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.