You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CLI go bindings generator (thema lineage gen gobindings) produces a cueFS that tries to embed the right files. Even when it does, though, there's a problem - load.InstancesWithThema() requires acue.mod/module.cue to exist at the root of the modFS that's passed in.
Or at least, that's the idea. But because of how CUE's load.Instances() scans the filesystem, load.InstancesWithThema()usually works even without that file so long as it's being executed with a cwd that either has a cue.mod, or one of its parent dirs does. This creates an awkward state where thema lineage gen gobindings creates working code sometimes - on the developer's local, when there's a cue.mod.
We need a more robust approach to generation that can work with defaults for the simple/demo case, but still be useful when the codebase in which it's being used has a larger embed.FS system in which the generated code exists. Grafana has such a system, and has built its own helpers - though they aren't great either, and this all really needs genericizing.
The text was updated successfully, but these errors were encountered:
The CLI go bindings generator (
thema lineage gen gobindings
) produces acueFS
that tries to embed the right files. Even when it does, though, there's a problem -load.InstancesWithThema()
requires acue.mod/module.cue
to exist at the root of themodFS
that's passed in.Or at least, that's the idea. But because of how CUE's
load.Instances()
scans the filesystem,load.InstancesWithThema()
usually works even without that file so long as it's being executed with a cwd that either has acue.mod
, or one of its parent dirs does. This creates an awkward state wherethema lineage gen gobindings
creates working code sometimes - on the developer's local, when there's acue.mod
.We need a more robust approach to generation that can work with defaults for the simple/demo case, but still be useful when the codebase in which it's being used has a larger
embed.FS
system in which the generated code exists. Grafana has such a system, and has built its own helpers - though they aren't great either, and this all really needs genericizing.The text was updated successfully, but these errors were encountered: