diff options
Diffstat (limited to 'classes')
| -rw-r--r-- | classes/go-mod-discovery.bbclass | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/classes/go-mod-discovery.bbclass b/classes/go-mod-discovery.bbclass index 9609ee35..3d58811c 100644 --- a/classes/go-mod-discovery.bbclass +++ b/classes/go-mod-discovery.bbclass | |||
| @@ -79,6 +79,18 @@ | |||
| 79 | # Default: "${FILE_DIRNAME}" (recipe's directory) | 79 | # Default: "${FILE_DIRNAME}" (recipe's directory) |
| 80 | # | 80 | # |
| 81 | # GO_MOD_DISCOVERY_SKIP_LICENSES - Set to "1" to skip license scanning | 81 | # GO_MOD_DISCOVERY_SKIP_LICENSES - Set to "1" to skip license scanning |
| 82 | # | ||
| 83 | # GO_MOD_DISCOVERY_LICENSE_TARGETS - Space-separated list of go build | ||
| 84 | # targets used by the recipe's | ||
| 85 | # do_compile. When set, the license | ||
| 86 | # scan filter is derived from | ||
| 87 | # `go list -deps` on these targets | ||
| 88 | # (the most accurate filter). Useful | ||
| 89 | # when do_compile builds multiple | ||
| 90 | # binaries with a wider import graph | ||
| 91 | # than the discovery's single | ||
| 92 | # BUILD_TARGET. Falls back to the | ||
| 93 | # GOMODCACHE walk when unset. | ||
| 82 | # Default: "" (scan enabled) | 94 | # Default: "" (scan enabled) |
| 83 | # | 95 | # |
| 84 | # WORKFLOW EXAMPLES: | 96 | # WORKFLOW EXAMPLES: |
| @@ -421,6 +433,15 @@ Or run 'bitbake ${PN} -c show_upgrade_commands' to see manual options." | |||
| 421 | LICENSE_FLAGS="" | 433 | LICENSE_FLAGS="" |
| 422 | if [ "${GO_MOD_DISCOVERY_SKIP_LICENSES}" != "1" ]; then | 434 | if [ "${GO_MOD_DISCOVERY_SKIP_LICENSES}" != "1" ]; then |
| 423 | LICENSE_FLAGS="--scan-licenses --common-license-dir ${COMMON_LICENSE_DIR} --discovery-cache ${GO_MOD_DISCOVERY_DIR}/cache" | 435 | LICENSE_FLAGS="--scan-licenses --common-license-dir ${COMMON_LICENSE_DIR} --discovery-cache ${GO_MOD_DISCOVERY_DIR}/cache" |
| 436 | # If the recipe declares its full set of build targets (used by its | ||
| 437 | # own do_compile), pass each one through so the license scan can | ||
| 438 | # scope the filter via `go list -deps` rather than the discovery's | ||
| 439 | # single BUILD_TARGET-derived GOMODCACHE walk. Use repeated | ||
| 440 | # --build-target flags so the values survive shell word-splitting | ||
| 441 | # without quoting tricks. | ||
| 442 | for target in ${GO_MOD_DISCOVERY_LICENSE_TARGETS}; do | ||
| 443 | LICENSE_FLAGS="${LICENSE_FLAGS} --build-target ${target}" | ||
| 444 | done | ||
| 424 | fi | 445 | fi |
| 425 | 446 | ||
| 426 | python3 "${FETCHER_SCRIPT}" \ | 447 | python3 "${FETCHER_SCRIPT}" \ |
