code: def _compile(f_create, text, output):
      with tempfile.TemporaryDirectory() as temp_dir:
          src_path = os.path.join(temp_dir, "src.cpp")
          with open(src_path, "w", encoding="utf-8") as file:
              file.write(_src_gen(text))
          log_path = os.path.join(temp_dir, "log.txt")
          ccache_env = {
              "CCACHE_COMPILERCHECK": "content",
              "CCACHE_LOGFILE": log_path,
          }
          f_create(
              output,
              ["src.cpp"],
              ["-c"],
              cwd=temp_dir,
              ccache_env=ccache_env,
          )
          with open(log_path, "r", encoding="utf-8") as file:
              log = file.read()
          return log
  
file_path: tvm/tests/python/contrib/test_ccache.py
imports: import os
  import pytest
  import shutil
  import tempfile
  import tvm
  from tvm.contrib.cc import create_shared, create_executable, _is_linux_like, _is_windows_like
label_desc: Use image node_id 2 for calling a global function with example usage: _compile(f_create, text, output) and returns: log