message: cxx: expose the set_lib_id function
  And extract inner function into a sibling.
diff: @@ -2114,26 +2114,23 @@ class CompilationDatabase(drake.Node):
  CompilationDatabase.Builder(self)
  -class PatchAndInstall(drake.Install):
  -
  - def execute(self):
  - if not super().execute():
  - return False
  - if os.path.islink(str(self.target.path())):
  - return True
  - if cxx_toolkit.os == drake.os.macos:
  - def set_lib_id(path):
  +def set_lib_id(path, toolkit):
  + '''Change the id of a dylib on macOS.'''
  + if toolkit.os == drake.os.macos:
  subprocess.check_output([
  'install_name_tool',
  '-id',
  '@rpath/%s' % os.path.basename(str(path)),
  str(path)])
  - def get_deps_fix_rpaths(path):
  +
  +class PatchAndInstall(drake.Install):
  +
  + def get_deps_fix_rpaths(self, path):
  os.chmod(str(path), 0o755)
  if 'dylib' in str(path):
  - set_lib_id(path)
  - if cxx_toolkit.kind is drake.cxx.GccToolkit.Kind.gcc:
  + set_lib_id(path, self.toolkit)
  + if self.toolkit.kind is drake.cxx.GccToolkit.Kind.gcc:
  otool_out = subprocess.check_output(['otool', '-L', str(path)])
  otool_lines = otool_out.decode('utf-8').strip().split('\n')
  otool_lines = [
  @@ -2160,6 +2157,11 @@ class PatchAndInstall(drake.Install):
  os.chmod(dep_file, 0o555)
  os.chmod(str(path), 0o555)
  - path = self.target.path()
  - get_deps_fix_rpaths(path)
  + def execute(self):
  + if not super().execute():
  + return False
  + if os.path.islink(str(self.target.path())):
  + return True
  + if self.toolkit.os == drake.os.macos:
  + self.get_deps_fix_rpaths(self.target.path())
  return True
  