Skip to content

Android cross environment isn't fully delocalised #10

Description

@freakboy3742

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Needs design

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions