Skip to content

Instantly share code, notes, and snippets.

@fmeum
fmeum / bzlmod-repo-name.md
Last active June 16, 2022 18:19
Improving module extension usability

Current situation

I frequently encountered the following two situations when working with and designing for bzlmod.

http_archive as a module extension

A typical usage of the direct analogue of the current http_archive repository rule for MODULE.bazel would probably look as follows:

http = use_extension("@bazel_tools//...", "http")
@fmeum
fmeum / test.sh
Last active October 17, 2021 07:32
Bazel runfiles not propagated when forwarding DefaultInfo
touch WORKSPACE
touch i_am_a_runfile
cat << EOF > BUILD.bazel
load(":rules.bzl", "wrap_library")
cc_library(
name = "lib",
srcs = ["main.cc"],
@fmeum
fmeum / debug.bzl
Created October 14, 2021 08:29
Starlark debug macro
def _stringify_provider(p):
if type(p) == "DefaultInfo":
return """
{}
data_runfiles:
{}
default_runfiles:
{}
files:
{}
@fmeum
fmeum / bazel-4.2.0-regression.sh
Created August 23, 2021 06:27
Regression in Bazel 4.2.0
#!/usr/bin/env bash
cat << EOF > WORKSPACE
workspace(name = "regression")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_skylib",
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
@fmeum
fmeum / BUILD
Last active December 3, 2020 07:09
Starlark build setting invoking Go context throws an exception
load(":exception.bzl", "exception")
exception(
name = "exception",
build_setting_default = True,
)
@fmeum
fmeum / keybase.md
Created March 8, 2017 11:48
Keybase.io

Keybase proof

I hereby claim:

  • I am FabianHenneke on github.
  • I am fhenneke (https://keybase.io/fhenneke) on keybase.
  • I have a public key whose fingerprint is 3AC9 B5E6 F0B0 5ADF 7096 5476 9D38 8D67 26E6 215B

To claim this, I am signing this object: