buck2 icon indicating copy to clipboard operation
buck2 copied to clipboard

Poor error message for incorrect `load` with missing `@`

Open lf- opened this issue 5 months ago • 0 comments

Error loading `load` of `toolchains//nix.bzl` from `snowydeer/snowydeer.bxl:1:6-27`: Invalid path `toolchains//nix.bzl` for file relative import path. Should be a forward relative path. (buck2 error)

Code:

load("toolchains//nix.bzl", "NixPathInfo")

Fix:

load("@toolchains//nix.bzl", "NixPathInfo")

Searching the docs I can't find "forward relative path" in the docs. I also can't find where the @ thing is documented in the docs. I would expect it to be mentioned at "target label": https://buck2.build/docs/concepts/glossary/#target-label. It seems sorta documented here: https://buck2.build/docs/getting_started/tutorial_to_concepts/#load-function-and-attributes but it's not clear that you need @ because it's a different cell.

lf- avatar Jul 11 '25 17:07 lf-