From: George Sapkin Date: Sat, 31 Jan 2026 00:44:52 +0000 (+0200) Subject: golang: install into lib instead of share X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=6f4155c0a06facf4f0a1ab2050da986bb908167d;p=openwrt-packages.git golang: install into lib instead of share Installing into share and symlinking to lib breaks tests: --- FAIL: TestAllDependencies (0.01s) moddeps_test.go:49: findGorootModules didn't find the well-known module "std" --- FAIL: TestDependencyVersionsConsistent (0.00s) moddeps_test.go:356: findGorootModules didn't find the well-known module "std" Install into lib directly instead. Fixes: c137c382 ("golang: new packages") Link: https://github.com/openwrt/packages/pull/28445 Signed-off-by: George Sapkin --- diff --git a/lang/golang/golang-compiler.mk b/lang/golang/golang-compiler.mk index a85af0f7a..43dc8a7f1 100644 --- a/lang/golang/golang-compiler.mk +++ b/lang/golang/golang-compiler.mk @@ -1,5 +1,6 @@ # # Copyright (C) 2018, 2020-2021, 2023 Jeffery To +# Copyright (C) 2025-2026 George Sapkin # # SPDX-License-Identifier: GPL-2.0-only @@ -29,16 +30,14 @@ endef # 2: go version id define GoCompiler/Default/Install/make-dirs $(INSTALL_DIR) "$(1)/lib/go-$(2)" - $(INSTALL_DIR) "$(1)/share/go-$(2)" endef # 1: source go root # 2: destination prefix # 3: go version id # 4: file/directory name -define GoCompiler/Default/Install/install-share-data - $(CP) "$(1)/$(4)" "$(2)/share/go-$(3)/" - $(LN) "../../share/go-$(3)/$(4)" "$(2)/lib/go-$(3)/" +define GoCompiler/Default/Install/install-lib-data + $(CP) "$(1)/$(4)" "$(2)/lib/go-$(3)/" endef # 1: source go root @@ -49,14 +48,14 @@ endef define GoCompiler/Default/Install/Bin $(call GoCompiler/Default/Install/make-dirs,$(2),$(3)) - $(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),api) + $(call GoCompiler/Default/Install/install-lib-data,$(1),$(2),$(3),api) $(INSTALL_DATA) -p "$(1)/go.env" "$(2)/lib/go-$(3)/" $(INSTALL_DATA) -p "$(1)/VERSION" "$(2)/lib/go-$(3)/" for file in CONTRIBUTING.md LICENSE PATENTS README.md SECURITY.md; do \ if [ -f "$(1)/$$$$file" ]; then \ - $(INSTALL_DATA) -p "$(1)/$$$$file" "$(2)/share/go-$(3)/" ; \ + $(INSTALL_DATA) -p "$(1)/$$$$file" "$(2)/lib/go-$(3)/" ; \ fi ; \ done @@ -91,7 +90,7 @@ endef define GoCompiler/Default/Install/Doc $(call GoCompiler/Default/Install/make-dirs,$(2),$(3)) - $(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),doc) + $(call GoCompiler/Default/Install/install-lib-data,$(1),$(2),$(3),doc) endef # 1: source go root @@ -100,21 +99,19 @@ endef define GoCompiler/Default/Install/Src $(call GoCompiler/Default/Install/make-dirs,$(2),$(3)) - $(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),lib) - $(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),misc) - $(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),src) - $(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),test) + $(call GoCompiler/Default/Install/install-lib-data,$(1),$(2),$(3),lib) + $(call GoCompiler/Default/Install/install-lib-data,$(1),$(2),$(3),misc) + $(call GoCompiler/Default/Install/install-lib-data,$(1),$(2),$(3),src) + $(call GoCompiler/Default/Install/install-lib-data,$(1),$(2),$(3),test) $(FIND) \ - "$(2)/share/go-$(3)/src/" \ + "$(2)/lib/go-$(3)/src/" \ \! -type d -a \( -name "*.bat" -o -name "*.rc" \) \ -delete if [ -d "$(1)/pkg/include" ]; then \ $(INSTALL_DIR) "$(2)/lib/go-$(3)/pkg" ; \ - $(INSTALL_DIR) "$(2)/share/go-$(3)/pkg" ; \ - $(CP) "$(1)/pkg/include" "$(2)/share/go-$(3)/pkg/" ; \ - $(LN) "../../../share/go-$(3)/pkg/include" "$(2)/lib/go-$(3)/pkg/" ; \ + $(CP) "$(1)/pkg/include" "$(2)/lib/go-$(3)/pkg/" ; \ fi endef @@ -122,7 +119,6 @@ endef # 2: go version id define GoCompiler/Default/Uninstall rm -rf "$(1)/lib/go-$(2)" - rm -rf "$(1)/share/go-$(2)" endef # 1: destination prefix