Skip to content

Commit 49d227f

Browse files
rjwaltersclaude
andcommitted
feat(build-arena): replace Python converter with 'elide adopt' command
Major changes: - Remove maven-to-elide.py Python script - Update CLAUDE-ELIDE.md to use 'elide adopt maven/gradle' instead - Update elide-builder.Dockerfile to install Elide from local build - Update build-images.sh to build Elide first, then copy to Docker context - Update CLAUDE-STANDARD.md to reflect pre-installed Maven/Gradle - Add docker/.gitignore to exclude temporary elide binary Benefits: - Uses development version of Elide with 'elide adopt' support - Fair comparison - both images have build tools pre-installed - No download delays during races - Cleaner workflow using official Elide commands 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 2690576 commit 49d227f

File tree

6 files changed

+89
-263
lines changed

6 files changed

+89
-263
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
elide

tools/build-arena/docker/CLAUDE-ELIDE.md

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ OR use one of these bell patterns:
4040

4141
- **Java**: OpenJDK 17 (Temurin)
4242
- **Elide**: Pre-installed (`elide --version` to verify)
43-
- **Python 3**: Pre-installed for running conversion scripts
4443
- **Claude Code**: You! (version shown at startup)
4544
- **Working Directory**: `/workspace`
4645
- **API Key**: Pre-configured via `ANTHROPIC_API_KEY` environment variable
47-
- **Maven Converter**: Pre-installed at `/app/maven-to-elide.py`
4846

4947
## Required Workflow Steps
5048

@@ -88,31 +86,29 @@ cat README.md
8886

8987
**This is the most important step!** Elide requires an `elide.pkl` file to build Maven projects.
9088

91-
For single-module projects:
92-
```bash
93-
python3 /app/maven-to-elide.py pom.xml
94-
cat elide.pkl # Verify conversion
95-
```
89+
Use the `elide adopt` command to convert Maven or Gradle projects:
9690

97-
For multi-module projects:
9891
```bash
99-
# Navigate to the main submodule (usually same name as repo)
100-
cd <main-module-name>
101-
python3 /app/maven-to-elide.py pom.xml
102-
cat elide.pkl # Verify conversion
92+
# For Maven projects
93+
elide adopt maven
94+
95+
# For Gradle projects
96+
elide adopt gradle
10397
```
10498

105-
**What the converter does:**
106-
- Parses `pom.xml` to extract dependencies
99+
**What `elide adopt` does:**
100+
- Detects the build system (Maven or Gradle)
101+
- Parses `pom.xml` or `build.gradle[.kts]` to extract dependencies
107102
- Resolves versions from dependency management
108-
- Maps source directories (src/main/java, src/test/java)
109-
- Generates `elide.pkl` in Elide's format
103+
- Maps source directories (src/main/java, src/test/java, etc.)
104+
- Generates `elide.pkl` in Elide's PKL format
105+
- Handles multi-module projects automatically
110106

111107
**Important notes:**
112-
- Works best for single-module Maven projects
113-
- Projects without custom plugins
114-
- Test dependencies may fail if inherited from parent POM
115-
- Main source compilation should succeed
108+
- Works for both single and multi-module projects
109+
- Supports Maven and Gradle build systems
110+
- May skip test dependencies if versions can't be resolved
111+
- Main source compilation should succeed even if tests fail
116112

117113
### Step 5: Build with Elide (TIMED!)
118114

@@ -193,11 +189,8 @@ ls -la
193189
cat pom.xml
194190
ls -la */pom.xml
195191

196-
# Navigate to main module
197-
cd gson
198-
199192
# Step 4: CONVERT TO ELIDE FORMAT
200-
python3 /app/maven-to-elide.py pom.xml
193+
elide adopt maven
201194
cat elide.pkl # Verify conversion
202195

203196
# Step 5: Build (timed)
@@ -234,16 +227,27 @@ elide package # Create JAR/WAR
234227
elide clean # Clean build artifacts
235228
```
236229

237-
## Maven-to-Elide Converter Reference
230+
## Elide Adopt Reference
231+
232+
**Command:** `elide adopt <build-system>`
238233

239-
**Location:** `/app/maven-to-elide.py`
234+
**Supported build systems:**
235+
- `maven` - Converts Maven projects (pom.xml)
236+
- `gradle` - Converts Gradle projects (build.gradle or build.gradle.kts)
240237

241238
**Usage:**
242239
```bash
243-
python3 /app/maven-to-elide.py [path-to-pom.xml]
240+
# Auto-detect build system
241+
elide adopt
242+
243+
# Explicitly specify Maven
244+
elide adopt maven
245+
246+
# Explicitly specify Gradle
247+
elide adopt gradle
244248
```
245249

246-
**Output:** Creates `elide.pkl` in the same directory as the pom.xml
250+
**Output:** Creates `elide.pkl` in the current directory
247251

248252
**Example output:**
249253
```pkl
@@ -289,10 +293,11 @@ sources {
289293
## Troubleshooting
290294

291295
### If conversion fails:
292-
1. Check if pom.xml exists and is valid XML
293-
2. For multi-module projects, navigate to the submodule first
294-
3. Check warnings about missing versions - may need parent POM
295-
4. **Still ring the bell with FAILURE status!**
296+
1. Check if pom.xml or build.gradle exists and is valid
297+
2. Try running `elide adopt` without arguments to auto-detect
298+
3. For Maven, check for missing parent POM dependencies
299+
4. For Gradle, check for missing plugin repositories
300+
5. **Still ring the bell with FAILURE status!**
296301

297302
### If build fails after conversion:
298303
1. Check the generated elide.pkl for correctness
@@ -306,13 +311,13 @@ sources {
306311
**"Package does not exist" errors during test compilation:**
307312
- Test dependencies missing versions from parent POM
308313
- Main code may still compile successfully
309-
- This is a known limitation of the current converter
314+
- This is expected for some complex projects
310315

311316
**Multi-module project:**
312317
```bash
313318
ls -la */pom.xml
314319
cd <main-module-name>
315-
python3 /app/maven-to-elide.py pom.xml
320+
elide adopt maven
316321
elide build
317322
```
318323

@@ -355,7 +360,7 @@ Error: Compilation failed - incompatible Java version
355360
---
356361

357362
**Remember**:
358-
- Download tools → Clone repo → **CONVERT TO ELIDE FORMAT** → Build → Test → 🔔 RING THE BELL 🔔
359-
- The conversion step is CRITICAL - Elide will not build Maven projects without elide.pkl
363+
- Clone repo → **CONVERT TO ELIDE FORMAT** (using `elide adopt`) → Build → Test → 🔔 RING THE BELL 🔔
364+
- The conversion step is CRITICAL - Elide will not build Maven/Gradle projects without elide.pkl
360365
- The bell signal is THE FINISH LINE for the Build Arena race!
361366
- Speed and automation are key to winning the benchmark competition!

tools/build-arena/docker/CLAUDE-STANDARD.md

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ You are competing in the **Build Arena Race** using **Maven or Gradle**!
44

55
## 🏁 YOUR MISSION
66

7-
1. **Download and install Maven or Gradle**
8-
2. **Clone the target repository**
9-
3. **Build the project using Maven/Gradle**
10-
4. **🔔 RING THE BELL** to signal completion
7+
1. **Clone the target repository**
8+
2. **Build the project using Maven/Gradle** (both are pre-installed)
9+
3. **🔔 RING THE BELL** to signal completion
1110

1211
## ⚠️ CRITICAL: YOU MUST RING THE BELL!
1312

@@ -18,33 +17,15 @@ Runner: MAVEN (or GRADLE)
1817
Status: [SUCCESS/FAILURE]
1918
```
2019

21-
## Step 1: Install Maven
20+
## Step 1: Verify Build Tools
2221

23-
Maven is NOT pre-installed. You must download it:
22+
Maven and Gradle are pre-installed. Verify they're available:
2423

2524
```bash
26-
# Download and install Maven
27-
cd /tmp
28-
wget https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
29-
tar xzf apache-maven-3.9.9-bin.tar.gz
30-
mv apache-maven-3.9.9 ~/maven
31-
export PATH="$HOME/maven/bin:$PATH"
32-
33-
# Verify installation
25+
# Verify Maven
3426
mvn --version
35-
```
36-
37-
## Alternative: Install Gradle
3827

39-
```bash
40-
# Download and install Gradle
41-
cd /tmp
42-
wget https://services.gradle.org/distributions/gradle-8.5-bin.zip
43-
unzip gradle-8.5-bin.zip
44-
mv gradle-8.5 ~/gradle
45-
export PATH="$HOME/gradle/bin:$PATH"
46-
47-
# Verify installation
28+
# Verify Gradle
4829
gradle --version
4930
```
5031

@@ -160,12 +141,7 @@ echo "Status: ${BUILD_STATUS}"
160141
## Example Complete Workflow
161142

162143
```bash
163-
# Install Maven
164-
cd /tmp
165-
wget https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
166-
tar xzf apache-maven-3.9.9-bin.tar.gz
167-
mv apache-maven-3.9.9 ~/maven
168-
export PATH="$HOME/maven/bin:$PATH"
144+
# Verify Maven is installed
169145
mvn --version
170146

171147
# Clone repo
@@ -201,4 +177,4 @@ echo "Status: ${BUILD_STATUS}"
201177

202178
---
203179

204-
**Remember**: Download Maven/Gradle → Clone → Build → **Verify artifacts** → 🔔 RING THE BELL 🔔
180+
**Remember**: Clone → Build → **Verify artifacts** → 🔔 RING THE BELL 🔔

tools/build-arena/docker/build-images.sh

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,45 @@ set -e
77
# Colors
88
GREEN='\033[0;32m'
99
YELLOW='\033[1;33m'
10+
BLUE='\033[0;34m'
1011
NC='\033[0m'
1112

1213
echo -e "${GREEN}Building Docker images for Build Arena${NC}"
1314
echo ""
1415

16+
# Step 1: Build Elide from source
17+
echo -e "${BLUE}Step 1: Building Elide from source...${NC}"
18+
cd ../../.. # Navigate to repo root from tools/build-arena/docker
19+
echo "Running: ./gradlew :packages:cli:installDist"
20+
./gradlew :packages:cli:installDist
21+
22+
# Step 2: Copy Elide binary to docker build context
23+
echo -e "${BLUE}Step 2: Copying Elide binary to docker build context...${NC}"
24+
ELIDE_BIN="packages/cli/build/install/cli/bin/elide"
25+
if [ ! -f "$ELIDE_BIN" ]; then
26+
echo "Error: Elide binary not found at $ELIDE_BIN"
27+
echo "Build may have failed. Check output above."
28+
exit 1
29+
fi
30+
31+
cp "$ELIDE_BIN" tools/build-arena/docker/elide
32+
echo "✓ Copied Elide binary to tools/build-arena/docker/elide"
33+
34+
# Return to docker directory
35+
cd tools/build-arena/docker
36+
echo ""
37+
1538
# Check if buildx is available
1639
if ! docker buildx version > /dev/null 2>&1; then
1740
echo -e "${YELLOW}Warning: docker buildx not found. Using standard docker build.${NC}"
1841
echo "For multi-platform builds, install Docker Desktop or enable buildx."
1942
echo ""
2043

2144
# Standard single-platform build
22-
echo "Building elide-builder image (single platform)..."
45+
echo -e "${BLUE}Step 3: Building elide-builder image (single platform)...${NC}"
2346
docker build -t elide-builder:latest -f elide-builder.Dockerfile .
2447

25-
echo "Building standard-builder image (single platform)..."
48+
echo -e "${BLUE}Step 4: Building standard-builder image (single platform)...${NC}"
2649
docker build -t standard-builder:latest -f standard-builder.Dockerfile .
2750
else
2851
# Detect native platform
@@ -45,16 +68,16 @@ else
4568
docker buildx use build-arena-builder
4669
fi
4770

48-
# Build for linux/amd64 (most common production platform)
49-
echo "Building elide-builder image for ${PLATFORM}..."
71+
# Build for native platform
72+
echo -e "${BLUE}Step 3: Building elide-builder image for ${PLATFORM}...${NC}"
5073
docker buildx build \
5174
--platform ${PLATFORM} \
5275
--tag elide-builder:latest \
5376
--file elide-builder.Dockerfile \
5477
--load \
5578
.
5679

57-
echo "Building standard-builder image for ${PLATFORM}..."
80+
echo -e "${BLUE}Step 4: Building standard-builder image for ${PLATFORM}...${NC}"
5881
docker buildx build \
5982
--platform ${PLATFORM} \
6083
--tag standard-builder:latest \
@@ -63,6 +86,12 @@ else
6386
.
6487
fi
6588

89+
# Cleanup: Remove copied Elide binary
90+
echo ""
91+
echo -e "${BLUE}Step 5: Cleaning up...${NC}"
92+
rm -f elide
93+
echo "✓ Removed temporary Elide binary"
94+
6695
echo ""
6796
echo -e "${GREEN}All images built successfully!${NC}"
6897
docker images | grep -E "(elide-builder|standard-builder)"

tools/build-arena/docker/elide-builder.Dockerfile

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ RUN apt-get update && apt-get install -y \
2525
jq \
2626
apt-transport-https \
2727
software-properties-common \
28-
python3 \
29-
python3-pip \
3028
&& rm -rf /var/lib/apt/lists/*
3129

3230
# Install Node.js (required for Claude Code)
@@ -37,15 +35,10 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
3735
# Install Claude Code CLI (trying version 2.0.30 - before apiKeyHelper changes)
3836
RUN npm install -g @anthropic-ai/[email protected]
3937

40-
# Install Elide (multi-platform support for amd64/arm64)
41-
ARG TARGETARCH
42-
ENV ELIDE_VERSION=1.0.0-beta10
43-
RUN ELIDE_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "amd64") && \
44-
wget -q "https://github.com/elide-dev/elide/releases/download/${ELIDE_VERSION}/elide-${ELIDE_VERSION}-linux-${ELIDE_ARCH}.tgz" && \
45-
tar -xzf "elide-${ELIDE_VERSION}-linux-${ELIDE_ARCH}.tgz" && \
46-
mv "elide-${ELIDE_VERSION}-linux-${ELIDE_ARCH}/elide" /usr/local/bin/elide && \
47-
chmod +x /usr/local/bin/elide && \
48-
rm -rf "elide-${ELIDE_VERSION}-linux-${ELIDE_ARCH}" "elide-${ELIDE_VERSION}-linux-${ELIDE_ARCH}.tgz"
38+
# Install Elide from local build (development version with 'elide adopt' support)
39+
# The build-images.sh script will build Elide and copy it here before running docker build
40+
COPY elide /usr/local/bin/elide
41+
RUN chmod +x /usr/local/bin/elide
4942

5043
# Verify installations
5144
RUN java -version && \
@@ -72,10 +65,6 @@ WORKDIR /workspace
7265
COPY CLAUDE-ELIDE.md /workspace/CLAUDE.md
7366
RUN chown builder:builder /workspace/CLAUDE.md
7467

75-
# Copy Maven to Elide converter script
76-
COPY maven-to-elide.py /app/maven-to-elide.py
77-
RUN chmod +x /app/maven-to-elide.py
78-
7968
# Pre-configure Claude Code to skip prompts and enable non-interactive mode
8069
# Create directory structure for Claude Code configuration
8170
RUN mkdir -p /home/builder/.claude /home/builder/.config/claude-code && \

0 commit comments

Comments
 (0)