txthinking / brook

A cross-platform programmable network tool
https://brook.app
GNU General Public License v3.0
14.5k stars 2.39k forks source link

Cannot build for openwrt #1273

Closed ChaingTsung closed 7 months ago

ChaingTsung commented 1 year ago

This can not be built for openwrt with branch main , following is the log:

make[3]: Leaving directory '/home/yoki/openwrt/feeds/routing/bmx6'
time: package/feeds/routing/bmx6/compile#0.28#0.06#0.30
make[3]: Entering directory '/home/yoki/openwrt/feeds/routing/luci-app-bmx6'
mkdir -p /home/yoki/openwrt/staging_dir/target-aarch64_cortex-a53_musl/root-mediatek/stamp
SHELL= flock /home/yoki/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/yoki/openwrt/build_dir/target-aarch64_cortex-a53_musl/luci-app-bmx6/.pkgdir/luci-lib-jquery-1-4/. /home/yoki/openwrt/staging_dir/target-aarch64_cortex-a53_musl/root-mediatek/'
touch /home/yoki/openwrt/staging_dir/target-aarch64_cortex-a53_musl/root-mediatek/stamp/.luci-lib-jquery-1-4_installed
echo "luci-lib-jquery-1-4" >> /home/yoki/openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/luci-app-bmx6.default.install
make[3]: Leaving directory '/home/yoki/openwrt/feeds/routing/luci-app-bmx6'
time: package/feeds/routing/luci-app-bmx6/compile#0.37#0.08#0.42
make[3]: Entering directory '/home/yoki/openwrt/feeds/routing/mesh11sd'
mkdir -p /home/yoki/openwrt/staging_dir/target-aarch64_cortex-a53_musl/root-mediatek/stamp
SHELL= flock /home/yoki/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/yoki/openwrt/build_dir/target-aarch64_cortex-a53_musl/mesh11sd-2.0.0/.pkgdir/mesh11sd/. /home/yoki/openwrt/staging_dir/target-aarch64_cortex-a53_musl/root-mediatek/'
touch /home/yoki/openwrt/staging_dir/target-aarch64_cortex-a53_musl/root-mediatek/stamp/.mesh11sd_installed
echo "mesh11sd" >> /home/yoki/openwrt/staging_dir/target-aarch64_cortex-a53_musl/pkginfo/mesh11sd.default.install
make[3]: Leaving directory '/home/yoki/openwrt/feeds/routing/mesh11sd'
time: package/feeds/routing/mesh11sd/compile#0.38#0.06#0.41
make[3]: Entering directory '/home/yoki/openwrt/feeds/small/brook'
rm -f /home/yoki/openwrt/build_dir/target-aarch64_cortex-a53_musl/brook-20230606/.built
touch /home/yoki/openwrt/build_dir/target-aarch64_cortex-a53_musl/brook-20230606/.built_check
CONFIG_GOLANG_MOD_CACHE_WORLD_READABLE="" GO_BUILD_CACHE_DIR="/home/yoki/openwrt/tmp/go-build" GO_MOD_CACHE_DIR="/home/yoki/openwrt/dl/go-mod-cache" GO_MOD_ARGS="-modcacherw" GO_PKG="github.com/txthinking/brook" GO_INSTALL_EXTRA="" GO_INSTALL_ALL="" GO_SOURCE_ONLY="" GO_BUILD_PKG="github.com/txthinking/brook/cli/brook" GO_EXCLUDES="" GO_GO_GENERATE="" GO_INSTALL_BIN_PATH="/usr/bin" BUILD_DIR="/home/yoki/openwrt/build_dir/target-aarch64_cortex-a53_musl/brook-20230606" GO_BUILD_DIR="/home/yoki/openwrt/build_dir/target-aarch64_cortex-a53_musl/brook-20230606/.go_work/build" GO_BUILD_BIN_DIR="/home/yoki/openwrt/build_dir/target-aarch64_cortex-a53_musl/brook-20230606/.go_work/build/bin/linux_arm64" GO_BUILD_DEPENDS_PATH="/usr/share/gocode" GO_BUILD_DEPENDS_SRC="/home/yoki/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/share/gocode/src" GOOS="linux" GOARCH="arm64" GO386="" GOAMD64="" GOARM="" GOMIPS="" GOMIPS64="" GOPPC64="" CGO_ENABLED=1 CC="aarch64-openwrt-linux-musl-gcc" CXX="aarch64-openwrt-linux-musl-g++" CGO_CFLAGS="-Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/yoki/openwrt/build_dir/target-aarch64_cortex-a53_musl/brook-20230606=brook-20230606 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_CPPFLAGS="-I/home/yoki/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-12.3.0_musl/usr/include -I/home/yoki/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-12.3.0_musl/include/fortify -I/home/yoki/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-12.3.0_musl/include" CGO_CXXFLAGS="-Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/yoki/openwrt/build_dir/target-aarch64_cortex-a53_musl/brook-20230606=brook-20230606 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_LDFLAGS="-L/home/yoki/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-12.3.0_musl/usr/lib -L/home/yoki/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-12.3.0_musl/lib -fuse-ld=bfd -znow -zrelro" GOPATH="/home/yoki/openwrt/build_dir/target-aarch64_cortex-a53_musl/brook-20230606/.go_work/build" GOCACHE="/home/yoki/openwrt/tmp/go-build" GOMODCACHE="/home/yoki/openwrt/dl/go-mod-cache" GOENV=off GOTOOLCHAIN=local /usr/bin/env bash /home/yoki/openwrt/feeds/packages/lang/golang//golang-build.sh build -v -buildvcs=false -trimpath -ldflags "all=-buildid '1693203219' -linkmode external -extldflags '-L/home/yoki/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-12.3.0_musl/usr/lib -L/home/yoki/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-12.3.0_musl/lib -fuse-ld=bfd -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.32.0/internal/qtls/go121.go:5:13: cannot use "The version of quic-go you're using can't be built on Go 1.21 yet. 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 on Go 1.21 yet. F...) as int value in variable declaration

make[3]: *** [Makefile:47: /home/yoki/openwrt/build_dir/target-aarch64_cortex-a53_musl/brook-20230606/.built] Error 1
make[3]: Leaving directory '/home/yoki/openwrt/feeds/small/brook'
time: package/feeds/small/brook/compile#3.70#3.88#12.72
    ERROR: package/feeds/small/brook failed to build.
make[2]: *** [package/Makefile:120: package/feeds/small/brook/compile] Error 1
make[2]: Leaving directory '/home/yoki/openwrt'
make[1]: *** [package/Makefile:114: /home/yoki/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/yoki/openwrt'
make: *** [/home/yoki/openwrt/include/toplevel.mk:232:world] ERROR 2

There is the Makefile of OpenWRT:

# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org

include $(TOPDIR)/rules.mk

PKG_NAME:=brook
PKG_VERSION:=20230606
PKG_RELEASE:=$(AUTORELEASE)

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/txthinking/brook/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=4490f203973b59e5bbaa4cbfb8835232f9671dac1b82ab4de882d32a2ad6b612

PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE

PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0

GO_PKG:=github.com/txthinking/brook
GO_PKG_BUILD_PKG:=$(GO_PKG)/cli/brook

include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk

define Package/brook
  SECTION:=net
  CATEGORY:=Network
  SUBMENU:=Web Servers/Proxies
  TITLE:=A cross-platform proxy software
  DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
  URL:=https://github.com/txthinking/brook
endef

define Package/brook/description
  Brook is a cross-platform strong encryption and not detectable proxy.
  Zero-Configuration.
endef

$(eval $(call GoBinPackage,brook))
$(eval $(call BuildPackage,brook))
txthinking commented 1 year ago

it is about https://github.com/txthinking/brook/issues/1245 You can try master branch

txthinking commented 7 months ago

v20240214