<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compile_compiler_bridge(self, context):
 """Compile the compiler bridge to be used by zinc, using our scala bootstrapper. It will compile and cache the jar, and materialize it if not already there. :param context: The context of the task trying to compile the bridge. This is mostly needed to use its scheduler to create digests of the relevant jars. :return: The absolute path to the compiled scala-compiler-bridge jar. """

    bridge_jar_name = 'scala-compiler-bridge.jar'
    bridge_jar = os.path.join(self._compiler_bridge_cache_dir, bridge_jar_name)
    global_bridge_cache_dir = os.path.join(self._zinc_factory.get_options().pants_bootstrapdir, fast_relpath(self._compiler_bridge_cache_dir,  self._workdir()))
    globally_cached_bridge_jar = os.path.join(global_bridge_cache_dir, bridge_jar_name)

    # Workaround to avoid recompiling the bridge for every integration test
    # We check the bootstrapdir (.cache) for the bridge.
    # If it exists, we make a copy to the buildroot.
    #
    # TODO Remove when action caches are implemented.
    if os.path.exists(globally_cached_bridge_jar):
      # Cache the bridge jar under buildroot, to allow snapshotting
      safe_mkdir(self._relative_to_buildroot(self._compiler_bridge_cache_dir))
      safe_hardlink_or_copy(globally_cached_bridge_jar, bridge_jar)

    if not os.path.exists(bridge_jar):
      res = self._run_bootstrapper(bridge_jar, context)
      context._scheduler.materialize_directories((
        DirectoryToMaterialize(get_buildroot(), res.output_directory_digest),
      ))
      # For the workaround above to work, we need to store a copy of the bridge in
      # the bootstrapdir cache (.cache).
      safe_mkdir(global_bridge_cache_dir)
      safe_hardlink_or_copy(bridge_jar, globally_cached_bridge_jar)

      return ClasspathEntry(bridge_jar, res.output_directory_digest)
    else:
      bridge_jar_snapshot = context._scheduler.capture_snapshots((PathGlobsAndRoot(
        PathGlobs((self._relative_to_buildroot(bridge_jar),)),
        text_type(get_buildroot())
      ),))[0]
      bridge_jar_digest = bridge_jar_snapshot.directory_digest
      return ClasspathEntry(bridge_jar, bridge_jar_digest)