bazel-ios / rules_ios

Bazel rules for building iOS applications and frameworks
Apache License 2.0
276 stars 84 forks source link

`raise Exception(f"failed to clonefile {src} to {full_dest}")` when using a specific combination of `apple_framework_packaging` and `link_dynamic = True` #851

Closed thiagohmcruz closed 5 months ago

thiagohmcruz commented 5 months ago

This is a bit 🤯 but hit this internally and managed to get it to repro in rules_ios:

You'll hit this err:

ERROR: /Users/thiago/Development/rules_ios/tests/ios/app/BUILD.bazel:273:14: Bundling, processing and signing TestAppWithInfoPlist.__internal__.__test_bundle failed: (Exit 1): bundletool_experimental failed: error executing command (from target //tests/ios/app:TestAppWithInfoPlist.__internal__.__test_bundle) 
  (cd /private/var/tmp/_bazel_thiago/122885c1fe4a2c6ed7635584956dfc9d/execroot/_main && \
  exec env - \
    APPLE_SDK_PLATFORM=iPhoneSimulator \
    APPLE_SDK_VERSION_OVERRIDE=17.2 \
    XCODE_VERSION_OVERRIDE=15.1.0.15C65 \
  bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-5a29d6cb7794/bin/external/rules_apple~3.1.1/tools/bundletool/bundletool_experimental bazel-out/ios-sim_arm64-min12.0-applebin_ios-ios_sim_arm64-dbg-ST-583c107f4262/bin/tests/ios/app/TestAppWithInfoPlist.__internal__.__test_bundle-intermediates/bundletool_control.json)
# Configuration: 2aae2c8b6c9a86c2bcbecbffdf541d35bd1e3ea9614340c49e0de0b26ab2c255
# Execution platform: @local_config_platform//:host
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_thiago/122885c1fe4a2c6ed7635584956dfc9d/execroot/_main/bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-5a29d6cb7794/bin/external/rules_apple~3.1.1/tools/bundletool/bundletool_experimental.runfiles/rules_apple~3.1.1/tools/bundletool/bundletool_experimental.py", line 310, in <module>
    _main(sys.argv[1])
  File "/private/var/tmp/_bazel_thiago/122885c1fe4a2c6ed7635584956dfc9d/execroot/_main/bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-5a29d6cb7794/bin/external/rules_apple~3.1.1/tools/bundletool/bundletool_experimental.runfiles/rules_apple~3.1.1/tools/bundletool/bundletool_experimental.py", line 302, in _main
    bundler.run()
  File "/private/var/tmp/_bazel_thiago/122885c1fe4a2c6ed7635584956dfc9d/execroot/_main/bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-5a29d6cb7794/bin/external/rules_apple~3.1.1/tools/bundletool/bundletool_experimental.runfiles/rules_apple~3.1.1/tools/bundletool/bundletool_experimental.py", line 138, in run
    self._add_files(f['src'], f['dest'], f.get('executable', False),
  File "/private/var/tmp/_bazel_thiago/122885c1fe4a2c6ed7635584956dfc9d/execroot/_main/bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-5a29d6cb7794/bin/external/rules_apple~3.1.1/tools/bundletool/bundletool_experimental.runfiles/rules_apple~3.1.1/tools/bundletool/bundletool_experimental.py", line 170, in _add_files
    self._copy_file(fsrc, fdest, executable, bundle_root)
  File "/private/var/tmp/_bazel_thiago/122885c1fe4a2c6ed7635584956dfc9d/execroot/_main/bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-5a29d6cb7794/bin/external/rules_apple~3.1.1/tools/bundletool/bundletool_experimental.runfiles/rules_apple~3.1.1/tools/bundletool/bundletool_experimental.py", line 226, in _copy_file
    raise Exception(f"failed to clonefile {src} to {full_dest}")
Exception: failed to clonefile bazel-out/ios-sim_arm64-min12.0-applebin_ios-ios_sim_arm64-dbg-ST-674860435576/bin/tests/ios/app/FW.framework/FW to bazel-out/ios-sim_arm64-min12.0-applebin_ios-ios_sim_arm64-dbg-ST-583c107f4262/bin/tests/ios/app/TestAppWithInfoPlist.__internal__.__test_bundle_archive-root/TestAppWithInfoPlist.xctest/Frameworks/FW.framework/FW
Target //tests/ios/app:TestAppWithInfoPlist failed to build

Notes:

Still investigating but any insights appreciated.

thiagohmcruz commented 5 months ago

If I rebase the repro branch the issue is gone 🤔 (🎉 ?). It was a couple of commits behind so maybe the latest transitions related changes have fixed it in master.

thiagohmcruz commented 5 months ago

Closing this as it's not happening in main anymore.