Skip to content

Commit

Permalink
enabling sccache
Browse files Browse the repository at this point in the history
  • Loading branch information
MyroTk committed Oct 10, 2023
1 parent f040635 commit 772f55f
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions tests/ci/build_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_packager_cmd(
output_path: Path,
build_version: str,
image_version: str,
ccache_path: str,
sccache_directory: str,
official: bool,
) -> str:
package_type = build_config["package_type"]
Expand All @@ -88,8 +88,8 @@ def get_packager_cmd(
cmd += " --clang-tidy"

# NOTE(vnemkov): we are going to continue to use ccache for now
cmd += " --cache=ccache"
cmd += f" --ccache-dir={ccache_path}"
cmd += " --cache=sccache"
cmd += f" --s3-directory={sccache_directory}"
cmd += " --s3-rw-access"
cmd += f" --s3-bucket={S3_BUILDS_BUCKET}"

Expand Down Expand Up @@ -345,28 +345,30 @@ def main():
# NOTE(vnemkov): since we still want to use CCACHE over SCCACHE, unlike upstream,
# we need to create local directory for that, just as with 22.8
ccache_path = os.path.join(CACHES_PATH, build_name + "_ccache")

logging.info("Will try to fetch cache for our build")
try:
get_ccache_if_not_exists(
ccache_path, s3_helper, pr_info.number, TEMP_PATH, pr_info.release_pr
)
except Exception as e:
# In case there are issues with ccache, remove the path and do not fail a build
logging.info("Failed to get ccache, building without it. Error: %s", e)
rmtree(ccache_path, ignore_errors=True)

if not os.path.exists(ccache_path):
logging.info("cache was not fetched, will create empty dir")
os.makedirs(ccache_path)
sccache_directory = pr_info.number

# Remove for sccache
# logging.info("Will try to fetch cache for our build")
# try:
# get_ccache_if_not_exists(
# ccache_path, s3_helper, pr_info.number, TEMP_PATH, pr_info.release_pr
# )
# except Exception as e:
# # In case there are issues with ccache, remove the path and do not fail a build
# logging.info("Failed to get ccache, building without it. Error: %s", e)
# rmtree(ccache_path, ignore_errors=True)

# if not os.path.exists(ccache_path):
# logging.info("cache was not fetched, will create empty dir")
# os.makedirs(ccache_path)

packager_cmd = get_packager_cmd(
build_config,
os.path.join(REPO_COPY, "docker/packager"),
build_output_path,
version.string,
image_version,
ccache_path,
sccache_directory,
official_flag,
)

Expand Down Expand Up @@ -394,8 +396,9 @@ def main():
sys.exit(1)

# Upload the ccache first to have the least build time in case of problems
logging.info("Will upload cache")
upload_ccache(ccache_path, s3_helper, pr_info.number, TEMP_PATH)
# Disabling ccache upload
# logging.info("Will upload cache")
# upload_ccache(ccache_path, s3_helper, pr_info.number, TEMP_PATH)

# FIXME performance
performance_urls = []
Expand Down

0 comments on commit 772f55f

Please sign in to comment.