internal/buildattr: factor out from cue/load
This factors out the build attribute evaluation logic so that it
can be used from other places.
This does not change any behavior.
For #3180.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: Id2a72d69695cb09118ead5c42fdb4c22feb66c76
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1197159
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>