beeware / beeware/xbuild

Android cross environment isn't fully delocalised

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
12
Forks
5
Avg merge
2h 20m
Merged PRs (30d)
3

Description

### Describe the bug

The `xvenv` environment created for Android contains definitions for CC and other build tools that reference the full path to `ANDROID_HOME` on the machine where Python was built.

### Steps to reproduce

1. Create and activate an Android xvenv
2. Run `python -c "import sysconfig; print(sysconfig.get_config_var('CC'))"
3. See a path like `/Users/msmith/Library/Android/sdk/ndk/27.2.12479018/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang`, even if you're not msmith.

### Expected behavior

Portions of the sysconfig file that include references to the build machine (especially `ANDROID_HOME`) should be delocalised.

### Screenshots

_No response_

### Environment

- Operating System: Any (but targing Android)
- Python version: 3.13.5
- Software versions:
- xbuild: 0.2.0

### Logs

```

```

### Additional context

`cibuildwheel` avoids this by invoking `android_env.sh` to set variables in the Android environment. It may be appropriate for `xbuild` to do the same - although it's unclear where that environmental configuration would be applied.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the Android xvenv generates its sysconfig definitions and how the build-machine ANDROID_HOME path enters CC and related build-tool settings. Compare the approach with cibuildwheel's android_env.sh handling; done means an Android xvenv no longer embeds machine-specific paths, including the reported CC value.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, python
Domain
build-system, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.