Bazel-Builds in großen Monorepos können langsam und komplex sein. Dieser Skill bietet bewährte Muster für Remote-Caching, parallele Ausführung und benutzerdefinierte Regeln, um Build-Zeiten drastisch zu reduzieren.
تنزيل ZIP المهارة
رفع في Claude
اذهب إلى Settings → Capabilities → Skills → Upload skill
فعّل وابدأ الاستخدام
اختبرها
استخدام "bazel-build-optimization". Help me set up Bazel for a Python project with external dependencies
النتيجة المتوقعة:
Here is a basic WORKSPACE.bazel configuration for Python:
```python
workspace(name = "myproject")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "...",
strip_prefix = "rules_python-0.27.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.27.0/rules_python-0.27.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
```
Then create a BUILD.bazel file with py_library and py_test rules.
استخدام "bazel-build-optimization". How do I configure remote execution?
النتيجة المتوقعة:
Add this to your .bazelrc for remote execution:
```bash
build:remote-exec --remote_executor=grpcs://remote.example.com
build:remote-exec --remote_instance_name=projects/myproject/instances/default
build:remote-exec --jobs=500
```
Security tips:
- Use TLS for remote endpoints
- Authenticate with OAuth or certificates
- Start with read-only remote cache before enabling execution
التدقيق الأمني
آمنStatic analysis detected 36 potential issues (external_commands, network, filesystem patterns), but all are false positives. The skill contains documentation and templates for Bazel build optimization with example commands and configuration snippets - no actual executable code with security implications. URLs are legitimate documentation links, filesystem references are standard Bazel cache paths, and cryptographic mentions are SHA256 checksums for download verification.
درجة الجودة
ماذا يمكنك بناءه
Remote-Caching für CI/CD-Pipelines einrichten
Konfigurieren Sie Bazel mit Remote-Caching, um Build-Artefakte über CI-Runner hinweg zu teilen und Build-Zeiten von Stunden auf Minuten zu reduzieren.
Großes TypeScript-Monorepo optimieren
Wenden Sie Best Practices für die Organisation von BUILD-Dateien, Aktivierung paralleler Ausführung und Konfiguration von Disk-Caching an.
Benutzerdefinierte Build-Regeln für Docker erstellen
Schreiben Sie eine benutzerdefinierte Bazel-Regel, um Docker-Images als Teil des Build-Graphen mit korrekter Dependency-Verfolgung zu erstellen.
جرّب هذه الموجهات
Help me set up Bazel for a new monorepo. I need to configure WORKSPACE.bazel with rules for JavaScript and Python. What are the essential configurations?
I want to set up remote caching for our Bazel builds. We use Google Cloud. Show me the .bazelrc configuration needed and any security considerations.
Create a custom Bazel rule that builds a Docker image. The rule should accept a Dockerfile, base image, and layer files as inputs.
Our Bazel build takes 30 minutes. Help me profile it using bazel build --profile and identify the slowest actions. What optimizations should I try first?
أفضل الممارسات
- Verwenden Sie feinkörnige Targets statt großer Glob-Muster für bessere inkrementelle Builds
- Aktivieren Sie Remote-Caching frühzeitig - es bietet die größten Performance-Gewinne
- Pinnen Sie Dependency-Versionen in WORKSPACE, um reproduzierbare Builds zu gewährleisten
تجنب
- Verwendung von glob(['**/*.py']) für srcs - verursacht unnötige Rebuilds
- WORKSPACE-Setup überspringen - führt zu inkonsistenter Dependency-Auflösung
- Build-Warnungen ignorieren - kleine Probleme werden zu technischer Schuld
الأسئلة المتكررة
Installiert dieser Skill Bazel?
Kann ich dies für andere Build-Systeme als Bazel verwenden?
Wie viel Build-Zeit kann ich sparen?
Ist Remote-Caching sicher?
Kann dies bei der Migration zu Bazel helfen?
Welche Sprachen werden unterstützt?
تفاصيل المطور
المؤلف
sickn33الترخيص
MIT
المستودع
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/bazel-build-optimizationمرجع
main
بنية الملفات
📄 SKILL.md