aws / aws/bedrock-agentcore-starter-toolkit
[BUG] Cross-platform build fails: CLI uses Windows venv interpreter to install Linux ARM64 dependencies with uv
- Dominant language
- Python
- Stars
- 508
- Forks
- 155
- Avg merge
- 8h 50m
- Merged PRs (30d)
- 4
Description
**Describe the bug**
When running `agentcore launch` on Windows with `uv` for dependency management, the CLI attempts to install Linux ARM64 dependencies using the existing Windows virtual environment's Python interpreter. This causes dependency resolution to fail for platform-specific packages like `pywin32`, which only has Windows wheels but is being resolved for Linux ARM64 deployment.
**To Reproduce**
Steps to reproduce the behavior:
1. Set up a project on Windows (Intel x64) with `uv` and `pyproject.toml`
2. Create a virtual environment with `uv sync` (creates `.venv` with Windows Python interpreter)
3. Configure AgentCore for Linux ARM64 deployment (`platform: linux/arm64` in `.bedrock_agentcore.yaml`)
4. Run command: `uv run agentcore launch --agent rpg_tools`
5. See error during "Installing dependencies with uv for aarch64-manylinux_2_28"
**Expected behavior**
The CLI should create a separate temporary environment or use `uv`'s cross-platform resolution capabilities to install dependencies for the target platform (Linux ARM64) without requiring the local development environment's Python interpreter. Platform-specific dependencies like `pywin32` (which has `marker = "sys_platform == 'win32'"` in `uv.lock`) should be automatically excluded when building for Linux.
**Error Output**
```
Building dependencies for Linux ARM64 Runtime (manylinux2014_aarch64)
...
❌ Failed to install dependencies with uv: Using CPython 3.12.8 interpreter at:
.venv\Scripts\python.exe
× No solution found when resolving dependencies:
╰─▶ Because pywin32==311 has no wheels with a matching platform tag (e.g.,
`manylinux_2_28_aarch64`) and you require pywin32==311, we can conclude
that your requirements are unsatisfiable.
hint: Wheels are available for `pywin32` (v311) on the following
platforms: `win32`, `win_amd64`, `win_arm64`
```
**Environment:**
- OS: Windows 11 (Intel x64)
- Python version: 3.12.8
- uv version: 0.9.16
- bedrock-agentcore version: >=1.1.1
- Installation method: uv
**Additional context**
The `uv.lock` file correctly includes platform markers for `pywin32`:
```
{ name = "pywin32", marker = "sys_platform == 'win32'" }
```
This indicates that `pywin32` should only be installed on Windows platforms. However, the AgentCore CLI appears to be calling `uv pip install` with the Windows `.venv` Python interpreter (`.venv\Scripts\python.exe`) while trying to target Linux ARM64, which causes `uv` to attempt installing all locked dependencies including `pywin32` for the wrong platform.
The issue occurs because:
1. Local development requires a Windows virtual environment to run the AgentCore CLI
2. The CLI reuses this Windows venv's Python interpreter for cross-platform dependency installation
3. `uv` cannot resolve platform-specific dependencies when the interpreter platform doesn't match the target platform
**Suggested fix:**
The CLI should either:
* Use `uv export --python-platform manylinux_2_28_aarch64` to generate a platform-specific requirements file, then install to target directory
* Use `uv sync --python-platform linux` if available (uv >=0.5.0)
* Create a temporary isolated environment with correct platform specification
* Parse `uv.lock` directly and filter dependencies by platform markers
Contributor guide
Research direction
Reproduce the failure with `uv run agentcore launch --agent rpg_tools` using `platform: linux/arm64`, then trace the CLI's dependency-installation path and inspect `uv.lock` alongside `pyproject.toml`. Done means Linux ARM64 resolution no longer reuses `.venv\Scripts\python.exe`, excludes Windows-only packages such as `pywin32`, and completes installation for the target platform.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100