bazelbuild / bazelbuild/rules_apple

Not compatible with `--noexperimental_python_import_all_repositories`

Open
#2,594 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
593
Forks
334
Avg merge
16h 48m
Merged PRs (30d)
9

Description

The `--noexperimental_python_import_all_repositories` setting is useful in working around https://github.com/bazelbuild/bazel/issues/14640 with the PYTHONPATH becoming too large if you have python targets with large numbers of dependencies.

But `rules_apple` does not seem to be compatible with this. Specifically, when using `apple_core_ml_library` with `--noexperimental_python_import_all_repositories`

```
ERROR:*****/BUILD:346:22: MlmodelGenerate ****/****.m failed: (Exit 1): xctoolrunner failed: error executing MlmodelGenerate command (from target //****:****.CoreML) bazel-out/darwin_arm64-opt-exec-ST-13d3ddad9198/bin/external/build_bazel_rules_apple/tools/xctoolrunner/xctoolrunner coremlc generate ... (remaining 2 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging

Traceback (most recent call last):

File "****/../build_bazel_rules_apple/tools/xctoolrunner/xctoolrunner.py", line 43, in

from tools.wrapper_common import execute

ModuleNotFoundError: No module named 'tools'
```

Contributor guide

Open the contributing guide

Research direction

Start with tools/xctoolrunner/xctoolrunner.py and the apple_core_ml_library implementation, then reproduce the failure using --noexperimental_python_import_all_repositories. Trace why the xctoolrunner invocation cannot import tools; done means the Core ML target builds successfully with that setting enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.