Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webui: support openwrt #1947

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

codetiger666
Copy link

可以正常编译了,关闭了size_t_is_usize,x86编译arm64会报错

@codetiger666
Copy link
Author

使用x86Ubuntu编译arm64成功

@codetiger666
Copy link
Author

只需要luci添加相应开关就不需要手动修改配置文件了

@codetiger666
Copy link
Author

编译目标强制修改了一点规则,用之前的shell会有一点小问题

@openips
Copy link

openips commented Mar 26, 2025

我试试

@openips
Copy link

openips commented Mar 26, 2025

smartdns-ui是不是需要单独出来一个pkgname 另外是不是可以smartdns和smartdns-ui用一个Makefile文件 加个判断

@codetiger666
Copy link
Author

smartdns-ui是不是需要单独出来一个pkgname 另外是不是可以smartdns和smartdns-ui用一个Makefile文件 加个判断

包名忘记改了,
image
最终名称就是smartdns-ui,这里有定义

@codetiger666
Copy link
Author

smartdns-ui是不是需要单独出来一个pkgname 另外是不是可以smartdns和smartdns-ui用一个Makefile文件 加个判断

我先改一下名称

@codetiger666
Copy link
Author

smartdns-ui是不是需要单独出来一个pkgname 另外是不是可以smartdns和smartdns-ui用一个Makefile文件 加个判断

改好了,放在一起感觉不是很好

@openips
Copy link

openips commented Mar 26, 2025

smartdns-ui是不是需要单独出来一个pkgname 另外是不是可以smartdns和smartdns-ui用一个Makefile文件 加个判断

改好了,放在一起感觉不是很好

放在一起编译的时候方便 要不还得维护两个Makefile

@codetiger666 codetiger666 force-pushed the master branch 2 times, most recently from 015954f to 9472709 Compare March 26, 2025 09:55
@codetiger666
Copy link
Author

smartdns-ui是不是需要单独出来一个pkgname 另外是不是可以smartdns和smartdns-ui用一个Makefile文件 加个判断

改好了,放在一起感觉不是很好

放在一起编译的时候方便 要不还得维护两个Makefile

好了,放一起了

@openips
Copy link

openips commented Mar 26, 2025

smartdns-ui是不是需要单独出来一个pkgname 另外是不是可以smartdns和smartdns-ui用一个Makefile文件 加个判断

改好了,放在一起感觉不是很好

放在一起编译的时候方便 要不还得维护两个Makefile

好了,放一起了

感谢 正在编译测试

@openips
Copy link

openips commented Mar 26, 2025

太慢了 直接编译镜像了 明天早上再看看

@codetiger666
Copy link
Author

太慢了 直接编译镜像了 明天早上再看看

node编译很慢

@openips
Copy link

openips commented Mar 26, 2025

make clean所有代码树后重新编译 ,发现Makefile漏了cargo ,需要强制 cargo 从 rustc 构建中生成,最终编译失败 提示如下:

/bin/sh: 1: cargo: not found
make[4]: *** [Makefile:67: smartdns-ui] Error 127
make[4]: Leaving directory '/LEDE/openwrt-x64/build_dir/target-x86_64_musl/smartdns-1.2025.0327/plugin/smartdns-ui'
make[3]: *** [Makefile:103: /LEDE/openwrt-x64/build_dir/target-x86_64_musl/smartdns-1.2025.0327/.built] Error 2
make[3]: Leaving directory '/LEDE/openwrt-x64/feeds/packages/net/smartdns'
time: package/feeds/packages/smartdns/compile#16.97#1.80#21.44
    ERROR: package/feeds/packages/smartdns failed to build.
make[2]: *** [package/Makefile:189: package/feeds/packages/smartdns/compile] Error 1
make[2]: Leaving directory '/LEDE/openwrt-x64'
make[1]: *** [package/Makefile:183: /LEDE/openwrt-x64/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/LEDE/openwrt-x64'
make: *** [/LEDE/openwrt-x64/include/toplevel.mk:233: world] Error 2

find . -name cargo 后发现
./build_dir/host/meson-1.6.1/mesonbuild/cargo
正常可以编译的系统中find . -name cargo结果如下

./build_dir/host/meson-1.6.1/mesonbuild/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/x86_64-unknown-linux-gnu/stage1-tools-bin/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/x86_64-unknown-linux-gnu/stage0/etc/bash_completion.d/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/x86_64-unknown-linux-gnu/stage0/bin/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/x86_64-unknown-linux-gnu/stage0/share/doc/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/x86_64-unknown-linux-gnu/stage0-sysroot/bin/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/tmp/tarball/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/tmp/tarball/cargo/x86_64-unknown-linux-gnu/cargo-1.85.0-x86_64-unknown-linux-gnu/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/tmp/tarball/cargo/x86_64-unknown-linux-gnu/cargo-1.85.0-x86_64-unknown-linux-gnu/cargo/etc/bash_completion.d/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/tmp/tarball/cargo/x86_64-unknown-linux-gnu/cargo-1.85.0-x86_64-unknown-linux-gnu/cargo/bin/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/tmp/tarball/cargo/x86_64-unknown-linux-gnu/cargo-1.85.0-x86_64-unknown-linux-gnu/cargo/share/doc/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/tmp/tarball/cargo/x86_64-unknown-linux-gnu/image/etc/bash_completion.d/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/tmp/tarball/cargo/x86_64-unknown-linux-gnu/image/bin/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/tmp/tarball/cargo/x86_64-unknown-linux-gnu/image/share/doc/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/dist/cargo-1.85.0-x86_64-unknown-linux-gnu/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/dist/cargo-1.85.0-x86_64-unknown-linux-gnu/cargo/etc/bash_completion.d/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/dist/cargo-1.85.0-x86_64-unknown-linux-gnu/cargo/bin/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/build/dist/cargo-1.85.0-x86_64-unknown-linux-gnu/cargo/share/doc/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/src/doc/rust-by-example/src/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/src/tools/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/src/tools/cargo/tests/testsuite/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/src/tools/cargo/src/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/src/tools/cargo/src/bin/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/src/tools/rustc-perf/collector/compile-benchmarks/cargo-0.60.0/src/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/src/tools/rustc-perf/collector/compile-benchmarks/cargo-0.60.0/src/bin/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/src/tools/clippy/clippy_lints/src/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/src/tools/rust-installer/test/image3/bin/cargo
./build_dir/target-aarch64_cortex-a53_musl/host/rustc-1.85.0-src/src/tools/rust-installer/test/image-docdir2/share/doc/cargo
./staging_dir/target-aarch64_cortex-a53_musl/host/etc/bash_completion.d/cargo
./staging_dir/target-aarch64_cortex-a53_musl/host/bin/cargo
./staging_dir/target-aarch64_cortex-a53_musl/host/share/doc/cargo

@openips
Copy link

openips commented Mar 26, 2025

继续编译的时候,提示错误
bash: line 1: npm: command not found

@codetiger666
Copy link
Author

继续编译的时候,提示错误 bash: line 1: npm: command not found

把包整在一起后依赖不能用条件判断

@codetiger666
Copy link
Author

继续编译的时候,提示错误 bash: line 1: npm: command not found

我重新提交一版,不管是否选择ui,都默认编译rust.node

@codetiger666
Copy link
Author

继续编译的时候,提示错误 bash: line 1: npm: command not found

你再试试吧

@openips
Copy link

openips commented Mar 26, 2025

继续编译的时候,提示错误 bash: line 1: npm: command not found

你再试试吧

已经用这个Makefile编译了 目前没有报错退出 估计编译完要好久 稍后反馈编译结果

@codetiger666
Copy link
Author

继续编译的时候,提示错误 bash: line 1: npm: command not found

你再试试吧

已经用这个Makefile编译了 目前没有报错退出 估计编译完要好久 稍后反馈编译结果

好的

@uingei
Copy link

uingei commented Mar 26, 2025

最近编译 mipsle-softfloat 包 smartdns 都报错,armv7 没问题,但是 ui 一直报错,貌似调整 size_t_is_usize 也不行

用的这个源 https://github.com/pymumu/openwrt-smartdns.git

@openips
Copy link

openips commented Mar 27, 2025

继续编译的时候,提示错误 bash: line 1: npm: command not found

你再试试吧

已经用这个Makefile编译了 目前没有报错退出 估计编译完要好久 稍后反馈编译结果

好的

目前 aarch64_cortex-a53的smartdns和smartdns-ui已经编译完毕 X64还在编译过程中
接下来的验证工作为:
1、单独安装smartdns和smartdns-ui的ipk 验证功能完整性
2、重刷包含smartdns和smartdns-ui的镜像文件,验证功能完整性

目前只有X64和arm64平台 只能分别针对这两种平台测试 稍后给出测试报告

@codetiger666
Copy link
Author

继续编译的时候,提示错误 bash: line 1: npm: command not found

你再试试吧

已经用这个Makefile编译了 目前没有报错退出 估计编译完要好久 稍后反馈编译结果

好的

目前 aarch64_cortex-a53的smartdns和smartdns-ui已经编译完毕 X64还在编译过程中 接下来的验证工作为: 1、单独安装smartdns和smartdns-ui的ipk 验证功能完整性 2、重刷包含smartdns和smartdns-ui的镜像文件,验证功能完整性

目前只有X64和arm64平台 只能分别针对这两种平台测试 稍后给出测试报告

ui包需要配合主包用,ui包里面只有so跟web界面,调用都在主包里

@openips
Copy link

openips commented Mar 27, 2025

继续编译的时候,提示错误 bash: line 1: npm: command not found

你再试试吧

已经用这个Makefile编译了 目前没有报错退出 估计编译完要好久 稍后反馈编译结果

好的

目前 aarch64_cortex-a53的smartdns和smartdns-ui已经编译完毕 X64还在编译过程中 接下来的验证工作为: 1、单独安装smartdns和smartdns-ui的ipk 验证功能完整性 2、重刷包含smartdns和smartdns-ui的镜像文件,验证功能完整性
目前只有X64和arm64平台 只能分别针对这两种平台测试 稍后给出测试报告

ui包需要配合主包用,ui包里面只有so跟web界面,调用都在主包里

明白
arm64已经测试完毕单独安装ipk 测试成功
Linux 6.6.83 #0 SMP Mon Mar 17 15:40:46 2025 aarch64 GNU/Linux

 netstat -ntpl|grep smartdns
tcp        0      0 0.0.0.0:6080            0.0.0.0:*               LISTEN      13800/smartdns

web
image

X64的ipk还在编译 arm64的固件镜像正在重新生成

@openips
Copy link

openips commented Mar 29, 2025

rust真不熟

@codetiger666
Copy link
Author

rust真不熟

这玩意跨平台兼容性太差了

@openips
Copy link

openips commented Mar 29, 2025

rust真不熟

这玩意跨平台兼容性太差了

没办法 openwrt官方用的是rust编译

@openips
Copy link

openips commented Mar 29, 2025

那个只是设置clang的sysroot使用交叉编译器的路径,不会缺少符号或头文件

你build.rs搜sysroot就可以看到处理

大佬 您用openwrt的main git 把smartdns-ui放到package 然后和openwrt一起编译就能发现编译失败的提示了 如果只用脚本确实可以直接编译成功

@pymumu
Copy link
Owner

pymumu commented Mar 29, 2025

又改了一下,可以看看。

原因是获取sysroot不成功,openwrt的gcc没有开启sysroot

@codetiger666
Copy link
Author

又改了一下,可以看看。

原因是获取sysroot不成功,openwrt的gcc没有开启sysroot

我试试

@openips
Copy link

openips commented Mar 29, 2025

我也在编译 有结果了发log

@openips
Copy link

openips commented Mar 29, 2025

又改了一下,可以看看。

原因是获取sysroot不成功,openwrt的gcc没有开启sysroot

最新的Makefile 116行写的有问题 应该是
MIRROR_HASH:=$(SMARTDNS_WEBUI_HASH)

arm64编译通过 有几个错误提示

/LEDE/openwrt-r4/staging_dir/host/bin/find: '/LEDE/openwrt-r4/build_dir/target-aarch64_cortex-a53_musl/smartdns-1.2025.46.2/ipkg-aarch64_cortex-a53/smartdns/etc/smartdns/domain-block.list': No such file or directory
/LEDE/openwrt-r4/staging_dir/host/bin/find: '/LEDE/openwrt-r4/build_dir/target-aarch64_cortex-a53_musl/smartdns-1.2025.46.2/ipkg-aarch64_cortex-a53/smartdns/etc/smartdns/domain-forwarding.list': No such file or directory
/LEDE/openwrt-r4/staging_dir/host/bin/find: '/LEDE/openwrt-r4/build_dir/target-aarch64_cortex-a53_musl/smartdns-1.2025.46.2/ipkg-aarch64_cortex-a53/smartdns-ui/etc/config/smartdns': No such file or directory

X64编译成功 查看日志没有arm64的错误提示
编译日志见附件

smartdns_x64.log
smartdns_arm64.log

已经将编译完毕的apk和ipk文件在arm64和x64系统中安装成功并成功运行

 ps w|grep smartdns
20584 root     33068 S    /usr/sbin/smartdns -f -c /var/etc/smartdns/smartdns.conf
21549 root      1340 S    grep smartdns
netstat -ntpl|grep smartdns
tcp        0      0 0.0.0.0:6080            0.0.0.0:*               LISTEN      20584/smartdns

整体感觉编译速度很快 下方附件为编译完毕的arm和x64的安装包
smartdns.zip

@uingei
Copy link

uingei commented Mar 29, 2025

云编译 x86_64 没啥问题了

编译 armv7l 遇到两问题

--- stderr Consider installing the bindgen-cli:cargo install --force --locked bindgen-cli`
See our User Guide for more information about bindgen:https://aws.github.io/aws-lc-rs/index.html
Failure invoking external bindgen! External bindgen command failed.

thread 'main' panicked at /workdir/openwrt/dl/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/aws-lc-sys-0.27.1/builder/main.rs:645:5:
aws-lc-sys build failed. Please enable the 'bindgen' feature on aws-lc-rs or aws-lc-sys.For more information, see the aws-lc-rs User Guide: https://aws.github.io/aws-lc-rs/index.html
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
make[4]: *** [Makefile:90: smartdns-ui] Error 101
make[4]: Leaving directory '/workdir/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/smartdns-1.2025.46.2/plugin/smartdns-ui'
make[3]: *** [Makefile:145: /workdir/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/smartdns-1.2025.46.2/.built] Error 2
make[3]: Leaving directory '/workdir/openwrt/feeds/packages/net/smartdns'
time: package/feeds/packages/smartdns/compile#83.70#10.92#43.54
ERROR: package/feeds/packages/smartdns failed to build.
make[2]: *** [package/Makefile:179: package/feeds/packages/smartdns/compile] Error 1`

强制安装 binggen-cli 这里能过

Finishedrelease profile [optimized] target(s) in 1m 51s cp target/release/libsmartdns_ui.so target/ cp: cannot stat 'target/release/libsmartdns_ui.so': No such file or directory make[4]: *** [Makefile:91: smartdns-ui] Error 1 make[4]: Leaving directory '/workdir/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/smartdns-1.2025.46.2/plugin/smartdns-ui' make[3]: *** [Makefile:147: /workdir/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/smartdns-1.2025.46.2/.built] Error 2 make[3]: Leaving directory '/workdir/openwrt/feeds/packages/net/smartdns' time: package/feeds/packages/smartdns/compile#584.98#44.39#203.86 ERROR: package/feeds/packages/smartdns failed to build. make[2]: *** [package/Makefile:179: package/feeds/packages/smartdns/compile] Error 1

x86_64 目录变量能获取,这个下面就为空了

@openips
Copy link

openips commented Mar 29, 2025

又改了一下,可以看看。

原因是获取sysroot不成功,openwrt的gcc没有开启sysroot

补充arm64测试结果
在openwrt目录下执行
make clean && rm -rf build_dir/ && rm -rf staging_dir/ && make -j1
编译至smartdns-ui时提示npm找不到导致编译失败

make[4]: Leaving directory '/LEDE/openwrt-r4/build_dir/target-aarch64_cortex-a53_musl/smartdns-1.2025.0330/src'
npm install --prefix /LEDE/openwrt-r4/build_dir/target-aarch64_cortex-a53_musl/smartdns-1.2025.0330/smartdns-webui/
bash: line 1: npm: command not found
make[3]: *** [Makefile:142: /LEDE/openwrt-r4/build_dir/target-aarch64_cortex-a53_musl/smartdns-1.2025.0330/.built] Error 127
make[3]: Leaving directory '/LEDE/openwrt-r4/feeds/packages/net/smartdns'
time: package/feeds/packages/smartdns/compile#17.84#2.40#26.03
    ERROR: package/feeds/packages/smartdns failed to build.
make[2]: *** [package/Makefile:189: package/feeds/packages/smartdns/compile] Error 1
make[2]: Leaving directory '/LEDE/openwrt-r4'
make[1]: *** [package/Makefile:183: /LEDE/openwrt-r4/staging_dir/target-aarch64_cortex-a53_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/LEDE/openwrt-r4'
make: *** [/LEDE/openwrt-r4/include/toplevel.mk:233: world] Error 2

原因应该是#1947 (comment)

之前的解决办法是不管是否选择ui,都默认编译rust.node
请大佬修改一下

@PikuZheng
Copy link
Contributor

修改 binggen 版本这里能过

问下 这里binggen改成什么版本号?改版本后还需要先强制安装binggen-cli吗?

@uingei
Copy link

uingei commented Mar 30, 2025

修改 binggen 版本这里能过

问下 这里binggen改成什么版本号?改版本后还需要先强制安装binggen-cli吗?

说得不清楚,不需要改版本,某些平台像 armv7l 就需要强制安装 binggen-cli

@PikuZheng
Copy link
Contributor

说得不清楚,不需要改版本,某些平台像 armv7l 就需要强制安装 binggen-cli

cargo install --force --locked bindgen-cli && cargo build --release --target=armv7-unknown-linux-musleabihf
报错

warning: aws-lc-sys@0.27.1: Building with: CMake
warning: aws-lc-sys@0.27.1: Symbol Prefix: Some("aws_lc_0_27_1")
warning: aws-lc-sys@0.27.1: CMAKE environment variable set: cmake
error: failed to run custom build command for `aws-lc-sys v0.27.1`

Caused by:
  process didn't exit successfully: `/workdir/plugin/smartdns-ui/target/release/build/aws-lc-sys-ad00b9a10b21f8d6/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=AWS_LC_SYS_NO_PREFIX
  cargo:rerun-if-env-changed=AWS_LC_SYS_PREGENERATING_BINDINGS
  cargo:rerun-if-env-changed=AWS_LC_SYS_EXTERNAL_BINDGEN
  cargo:rerun-if-env-changed=AWS_LC_SYS_NO_ASM
  cargo:rerun-if-env-changed=AWS_LC_SYS_CFLAGS
  cargo:rerun-if-env-changed=AWS_LC_SYS_PREBUILT_NASM
  cargo:rerun-if-env-changed=AWS_LC_SYS_C_STD
  cargo:rerun-if-env-changed=AWS_LC_SYS_CMAKE_BUILDER
  cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC
  cargo:rerun-if-env-changed=CMAKE
  cargo:warning=Building with: CMake
  cargo:warning=Symbol Prefix: Some("aws_lc_0_27_1")
  cargo:rerun-if-env-changed=CMAKE
  cargo:warning=CMAKE environment variable set: cmake

  --- stderr
  Consider installing the bindgen-cli: `cargo install --force --locked bindgen-cli`
  See our User Guide for more information about bindgen:https://aws.github.io/aws-lc-rs/index.html
  Failure invoking external bindgen! External bindgen command failed.

  thread 'main' panicked at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/aws-lc-sys-0.27.1/builder/main.rs:645:5:
  aws-lc-sys build failed. Please enable the 'bindgen' feature on aws-lc-rs or aws-lc-sys.For more information, see the aws-lc-rs User Guide: https://aws.github.io/aws-lc-rs/index.html
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@uingei
Copy link

uingei commented Mar 30, 2025

说得不清楚,不需要改版本,某些平台像 armv7l 就需要强制安装 binggen-cli

cargo install --force --locked bindgen-cli && cargo build --release --target=armv7-unknown-linux-musleabihf 报错

warning: aws-lc-sys@0.27.1: Building with: CMake
warning: aws-lc-sys@0.27.1: Symbol Prefix: Some("aws_lc_0_27_1")
warning: aws-lc-sys@0.27.1: CMAKE environment variable set: cmake
error: failed to run custom build command for `aws-lc-sys v0.27.1`

Caused by:
  process didn't exit successfully: `/workdir/plugin/smartdns-ui/target/release/build/aws-lc-sys-ad00b9a10b21f8d6/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=AWS_LC_SYS_NO_PREFIX
  cargo:rerun-if-env-changed=AWS_LC_SYS_PREGENERATING_BINDINGS
  cargo:rerun-if-env-changed=AWS_LC_SYS_EXTERNAL_BINDGEN
  cargo:rerun-if-env-changed=AWS_LC_SYS_NO_ASM
  cargo:rerun-if-env-changed=AWS_LC_SYS_CFLAGS
  cargo:rerun-if-env-changed=AWS_LC_SYS_PREBUILT_NASM
  cargo:rerun-if-env-changed=AWS_LC_SYS_C_STD
  cargo:rerun-if-env-changed=AWS_LC_SYS_CMAKE_BUILDER
  cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC
  cargo:rerun-if-env-changed=CMAKE
  cargo:warning=Building with: CMake
  cargo:warning=Symbol Prefix: Some("aws_lc_0_27_1")
  cargo:rerun-if-env-changed=CMAKE
  cargo:warning=CMAKE environment variable set: cmake

  --- stderr
  Consider installing the bindgen-cli: `cargo install --force --locked bindgen-cli`
  See our User Guide for more information about bindgen:https://aws.github.io/aws-lc-rs/index.html
  Failure invoking external bindgen! External bindgen command failed.

  thread 'main' panicked at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/aws-lc-sys-0.27.1/builder/main.rs:645:5:
  aws-lc-sys build failed. Please enable the 'bindgen' feature on aws-lc-rs or aws-lc-sys.For more information, see the aws-lc-rs User Guide: https://aws.github.io/aws-lc-rs/index.html
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

我是直接改 https://github.com/pymumu/openwrt-smartdns 的 Makefile

sed -i '/define Build\/Compile\/smartdns-ui/a\\t$(TAB)cargo install --force --locked bindgen-cli' feeds/packages/net/smartdns/Makefile

@PikuZheng
Copy link
Contributor

我是直接改 https://github.com/pymumu/openwrt-smartdns 的 Makefile

sed -i '/define Build\/Compile\/smartdns-ui/a\\t$(TAB)cargo install --force --locked bindgen-cli' feeds/packages/net/smartdns/Makefile

感谢,试过强制安装bindgen-cli但这个在musl行不通

@uingei
Copy link

uingei commented Mar 30, 2025

@PikuZheng
Copy link
Contributor

我跟你一样的 armv7-unknown-linux-musleabihf

这种通用架构我还是考虑单独编译ui的so 然后塞到ipk里去。用openwrt的sdk太麻烦了

@openips
Copy link

openips commented Mar 30, 2025

pr的Makefile就可以用openwrt的sdk编译成功

@uingei
Copy link

uingei commented Mar 30, 2025

pr的Makefile就可以用openwrt的sdk编译成功

试过?必须 bindgen-cli 和 修改 cp 行,我试了很多次了

@uingei
Copy link

uingei commented Mar 30, 2025

最新 commit 83a58fc 编译 armv7-unknown-linux-musleabihf 报错
1.log

x86_64 没问题,而且不会因为多线程编译报错了
arm64 编译的时候也会装 bindgen-cli ,但是不需要

@openips
Copy link

openips commented Mar 31, 2025

pr的Makefile就可以用openwrt的sdk编译成功

试过?必须 bindgen-cli 和 修改 cp 行,我试了很多次了

arm64和x64试过了 你是arm32 没试过

@PikuZheng
Copy link
Contributor

pr的Makefile就可以用openwrt的sdk编译成功

试过?必须 bindgen-cli 和 修改 cp 行,我试了很多次了

arm64和x64试过了 你是arm32 没试过

x86_64和arm64的aws-lc-sys不需要bindgen-cli。armv7需要。参考 https://aws.github.io/aws-lc-rs/requirements/linux.html 。最后我是修改Cargo.toml强制启用aws-lc-sys的bindgen feature编译通过,用的cargo,没使用Makefile。

编译依赖的bindgen和clang、llvm是另一件事。

@PikuZheng
Copy link
Contributor

cp文件好像只有arm架构有eabi eabihf之类的后缀。可以考虑用find和xargs直接取.so文件

@openips
Copy link

openips commented Mar 31, 2025

喊大佬来改Makefile吧

@uingei
Copy link

uingei commented Mar 31, 2025

cp文件好像只有arm架构有eabi eabihf之类的后缀。可以考虑用find和xargs直接取.so文件

cp 现在可能没什么问题了,arm64 x86_64 下都没问题了,armv7下也能正确识别平台,估计问题不大,现在问题就在判断bindgen-cli上了

@pymumu
Copy link
Owner

pymumu commented Mar 31, 2025

重新改了一下,看看。

nodejs编译太慢,没有自动编译nodejs,自行提前安装nodejs和npm

@openips
Copy link

openips commented Mar 31, 2025

重新改了一下,看看。

nodejs编译太慢,没有自动编译nodejs,自行提前安装nodejs和npm

已经在测试编译 稍后反馈

@uingei
Copy link

uingei commented Mar 31, 2025

重新改了一下,看看。

nodejs编译太慢,没有自动编译nodejs,自行提前安装nodejs和npm

armv7 arm64 都测试ok,编译一次搞定

@openips
Copy link

openips commented Apr 1, 2025

重新改了一下,看看。

nodejs编译太慢,没有自动编译nodejs,自行提前安装nodejs和npm

用最新的Makefile编译了一下 失败 看了一下需要先安装npm 安装完毕后可以安装成功
建议在readme中增加说明需要提前安装npm
目前已经编译完毕 还没有开始安装测试
等整个openwrt的文件编译完毕后刷机再测试

@openips
Copy link

openips commented Apr 1, 2025

@pymumu 大佬 最新的Makefile忘记建立/etc/smartdns/data目录了 ipk apk无法运行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants