-
Notifications
You must be signed in to change notification settings - Fork 542
Description
Describe the bug
When creating a new Valdi UI Application project with valdi bootstrap --with-cleanup, the bootstrap process succeeds until projectsync runs. At that point, Bazel fails with the error:
ERROR: Error computing the main repository mapping:
Label '//bzl:workspace_prepare.bzl' is invalid because 'bzl' is not a package;
perhaps you meant to put the colon here: '//:bzl/workspace_prepare.bzl'?
This prevents Valdi from discovering project targets or completing initialization.
The generated WORKSPACE file references @valdi//bzl:workspace_prepare.bzl, but the Valdi distribution's bzl/ directory is missing a BUILD.bazel file, so Bazel does not treat it as a valid package.
To Reproduce
Steps to reproduce the behavior:
- Install Valdi and run
valdi doctor(everything passes except an optional Java 17 warning). - Create an empty directory, e.g.
/Users/<user>/valdi. - Run:
valdi bootstrap --with-cleanup - Choose UI Application, name the project, and let Valdi generate files.
- During
projectsync, see Bazel fail with the invalid label error shown above.
Expected behavior
The bootstrap process should complete without Bazel errors.
valdi projectsync should successfully discover and sync Valdi targets, and the generated project should build normally.
The Valdi distribution should include a valid bzl/ package (i.e., a BUILD.bazel file) so that labels like //bzl:workspace_prepare.bzl resolve correctly.
Screenshots
Console output from the failing bootstrap:
✖ Running Bazel command: bazel query "kind('valdi_projectsync', //...)"
Error: checking cached actions
ERROR: Error computing the main repository mapping: Label '//bzl:workspace_prepare.bzl' is invalid because 'bzl' is not a package; perhaps you meant to put the colon here: '//:bzl/workspace_prepare.bzl'?
Development platform (please complete the following information):
- OS: macOS 15.7.2 (2024 iMac)
- Valdi version: beta-0.0.1
- Bazel: 7.2.1 (via Bazelisk)
- Node: v20.19.5
- Java: 11.0.29 (Valdi doctor warns Java 17 recommended)
Target platform (please complete the following information):
- Device: N/A (project fails before targeting any platform)
- OS: N/A
- Version: N/A
Additional context
Valdi’s published archive for beta-0.0.1 appears to be missing a BUILD.bazel in the bzl/ directory. As a result, Bazel cannot treat bzl/ as a package, and all load("//bzl:...") calls in the Valdi workspace extensions fail.
Adding a minimal BUILD.bazel to the Valdi bzl/ directory (e.g., using exports_files([...])) fixes the issue locally, confirming the root cause.