kenzok8 / openwrt-packages

openwrt常用软件包
https://op.dllkids.xyz
6.26k stars 2.59k forks source link

mosdns编译报错 #440

Closed lzipant closed 7 months ago

lzipant commented 7 months ago

请教一下怎么解决这个报错(使用的是LIenol的代码),下面是编译日志:

...

make[3]: Entering directory '/home/harrisonlee/openwrt/Lienol/feeds/kenzo/mosdns'
rm -f /home/harrisonlee/openwrt/Lienol/build_dir/target-x86_64_musl/mosdns-5.3.1/.built
touch /home/harrisonlee/openwrt/Lienol/build_dir/target-x86_64_musl/mosdns-5.3.1/.built_check
CONFIG_GOLANG_MOD_CACHE_WORLD_READABLE="" GO_BUILD_CACHE_DIR="/home/harrisonlee/openwrt/Lienol/tmp/go-build" GO_MOD_CACHE_DIR="/home/harrisonlee/openwrt/Lienol/dl/go-mod-cache" GO_MOD_ARGS="-modcacherw" GO_PKG="github.com/IrineSistiana/mosdns" GO_INSTALL_EXTRA="" GO_INSTALL_ALL="" GO_SOURCE_ONLY="" GO_BUILD_PKG="github.com/IrineSistiana/mosdns/..." GO_EXCLUDES="" GO_GO_GENERATE="" GO_INSTALL_BIN_PATH="/usr/bin" BUILD_DIR="/home/harrisonlee/openwrt/Lienol/build_dir/target-x86_64_musl/mosdns-5.3.1" GO_BUILD_DIR="/home/harrisonlee/openwrt/Lienol/build_dir/target-x86_64_musl/mosdns-5.3.1/.go_work/build" GO_BUILD_BIN_DIR="/home/harrisonlee/openwrt/Lienol/build_dir/target-x86_64_musl/mosdns-5.3.1/.go_work/build/bin" GO_BUILD_DEPENDS_PATH="/usr/share/gocode" GO_BUILD_DEPENDS_SRC="/home/harrisonlee/openwrt/Lienol/staging_dir/target-x86_64_musl/usr/share/gocode/src" GOOS="linux" GOARCH="amd64" GO386="" GOAMD64="v1" GOARM="" GOMIPS="" GOMIPS64="" GOPPC64="" CC="x86_64-openwrt-linux-musl-gcc" CXX="x86_64-openwrt-linux-musl-g++" CGO_CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -fmacro-prefix-map=/home/harrisonlee/openwrt/Lienol/build_dir/target-x86_64_musl/mosdns-5.3.1=mosdns-5.3.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_CPPFLAGS="-I/home/harrisonlee/openwrt/Lienol/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/usr/include -I/home/harrisonlee/openwrt/Lienol/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/include/fortify -I/home/harrisonlee/openwrt/Lienol/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/include" CGO_CXXFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -fmacro-prefix-map=/home/harrisonlee/openwrt/Lienol/build_dir/target-x86_64_musl/mosdns-5.3.1=mosdns-5.3.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_LDFLAGS="-L/home/harrisonlee/openwrt/Lienol/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/usr/lib -L/home/harrisonlee/openwrt/Lienol/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/lib -znow -zrelro" CGO_ENABLED=0 GOPATH="/home/harrisonlee/openwrt/Lienol/build_dir/target-x86_64_musl/mosdns-5.3.1/.go_work/build" GOCACHE="/home/harrisonlee/openwrt/Lienol/tmp/go-build" GOMODCACHE="/home/harrisonlee/openwrt/Lienol/dl/go-mod-cache" GOENV=off /usr/bin/env bash /home/harrisonlee/openwrt/Lienol/feeds/packages/lang/golang//golang-build.sh build -v -buildvcs=false -trimpath -ldflags "all=-buildid '1698496229' -linkmode external -extldflags '-L/home/harrisonlee/openwrt/Lienol/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/usr/lib -L/home/harrisonlee/openwrt/Lienol/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/lib -Wl,-z,now -Wl,-z,relro'"        -ldflags " -X main.version=v5.3.1 -buildid '1698496229' -linkmode external -extldflags '-L/home/harrisonlee/openwrt/Lienol/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/usr/lib -L/home/harrisonlee/openwrt/Lienol/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/lib -Wl,-z,now -Wl,-z,relro'"
Finding targets

Building targets
github.com/quic-go/quic-go/internal/qtls
# github.com/quic-go/quic-go/internal/qtls
../../../../../dl/go-mod-cache/github.com/quic-go/quic-go@v0.40.0/internal/qtls/go_oldversion.go:5:13: cannot use "The version of quic-go you're using can't be built using outdated Go versions. For more details, please see https://github.com/quic-go/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built using outdated Go...) as int value in variable declaration
note: module requires Go 1.20
github.com/IrineSistiana/mosdns/v5/pkg/utils
github.com/IrineSistiana/mosdns/v5/pkg/upstream/bootstrap
# github.com/IrineSistiana/mosdns/v5/pkg/utils
../../pkg/utils/strings.go:29:16: undefined: unsafe.String
../../pkg/utils/strings.go:29:30: undefined: unsafe.SliceData
note: module requires Go 1.20
# github.com/IrineSistiana/mosdns/v5/pkg/upstream/bootstrap
../../pkg/upstream/bootstrap/bootstrap.go:93:22: undefined: context.Cause
../../pkg/upstream/bootstrap/bootstrap.go:205:35: undefined: context.Cause
note: module requires Go 1.20

make[3]: *** [Makefile:49: /home/harrisonlee/openwrt/Lienol/build_dir/target-x86_64_musl/mosdns-5.3.1/.built] Error 1
make[3]: Leaving directory '/home/harrisonlee/openwrt/Lienol/feeds/kenzo/mosdns'
time: package/feeds/kenzo/mosdns/compile#0.47#0.21#0.33
    ERROR: package/feeds/kenzo/mosdns failed to build.
make[2]: *** [package/Makefile:120: package/feeds/kenzo/mosdns/compile] Error 1
make[2]: Leaving directory '/home/harrisonlee/openwrt/Lienol'
make[1]: *** [package/Makefile:114: /home/harrisonlee/openwrt/Lienol/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/harrisonlee/openwrt/Lienol'
make: *** [/home/harrisonlee/openwrt/Lienol/include/toplevel.mk:230: world] Error 2
lzipant commented 7 months ago

使用coolsnowwolf大佬的代码没有问题。

tujj99 commented 5 months ago

golang版本问题:

rm -rf feeds/packages/lang/golang git clone https://github.com/sbwml/packages_lang_golang -b 20.x feeds/packages/lang/golang