Skip to content

Simplify indexstore .filelist creation #3144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions xcodeproj/internal/files/incremental_output_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ def _collect_incremental_output_files(
indexstores_filelist = indexstore_filelists.write(
actions = actions,
indexstore_and_target_overrides = transitive_indexstore_overrides,
indexstores = transitive_indexstores,
name = "bi",
rule_name = name,
)
Expand Down Expand Up @@ -348,7 +347,6 @@ def _collect_mixed_language_output_files(
indexstores_filelist = indexstore_filelists.write(
actions = actions,
indexstore_and_target_overrides = transitive_indexstore_overrides,
indexstores = transitive_indexstores,
name = "bi",
rule_name = name,
)
Expand Down
1 change: 0 additions & 1 deletion xcodeproj/internal/files/legacy_output_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ def _collect_legacy_output_files(
indexstores_filelist = indexstore_filelists.write(
actions = ctx.actions,
indexstore_and_target_overrides = transitive_indexstore_overrides,
indexstores = transitive_indexstores,
name = "bi",
rule_name = rule_attr.name,
)
Expand Down
27 changes: 2 additions & 25 deletions xcodeproj/internal/indexstore_filelists.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ def _write(
actions,
name,
rule_name,
indexstore_and_target_overrides,
indexstores):
indexstore_and_target_overrides):
args = actions.args()
args.use_param_file("%s", use_always = True)
args.set_param_file_format("multiline")
Expand All @@ -22,29 +21,7 @@ def _write(

output = actions.declare_file("{}-{}.filelist".format(rule_name, name))

# We make an action to copy the params file, because we want to force the
# downloading of `indexstores`. We don't want to directly place the
# `indexstores` in an output group to prevent the explosion of the BEP.
actions.run_shell(
arguments = [args, output.path],
inputs = indexstores,
outputs = [output],
command = """\
if [[ $(stat -f '%d' "$1") == $(stat -f '%d' "${2%/*}") ]]; then
cp -c "$1" "$2"
else
cp "$1" "$2"
fi
""",
mnemonic = "WriteIndexstoreFilelist",
# The action is simply a file copy, would be slower if remote.
# Same for caching in any way. Also no need for sandboxing.
execution_requirements = {
"no-cache": "1",
"no-remote": "1",
"no-sandbox": "1",
},
)
actions.write(output, args)

return output

Expand Down