Skip to content

Automate bazelisk installation in proot-distro Debian for Termux #16

@jaeyeom

Description

@jaeyeom

Background

This project uses Ansible to automate development environment setup across multiple platforms (Linux, macOS, Termux). The Ansible setup is located in devtools/setup-dev/ansible/ and includes:

  • Package installation with platform-specific handling
  • Development tool configuration (git, emacs, shell, etc.)
  • Cross-platform compatibility with include guards
  • Generated playbooks from Go templates for common packages

Current State

Bazel support was recently added for Termux via a wrapper script that runs bazel inside proot-distro Debian:

  • Wrapper script: ~/.local/bin/bazel (added in commit 9b1dae6)
  • Current Debian setup: Bazelisk v1.8.1 manually installed at /usr/local/bin/bazel
  • Wrapper functionality: Handles path mapping, user detection, and .bazeliskrc support

Problem

The current bazelisk installation in Debian is manual and not managed by Ansible. This needs to be automated for consistent environment setup.

Tasks

  • Add Ansible playbook to install proot-distro on Termux
  • Create Debian environment if it doesn't exist
  • Install bazelisk inside Debian environment using the same method as non-Darwin, non-Termux platforms
  • Ensure proper user setup in Debian environment

Technical Details

The bazelisk installation should mirror the logic in bazel.yml:38-76:

  1. Download latest bazelisk release from GitHub API
  2. Install architecture-appropriate binary (bazelisk-linux-amd64 or bazelisk-linux-arm64)
  3. Place at /usr/local/bin/bazel with executable permissions
  4. Handle version checking and updates

Integration

This should integrate with the existing Ansible structure:

  • Conditional execution only on Termux (when: ansible_env.TERMUX_VERSION is defined)
  • Follow the project's include guard pattern
  • Respect the existing playbook dependency system

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions