SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
19.95k stars 2.37k forks source link

package crypto/ecdh is not in GOROOT #863

Closed smallprogram closed 1 year ago

smallprogram commented 1 year ago

Operating system

Linux

System version

Ubuntu 22.04

Installation type

Others

If you are using a graphical client, please provide the version of the client.

No response

Version

```console 1.5.0-beta.5 ```

Description

complie with openwrt sdk error

error message:

make[2]: Entering directory '/home/zhusir/test/sdk/feeds/passwall_packages/sing-box'
rm -f /home/zhusir/test/sdk/build_dir/target-x86_64_musl/sing-box-1.5.0-beta.5/.built
touch /home/zhusir/test/sdk/build_dir/target-x86_64_musl/sing-box-1.5.0-beta.5/.built_check
CONFIG_GOLANG_MOD_CACHE_WORLD_READABLE="" GO_BUILD_CACHE_DIR="/home/zhusir/test/sdk/tmp/go-build" GO_MOD_CACHE_DIR="/home/zhusir/test/sdk/dl/go-mod-cache" GO_MOD_ARGS="-modcacherw" GO_PKG="github.com/sagernet/sing-box" GO_INSTALL_EXTRA="" GO_INSTALL_ALL="" GO_SOURCE_ONLY="" GO_BUILD_PKG="github.com/sagernet/sing-box/cmd/sing-box" GO_EXCLUDES="" GO_GO_GENERATE="" GO_INSTALL_BIN_PATH="/usr/bin" BUILD_DIR="/home/zhusir/test/sdk/build_dir/target-x86_64_musl/sing-box-1.5.0-beta.5" GO_BUILD_DIR="/home/zhusir/test/sdk/build_dir/target-x86_64_musl/sing-box-1.5.0-beta.5/.go_work/build" GO_BUILD_BIN_DIR="/home/zhusir/test/sdk/build_dir/target-x86_64_musl/sing-box-1.5.0-beta.5/.go_work/build/bin" GO_BUILD_DEPENDS_PATH="/usr/share/gocode" GO_BUILD_DEPENDS_SRC="/home/zhusir/test/sdk/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 -ffile-prefix-map=/home/zhusir/test/sdk/build_dir/target-x86_64_musl/sing-box-1.5.0-beta.5=sing-box-1.5.0-beta.5 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_CPPFLAGS="-I/home/zhusir/test/sdk/staging_dir/toolchain-x86_64_gcc-11.2.0_musl/usr/include -I/home/zhusir/test/sdk/staging_dir/toolchain-x86_64_gcc-11.2.0_musl/include/fortify -I/home/zhusir/test/sdk/staging_dir/toolchain-x86_64_gcc-11.2.0_musl/include" CGO_CXXFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/home/zhusir/test/sdk/build_dir/target-x86_64_musl/sing-box-1.5.0-beta.5=sing-box-1.5.0-beta.5 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_LDFLAGS="-L/home/zhusir/test/sdk/staging_dir/toolchain-x86_64_gcc-11.2.0_musl/usr/lib -L/home/zhusir/test/sdk/staging_dir/toolchain-x86_64_gcc-11.2.0_musl/lib -znow -zrelro" CGO_ENABLED=0 GOPATH="/home/zhusir/test/sdk/build_dir/target-x86_64_musl/sing-box-1.5.0-beta.5/.go_work/build" GOCACHE="/home/zhusir/test/sdk/tmp/go-build" GOMODCACHE="/home/zhusir/test/sdk/dl/go-mod-cache" GOENV=off /usr/bin/env bash /home/zhusir/test/sdk/feeds/packages/lang/golang//golang-build.sh build -v -buildvcs=false -trimpath -ldflags "all=-buildid '1672705461' -linkmode external -extldflags '-L/home/zhusir/test/sdk/staging_dir/toolchain-x86_64_gcc-11.2.0_musl/usr/lib -L/home/zhusir/test/sdk/staging_dir/toolchain-x86_64_gcc-11.2.0_musl/lib -Wl,-z,now -Wl,-z,relro'"        -ldflags " -X github.com/sagernet/sing-box/constant.Version=v1.5.0-beta.5 -buildid '1672705461' -linkmode external -extldflags '-L/home/zhusir/test/sdk/staging_dir/toolchain-x86_64_gcc-11.2.0_musl/usr/lib -L/home/zhusir/test/sdk/staging_dir/toolchain-x86_64_gcc-11.2.0_musl/lib -Wl,-z,now -Wl,-z,relro'" -tags "with_clash_api,with_dhcp,with_ech,with_quic,with_utls,with_wireguard"
Finding targets

Building targets
../../../../../dl/go-mod-cache/github.com/sagernet/cloudflare-tls@v0.0.0-20230829051644-4a68352d0c4a/cfkem.go:25:2: package crypto/ecdh is not in GOROOT (/home/zhusir/test/sdk/staging_dir/hostpkg/lib/go-cross/src/crypto/ecdh)

make[2]: *** [Makefile:159: /home/zhusir/test/sdk/build_dir/target-x86_64_musl/sing-box-1.5.0-beta.5/.built] Error 1
make[2]: Leaving directory '/home/zhusir/test/sdk/feeds/passwall_packages/sing-box'
time: package/feeds/passwall_packages/sing-box/compile#0.28#0.11#0.19
    ERROR: package/feeds/passwall_packages/sing-box failed to build.
make[1]: *** [package/Makefile:116: package/feeds/passwall_packages/sing-box/compile] Error 1
make[1]: Leaving directory '/home/zhusir/test/sdk'
make: *** [/home/zhusir/test/sdk/include/toplevel.mk:223: package/luci-app-passwall/compile] Error 2

Reproduction

wget https://downloads.openwrt.org/releases/22.03.3/targets/x86/64/openwrt-sdk-22.03.3-x86-64_gcc-11.2.0_musl.Linux-x86_64.tar.xz
mkdir sdk && tar -xJf openwrt-sdk-22.03.3-x86-64_gcc-11.2.0_musl.Linux-x86_64.tar.xz -C ./sdk --strip-components=1
cd sdk
echo "src-git base https://github.com/openwrt/openwrt.git;openwrt-22.03" > feeds.conf
echo "src-git packages https://github.com/openwrt/packages.git;openwrt-22.03" >> feeds.conf
echo "src-git luci https://github.com/openwrt/luci.git;openwrt-22.03" >> feeds.conf
echo "src-git routing https://git.openwrt.org/feed/routing.git;openwrt-22.03"  >> feeds.conf
echo "src-git passwall_packages https://github.com/xiaorouji/openwrt-passwall.git;packages" >> feeds.conf
echo "src-git passwall_luci https://github.com/xiaorouji/openwrt-passwall.git;luci" >> feeds.conf
./scripts/feeds update -a
./scripts/feeds install -a -f -p passwall_packages
./scripts/feeds install luci-app-passwall
echo "CONFIG_ALL_NONSHARED=n" > .config
echo "CONFIG_ALL_KMODS=n" >> .config
echo "CONFIG_ALL=n" >> .config
echo "CONFIG_AUTOREMOVE=n" >> .config
echo "CONFIG_PACKAGE_luci-app-passwall=m" >> .config
echo "CONFIG_PACKAGE_luci-app-passwall_INCLUDE_SingBox=y" >> .config
make defconfig
make download -j8
make package/luci-app-passwall/{clean,compile} -j1 V=s

Logs

```console # Replace this line with logs ```
nekohasekai commented 1 year ago

https://sing-box.sagernet.org/installation/from-source/#requirements

sdhz151 commented 1 year ago

云编译。这样添加吧简单! golang版本低了。

smallprogram commented 1 year ago

云编译。这样添加吧简单! golang版本低了。 - name: Install golang run: cd openwrt && rm -rf feeds/packages/lang/golang && svn co https://github.com/openwrt/packages/branches/openwrt-23.05/lang/golang feeds/packages/lang/golang

- name: Download package上面添加
  id: package

嗯,我直接用23.05的sdk了