bouldev / PhoenixBuilder

New era FastBuilder Phoenix
GNU Affero General Public License v3.0
2 stars 1 forks source link

工作流无法编译 `netbsd` 和 `ish` 版本 #4

Open Happy2018new opened 4 months ago

Happy2018new commented 4 months ago

Copied from origin issue.


Netbsd 版本无法编译

编译 netbsd 版本时遭遇了如下错误

GODEBUG=madvdontneed=1 CGO_CFLAGS="-DFB_VERSION=\"5.9.0\" -DFB_COMMIT=\"51c36a3\" -DFB_COMMIT_LONG=\"51c36a35f5bff082fc1a2aeec33b4a9274cb7725\"" CGO_LDFLAGS="-Ldepends/buildroot/netbsd/i386/lib -Ldepends/buildroot/netbsd/i386/usr/lib -Wl,-rpath,/usr/pkg/lib" ALT_CLANG="/home/runner/llvm/bin/clang" CC="`pwd`/depends/buildroot/netbsd/bin/clang -target i386--netbsd --sysroot=`pwd`/depends/buildroot/netbsd/i386 -fuse-ld=/home/runner/llvm/bin/ld.lld -Wno-unused-command-line-argument" GOOS=netbsd GOARCH=386 CGO_ENABLED=1 go build -trimpath -ldflags "-s -w" -o build/phoenixbuilder-netbsd-executable-x86
# phoenixbuilder
/opt/hostedtoolcache/go/1.21.8/x64/pkg/tool/linux_amd64/link: running /home/runner/work/PhoenixBuilder/PhoenixBuilder/depends/buildroot/netbsd/bin/clang failed: exit status 1
ld.lld: error: unable to find library -lresolv
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [Makefile:206: build/phoenixbuilder-netbsd-executable-x86] Error 1
Error: Process completed with exit code 2.

ISH 版本无法编译

编译 ish 版本时遭遇了如下错误

GODEBUG=madvdontneed=1 CGO_CFLAGS="-DFB_VERSION=\"5.9.0\" -DFB_COMMIT=\"adde889\" -DFB_COMMIT_LONG=\"adde889bb88dd4ede667abe922e6880aa1953dac\"" CC="/home/runner/i686-unknown-linux-musl/bin/i686-unknown-linux-musl-gcc --sysroot=`pwd`/depends/buildroot/ish" CGO_ENABLED=1 GOOS=linux GOARCH=386 go build -tags "ish" -trimpath -ldflags "-s -w" -o build/phoenixbuilder-ish-executable
# phoenixbuilder/fastbuilder/readline
readline.c: In function 'readline_to_args':
readline.c:116:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  116 |         ret[0]=(void *)(int64_t)(argc);
      |                ^
readline.c: In function 'fb_readline_completion':
readline.c:163:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  163 |         int argc=(int)(int64_t)args[0];
      |                       ^
# phoenixbuilder
/opt/hostedtoolcache/go/1.21.8/x64/pkg/tool/linux_amd64/link: running /home/runner/i686-unknown-linux-musl/bin/i686-unknown-linux-musl-gcc failed: exit status 1
/home/runner/i686-unknown-linux-musl/bin/../lib/gcc/i686-unknown-linux-musl/11.2.0/../../../../i686-unknown-linux-musl/bin/ld: cannot find -lresolv: No such file or directory
collect2: error: ld returned 1 exit status

make: *** [Makefile:144: build/phoenixbuilder-ish-executable] Error 1
Error: Process completed with exit code 2.

注意事项

工作流运行日志

Happy2018new commented 4 months ago

Wrote by @Torrekie


netbsd缺少libresolv这个,需要确认源码中它出现在什么地方,然后移除对这个库的需求参数

然后ish这个,大概是int64_t和void *以及int的大小不一致的问题,在C编译器处理时显示warning但是会被golang视为错误,解法是根据是否有__LP64__来判断正确的cast类型,或者通过#pragma GCC diagnostic ignore "-Wint-to-pointer-cast" 这样的方式来避免warning的产生

Happy2018new commented 4 months ago

Wrote by myself, with some modify.


哈哈,我不太了解这些,或许需要你帮助修复它们?

Torrekie commented 4 months ago

i believe the ish build problem has been fixed by fd730dc2871eaf897c2163b3b9e7f7e9a738b8c0, please check this when next version bump

Happy2018new commented 4 months ago

i believe the ish build problem has been fixed by fd730dc, please check this when next version bump

Action failed: https://github.com/bouldev/PhoenixBuilder/actions/runs/9924745871/job/27416400829