diff options
Diffstat (limited to 'classes/go-mod-vcs.bbclass')
| -rw-r--r-- | classes/go-mod-vcs.bbclass | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/classes/go-mod-vcs.bbclass b/classes/go-mod-vcs.bbclass index 5ba6a775..f7c8b27a 100644 --- a/classes/go-mod-vcs.bbclass +++ b/classes/go-mod-vcs.bbclass | |||
| @@ -42,6 +42,13 @@ | |||
| 42 | # Go can extract on-demand from cache (experimental) | 42 | # Go can extract on-demand from cache (experimental) |
| 43 | # | 43 | # |
| 44 | 44 | ||
| 45 | # Override go.bbclass defaults for VCS-based module caching | ||
| 46 | # These ensure offline builds use our pre-built module cache | ||
| 47 | export GOMODCACHE = "${S}/pkg/mod" | ||
| 48 | export GOPROXY = "off" | ||
| 49 | export GOSUMDB = "off" | ||
| 50 | export GOTOOLCHAIN = "local" | ||
| 51 | |||
| 45 | python do_create_module_cache() { | 52 | python do_create_module_cache() { |
| 46 | """ | 53 | """ |
| 47 | Build Go module cache from downloaded git repositories. | 54 | Build Go module cache from downloaded git repositories. |
| @@ -473,7 +480,7 @@ python do_create_module_cache() { | |||
| 473 | if go_match: | 480 | if go_match: |
| 474 | go_version = go_match.group(1).decode('utf-8', errors='ignore') | 481 | go_version = go_match.group(1).decode('utf-8', errors='ignore') |
| 475 | # Module declaration doesn't match import path - synthesize correct one | 482 | # Module declaration doesn't match import path - synthesize correct one |
| 476 | bb.warn(f"Module {module_path}@{version}: go.mod declares '{declared_module}' but should be '{module_path}', synthesizing correct go.mod (preserving go {go_version})") | 483 | bb.note(f"Module {module_path}@{version}: go.mod declares '{declared_module}' but should be '{module_path}', synthesizing correct go.mod (preserving go {go_version})") |
| 477 | mod_content = synthesize_go_mod(module_path, go_version) | 484 | mod_content = synthesize_go_mod(module_path, go_version) |
| 478 | else: | 485 | else: |
| 479 | bb.debug(1, f"go.mod not found at {gomod_file}") | 486 | bb.debug(1, f"go.mod not found at {gomod_file}") |
| @@ -646,7 +653,7 @@ python do_create_module_cache() { | |||
| 646 | hash_value = retry_hash | 653 | hash_value = retry_hash |
| 647 | 654 | ||
| 648 | if hash_value and hash_value != expected_hash: | 655 | if hash_value and hash_value != expected_hash: |
| 649 | bb.warn(f"{module_key} still mismatches expected hash after retry ({hash_value} != {expected_hash})") | 656 | bb.note(f"{module_key} still mismatches expected hash after retry ({hash_value} != {expected_hash})") |
| 650 | 657 | ||
| 651 | if hash_value: | 658 | if hash_value: |
| 652 | ziphash_path = download_dir / f"{escaped_version}.ziphash" | 659 | ziphash_path = download_dir / f"{escaped_version}.ziphash" |
