The goal of this project is to provide a set of Bazel rules to build Unreal Engine itself and Unreal Engine projects with Bazel.
I'm making my own game using Unreal. I have a background in Software Engineering/Ops and I found it difficult to navigate all the custom build scripts and tools that Unreal Engine uses. I want it to be easier to build Unreal Engine and Unreal Engine projects in different environments (Linux, Windows, Mac, CI/CD, etc) without having to think about the ins and outs of Unreal Engine's build system.
Bazel is a build system that is designed to be fast, reliable, and reproducible. I know it well enough to be able to map Unreal Engine's build system to it.
Unreal Engine's build system is complex and not well documented (in my opinion). It's difficult to understand how to build Unreal Engine and Unreal Engine projects in different environments.
TODO
For faster iteration during development, set up a local remote cache using bazel-remote + MinIO:
# Start cache services
docker-compose up -d
# Verify services are running
docker ps # Should show bazel-remote and minio containers
# Build with remote cache enabled
bazel build --config=cache //...Benefits:
- Instant pack downloads after first fetch (1045 packs in ~1 second)
- Persistent cache across
bazel cleanrebuilds - Shared cache across multiple workspaces
Services:
- bazel-remote (localhost:8080 HTTP, localhost:9092 gRPC) - Bazel cache proxy
- MinIO (localhost:9000 S3, localhost:9001 console) - Object storage backend
Storage:
- Cache data persists in Docker volume
minio-data - To clear cache:
docker-compose down -v
Note: CI uses GitHub Actions cache instead (simpler for ephemeral environments).
- Build Unreal Engine from source in Bazel
- Download a specific commit of Unreal Engine as a bazel repo rule
- Configure Unreal Engine (mimic
Setup.(bat|sh)functionality)- Download git dependencies
- Unpack git dependencies
- Build a module of Unreal Engine in Bazel (Phase 1.2)
- Design and implement
ue_moduleBazel rule - Write BUILD.bazel for Core module
- Build Core module with Bazel
- Build CoreUObject module (depends on Core)
- Design and implement
- Build Unreal Editor in Bazel (Phase 1.3+)
- Build and Package Unreal Engine projects in Bazel (Phase 2)
- Design and implement
ue_projectBazel rule - Generate BUILD files for Unreal Engine plugins
- Design and implement