dagger: Some cue errors are not caught before running

One big selling point of Cue is that you can catch many errors in your configuration before applying it. However, certain errors which should be caught before running (or at least feel like they should be caught), are not.

So far I have identified one category of errors which is not caught by Cue before execution:

  • References to a non-existing definition in an imported package

For example, I expect this snippet to fail before execution, but it does not:

import (
   “strings” // Package name does not matter. Builtin or external package doesn’t matter.
)

// #Nope field does not exist in the package
foo: strings.#Nope

In summary, references to non-existing fields in another package are not considered an error at build time, but will in fact resolve to an error when queried at run time.

Related

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (16 by maintainers)

Commits related to this issue

Most upvoted comments

@helderco Can you help me out filling the integration tests with all reported cases of this issue, verifying it actually fixes all of them?

There’s only one remaining issue from my list above: #1885. I confirm that’s covered in #2334.

I’ve commented over in https://github.com/cue-lang/cue/issues/629#issuecomment-1111822832. Please can you help to establish whether the issues Dagger are seeing are covered by the cases in the original description of https://github.com/cue-lang/cue/issues/629 or not? That will then help to confirm whether the proposal in https://github.com/cue-lang/cue/issues/629#issuecomment-1111867269 is sufficient or not.