From 9eacb33825950a5db6518466b9a37eacef0ca009 Mon Sep 17 00:00:00 2001 From: vraspar Date: Thu, 1 Aug 2024 13:01:41 -0700 Subject: [PATCH] Refactor build_and_assemble_apple_pods.py for debugging --- .../ci_build/github/apple/build_and_assemble_apple_pods.py | 6 ++++++ tools/ci_build/github/apple/build_apple_framework.py | 7 +++++++ tools/ci_build/github/apple/c/assemble_c_pod_package.py | 4 ++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/apple/build_and_assemble_apple_pods.py b/tools/ci_build/github/apple/build_and_assemble_apple_pods.py index 5014ba11d983d..24a50048302a6 100755 --- a/tools/ci_build/github/apple/build_and_assemble_apple_pods.py +++ b/tools/ci_build/github/apple/build_and_assemble_apple_pods.py @@ -116,6 +116,9 @@ def main(): run(build_apple_framework_args) + print("framework Out" : str (build_dir / "framework_out")) + run(["ls", "-LR", str(build_dir / "framework_out")]) + if args.test: test_apple_packages_args = [ sys.executable, @@ -148,6 +151,9 @@ def main(): package_variant=package_variant, ) + print("C pod dir:", c_pod_staging_dir) + run(["ls", "-LR", str(c_pod_staging_dir)]) + if args.test: test_c_pod_args = ["pod", "lib", "lint", "--verbose"] diff --git a/tools/ci_build/github/apple/build_apple_framework.py b/tools/ci_build/github/apple/build_apple_framework.py index b92baa3da6872..4dc8f62b63a02 100644 --- a/tools/ci_build/github/apple/build_apple_framework.py +++ b/tools/ci_build/github/apple/build_apple_framework.py @@ -216,6 +216,13 @@ def _build_package(args): subprocess.run(build_xcframework_cmd, shell=False, check=True, cwd=REPO_DIR) + # For debugging + print("XCFramework dir:" , xcframework_dir) + result = subprocess.run( + ["ls", "-lR"], shell=False, check=True, cwd=xcframework_dir, stdout=subprocess.PIPE, text=True + ) + print(result.stdout) + def parse_args(): parser = argparse.ArgumentParser( diff --git a/tools/ci_build/github/apple/c/assemble_c_pod_package.py b/tools/ci_build/github/apple/c/assemble_c_pod_package.py index ca4f01cf65bd9..dc4e14872267b 100644 --- a/tools/ci_build/github/apple/c/assemble_c_pod_package.py +++ b/tools/ci_build/github/apple/c/assemble_c_pod_package.py @@ -66,8 +66,8 @@ def assemble_c_pod_package( print("Warning: staging directory already exists", file=sys.stderr) # copy the necessary files to the staging directory - shutil.copytree(framework_dir, staging_dir / framework_dir.name, dirs_exist_ok=True) - shutil.copytree(public_headers_dir, staging_dir / public_headers_dir.name, dirs_exist_ok=True) + shutil.copytree(framework_dir, staging_dir / framework_dir.name, dirs_exist_ok=True, symlinks=True) + shutil.copytree(public_headers_dir, staging_dir / public_headers_dir.name, dirs_exist_ok=True, symlinks=True) copy_repo_relative_to_dir(["LICENSE"], staging_dir) # generate the podspec file from the template