Skip to content

feat: multi-platform CodeBuild support (Windows, Linux x64, Linux ARM64)#157

Open
pipeflo wants to merge 12 commits intoaws-solutions-library-samples:mainfrom
pipeflo:feat/codebuild-multi-platform
Open

feat: multi-platform CodeBuild support (Windows, Linux x64, Linux ARM64)#157
pipeflo wants to merge 12 commits intoaws-solutions-library-samples:mainfrom
pipeflo:feat/codebuild-multi-platform

Conversation

@pipeflo
Copy link
Copy Markdown

@pipeflo pipeflo commented Mar 14, 2026

Summary

Adds multi-platform CodeBuild support so administrators can build distribution binaries for all platforms from any machine (including Windows).

  • New package_cb command: triggers CodeBuild projects for Windows (Nuitka+MinGW), Linux x64 (PyInstaller), and Linux ARM64 (PyInstaller). On macOS, also builds Mac binaries locally.
  • Updated builds command: lists, checks status, and downloads artifacts across all 3 platforms (previously Windows-only).
  • Updated CloudFormation template (codebuild-windows.yaml): adds Linux x64 and Linux ARM64 CodeBuild projects alongside the existing Windows project.
  • Updated CLI registration: registers the new package_cb command.

Changed files

File Change
deployment/infrastructure/codebuild-windows.yaml Add Linux x64 + ARM64 CodeBuild projects
source/claude_code_with_bedrock/cli/commands/package_cb.py New command: multi-platform CodeBuild + local macOS builds
source/claude_code_with_bedrock/cli/commands/builds.py Multi-platform list/status/download
source/claude_code_with_bedrock/cli/__init__.py Register PackageCbCommand
source/tests/cli/commands/test_package_async.py Updated tests for multi-platform

Workflow

ccwb package_cb                            # Start CodeBuild builds (all platforms)
ccwb builds                                # List builds across all platforms
ccwb builds --status latest                # Check all build statuses
ccwb builds --status latest --download     # Download succeeded artifacts
ccwb distribute                            # Create distribution package

Notes

Test plan

  • Run ccwb package_cb and verify all 3 CodeBuild builds start
  • Run ccwb builds and verify all 3 platforms listed
  • Run ccwb builds --status latest after builds complete
  • Run ccwb builds --status latest --download and verify artifacts extracted
  • Run ccwb distribute and verify presigned URL generated
  • Run poetry run pytest tests/cli/commands/test_package_async.py -v — 9 tests pass

pipeflo added 10 commits March 9, 2026 22:44
…hema

preferred_username is listed in AliasAttributes, which requires it to be
unique across the pool. Having it also as Required: true creates a
conflict: users created via admin-create-user cannot set this attribute
during creation, leaving them unable to log in through the Cognito
Hosted UI. Changing to Required: false resolves the issue while still
allowing preferred_username to function as an alias for sign-in.
Reflects the schema fix — preferred_username is an optional attribute
used as a sign-in alias, not a required attribute.
When the provider is Cognito, the JWT iss claim is
https://cognito-idp.<region>.amazonaws.com/<pool-id>, not the hosted
UI domain (e.g., app.auth.region.amazoncognito.com). The API Gateway
JWT authorizer on the quota API rejects all Cognito tokens because the
issuer URL doesn't match. Construct the correct cognito-idp endpoint
from the User Pool ID for Cognito providers.
The OktaDomain AllowedPattern regex only accepted .okta.com and
.okta-emea.com domains, rejecting .oktapreview.com (Okta sandbox/test
environments). Update the regex to also accept preview domains.
…tection

Two issues preventing native Windows builds with Nuitka:

1. binary_name was never set for the Windows target platform, causing
   'cannot access local variable binary_name' error at build time.

2. Nuitka availability check used 'which' (Unix-only command), which
   fails on Windows. Use 'python -m nuitka --version' instead, which
   works cross-platform.
When building natively on Windows with monitoring enabled, the OTEL
helper build would always fail because it expected the binary to be
pre-built by CodeBuild. Add native Windows support to both
_build_otel_helper (routing) and _build_native_otel_helper (Nuitka
build) so the OTEL helper can be compiled locally on Windows.
The existing Windows build docs assume a macOS/Linux admin using
CodeBuild. Add documentation for building natively on Windows with
Nuitka, including prerequisites, cross-platform build matrix,
multi-platform distribution strategy, and troubleshooting.
On Windows, open() defaults to cp1252 encoding which cannot handle
Unicode characters (emojis like ❌, ✓, ⚠️) used in install.sh and
README.md. Add explicit encoding="utf-8" to these file writers.
- Add package_cb command to trigger CodeBuild from any OS
- Support interactive platform selection or --platform flag
- Fix MinGW SSL download error in Windows CodeBuild buildspec
- Fix PATH persistence across CodeBuild PowerShell commands
- Add Linux x64 and Linux ARM64 CodeBuild projects with PyInstaller
- Fix zip path separators for Windows compatibility (.as_posix())
- All 3 platforms tested and verified in CodeBuild

Co-Authored-By: Claude
- builds.py: support listing/status/download for all 3 CodeBuild
  platforms (Windows, Linux x64, Linux ARM64), not just Windows
- package_cb.py: add macOS local builds, OTel resource attributes
  prompts, co-authorship option, and build-verbose flag
- test_package_async.py: updated tests for multi-platform builds
@pipeflo pipeflo requested a review from a team as a code owner March 14, 2026 16:10
pipeflo added 2 commits March 14, 2026 15:48
The inline PowerShell in install.bat failed on Windows because CMD caret
(^) line continuations are literal inside double quotes, and escaped
quotes (\") break CMD quote tracking — causing PowerShell variables to
leak out as CMD commands.

Split into install.bat (3-line launcher) + ccwb-install.ps1 (pure
PowerShell logic). Updated distribute.py to include ccwb-install.ps1 in
package archives and per-OS packages. Updated all docs with new file.
- install.sh: force Unix line endings (newline="\n") when generated on
  Windows, preventing "cannot execute: required file not found" on Linux
- CodeBuild Linux x64: switch from Ubuntu 24.04 (standard:7.0) to
  Amazon Linux 2023 (amazonlinux2-x86_64-standard:5.0) for glibc 2.34
  compatibility — binaries now work on AL2023/RHEL9/Rocky9
- Add chmod +x install.sh to all CLI output and documentation since
  zip archives lose Unix execute permissions
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.

1 participant