From 3573a0587cad010b97e7a9f6d19fbdf4ab53d6c8 Mon Sep 17 00:00:00 2001 From: Mark Shroyer Date: Wed, 22 Feb 2023 18:50:08 -0800 Subject: [PATCH] Only upload cached projects with built_marker (#4087) Summary: X-link: https://github.com/facebookincubator/velox/pull/4087 Under some circumstances, getdeps can cache a project artifact where there is no built_marker, forcing the script to re-build the artifact from source. After D43260530 (https://github.com/facebook/proxygen/commit/47dde7c2490569fc262f8a1708ad670051e46c6a) this no longer causes a build failure, but it can still make builds take longer than they should. This ensures we only cache artifacts with a built_marker, so that they aren't overwritten by artifacts without. Reviewed By: genevievehelsel Differential Revision: D43405855 fbshipit-source-id: b1b9e194e642fa820d0fbc54a7c15ff81fc90a82 --- build/fbcode_builder/getdeps.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build/fbcode_builder/getdeps.py b/build/fbcode_builder/getdeps.py index a500e5c77..eb08ab096 100755 --- a/build/fbcode_builder/getdeps.py +++ b/build/fbcode_builder/getdeps.py @@ -631,12 +631,15 @@ class BuildCmd(ProjectCmdBase): # set the built_marker. This allows subsequent runs of getdeps.py # for the project to run with different cmake_targets to trigger # cmake + has_built_marker = False if not (m == manifest and args.cmake_target != "install"): with open(built_marker, "w") as f: f.write(project_hash) + has_built_marker = True - # Only populate the cache from continuous build runs - if args.schedule_type == "continuous": + # Only populate the cache from continuous build runs, and + # only if we have a built_marker. + if args.schedule_type == "continuous" and has_built_marker: cached_project.upload() elif args.verbose: print("found good %s" % built_marker)