ci: arm32 (glibc<=2.28) native-only build, remove other workflows#1
Conversation
|
@copilot 开始 执行 |
|
@copilot 我看到 https://github.com/IoTSharp/runtime/blob/f93d97dce1889b524f87229df037314c6f7bd8ca/.github/workflows/build-linux-arm-lowglibc.yml 这个修改应该没问题?拿过来, 我们提交到当前pr中 , 或者我们核对我们的目标, 开始实现 |
Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
已按目标实现:把 已校验:
CodeQL 0 告警。Code Review 仅给出版本固定的一致性建议(checkout@v4、upload-artifact@v4);由于其它 workflow 全部删除,已无需保持一致,故保留你认可的原文件内容。提交:见本次 push。 |
|
@copilot W: The repository 'http://archive.debian.org/debian buster-security Release' does not have a Release file. |
…security) Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
已修复。根因: 修复:在默认回退到 注:日志里 |
|
@copilot FAILED: [code=1] libs-native/System.Security.Cryptography.Native/CMakeFiles/objlib.dir/opensslshim.c.o define static_assert _Static_assert1 error generated. Build FAILED. /home/runner/work/runtime/runtime/src/coreclr/runtime.proj(120,5): error MSB3073: The command ""/home/runner/work/runtime/runtime/src/coreclr/build-runtime.sh" -arm -release -cross -os linux -ninja -targetrid linux-arm -cmakeargs "-DCLR_DOTNET_RID=linux-arm" -cmakeargs "-DCLR_DOTNET_HOST_PATH='/home/runner/work/runtime/runtime/.dotnet/dotnet'" -cmakeargs "-DCDAC_BUILD_TOOL_BINARY_PATH=/home/runner/work/runtime/runtime/artifacts/bin/coreclr/linux.arm.Release/cdac-build-tool/cdac-build-tool.dll" -cmakeargs "-DFEATURE_DYNAMIC_CODE_COMPILED=1" " exited with code 1. Time Elapsed 00:08:00.75 |
…_64BIT_TIME_T) Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
已修复。 根因(非 workflow bug,是平台支持下限):.NET 10 在 ARM32 Linux 上强制要求 64 位 为兑现本 PR「glibc ≤ 2.28」的目标,新增可选退化开关,只影响显式启用它的构建:
校验:CodeQL 0 告警;cmake 条件已用 |
|
@copilot roduct binaries are available at /home/runner/work/runtime/runtime/artifacts/bin/coreclr/linux.arm.Release/x64
ld.lld : error : undefined symbol: __fstat64_time64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __lstat64_time64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __fcntl_time64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __ioctl_time64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __futimens64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __getrusage64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __clock_gettime64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __pthread_cond_timedwait64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __clock_nanosleep_time64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __prctl_time64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __nanosleep64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __recvmsg64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __time64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __gettimeofday64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
ld.lld : error : undefined symbol: __gmtime64 [/home/runner/work/runtime/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj]
|
…r arm32 lowglibc Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
日志里那些 已把 subset 检测改为优先用
这样只编译原生 |
|
@copilot 下面这些报错如果不能编译通过会不会有问题? 如果缺少这些符号, 我们是不是 也需要兼容一下? 在原生动态库里面 |
不需要在原生动态库里兼容这些符号,这些报错不会影响我们的目标产物。 来源:这些 这些符号是什么: 为什么不用兼容:
上一条已把 subset 改成 当前运行(commit |
… on __USE_TIME_BITS64 Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Note
本 PR 的内容由 GitHub Copilot 编码代理生成。
目标
在
release/10.0上保留 唯一一个 GitHub Actions workflow,交叉编译 linux-arm (arm32, armhf) 的 native 运行时,目标 glibc 锁在 Debian 10 buster = glibc 2.28。最终产物只打包.so(含带版本号的软链),经actions/upload-artifact@v4上传。所有其它 workflow 已移除。新 workflow:
.github/workflows/build-linux-arm-lowglibc.ymlpush/pull_request针对release/10.0、workflow_dispatch。runnerubuntu-22.04,timeout-minutes: 240,permissions: contents: read,并发组build-arm-${{ github.ref }}(cancel-in-progress)。build-rootfs.sh arm buster --skipsigcheck构建 armhf + Debian 10 (glibc 2.28) rootfs。eng/Subsets.props,优先clr.native+libs.native+host.native,否则clr.native+libs.native,兜底clr+libs+host。.native子集是纯 CMake 原生构建,不拉入clr.tools,因此不再编译 CoreLib / crossgen2 / ILCompiler / R2RDump 等托管程序集(也消除了 ILCompiler 链接阶段的__*_time64undefined symbol)。.so跑objdump -T,取最高GLIBC_x.y,要求<= GLIBC_2.28,否则 job 失败。tar出dotnet-runtime-linux-arm-glibc228-<UTC>.tar.gz,artifactdotnet-runtime-linux-arm-glibc228,retention-days: 30。产物只含.so及软链。删除的 workflows / 辅助文件
.github/workflows/下其余全部 33 个文件(含shared/子目录)已删除,仅保留新增的build-linux-arm-lowglibc.yml。.github/其它目录(ISSUE_TEMPLATE/、copilot-instructions.md等)保持不变。rootfs 修复(buster-security 404)
eng/common/cross/build-rootfs.sh:buster分支虽把源指向archive.debian.org,但未清空默认__UbuntuSuites="updates security backports",导致 apt 请求不存在的buster-security→404→ exit 100。修复为在回退到archive.debian.org时清空__UbuntuSuites(与现有armel分支一致),__Suites仅剩buster。glibc 2.28 64 位 time_t 处理(方案 2)
弃用上一轮的
CLR_DISABLE_64BIT_TIME_T环境开关,改为一处编译期门控,行为等价但更干净:eng/native/configurecompiler.cmake:还原为 upstream 原样——无条件-D_TIME_BITS=64(移除 env 开关)。glibc 2.28 不识别该宏,静默忽略,time_t仍为 32 位。src/native/libs/System.Security.Cryptography.Native/opensslshim.c:把 64 位time_t的static_assert门控从_TIME_BITS==64改为__USE_TIME_BITS64。该宏由 glibc 仅在_TIME_BITS=64真正生效时定义(见features-time64.h:_TIME_BITS==64 && _FILE_OFFSET_BITS==64 && __TIMESIZE==32,即 glibc ≥ 2.34):sizeof(time_t)==8护栏。features-time64.h不存在 → 宏未定义 → 断言跳过 → 以 32 位time_t编译通过。CLR_DISABLE_64BIT_TIME_T。运行期
g_libSslUses32BitTime自检保持自洽(buster 上我方与系统 libssl 均为 32 位time_t)。Buster EOL 风险
Debian 10
buster已 EOL,build-rootfs.sh默认回退到archive.debian.org,其Release签名通常过期,故 workflow 显式传--skipsigcheck。归档源若网络中断或丢包,rootfs 构建会失败——这是 buster EOL 的固有风险。改动范围
.github/workflows/build-linux-arm-lowglibc.yml、eng/common/cross/build-rootfs.sh、eng/native/configurecompiler.cmake、src/native/libs/System.Security.Cryptography.Native/opensslshim.c,外加删除其余 33 个 workflow 文件。Original prompt
目标
在
IoTSharp/runtime的release/10.0分支上,准备一份 极简的 CI —— 只保留 一个 GitHub Actions workflow,用来交叉编译 linux-arm (arm32, armhf) 的 native 运行时,并把目标 glibc 锁在尽可能低的版本(首选 Debian 10buster= glibc 2.28)。所有其他 workflow 全部移除。构建产物只保留.so文件,打 tar.gz 上传为 GitHub Actions artifact。步骤
1. 同步
release/10.0到 upstream在工作目录里:
git remote add upstream https://github.com/dotnet/runtime.git git fetch upstream release/10.0 # 用 upstream 的 release/10.0 强制重置 origin 的 release/10.0 git checkout -B release/10.0 upstream/release/10.0 git push --force-with-lease origin release/10.0之后从同步好的
release/10.0上切出工作分支进行后续修改,并将最终 PR 的 base 设为release/10.0。2. 清空
.github/workflows/删除
.github/workflows/下 所有 现有 workflow / 辅助文件(.yml,.lock.yml,.md,.ps1,.json),以及shared/子目录(如还被其它已删 workflow 引用就一并删)。保留.github/下其它目录(如ISSUE_TEMPLATE/,copilot-instructions.md等)不动。3. 新增唯一 workflow
新增
.github/workflows/build-linux-arm-lowglibc.yml:push到release/10.0、workflow_dispatch、pull_request针对release/10.0。build-arm跑在ubuntu-22.04。permissions: { contents: read },concurrency: { group: 'build-arm-${{ github.ref }}', cancel-in-progress: true },timeout-minutes: 240。DOTNET_CLI_TELEMETRY_OPTOUT: 1,DOTNET_NOLOGO: 1。actions/checkout@v4,fetch-depth: 1。cmake clang lld llvm build-essential python3 debootstrap qemu-user-static binfmt-support libicu-dev libssl-dev libkrb5-dev zlib1g-dev libcurl4-openssl-dev libunwind-dev libnuma-dev liblttng-ust-dev tar gzip xz-utils unzip symlinks gnupg2 debian-archive-keyring file binutils-arm-linux-gnueabihf。eng/Subsets.props确认子集名host.native在 release/10.0 上存在,否则回退到clr+libs.native或clr+libs+host。最终选择应保证生成所有 native.so(含libcoreclr.so,libclrjit.so,System.*.Native.so,libhostfxr.so,libhostpolicy.so,libnethost.so等)。.so*:actions/upload-artifact@v4:name=dotnet-runtime-linux-arm-glibc228, path=dotnet-runtime-linux-arm-glibc228-*.tar.gz, retention-days=30。只上传
.so(含带版本号软链)。不要 上传.dll/.pdb/.json/ 托管程序集。4. 不要修改其它源码
只动
.github/workflows/目录。5. 验证
actionlint(如可用)或人工 review 检查 workflow 语法。./eng/common/cross/build-rootfs.sh在 release/10.0 上支持arm buster --skipsigcheck(应存在)。eng/Subsets.props中有效。6. PR
release/10.0。ci: arm32 (glibc<=2.28) native-only build, remove other workflows--skipsigcheck)。GITHUB_TOKEN。The following is the prior conversation context from the user's chat exploration (may be truncated):
User: 能帮我构建一个编译 当前项目为 arm32 版本, glibc 是 2.28 或者更低的脚本或者 dockerfile 吗 ?
Assistant: 下面是为 dotnet/runtime 编译 linux-arm (arm32, armhf) 并把目标 glibc 锁在 2.28(即 Debian 10 "buster") 的一套完整方案。
核心思路
dotnet/runtime官方支持交叉编译。targeting 的 glibc 版本由 rootfs(sysroot)里 libc 的版本决定。eng/common/cross/build-rootfs.sh 里已经内置了buster(Debian 10,glibc 2.28)的支持,配合arm架构即可:arm+buster→ armhf + glibc 2.28(你要的目标) ✅stretch(Debian 9, glibc 2.24),但 stretch 的归档源已比较老,buster 是更现实的“最低线”。宿主机用 Ubuntu ...
This pull request was created from Copilot chat.