diff --git a/build/fbcode_builder/getdeps/fetcher.py b/build/fbcode_builder/getdeps/fetcher.py index 102e1bc65..b27d9b91c 100644 --- a/build/fbcode_builder/getdeps/fetcher.py +++ b/build/fbcode_builder/getdeps/fetcher.py @@ -646,9 +646,10 @@ class ShipitTransformerFetcher(Fetcher): fbcode_path = [] return www_path + fbcode_path - def __init__(self, build_options, project_name) -> None: + def __init__(self, build_options, project_name, external_branch) -> None: self.build_options = build_options self.project_name = project_name + self.external_branch = external_branch self.repo_dir = os.path.join(build_options.scratch_dir, "shipit", project_name) self.shipit = None for path in ShipitTransformerFetcher._shipit_paths(build_options): @@ -679,24 +680,27 @@ class ShipitTransformerFetcher(Fetcher): if os.path.exists(tmp_path): shutil.rmtree(tmp_path) os.makedirs(os.path.dirname(tmp_path), exist_ok=True) + cmd = [ + self.shipit, + "shipit", + "--project=" + self.project_name, + "--create-new-repo", + "--source-repo-dir=" + self.build_options.fbsource_dir, + "--source-branch=.", + "--skip-source-init", + "--skip-source-pull", + "--skip-source-clean", + "--skip-push", + "--destination-use-anonymous-https", + "--create-new-repo-output-path=" + tmp_path, + ] + if self.external_branch: + cmd += [ + f"--external-branch={self.external_branch}", + ] # Run shipit - run_cmd( - [ - self.shipit, - "shipit", - "--project=" + self.project_name, - "--create-new-repo", - "--source-repo-dir=" + self.build_options.fbsource_dir, - "--source-branch=.", - "--skip-source-init", - "--skip-source-pull", - "--skip-source-clean", - "--skip-push", - "--destination-use-anonymous-https", - "--create-new-repo-output-path=" + tmp_path, - ] - ) + run_cmd(cmd) # Remove the .git directory from the repository it generated. # There is no need to commit this. diff --git a/build/fbcode_builder/getdeps/manifest.py b/build/fbcode_builder/getdeps/manifest.py index 5cec33aab..b1b25cd37 100644 --- a/build/fbcode_builder/getdeps/manifest.py +++ b/build/fbcode_builder/getdeps/manifest.py @@ -49,6 +49,7 @@ SCHEMA = { "shipit_project": OPTIONAL, "shipit_fbcode_builder": OPTIONAL, "use_shipit": OPTIONAL, + "shipit_external_branch": OPTIONAL, }, }, "dependencies": {"optional_section": True, "allow_values": False}, @@ -428,7 +429,11 @@ class ManifestParser(object): and real_shipit_available ): # We can use the code from fbsource - return ShipitTransformerFetcher(build_options, self.shipit_project) + return ShipitTransformerFetcher( + build_options, + self.shipit_project, + self.get("manifest", "shipit_external_branch"), + ) # If both of these are None, the package can only be coming from # preinstalled toolchain or system packages diff --git a/build/fbcode_builder/manifests/meta-python-3.12 b/build/fbcode_builder/manifests/meta-python-3.12 new file mode 100644 index 000000000..a216c036f --- /dev/null +++ b/build/fbcode_builder/manifests/meta-python-3.12 @@ -0,0 +1,17 @@ +# This is primarily to support CinderX, so it's not heavily configured. + +[manifest] +name = meta-python-3.12 +fbsource_path = third-party/python/3.12 +shipit_project = facebookincubator/cinder +shipit_fbcode_builder = false +shipit_external_branch = meta/3.12 + +[git] +repo_url = https://github.com/facebookincubator/cinder.git#meta/3.12 + +[build] +builder = autoconf + +[shipit.pathmap] +third-party/python/3.12 = .