Homebrew / homebrew-core

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

[glew] glewinfo binary doesn't have @rpath #28416

Closed T045T closed 6 years ago

T045T commented 6 years ago

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.

glew comes with glewinfo, which reports availability of OpenGL features.

Installing glew on High Sierra and running glewinfo looks like this:

$ brew update
Updated Homebrew from 67db701ae to 315ccf604.
Updated 2 taps (homebrew/core, homebrew/cask).
==> Updated Formulae
...

$ brew install glew
==> Downloading https://homebrew.bintray.com/bottles/glew-2.1.0.high_sierra.bottle.tar.gz
Already downloaded: /Users/nilsberg/Library/Caches/Homebrew/glew-2.1.0.high_sierra.bottle.tar.gz
==> Pouring glew-2.1.0.high_sierra.bottle.tar.gz
🍺  /Users/nilsberg/brew/Cellar/glew/2.1.0: 38 files, 3MB

$ which glewinfo
/Users/nilsberg/brew/bin/glewinfo

$ glewinfo
dyld: Library not loaded: @rpath/libGLEW.2.1.dylib
  Referenced from: /Users/nilsberg/brew/bin/glewinfo
  Reason: image not found
fish: 'glewinfo' terminated by signal SIGABRT (Abort)

The problem seems to be that libGLEW is referenced via @rpath, but otool -l glewinfo confirms that there is not @rpath definition in the executable. I've put that into a gist together with the output of brew config and brew doctor

I was able to manually add the missing @rpath to the binary using install_name_tool:

sudo install_name_tool -add_rpath ~/brew/Cellar/glew/2.1.0/lib/ ~/brew/Cellar/glew/2.1.0/bin/glewinfo

With that change, glewinfo works.

I confirmed that manually building glew from the tarball in the Formula yields a glewinfo binary with correct @rpath.

brew install -s glew produces a binary without @rpath, though.

Unrelated to this particular issue, brew install --HEAD glew fails completely (gist with logs):

$ brew install --HEAD glew

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.

==> Installing dependencies for glew: cmake
==> Installing glew dependency: cmake
==> Downloading https://homebrew.bintray.com/bottles/cmake-3.11.2.high_sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/8a/8a9b3ee8dc353de7231f972db6d02317d1cad18bb77a55e130ab38b366ef94e9?__gda__=exp=1527592826~hmac=58d9d4d0387df06d527f8223accda173c8c8883df99ad6f4c69c8573b5e91055
######################################################################## 100.0%
==> Pouring cmake-3.11.2.high_sierra.bottle.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
  /Users/nilsberg/brew/share/emacs/site-lisp/cmake
==> Summary
🍺  /Users/nilsberg/brew/Cellar/cmake/3.11.2: 2,363 files, 32.7MB
==> Installing glew --HEAD
==> Cloning https://github.com/nigels-com/glew.git
Cloning into '/Users/nilsberg/Library/Caches/Homebrew/glew--git'...
remote: Counting objects: 321, done.
remote: Compressing objects: 100% (280/280), done.
remote: Total 321 (delta 72), reused 103 (delta 39), pack-reused 0
Receiving objects: 100% (321/321), 214.12 KiB | 346.00 KiB/s, done.
Resolving deltas: 100% (72/72), done.
==> Checking out branch master
==> cmake ./cmake -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/Users/nilsberg/brew/Cellar/glew/HEAD-e544f8c -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAS
Last 15 lines from /Users/nilsberg/Library/Logs/Homebrew/glew/01.cmake:

CMake Error at CMakeLists.txt:169 (add_executable):
  No SOURCES given to target: glewinfo

CMake Error at CMakeLists.txt:99 (add_library):
  No SOURCES given to target: glew_s

CMake Error at CMakeLists.txt:95 (add_library):
  No SOURCES given to target: glew

-- Build files have been written to: /tmp/glew-20180529-24437-temno0/build

READ THIS: https://docs.brew.sh/Troubleshooting
T045T commented 6 years ago

Ping?

I'm new to using this issue template - do you wait for all the boxes in the template to be checked? Because I left those that do not apply to this issue unchecked, but I feel it is complete nonetheless.

stale[bot] commented 6 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.