Skip to content

Conversation

jszumski
Copy link
Contributor

@jszumski jszumski commented Apr 23, 2025

Fix argument length errors by switching WriteSwiftDebugSettings to use a param file when needed.

Previously when generating a very large project with 7000+ targets:

ERROR: /private/var/tmp/_bazel_jszumski/399f2da8a1f92cab020446a488e7bec6/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj_generated/generator/tools/rules/xcodeproj/bazel-project/BUILD:12:10: Generating bazel-project.xcodeproj Debug-swift_debug_settings.py failed: (Exit -1): universal_swift_debug_settings failed: error executing WriteSwiftDebugSettings command (from target @@rules_xcodeproj_generated//generator/tools/rules/xcodeproj/bazel-project:bazel-project) 
  (cd /private/var/tmp/_bazel_jszumski/399f2da8a1f92cab020446a488e7bec6/rules_xcodeproj.noindex/build_output_base/execroot/register && \
  exec env - \
  bazel-out/darwin_x86_64-opt-exec-macos-x86_64-min13.0-applebin_macos-ST-5b758c1c0c80/bin/external/rules_xcodeproj/tools/generators/swift_debug_settings/universal_swift_debug_settings 1 {...lots of pairs here...}
# Configuration: 794c86670c8dbf3648f6dfd018247dc9402b8c0a923a1790920ea9bf34028e6a
# Execution platform: @@internal_platforms_do_not_use//host:host
Action failed to execute: java.io.IOException: Cannot run program "/var/tmp/_bazel_jszumski/install/fd0e803cd377e5d6c999b9f309de8848/process-wrapper" (in directory "/private/var/tmp/_bazel_jszumski/399f2da8a1f92cab020446a488e7bec6/rules_xcodeproj.noindex/build_output_base/execroot/register"): error=7, Argument list too long

@jszumski jszumski force-pushed the jszumski/fix-swift-debug-settings-arg-length branch from 22062a6 to 73f2ec3 Compare April 23, 2025 19:33
@jszumski jszumski marked this pull request as ready for review April 23, 2025 19:54
@jszumski jszumski requested a review from a team as a code owner April 23, 2025 19:54
Copy link
Contributor

@thiagohmcruz thiagohmcruz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this affect tests/fixtures in any way? If not should we add one?

@jszumski
Copy link
Contributor Author

jszumski commented Apr 23, 2025

Does this affect tests/fixtures in any way? If not should we add one?

Nope, it's conditional based on the specific args:

Bazel will decide whether the arguments need to be spilled based on your system and arg length.

I'm happy to add a test but I couldn't find an example of any other param file call site that had one.

@jszumski jszumski requested a review from brentleyjones April 24, 2025 13:26
@brentleyjones brentleyjones enabled auto-merge (squash) May 7, 2025 15:05
@brentleyjones brentleyjones force-pushed the jszumski/fix-swift-debug-settings-arg-length branch from 73f2ec3 to 8b14f20 Compare May 7, 2025 15:05
@brentleyjones brentleyjones merged commit 8fac6d1 into main May 7, 2025
12 checks passed
@brentleyjones brentleyjones deleted the jszumski/fix-swift-debug-settings-arg-length branch May 7, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants