BuildImage runs compilation. An error of type FileAnnotationSet may be returned. It is up to the caller to parse this if needed. FileAnnotations will use external file paths. The given ModuleReadBucket must be self-contained. A ModuleReadBucket is self-contained if it was constructed from ModuleS
( ctx context.Context, logger *slog.Logger, moduleReadBucket bufmodule.ModuleReadBucket, options ...BuildImageOption, )
| 270 | // The image will contain only files targeted by the input moduleReadBucket, |
| 271 | // those returned by [bufmodule.GetTargetFileInfos]. |
| 272 | func BuildImage( |
| 273 | ctx context.Context, |
| 274 | logger *slog.Logger, |
| 275 | moduleReadBucket bufmodule.ModuleReadBucket, |
| 276 | options ...BuildImageOption, |
| 277 | ) (Image, error) { |
| 278 | buildImageOptions := newBuildImageOptions() |
| 279 | for _, option := range options { |
| 280 | option(buildImageOptions) |
| 281 | } |
| 282 | return buildImage( |
| 283 | ctx, |
| 284 | logger, |
| 285 | moduleReadBucket, |
| 286 | buildImageOptions.excludeSourceCodeInfo, |
| 287 | buildImageOptions.noParallelism, |
| 288 | ) |
| 289 | } |
| 290 | |
| 291 | // BuildImageOption is an option for BuildImage. |
| 292 | type BuildImageOption func(*buildImageOptions) |
searching dependent graphs…