Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-37768

cbc binary fails no working @rpath on OS-X and macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.5.1
    • 6.5.0
    • build
    • MacOS 10.11.6 “OS X El Capitan” and MacOS 10.14.5 “Mojave”

      couchbase-server-enterprise_6.5.0-macos_x86_64.dmg (for 10.14.5)
      couchbase-server-enterprise_6.0.3-macos_x86_64.zip (for 10.11.6)
    • Untriaged
    • 2
    • Unknown
    • Build Team 2020 Sprint 5

    Description

      Overview

      Asfter installing on a Mac, every cbc tool (cbc and all the names symbolically to cbc) will not work due to a @rpath issue as such none of them work after install

      cd /Applications/Couchbase\ Server.app/Contents/Resources/couchbase-core/bin
      cbc -h
      dyld: Library not loaded: @rpath/libcouchbase.2.dylib

      A quick fix to currently installed Mac deployments (should be in release notes)

      A simple fix for both MacOS 10.11.6 “OS X El Capitan” and MacOS 10.14.5 “Mojave” can be made as follows:

       

      cd /Applications/Couchbase\ Server.app/Contents/Resources/couchbase-core/bin
      install_name_tool -add_rpath @executable_path/../lib cbc
      

       

      Note, install_name_tool seems to be part of the standard MacOS 10.14.5 “Mojave”, however for my MacOS 10.11.6 “OS X El Capitan” it was missing but it gave me a prompt and auto installed for me.

      The cbc command now works as expected e.g.

      ./cbc create SampleDocument2 -V '{"a_key": "a_value"}' -U couchbase://localhost/source -u Administrator -P password --expiry=600
      SampleDocument2 Stored. CAS=0x15ef61cb1c080000

      Details on what and why I did the above to fix the @rpath issue can be found at: https://blog.krzyzanowskim.com/2018/12/05/rpath-what/

      The proper solution (build the cbc binary right).

      If we deliver 'cbc' and it's symbolically linked tool set (cbc-touch, cbc-cat, etc.) then the binaries should be built correctly in the first place so that 'cbc' just works right after install. 

      This shouldn't be hard as other executables like  couch_dbdump are built correctly the difference cann be seen via 'otool -l':

       

      otool -l cbc | grep executable_path
      install_name_tool -add_rpath @executable_path/../lib cbc
      otool -l cbc | grep executable_path
               path @executable_path/../lib (offset 12)
      otool -l couch_dbdump | grep executable_path
               path @executable_path/../lib (offset 12)
      

       

       

       

       

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              jon.strabala Jon Strabala
              jon.strabala Jon Strabala
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty