GenerateAppleSymbolsFile fails with permission error

Open
#2,027 11 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
32/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Domain
build-system

Research direction

Start at apple/internal/intermediates.bzl around line 43, where actions.declare_directory is used, and reproduce the repeated CI build with +output_groups=dsym. Inspect the permissions of symbols_output and the generated .symbols path across repeated builds. Done means identifying why the declared directory becomes read-only and ensuring GenerateAppleSymbolsFile can write its output.

Written by the indexing model from the issue text.

Description

I'm running a build with +output_groups=dsym and in some conditions in CI, the build fails with the following error:

Failed to write bazel-out/applebin_ios-ios_arm64-opt-ST-55c05c3eeee9/bin/XXXXXXXXXXXX.framework-intermediates/symbols_output/0D911365-E3B1-37ED-AFC6-D4FBB0160CB1.symbols: You don’t have permission to save the file “0D911365-E3B1-37ED-AFC6-D4FBB0160CB1.symbols” in the folder “symbols_output”.

When looking at the directory, it is indeed read-only but I'm failing to understand why actions.declare_directory from https://github.com/bazelbuild/rules_apple/blob/96fa885dd8310ddc65289e590f31d1f3b25f46d9/apple/internal/intermediates.bzl#L43 fails to give the rule a directory that can be written to.

This happens when running the same build multiple times, I'll try to find a sure way to reproduce it, but would be happy to get any insight in the meantime if you have any.

Dominant language
Starlark
Stars
600
Forks
354
Avg merge
2d 7h
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bazelbuild/rules_apple

All issues in bazelbuild/rules_apple

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.