Closed aalmiray closed 2 years ago
If there's an option to skip relocating dylib
files then I'd very much like to know how to apply it to a formula. TIA.
We could perhaps skip @rpath
IDs, though the effect it may have on the formulae we ship would need careful testing and in practice doesn't have much benefits given everything Homebrew installs lies under one prefix.
With that said, the change itself shouldn't break anything on its own - unless there's non-adhoc codesigning bundles involved? It'll be useful to know more about exactly what the issue is here - a crash report will say if it's a codesigning issue.
We haven't had this issue occur with Homebrew's build of OpenJDK.
FWIW the bundled JR and the application (jreleaser) are not codesigned at all.
If skipping relocation is deemed hazardous then perhaps adding a flag to enabled it explicitly plus a warning message would be preferable instead of automatically skipping relocation of @rpath
IDS that is, make it a conscious decision for the formula writer (use of the flag or env var) that's passed on to consumers (warning message).
re: OpenJDK. I suppose because the formula is built from keg? ID relocation still takes place
$ HOMEBREW_VERBOSE=1 HOMEBREW_DEBUG=1 brew install openjdk
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openjdk.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/autoconf.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/m4.rb
==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/manifests/17.0.1_1
/usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/3.3.11-103-g768b172\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 11.6.2\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --header Accept:\ application/vnd.oci.image.index.v1\+json --header Authorization:\ Bearer\ QQ== --location --silent --head --request GET https://ghcr.io/v2/homebrew/core/openjdk/manifests/17.0.1_1
Already downloaded: /Users/aalmiray/Library/Caches/Homebrew/downloads/3b1b62cfad844ff54529068a2fb6ce6454afcb241b5052fc130c7d1fecfb9b33--openjdk-17.0.1_1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/blobs/sha256:75ee17c1331022fa8bf1e63f00fe903f23fe31d3a09021117d46b5f6ed1e26e1
/usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/3.3.11-103-g768b172\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 11.6.2\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --header Authorization:\ Bearer\ QQ== --location --silent --head --request GET https://ghcr.io/v2/homebrew/core/openjdk/blobs/sha256:75ee17c1331022fa8bf1e63f00fe903f23fe31d3a09021117d46b5f6ed1e26e1
Already downloaded: /Users/aalmiray/Library/Caches/Homebrew/downloads/bdb0a9271915e9c16093867de598df9d7561fb674784c66599d7f2d6a3b81cc1--openjdk--17.0.1_1.big_sur.bottle.tar.gz
==> Verifying checksum for 'bdb0a9271915e9c16093867de598df9d7561fb674784c66599d7f2d6a3b81cc1--openjdk--17.0.1_1.big_sur.bottle.tar.gz'
/usr/local/Homebrew/Library/Homebrew/shims/shared/git --version
==> Pouring openjdk--17.0.1_1.big_sur.bottle.tar.gz
tar --extract --no-same-owner --file /Users/aalmiray/Library/Caches/Homebrew/downloads/bdb0a9271915e9c16093867de598df9d7561fb674784c66599d7f2d6a3b81cc1--openjdk--17.0.1_1.big_sur.bottle.tar.gz --directory /private/tmp/d20220123-13309-15v3n10
cp -pR /private/tmp/d20220123-13309-15v3n10/openjdk/. /usr/local/Cellar/openjdk
chmod -Rf +w /private/tmp/d20220123-13309-15v3n10
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libattach.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libattach.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libattach.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libawt.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libawt.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libawt.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libawt_lwawt.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libawt_lwawt.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libawt_lwawt.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libdt_socket.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libdt_socket.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libdt_socket.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libextnet.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libextnet.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libextnet.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libfontmanager.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libfontmanager.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libfontmanager.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libfreetype.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libfreetype.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libfreetype.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libinstrument.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libinstrument.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libinstrument.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libj2gss.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libj2gss.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libj2gss.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libj2pcsc.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libj2pcsc.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libj2pcsc.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libj2pkcs11.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libj2pkcs11.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libj2pkcs11.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libjaas.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjaas.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjaas.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libjava.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjava.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjava.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libjavajpeg.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjavajpeg.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjavajpeg.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libjawt.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjawt.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjawt.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libjdwp.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjdwp.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjdwp.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libjimage.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjimage.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjimage.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libjli.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjli.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjli.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libjsig.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjsig.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjsig.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libjsound.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjsound.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libjsound.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/liblcms.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/liblcms.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/liblcms.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libmanagement.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libmanagement.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libmanagement.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libmanagement_agent.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libmanagement_agent.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libmanagement_agent.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libmanagement_ext.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libmanagement_ext.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libmanagement_ext.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libmlib_image.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libmlib_image.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libmlib_image.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libnet.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libnet.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libnet.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libnio.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libnio.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libnio.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libosx.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libosx.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libosx.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libosxapp.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libosxapp.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libosxapp.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libosxkrb5.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libosxkrb5.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libosxkrb5.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libosxsecurity.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libosxsecurity.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libosxsecurity.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libosxui.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libosxui.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libosxui.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libprefs.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libprefs.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libprefs.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/librmi.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/librmi.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/librmi.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libsaproc.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libsaproc.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libsaproc.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libsplashscreen.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libsplashscreen.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libsplashscreen.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libsyslookup.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libsyslookup.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libsyslookup.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libverify.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libverify.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libverify.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/libzip.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libzip.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/libzip.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/server/libjsig.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/server/libjsig.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/server/libjsig.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home/lib/server/libjvm.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/server/libjvm.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/server/libjvm.dylib
==> Changing dylib ID of /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/MacOS/libjli.dylib
from @@HOMEBREW_PREFIX@@/opt/openjdk/libexec/openjdk.jdk/Contents/MacOS/libjli.dylib
to /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/MacOS/libjli.dylib
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromPathLoader): loading /usr/local/opt/openjdk/.brew/openjdk.rb
==> Caveats
For the system Java wrappers to find this JDK, symlink it with
sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
openjdk is keg-only, which means it was not symlinked into /usr/local,
because macOS provides similar software and installing this software in
parallel can cause all kinds of trouble.
If you need to have openjdk first in your PATH, run:
echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> /Users/aalmiray/.bash_profile
For compilers to find openjdk you may need to set:
export CPPFLAGS="-I/usr/local/opt/openjdk/include"
==> Summary
🍺 /usr/local/Cellar/openjdk/17.0.1_1: 639 files, 305.2MB
==> Running `brew cleanup openjdk`...
Do you pass -headerpad_max_install_names
to the linker when building your Java runtime?
We could perhaps skip
@rpath
IDs, though the effect it may have on the formulae we ship would need careful testing and in practice doesn't have much benefits given everything Homebrew installs lies under one prefix.
This was tried previously and broke some things, and was reverted afterward. It can be fixed with -rpath
flags, but I'm pretty sure this will leave many users confused about why they need these flags now but didn't use to.
As a workaround, you can carry around something like this in post_install
to undo relocation:
https://github.com/Homebrew/homebrew-core/commit/458380086f90b4ebc90f0d5d40b0d7e1fad06657
Do you pass
-headerpad_max_install_names
to the linker when building your Java runtime?
I think that's not an option you can call from jlink
$ jlink -h
Usage: jlink <options> --module-path <modulepath> --add-modules <module>[,<module>...]
Possible options include:
--add-modules <mod>[,<mod>...] Root modules to resolve
--bind-services Link in service provider modules and
their dependences
-c, --compress=<0|1|2> Enable compression of resources:
Level 0: No compression
Level 1: Constant string sharing
Level 2: ZIP
--disable-plugin <pluginname> Disable the plugin mentioned
--endian <little|big> Byte order of generated jimage
(default:native)
-h, --help, -? Print this help message
--ignore-signing-information Suppress a fatal error when signed
modular JARs are linked in the image.
The signature related files of the
signed modular JARs are not copied to
the runtime image.
--launcher <name>=<module>[/<mainclass>]
Add a launcher command of the given
name for the module and the main class
if specified
--limit-modules <mod>[,<mod>...] Limit the universe of observable
modules
--list-plugins List available plugins
-p, --module-path <path> Module path
--no-header-files Exclude include header files
--no-man-pages Exclude man pages
--output <path> Location of output path
--post-process-path <imagefile> Post process an existing image
--resources-last-sorter <name> The last plugin allowed to sort
resources
--save-opts <filename> Save jlink options in the given file
-G, --strip-debug Strip debug information
--suggest-providers [<name>,...] Suggest providers that implement the
given service types from the module path
-v, --verbose Enable verbose tracing
--version Version information
@<filename> Read options from file
As a workaround, you can carry around something like this in
post_install
to undo relocation:
Yes, this is what I thought would be needed. I wasn't sure what piece of code was required to make it work, thanks for the link.
Do you pass
-headerpad_max_install_names
to the linker when building your Java runtime?I think that's not an option you can call from
jlink
It is an option consumed by ld
.
-headerpad_max_install_names
Automatically adds space for future expansion of load commands such that all paths could expand to MAXPATHLEN. Only
useful if intend to run install_name_tool to alter the load commands later.
How would you use that flag then? Do I have to set it on the formula itself? I've not had the need t use ld
before so I have no idea how yo hook it up.
FWIW the post_install
snippet fixes the problem. Thanks!
brew config
outputbrew doctor
outputVerification
brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
This issue is similar to https://github.com/Homebrew/brew/issues/9526
Verified on my local environment, reported by @ApfelSaucell at https://github.com/jreleaser/jreleaser/issues/675
JReleaser's formula bundles a Java Runtime (built with Java's jlink). This results in a minimum Java runtime that may be used to launch the app without an external dependency to a Java formula. Java runtimes include
dylib
files whose ids are relocated upon install but shouldn't.What happened (include all command output)?
What did you expect to happen?
JReleaser's version should appear on the console, such as
Step-by-step reproduction instructions (by running
brew
commands)