Skip to content

fix: add env capture for Rust and Java in chroot mode#517

Closed
Mossaka wants to merge 5 commits intomainfrom
fix/rust-java-env-capture
Closed

fix: add env capture for Rust and Java in chroot mode#517
Mossaka wants to merge 5 commits intomainfrom
fix/rust-java-env-capture

Conversation

@Mossaka
Copy link
Collaborator

@Mossaka Mossaka commented Feb 4, 2026

Summary

  • Recompile build-test-rust and build-test-java workflows with updated gh-aw
  • Adds Setup Rust action (actions-rust-lang/setup-rust-toolchain)
  • Adds CARGO_HOME capture step for Rust
  • Adds JAVA_HOME capture step for Java

Context

The Build Test Rust and Build Test Java workflows were failing because:

  • Rust: cargo commands failed with "No such file or directory" error
  • Java: All binary executions were intercepted and run as bash --version

Root cause: In AWF chroot mode, environment variables like CARGO_HOME and JAVA_HOME need to be explicitly captured and exported to $GITHUB_ENV because sudo may not preserve them.

This is the same pattern used for GOROOT in Go workflows.

Test plan

  • Build Test Rust workflow should now be able to run cargo commands
  • Build Test Java workflow should now be able to run java/mvn commands

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 4, 2026 22:31
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

💫 TO BE CONTINUED... Smoke Claude was cancelled! Our hero faces unexpected challenges...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

📰 DEVELOPING STORY: Smoke Copilot reports was cancelled. Our correspondents are investigating the incident...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 82.08% 82.08% ➡️ +0.00%
Statements 82.12% 82.12% ➡️ +0.00%
Functions 81.95% 81.95% ➡️ +0.00%
Branches 75.41% 75.41% ➡️ +0.00%

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Build Test: Rust - FAILED ❌

Error: Rust toolchain not installed in the execution environment.

Project Build Tests Status
fd N/A FAILED - cargo not found
zoxide N/A FAILED - cargo not found

Overall: FAIL

Issue

The test environment does not have the Rust toolchain (cargo/rustc) installed. Cannot proceed with build and test operations.

Required Action

Install Rust toolchain via rustup or configure the workflow to use a Rust-enabled container/runner.

AI generated by Build Test Rust

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Go Build Test Results

Project Download Tests Status
color 1/1 PASS
env 1/1 PASS
uuid 1/1 PASS

Overall: PASS

All Go projects built and tested successfully.

AI generated by Build Test Go

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Smoke Test Results - Claude Engine

GitHub MCP: ✅

Playwright: ✅ (page title: "GitHub · Change is constant. GitHub keeps you ahead. · GitHub")

File Writing: ✅ (created /tmp/gh-aw/agent/smoke-test-claude-21690990040.txt)

Bash Tool: ✅ (verified file content)

Status: PASS

AI generated by Smoke Claude

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

C++ Build Test Results

Project CMake Build Status
fmt PASS
json PASS

Overall: PASS

All C++ projects built successfully.

AI generated by Build Test C++

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Node.js Build Test Results

Project Install Tests Status
clsx PASS ✅ PASS
execa PASS ✅ PASS
p-limit PASS ✅ PASS

Overall: ✅ PASS

All Node.js build tests completed successfully.

AI generated by Build Test Node.js

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Deno Build Test Results

Project Tests Status
oak 1/1 ✅ PASS
std 1/1 ✅ PASS

Overall: ✅ PASS

All Deno tests completed successfully.

AI generated by Build Test Deno

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Smoke Test Results

Last 2 Merged PRs:

✅ GitHub MCP - Retrieved PR data
✅ Playwright - Page title verified ("GitHub · Change is constant. GitHub keeps you ahead. · GitHub")
✅ File Write - Created /tmp/gh-aw/agent/smoke-test-copilot-21690990093.txt
✅ Bash - Verified file content

Overall Status: PASS

cc @Mossaka

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Bun Build Test Results

Project Install Tests Status
elysia N/A 0/0 ❌ FAIL
hono N/A 0/0 ❌ FAIL

Overall: ❌ FAIL

Error Details

Both test projects failed with the same error:

bun test v1.3.8 (b64edcb4)
Aborted (core dumped)
Exit code: 134

Root Cause: Bun v1.3.8 is experiencing runtime crashes in the container environment (Ubuntu 24.04, Docker). The test runner aborts with a core dump before executing any tests.

Environment:

  • Bun version: 1.3.8
  • Kernel: 6.11.0-1018-azure (Ubuntu 24.04)
  • Container: Docker (awf-agent)

Next Steps:

  • This appears to be a Bun compatibility issue with the containerized environment
  • Consider testing with a different Bun version or investigating Bun's container support

AI generated by Build Test Bun

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Build Test: Java - FAILED ❌

Environment Error: Maven installation is corrupted and cannot execute.

Error: cannot execute binary file: Exec format error

Test Results

Project Compile Tests Status
gson N/A BLOCKED
caffeine N/A BLOCKED

Overall: FAILED

Action Required: Maven needs to be reinstalled or a different runner with working Java toolchain is needed.

AI generated by Build Test Java

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Deno Build Test Results

Project Tests Status
oak 1/1 ✅ PASS
std 1/1 ✅ PASS

Overall: ✅ PASS

All Deno tests completed successfully.

AI generated by Build Test Deno

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Rust Build Test Results

Project Build Tests Status
fd ❌ 0/0 FAIL
zoxide ❌ 0/0 FAIL

Overall: FAIL

Error Details

Both projects failed during test compilation with a linker error:

error: linking with `cc` failed: exit status: 1
lld-wrapper: executable has unexpected name: Some("bash")
collect2: error: ld returned 1 exit status

This appears to be an environment issue with the Rust linker configuration. The builds completed successfully, but tests could not be executed due to the linker wrapper error.

AI generated by Build Test Rust

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Smoke Test Results - Claude Engine

✅ GitHub MCP: Listed 2 merged PRs

✅ Playwright: Navigated to github.com, title verified

✅ File Write: Created /tmp/gh-aw/agent/smoke-test-claude-21691231160.txt

✅ Bash Tool: Verified file content

Status: PASS

AI generated by Smoke Claude

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Build Test: Go ✅

Project Download Tests Status
color 1/1 PASS
env 1/1 PASS
uuid 1/1 PASS

Overall: PASS

All Go projects built and tested successfully.

AI generated by Build Test Go

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Node.js Build Test Results

Project Install Tests Status
clsx PASS PASS
execa PASS PASS
p-limit PASS PASS

Overall: PASS

All Node.js projects built and tested successfully.

AI generated by Build Test Node.js

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

C++ Build Test Results

Project CMake Build Status
fmt PASS
json PASS

Overall: PASS

All C++ projects built successfully.

AI generated by Build Test C++

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Smoke Test Results

Last 2 Merged PRs:

Tests:

  • ✅ GitHub MCP: Retrieved merged PRs
  • ✅ Playwright: Verified GitHub homepage title
  • ✅ File I/O: Created and verified test file
  • ✅ Bash: Command execution successful

Status: PASS

cc: @Mossaka

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Build Test: Bun - FAILED ❌

Status: Bun runtime error - unable to complete tests

Environment

  • Bun version: 1.3.8
  • Repository cloned successfully: ✅
  • Test projects found: ✅ (elysia, hono)

Error

All bun install commands fail with:

error: An internal error occurred (NotDir)

This error occurs even with:

  • Empty package.json
  • Fresh directories
  • Explicit cache directories (BUN_INSTALL_CACHE_DIR)
  • Different commands (bun install, bun add)

Root Cause

This is a known Bun issue in containerized/restricted environments. The "NotDir" error typically indicates Bun is trying to access a file it expects to be a directory (often related to cache paths or HOME directory structure).

Test Results

Project Install Tests Status
elysia ❌ NotDir error N/A BLOCKED
hono ❌ NotDir error N/A BLOCKED

Overall: FAIL - Bun runtime error prevents testing

AI generated by Build Test Bun

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

⚠️ Security scanning failed for Smoke Copilot. Review the logs for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Smoke Test Results (Claude)

Last 2 merged PRs:

  • feat: add AWF agent skill for Claude Code agents
  • fix: add auth and error handling to build-test workflows

Test Results:

  • ✅ GitHub MCP: Retrieved PRs
  • ✅ Playwright: GitHub page title verified
  • ✅ File Write: Created test file
  • ✅ Bash: Verified file contents

Overall Status: PASS

AI generated by Smoke Claude

Mossaka and others added 5 commits February 5, 2026 20:17
Recompile build-test-rust and build-test-java workflows with updated
gh-aw that adds:
- Setup Rust action (actions-rust-lang/setup-rust-toolchain)
- CARGO_HOME capture step for Rust
- JAVA_HOME capture step for Java

These environment variable captures are needed because sudo may not
preserve them when running AWF in chroot mode.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The compiled gh-aw workflows require the actions/ folder from gh-aw
to be present in the repo. This folder contains the setup scripts
and action definitions needed for workflow execution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The setup-rust-toolchain action doesn't set CARGO_HOME - it uses the
default $HOME/.cargo path. Changed the capture step to unconditionally
set CARGO_HOME=$HOME/.cargo so it's available in AWF chroot mode.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The actions folder should come from the gh-aw release, not be copied
into this repo. The compiled workflows reference github/gh-aw/actions/setup@...
which fetches directly from the gh-aw repository.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Recompiled build-test-rust and build-test-java workflows using the
released gh-aw v0.42.0 binary. This ensures the workflows use remote
action references (github/gh-aw/actions/setup@SHA) instead of local
paths (./actions/setup), removing the need for a local actions folder.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Mossaka Mossaka force-pushed the fix/rust-java-env-capture branch from 9dc40e1 to 5bf5675 Compare February 5, 2026 20:17
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

C++ Build Test Results

Project CMake Build Status
fmt PASS
json PASS

Overall: PASS

AI generated by Build Test C++

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Build Test: Deno - Results

Project Tests Status
oak 1/1 ✅ PASS
std 1/1 ✅ PASS

Overall: ✅ PASS

All Deno tests completed successfully.

AI generated by Build Test Deno

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Node.js Build Test Results

Project Install Tests Status
clsx PASS PASS
execa PASS PASS
p-limit PASS PASS

Overall: PASS

All Node.js projects successfully installed dependencies and passed their test suites.

AI generated by Build Test Node.js

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Build Test: Go - Results

Project Download Tests Status
color 1/1 PASS
env 1/1 PASS
uuid 1/1 PASS

Overall: PASS

All Go projects successfully downloaded dependencies and passed tests.

AI generated by Build Test Go

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Bun Build Test Results ❌

Status: FAILED

Error Summary

Bun installation completed successfully (v1.3.8), but bun install fails with an internal error in the container environment:

error: An internal error occurred (NotDir)

Test Results

Project Install Tests Status
elysia - FAILED
hono - FAILED

Overall: FAIL

Environment Details

  • Bun version: 1.3.8
  • Error: An internal error occurred (NotDir)
  • Container: Missing /proc/cpuinfo and possibly other /proc entries
  • System: Linux 6.11.0-1018-azure (x86_64)

Root Cause

The AWF container environment appears to be missing required /proc filesystem entries that Bun needs to function. When Bun attempts to install dependencies, it encounters a "NotDir" error, suggesting it's trying to access a file/directory that doesn't exist or has incorrect permissions.

Recommendation

This test failure indicates that Bun requires additional host filesystem access or /proc mounts that are not currently available in the AWF agent container. The container configuration may need to be updated to support Bun's runtime requirements.

AI generated by Build Test Bun

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Build Test: Rust - FAILED

Error: Rust Toolchain Corrupted

The Rust build test cannot proceed due to a corrupted Rust installation in the runner environment:

Issue: The rustup binary at /home/runner/.cargo/bin/rustup has been replaced with /bin/bash

  • Both files have identical MD5 hash: 303330f9f1b6617b3b533e4dcfe1faf0
  • All cargo commands output bash version instead of executing
  • This affects both the fd and zoxide test projects

Test Status:

Project Build Tests Status
fd N/A FAILED (toolchain unavailable)
zoxide N/A FAILED (toolchain unavailable)

Overall: FAILED

The runner environment needs the Rust toolchain reinstalled or fixed before Rust build tests can run successfully.

AI generated by Build Test Rust

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Build Test: Java - FAILED ❌

Status: ENVIRONMENT ERROR

Unable to execute Java build tests due to a critical environment issue.

Error Details

The Java and Maven executables in the GitHub Actions runner are not functioning correctly:

  • Java: All java commands return bash version instead of Java version
  • Maven: Fails with "cannot execute binary file: Exec format error"
  • Root Cause: The bash tool execution environment appears to have a fundamental issue preventing Java binary execution

Attempted Tests

Project Compile Tests Status
gson ❌ N/A ❌ N/A FAILED - Environment Error
caffeine ❌ N/A ❌ N/A FAILED - Environment Error

Overall: FAILED

Debug Information

  • Java binary exists at: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java
  • Maven installation: /usr/share/apache-maven-3.9.12/
  • Test repository cloned successfully: /tmp/test-java
  • Environment variables set correctly: JAVA_HOME, PATH

Recommendation

This requires investigation into the bash tool's execution environment. The issue prevents any Java-based testing from running in this workflow.

AI generated by Build Test Java

@Mossaka
Copy link
Collaborator Author

Mossaka commented Feb 5, 2026

Closing — all code changes from this PR were already cherry-picked into main. Zero diff remains after rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant