Skip to content

Using cue modules defined externally #23

@jaqx0r

Description

@jaqx0r

I'd like to extract a module into a different git repo, and then use it in my original repo.

I have created a new Bazel module with a cue_module and a cue_instance containing the src and ancestor.

I use that Bazel module in the original repo, and pass the cue module repo as a dep to the cue_instance target.

The cue execution then fails because it can't find the module providing the package I want to import.

Can we change the import search path to look for it?

"Module" repo:

  • MODULE.bazel defines the name
  • BUILD.bazel merely exports the cue_isntance
  • cue.mod/module.cue as you expect
  • cue.mod/BUILD.bazel exports the cue_module
  • foo.cue is the cue_istance being exported

"client" repo

  • MODULE.bazel adds the bazel_dep of module with a local_path_override
  • BUILD.bazel has the cue_instance, and adds @foo_module//:foo as a dep
import failed: cannot find package "github.com/jaqx0r/fue-cue/foo": cannot find module providing package github.com/jaqx0r/foo-cue/foo:
    ./client.cue:2:3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions