Skip to content

Modify build.Instance before building it? #440

Answered by cueckoo
cueckoo asked this question in General
Discussion options

You must be logged in to vote

Original reply by @mpvl in cuelang/cue#440 (comment)

You can modify build.Instance files, like adding additional Files, at will. The compiler will only look at Files.

It is also fine to modify the contents of existing Files.

You do need to ensure the Imports maps is updated accordingly to ensured imported packages are loaded as well if the added files introduce any imports, I believe. I may remove this requirement in the future, but for now it can't hurt to add it.

More info:
The building goes in two stages: first it collects the set of files, then it converts those to syntax trees in Files.

By the time load is done, all is converted to Files, so it safe to ignore any of the other file fi…

Replies: 2 comments 1 reply

Comment options

cueckoo
Jul 3, 2021
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by cueckoo
Comment options

cueckoo
Jul 3, 2021
Collaborator Author

You must be logged in to vote
1 reply
@cueckoo
Comment options

cueckoo Jul 3, 2021
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant