Visibility of the tool packages #1892
Unanswered
roman-mazur
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Originally started in Slack.
The documentation of the CUE tool package says that the package is visible only from the
_tool.cue
files. The motivation of hiding them from the main files is related to the hermetic nature of configurations written in CUE: accessing data from the OS or getting the user inputs breaks it.However, from my personal experience, this visibility enforcement of the
tool/
sub packages does not seem to be true forcue
v0.4.3. Here's a quick example of it works:Executing
cue eval
in the package specified above will print a definition ofPrint
.And the most fascinating part of it is that I personally find it very convenient and helpful in the context of how
cue eval
works today. It does not read_tool
files at all. So if you have a problem like an invalid disjunction defining your command in the_tool.cue
files, thecue cmd
may simply report that command as missing, which is quite confusing. I even developed a debugging practice likeWithout
my_debug.cue
, I get something like "badPrint not found". Withmy_debug.cue
, I get detailed feedback about the issue with bothcue badPrint
andcue eval
.Another benefit I get from having command pipelines defs in the main files is the easy way to inspect them. Doing
cue eval
on the package prints a structure of the command pipeline that I can review. It seems to be impossible today if I keep them in the tool files.So I wanted to express an opinion that maybe it's not worth enforcing the limited visibility of the
tool/
packages.Mainly because they don't make configuration non-hermetic while
cue eval
andcue export
are used. The configuration of the command pipelines, from my point of view, remains hermetic, and only the execution of the pipelines (invokingcue cmd
) breaks this property.Let me know if it makes sense and what you think about this question.
Beta Was this translation helpful? Give feedback.
All reactions