Skip to content

Instantly share code, notes, and snippets.

View alexeagle's full-sized avatar
🌿
Making a better Bazel

Alex Eagle alexeagle

🌿
Making a better Bazel
View GitHub Profile
#!/bin/bash
set -euo pipefail
bazel 2>/dev/null build --build_runfile_links @yq
YQ=$(bazel 2>/dev/null info execution_root)/$(bazel 2>/dev/null cquery --output=files @yq)
for pkg in $($YQ eval '
(.importers.".".dependencies // {}
+ .importers.".".devDependencies // {}
+ .importers.".".optionalDependencies // {})
| to_entries
@alexeagle
alexeagle / BUILD.in
Created March 5, 2025 23:39
Gazelle test fixture
# empty
load("@deps-test//my:rules.bzl", "x_lib")
x_lib(
name = "a_lib",
testonly = True,
srcs = ["a.json"],
deps = [
":b_lib",
"//lib:l_lib",
],
BZL_LIBRARY = "bzl_library"
LANG_NAME = "starlark"
BZL_EXT = ".bzl"
aspect.register_rule_kind(BZL_LIBRARY, {
"From": "@bazel_skylib//:bzl_library.bzl",
"NonEmptyAttrs": ["srcs"],
"MergeableAttrs": ["srcs"],
"ResolveAttrs": ["deps"],
"""
rules_kotlin support for 'aspect configure'
"""
KT_JVM_LIBRARY = "kt_jvm_library"
KT_JVM_BINARY = "kt_jvm_binary"
RULES_KOTLIN_REPO_NAME = "io_bazel_rules_kotlin"
PROVIDER_NAME = "kt"
LANG_NAME = "kotlin"
"""
rules_kotlin support for 'aspect configure'
"""
KT_JVM_LIBRARY = "kt_jvm_library"
KT_JVM_BINARY = "kt_jvm_binary"
RULES_KOTLIN_REPO_NAME = "io_bazel_rules_kotlin"
PROVIDER_NAME = "kt"
LANG_NAME = "kotlin"
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
# Bash installation script for https://github.com/choffmeister/git-describe-semver utility
# for use in --workspace_status command. We can't carry a bazel run dependency on this tool
# since we need to use it in --workspace_status.
git_describe_semver_url_base="https://github.com/choffmeister/git-describe-semver/releases/download"
git_describe_semver_version=0.3.9
@alexeagle
alexeagle / weekly-tag.yaml
Last active November 1, 2024 02:51
GitHub Actions to tag a repo at the beginning of each week. See blog.aspect.dev
# Apply a tag to HEAD at the beginning of each week.
# We can use this to create semver-looking tags for releases like
# 2020.44.123+abc1234
on:
schedule:
# Mondays at 5am UTC / midnight EST
- cron: '0 5 * * 1'
jobs:
tagger:
bazel-out/k8-fastbuild/internal/_middlemen/_S_Scommon_Stime_Cstamped_Umessage-BazelCppSemantics_build_arch_k8-fastbuild
common/time/stamped_message.cc
external/bazel_tools/tools/cpp/grep-includes.sh
external/gcc_toolchain_x86_64/bin/as
external/gcc_toolchain_x86_64/bin/cpp
external/gcc_toolchain_x86_64/bin/g++
external/gcc_toolchain_x86_64/bin/gcc
external/gcc_toolchain_x86_64/bin/gfortran
external/gcc_toolchain_x86_64_files/bin/x86_64-buildroot-linux-gnu-as
external/gcc_toolchain_x86_64_files/bin/x86_64-linux-as