summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2025-12-07 02:56:32 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2025-12-08 20:57:44 -0500
commitaee553e9d9c32a58be7b37ccb7daa43b87c78b8d (patch)
treeb0de44878c0947a427585aef92665db56ddd6b9c /classes
parent0e22a16765d5abb54e7d3d1640fa2c9b75768f8f (diff)
downloadmeta-virtualization-aee553e9d9c32a58be7b37ccb7daa43b87c78b8d.tar.gz
go-mod-vcs: declare cache defaults
There are variables which are common to all recipes, declare defaults to make recipe integration simpler. Also, when creating the cache the messages are normal about synthesis, etc, so reduce them to bb.note. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/go-mod-vcs.bbclass11
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
47export GOMODCACHE = "${S}/pkg/mod"
48export GOPROXY = "off"
49export GOSUMDB = "off"
50export GOTOOLCHAIN = "local"
51
45python do_create_module_cache() { 52python 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"