Skip to content

code lab - third party dependencies with Puku - fails on step 2 #3534

@bradmallan

Description

@bradmallan

After following the guidance in step 1 and 2, puku was failing to sync. I'm so new to Please that I got Gemini CLI to help me remedy the issue. Hopefully this can help improve the codelab guidance.

I have fixed the issue where plz puku sync -w was not updating third_party/go/BUILD.

The primary cause was that puku (and the Go plugin) was not explicitly told where to find
the go.mod file, which is required for synchronization. I also improved the puku alias
configuration to ensure it runs from the repository root.

Changes Made:

  1. Exported go.mod: Created a root BUILD file to export go.mod as a Please target
    (//:gomod).
  2. Configured ModFile: Updated .plzconfig to set ModFile = //:gomod in the [Plugin "go"]
    section. This allows puku to correctly locate and sync dependencies.
  3. Improved Puku Alias: Added --wd=. to the puku alias in .plzconfig to ensure it
    executes relative to the workspace root.
  4. Synchronized Dependencies: Ran plz puku sync -w to populate third_party/go/BUILD with
    the go_repo() entry for github.com/google/uuid.
  5. Generated Source BUILD Files: Ran plz puku fmt src/hello to generate the
    src/hello/BUILD file, which now correctly references the third-party dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions