Skip to content

fix(android): make the android tree usable from non-Windows clones - #134

Merged
linyubupa merged 3 commits into
mainfrom
fix/linux-host
Oct 10, 2026
Merged

linyubupa merged 3 commits into
mainfrom
fix/linux-host

Conversation

@alexyzhou

Copy link
Copy Markdown
Collaborator

Problem

Two host-portability breaks make android/ unbuildable from any Linux/macOS clone, and
both bite before a single line of project code runs:

  1. android/gradlew is committed as mode 100644 while android/gradlew.bat is 100755.
    README 1.3 tells the reader to run ./gradlew :app:assembleDebug; on Linux/macOS that is
    permission denied, exit code 126, with Gradle never starting.
  2. android/tools/llama/build_vendor_libs.sh resolves the monorepo root with pwd -W, a
    Git-Bash (MSYS) only form. On other POSIX shells the builtin rejects -W, the command
    substitution returns non-zero, and set -euo pipefail aborts at the depot line -
    silently, with no log output, so it reads as "the script is broken" rather than
    "wrong host".

Changes

  • Set the exec bit on android/gradlew in the index, not just on disk: a local chmod
    leaves the next clone exactly as broken as this one. The repo already tracks modes
    (ios/scripts/test.sh, macos/scripts/*.sh, python/scripts/fetch_models.py are all
    100755), so this is a missing bit rather than a policy change.
  • DEPOT=${EDGE0_DEPOT:-$(cd "$REPO/.." && { pwd -W 2>/dev/null || pwd -P; })} - Git-Bash
    semantics untouched (the -W form wins wherever it exists), other hosts get the resolved
    path, and EDGE0_DEPOT still overrides but is no longer required to be exported.
  • docs(android): host unit-test count 26 -> 32 in all five language copies.

Alex Zhou added 3 commits October 10, 2026 16:47
`git ls-files -s android/gradlew` reports 100644 while android/gradlew.bat is
100755: the android subtree was authored on Windows, where core.fileMode is
off, so the POSIX launcher shipped without its mode. README 1.3 tells every
reader to run `./gradlew :app:assembleDebug`, and on Linux/macOS that dies
with "permission denied" (rc=126) before Gradle even starts.

The bit is set in the index, not just on disk - chmod alone leaves the next
clone broken. The repo already tracks modes elsewhere (ios/scripts/test.sh,
macos/scripts/*.sh, python/scripts/fetch_models.py are all 100755), so this
is a missing bit rather than a policy change.
build_vendor_libs.sh derives the monorepo root with `pwd -W`, which only
exists in Git-Bash. On Linux/macOS the builtin rejects -W, the command
substitution returns non-zero, and `set -euo pipefail` aborts at the depot
line - silently, with no log output, which reads as a broken script rather
than a host-portability gap.

`{ pwd -W 2>/dev/null || pwd -P; }` leaves Git-Bash semantics untouched (the
-W form wins wherever it exists) and gives other POSIX hosts the resolved
path. EDGE0_DEPOT still overrides, but it is no longer required to be
exported: relying on a shell variable hides the regression from everyone
whose shell does not set it.

Verified on Linux with EDGE0_DEPOT unset: the depot root resolves and
vendor.llama.pin is visible from it.
`./gradlew :app:testDebugUnitTest` runs 32 tests here, not 26:
counting @test under app/src/test gives 32 in this tree (and in the
android source the release is cut from). The instrumented figure on the
line above it is accurate - app/src/androidTest carries exactly 8 @test
methods - so only the host-side number was stale.

Fixed across all five language copies so they do not drift apart.
@linyubupa
linyubupa merged commit dc16b45 into main Oct 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants