Skip to content

buffrs lint and buffrs package reject workspace manifests #323

Open

Description

@overby-me

Summary

install and publish both resolve and walk workspace members. lint and package error out on the same manifest instead, because both call Manifest::require_package_manifest (command.rs:257, command.rs:403), which bails on Manifest::Workspace (manifest/mod.rs:138-147).

Reproduction

mkdir ws && cd ws
printf '[workspace]\nmembers = ["packages/alpha", "packages/beta"]\n' > Proto.toml
for m in alpha beta; do
  mkdir -p packages/$m/proto
  printf 'edition = "0.13"\n\n[package]\ntype = "lib"\nname = "%s"\nversion = "0.1.0"\n\n[dependencies]\n' $m > packages/$m/Proto.toml
  printf 'syntax = "proto3";\npackage %s;\nmessage Foo { string bar = 1; }\n' $m > packages/$m/proto/$m.proto
done

install walks members:

$ buffrs install; echo "exit=$?"
:: workspace found. running install for 2 packages in workspace
:: running install for package: packages/alpha
:: installed alpha@0.1.0
:: running install for package: packages/beta
:: installed beta@0.1.0
:: workspace install complete using existing lockfile
exit=0

lint and package do not:

$ buffrs lint; echo "exit=$?"
Error:   × failed to lint protocol buffers in `proto`
  ╰─▶ A packages manifest is required, but a workspace manifest was found
exit=1

$ buffrs package --dry-run; echo "exit=$?"
Error:   × failed to export `ws` into the buffrs package format
  ╰─▶ A packages manifest is required, but a workspace manifest was found
exit=1

Expected

lint and package iterate members, consistent with install and publish.

Actual

Both reject the workspace root, forcing callers to do:

for m in $(yq '.workspace.members[]' Proto.toml); do (cd "$m" && buffrs lint); done

Impact

Every downstream build system reimplements member discovery and ordering. Those reimplementations drift from buffrs' own semantics (glob handling, exclusions, dependency ordering), producing subtly different results than buffrs publish does for the same workspace.

Suggested fix

Reuse the existing member-walking logic from install/publish in lint and package. A --package <name> filter would be a useful addition for both.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions