A comprehensive build system and compatibility checker for Zig packages across multiple Zig versions. This system automatically fetches packages from URLs, builds them with different Zig versions using Docker containers, and provides detailed compatibility reports.
- π³ Docker-based builds - Isolated build environments for each Zig version
- π Multi-version testing - Automatic testing across Zig master, 0.14.0, 0.13.0, and 0.12.0
- π Build result tracking - Detailed success/failure reports with error logs
- π Web interface - Submit packages and view results through a web UI
- π REST API - Programmatic access to submit packages and query results
- π¦ Package management - Track package metadata, authors, and licenses
-
Clone the repository:
git clone <repository-url> cd zig-pkg-checker
-
Build Docker images for all Zig versions:
make docker-build
-
Build and run the application:
make run-docker
The server will start on http://localhost:3000
- Package Submission - User submits a package via web UI or API
- Database Storage - Package metadata is stored in SQLite database
- Build Initiation - Build jobs are started for all Zig versions simultaneously
- Docker Execution - Each Zig version runs in its own Docker container
- Result Collection - Build results are collected and stored in database
- Result Display - Results are displayed in web UI with compatibility matrix
Each Zig version has its own Docker container:
zig-checker:master
- Latest Zig development versionzig-checker:0.14.0
- Zig 0.14.0 stablezig-checker:0.13.0
- Zig 0.13.0zig-checker:0.12.0
- Zig 0.12.0
For each package and Zig version combination:
- Clone - Package repository is cloned into container
- Build -
zig build
is executed with timeout - Test -
zig build test
is executed if tests exist - Result - Build status, test status, and logs are captured
- Cleanup - Container and temporary files are cleaned up
POST /api/packages
Content-Type: application/json
{
"name": "my-package",
"url": "https://github.com/user/repo",
"description": "A sample Zig package",
"author": "author-name",
"license": "MIT"
}
GET /api/packages
Returns packages with build results:
{
"packages": [
{
"id": 1,
"name": "my-package",
"url": "https://github.com/user/repo",
"description": "A sample Zig package",
"author": "author-name",
"license": "MIT",
"created_at": "2024-01-01T00:00:00Z",
"last_updated": "2024-01-01T00:00:00Z",
"popularity_score": 0,
"build_results": [
{
"zig_version": "master",
"build_status": "success",
"test_status": "success",
"last_checked": "2024-01-01T00:00:00Z"
},
{
"zig_version": "0.14.0",
"build_status": "failed",
"test_status": null,
"last_checked": "2024-01-01T00:00:00Z"
}
]
}
],
"total": 1,
"page": 1,
"limit": 20
}
GET /api/health
Visit http://localhost:3000
to access the web interface:
- Home (
/
) - Overview and statistics - Packages (
/packages
) - Browse submitted packages and their build status - Submit (
/submit
) - Submit a new package for testing - Stats (
/stats
) - Compatibility statistics and trends - API Docs (
/api
) - API documentation
# Build the application
make build
# Run tests
make test
# Build Docker images
make docker-build
# Clean up
make clean
# Clean Docker artifacts
make docker-clean
# Full cleanup
make clean-all
# Show help
make help
The application uses SQLite with the following tables:
- packages - Package metadata (name, URL, description, author, etc.)
- build_results - Build results for each package/Zig version combination
- issues - Tracked issues and compatibility problems
Build system settings can be configured in src/build_system.zig
:
- Container resource limits (memory, CPU)
- Build timeouts
- Supported Zig versions
- Docker image names
- Build containers run with no network access during builds
- Resource limits prevent runaway builds
- Temporary files are automatically cleaned up
- No persistent storage in build containers
# Check Docker is running
docker --version
# Rebuild images if corrupted
make docker-clean
make docker-build
# Check container logs
docker logs <container-name>
- Check package has valid
build.zig
file - Ensure repository is publicly accessible
- Review error logs in web interface
- Check Docker container resource limits
- Database file is created automatically in project root
- Delete
zig_pkg_checker.db
to reset database - Check file permissions for SQLite database
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
[Add your license here]