Repository navigation
Conversation
Two vendored dependency patches, the deb architecture mapping, and a qemu-based CI workflow. x86_64 and aarch64 keep the same code paths. - vendor/rcgen (0.11.3): ring 0.16 -> 0.17. ring 0.16.20 implements P-256 and curve25519 only as x86/arm assembly, so a loongarch64 link fails on GFp_nistz256_*; ring 0.17 is pure Rust for those curves. Two API adjustments follow: KeyRejected::description_() is gone, and EcdsaKeyPair::from_pkcs8 takes an extra &SystemRandom. - vendor/nix (0.26.4): add loongarch64 to the ioctl table's target_arch list. The crate picks the table by explicit architecture with no fallback, so webrtc-util's nix 0.26 does not compile there. - vendor/webrtc: drop rcgen's x509-parser feature, which pulls asn1-rs/nom for code this project never calls. - packaging/deb/build-deb.sh: map uname -m loongarch64 to the Debian port name loong64. The three names differ on purpose: rustc target_arch is loongarch64, the C macro is __loongarch64, the package architecture is loong64. - .github/workflows/loongarch64.yml: GitHub has no loongarch64 runner, so run the ordinary native build inside a ghcr.io/loong64/debian container under qemu-user. Each phase records its own failure and the run reports all of them at once, because a single pass costs hours; diagnose_only probes the toolchain and skips the build.
Found by the first diagnose_only run on the real loong64 container. - The wayland probe asked pkg-config for "libwayland-client", which is the Debian package name, not the module name build.rs looks up. The run reported the module MISSING while libwayland-dev had installed fine, so the wlroots engine would have been dropped from a package that could have built it. build.rs line 145 uses "wayland-client"; use the same name here. - wayland-scanner is a binary that build.rs shells out to for the protocol bindings, so pkg-config cannot see it. Probe it explicitly: without it the build fails at compile time instead of during the environment report. - The apt phase took 7 minutes and printed nothing, because every line went to /tmp/apt.log. Echo the tail when the group closes, otherwise a diagnose run cannot show what it actually installed.
The trixie-based build produced a binary that cannot start on Deepin 23:
uuremote-server: /lib/loongarch64-linux-gnu/libc.so.6:
version `GLIBC_2.39' not found (required by uuremote-server)
trixie ships glibc 2.41, and linking against it binds the weak libc symbols
pidfd_spawnp and pidfd_getpid to GLIBC_2.39. Both are extern_weak and are
never reached on this code path, but the loader still refuses to map the
binary when the version node is missing, so the failure happens before main()
and cannot be worked around at runtime. Deepin 23 ships glibc 2.38 and has no
newer candidate in its repositories, so the build environment has to match the
target rather than the target catching up.
Build on linuxdeepin/deepin:crimson-loong64 instead: it is a loong64-native
Deepin 25 image that pins glibc 2.38, the same ABI generation as Deepin 23, and
its apt source carries every required and optional package (GTK3, Wayland,
PipeWire, libei, SDL2), so no feature is lost. Verified by extracting the image
layer: libc.so.6 exports only GLIBC_2.36 and GLIBC_2.38.
Also assert the ceiling after the build. Pinning the image fixes today's
problem, but a dependency bump could raise the floor again silently, and the
symptom only appears on the target machine. The check reads the version
requirements from the produced binary and fails the run above GLIBC_MAX (2.38).
The first Deepin-based run failed before compiling anything:
error: linking with `cc` failed: exit status: 1
/usr/bin/ld: unrecognized option '--no-rosegment'
rustc 1.100 emits -Wl,--no-rosegment by default, but GNU ld only gained that
option in binutils 2.43 and Deepin crimson ships 2.41, with no backports to
pull a newer one from. The trixie image hid this because its binutils is new
enough, so switching the base image traded one ABI problem for another.
Link with the LLD that ships inside the rustc sysroot instead. It is 23.1.5,
understands every flag rustc emits, and needs no extra package. clang stays
the driver because it supplies the library search paths: pointing rustc
straight at rust-lld loses -lm/-ldl/-lc, so ld.lld is symlinked onto PATH and
selected through -fuse-ld=lld. The distribution's own lld is not usable here
(17.x predates --rosegment entirely).
The linker is set through CARGO_TARGET_*_LINKER pointing at a small wrapper
rather than through RUSTFLAGS, so any flags a later step sets are preserved.
clang moves to the required package list, and cc::Build in build.rs is
unaffected because it drives the compiler directly for -shared objects and
never passes --no-rosegment.
Verified on the target hardware: a rustc build through this wrapper produces a
binary that links and runs, including with --no-rosegment forced.
The target dir holds objects linked against the base image's glibc, so a cache restored across a base-image change mixes two ABIs and defeats the reason for pinning the image in the first place. Switching from trixie to crimson would have done exactly that on the first run, since the old key only hashed Cargo.lock. IMAGE_TAG is a separate variable because an image reference contains '/' and ':', which actions/cache keys cannot carry.
Attaching the packages used to race release.yml: both workflows started on the tag push, so the loong64 job polled gh release view for up to fifteen minutes waiting for the release to appear. Trigger on workflow_run of Release instead. The release therefore exists before this job starts, the polling loop goes away, and a Release that failed before its publisher job is skipped outright by the job-level condition rather than discovered later. The version now comes from Cargo.toml in the checked-out tree rather than from workflow_run.head_branch, which is documented as a branch and is only incidentally the tag name for tag pushes; the release tag is built as v<version> and checked with gh release view before the hour-long build starts. Also drop what only existed to debug the first runs: - diagnose_only and run_tests inputs, and the environment report they served. workflow_dispatch still builds a branch on demand for testing. - The per-package apt_install helper and its log tail. The base image is pinned, so a package missing from it is a regression that should fail the run; the feature probes below still degrade gracefully. - The duplicated "show the produced packages" step.
release.yml publishes uu-remote-linux-v<tag>-<arch>-linux.tar.gz with a per-asset .sha256, and uu-remote-linux_<version>_<arch>.deb likewise. The loong64 job produced uu-remote-linux-<version>-loongarch64-linux.tar.gz without the "v" and collected both checksums into a single SHA256SUMS file, so the loong64 assets did not look like the rest of the release and tooling that expects <asset>.sha256 next to <asset> would not find them. Use the tag form for the tarball directory name and write one .sha256 per asset. The deb already matched: build-deb.sh emits uu-remote-linux_<version>_loong64.deb.
The workflow moved to linuxdeepin/deepin:crimson-loong64 when the Debian trixie image turned out to link GLIBC_2.39 weak symbols, but the AGENTS.md note still named the old ghcr.io/loong64/debian image.
|
感谢龙芯支持和详细的说明!初步审查:
已请 Codex 审查,修完并且审查返回后再合并。 🤖 Generated with Claude Code |
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33798c2e86
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - CI (`.github/workflows/ci.yml`) runs `cargo test --locked` on ubuntu-22.04. Pushing a `v*` tag runs | ||
| `.github/workflows/release.yml`, which builds and publishes the x86_64 tarball; release notes come from | ||
| `docs/release-notes/<tag>.md`. | ||
| - `.github/workflows/loongarch64.yml` builds the loong64 deb/tarball by running the normal native build |
There was a problem hiding this comment.
Document LoongArch installation in both user READMEs
The installation sections in README.md and README.en.md still advertise only x86_64/aarch64 and amd64/arm64 downloads; a repository-wide search found the new LoongArch support only in agent/CI/vendor material. Users therefore have no documented mapping to the loong64 deb or loongarch64-linux tarball, or guidance on the Deepin 23 portal limitation. Update both user guides: root AGENTS.md explicitly requires “Update README.md / README.en.md when user-visible features or limitations change.”
AGENTS.md reference: AGENTS.md:L303-L303
Useful? React with 👍 / 👎.
| # emulated crates costs hours. Both are saved even when the job fails, so a | ||
| # compile error does not throw the work away. | ||
| - name: Cache cargo registry and target dir | ||
| uses: actions/cache@v4 |
There was a problem hiding this comment.
Save partially built caches on failed workflow runs
When an emulated build fails late, or a subsequent upload step fails after compilation, actions/cache@v4 does not save the newly built target/registry contents: its automatic save post-step is gated on job success. A retry therefore restores only an older successful cache, or none, discarding the expensive compilation work that the surrounding comment promises to preserve. Split restoration and saving, and run an explicit actions/cache/save@v4 step under an appropriate failure-tolerant condition so failed runs retain their progress.
Useful? React with 👍 / 👎.
| apt-get install -y --no-install-recommends rustc cargo \ | ||
| || fail "neither rustup nor the distribution toolchain is available" | ||
| fi | ||
| export PATH="$CARGO_HOME/bin:$PATH" |
There was a problem hiding this comment.
Bypass cached rustup proxies in the distribution fallback
On a cache-hit run where rustup download/installation fails, the restored $CARGO_HOME/bin can still contain cargo/rustc shims while the deliberately uncached /root/.rustup is empty. This unconditional PATH prepend selects those shims instead of the just-installed distribution binaries; rustup run --help describes these commands as “explicitly proxied by rustup”, and reproducing this layout exits with “no default is configured”. Consequently the advertised fallback still fails even when apt succeeds. Only prepend this directory after a usable rustup installation, or explicitly select the distribution binaries in the fallback branch.
Useful? React with 👍 / 👎.
|
Codex 审查意见补充(与前面的阻塞问题一起处理即可):
另外 🤖 Generated with Claude Code |
A registry dependency is compiled with --cap-lints allow, so the #![deny(unused)] in nix 0.26.4 never fired. As a path dependency that cap is gone and the dead_code half of the lint is a hard error for items this project never reaches (GetOsString, SetOsString and their fields on macOS). Keep deny(unused) for the other unused lints and allow dead_code only.
…llback Three problems reported in review: - actions/cache saves in a post step that is skipped when the job fails, which is exactly the run whose target dir is worth keeping. Split it into actions/cache/restore plus an actions/cache/save step with if: always(). - The image was referenced by a moving tag while both the cache key and the glibc 2.38 floor assertion depend on its contents. Pin the digest. - When rustup fails, $CARGO_HOME/bin from the cache still holds rustup's proxies, which shadow the distribution toolchain with 'no default toolchain is configured'. Remove them and keep that dir off PATH in the fallback branch.
Every release also publishes a loong64 deb and a loongarch64 tarball, but the installation section only mentioned x86_64 and aarch64, and the GNOME/KDE row of the session table silently does not apply on Deepin 23 because libei1 is not packaged there.
install.sh reads the desktop entries and the systemd unit template from packaging/common after the packaging refactor; the x86_64/aarch64 tarball in release.yml already ships that directory, the loong64 one did not. The copy is conditional so the same workflow works before and after the refactor lands.
|
感谢更新。新头 2ac9374 已在本地验证: 接下来等 CI 结果和 Codex 对新头的复审,返回后再决定合并。另外 #258 尚未合并,若它先合入,本 PR 可能需要再同步一次 main。 @codex review 🤖 Generated with Claude Code |
|
您好,关于README要说明一下,deb 说明那行抬头是「Ubuntu / Debian(v0.2.18 起)」,这个 v0.2.18 是 deb 这个格式第一次出现的版本,和龙芯无关。龙芯包从哪个版本开始有,将取决于这个 PR 合进哪个 release,现在写不出来。我暂时在这行括号里写了「龙芯选 loong64」,没有另标版本号。 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ac9374b22
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| path: | | ||
| ${{ runner.temp }}/loongarch/cache | ||
| ${{ runner.temp }}/loongarch/target | ||
| key: loongarch64-${{ env.IMAGE_TAG }}-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }} |
There was a problem hiding this comment.
Give each retry attempt a distinct cache key
When a failed run saves a partial build and is retried with “Re-run jobs”, this key is reused because github.run_id remains unchanged between attempts (gh run view --help illustrates multiple attempts of one run with gh run view 12345 --attempt 3). The new explicit save's cache-hit != 'true' guard then suppresses saving any additional compilation progress—even when the retry successfully completes the build. Subsequent attempts keep restoring the first partial snapshot, and the completed cache is never published for future runs. Include github.run_attempt in both primary restore/save keys while retaining the existing restore prefixes so retries can preserve their additional QEMU compilation work.
Useful? React with 👍 / 👎.
github.run_id does not change between attempts of the same run, so a re-run restored attempt 1's entry as an exact hit, cache-hit became 'true', and the save step was skipped -- the completed target dir was never published and later attempts kept restoring the first partial snapshot. Key on run_attempt as well, on both the restore and the save side, and leave the restore prefixes alone so an attempt still starts from whatever the previous one built.
|
感谢更新。新头 e910ae2 已核对:保存与恢复的 key 都加上了 CI 已批准运行,再请 Codex 复审新头,返回无问题后合并。 @codex review 🤖 Generated with Claude Code |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex 复审 e910ae2 无问题、CI 全绿,感谢!不过 #258 刚合并进 main(打包资源移到 🤖 Generated with Claude Code |
# Conflicts: # AGENTS.md # packaging/deb/build-deb.sh
packaging/common exists on main since VallierDev#258 moved the desktop entries and the systemd unit template there, so the transitional directory check can go and the staging steps match release.yml exactly.
|
感谢 rebase!合并 main 后的新头 c0a2c15 已核对:冲突解决干净(README 中英、build-deb.sh、AGENTS.md 与 #258 的改动并存),loong64 tarball 现在与 release.yml 一样无条件打包 CI 已批准运行,通过后合并。 🤖 Generated with Claude Code |
前言
为项目添加 loongarch64(龙芯)支持,并让每次发版都自动构建 loong64 的安装包。
具体内容:
uu-remote-linux-v<version>-loongarch64-linux.tar.gz+.sha256uu-remote-linux_<version>_loong64.deb+.sha256workflow_dispatch也可以手动触发龙芯构建做测试,不必须与发版一起x86_64 与 aarch64 的代码路径和产物完全不变,只有 3 行真正的逻辑改动(两条
[patch.crates-io]条目、build-deb.sh一个 case 分支),其余是 vendored 依赖和新增的 CI workflow。改动清单
vendor/nix/vendor/rcgen/Cargo.toml[patch.crates-io]里挂上这两个 path 依赖(+6 行)Cargo.lockvendor/webrtc/Cargo.tomlx509-parserfeature(-1 行)packaging/deb/build-deb.shuname -m映射表增加loongarch64 → loong64(+1 行).github/workflows/loongarch64.ymlAGENTS.md非 vendor 部分合计 +402 / -50 行,其中
.github/workflows/loongarch64.yml占 374 行,Cargo.lock的 63 行变化是 ring 收敛的连带结果。三个架构名不同是刻意的,不能互相替代:
target_arch是loongarch64__loongarch64loong64(AOSC 那边用loongarch64,本 PR 按 Debian/Deepin 走loong64)为什么需要动依赖
nix 0.26.4(webrtc-util锁定):ioctl request-code 表按target_arch显式列举,loongarch64一个都匹配不上,crate 直接编译不过rcgen 0.11.3:把ring锁在0.16,而 ring 0.16.20 的 P-256 / curve25519 只有 x86/arm 汇编,loongarch64 链接时缺GFp_nistz256_*符号这两个 crate 除了打补丁没有别的路(
nix0.26 早已不维护、webrtc-util又锁死在 0.26),所以按vendor/webrtc-dtls已有的惯例,把它们 vendored 进来各改一处。另外build-deb.sh的架构映射表本来就不认识loongarch64,加上一行即可。至于 CI —— GitHub 没有 loongarch64 托管 runner,所以新增了一条 qemu 构建路径(见下文)。
引入文件的出处
vendor/nix— nix 0.26.4nix0.26.4(https://crates.io/crates/nix/0.26.4),许可证 MIT,上游 LICENSE 原样保留Cargo.toml、Cargo.toml.orig、src、test),不含 registry 的.cargo-ok标记和编辑器备份webrtc-util 0.8.1依赖nix 0.26.2(锁定到 0.26.4)。这个版本的src/sys/ioctl/linux.rs用显式target_arch列表来选择 ioctl request-code 表,loongarch64一个都匹配不上(既不是 “generic” 表,也不是 mips/powerpc/sparc 那张),于是pub use self::consts::*;解析失败,整个 crate 在 loongarch64 上编译不过src/sys/ioctl/linux.rs:46给 “generic” 表加上target_arch = "loongarch64"。LoongArch 的 ioctl 编码就是 8/8/14/2 位布局,和 x86/arm/s390x/riscv 同一张表,所以这是正确的那张。已经匹配到表的架构一个字节都没动vendor/nix/PATCHES.mdvendor/rcgen— rcgen 0.11.3rcgen0.11.3(https://crates.io/crates/rcgen/0.11.3,上游仓库github.com/est31/rcgen),许可证 MIT OR Apache-2.0,两份上游许可证原样保留ring锁在0.16,而 ring 0.16.20 的 P-256 和 curve25519 只有 x86/arm 汇编实现,loongarch64 链接时会因未定义的GFp_nistz256_*/GFp_x25519_*失败。ring 0.17.x 这几条曲线是纯 Rust 实现,能编到 loongarch64;而且vendor/webrtc-dtls本来就要 ring 0.17,等于把项目里的 ring 收敛成一个版本Cargo.toml:ring = "0.16"→"0.17"src/error.rs:ring 0.17 删掉了KeyRejected::description_(),RcgenError::RingKeyRejected改为接收&'static str,用Box::leak(format!("{:?}", err).into_boxed_str())生成src/key_pair.rs:EcdsaKeyPair::from_pkcs8在 ring 0.17 多了一个&SystemRandom参数diff -rq核对过)。证书格式、密钥类型、wire 行为都不变;ring 0.17 在 x86/arm 上仍然走原来的汇编后端,所以其他架构的性能不受影响vendor/rcgen/PATCHES.mdvendor/webrtc的一行改动vendor/webrtc里rcgen依赖开着x509-parserfeature,会拖进asn1-rs/nom一整套,而本项目从不调用那段代码,所以把它去掉了。注意webrtc-dtls自己仍然依赖x509-parser,因此这个 crate 还在依赖树里,只是webrtc不再主动启用它。龙芯上的库支持情况(实测,Deepin 23.1 / 3A6000)
uuremote-server doctor的实际输出(脱敏后):逐项说明:
readelf -d确认链上了 libgtk-3uuremote-viewer能编出来libuu-wayland.so能编、能加载libuu-portal.so编出来了;但 Deepin 23 的 apt 源里没有libei1,运行时dlopen失败,GNOME/KDE portal 会话在这个系统上不可用。deb 里libei1本来就只是Suggests,不影响安装,X11 和 wlroots 路径完全正常h264_vaapi/hevc_vaapi,硬件编码可用inproc-av本来也不是 release 特性,未启用60-uu-remote-linux-uinput.rules照旧提供总结:X11 与 wlroots Wayland 路径完整可用;GNOME/KDE portal 路径的插件能编出来,但要用户自己装上 libei1 才能用,而 Deepin 23 目前没有这个包。
CI 脚本(
.github/workflows/loongarch64.yml)由于没有原生 runner,workflow 在
linuxdeepin/deepin:crimson-loong64容器内通过qemu-user执行常规本机构建(不做交叉编译):GLIBC_2.39符号而无法在 Deepin 23 运行),并在构建后用readelf断言最高 glibc 符号版本不超过 2.38。ld不支持 rustc 默认传入的-Wl,--no-rosegment,通过包装 clang 调用 sysroot 自带的rust-lld解决。wayland/portal(libei-1.0 >= 1.1),强制要求 GTK3 链接成功;以镜像 tag +Cargo.lock哈希缓存target/(冷构建约 1 小时,命中缓存约 24 分钟)。workflow_run挂载在Release成功后执行(另保留workflow_dispatch手动触发),产物命名与release.yml保持一致(tar.gz、deb及各自.sha256)。因 qemu 下跑全量测试耗时过长,本 job 仅做构建与二进制校验,未跑cargo test。关于 rcgen 的版本
vendor/rcgen是本次 diff 体积的主要来源之一(282 KB),如果愿意升版本,可以删掉这部分。我核对了 rcgen 的发布历史:ring 0.17 的升级在 rcgen 0.12.0 就已经由上游自己做了,这 3 处补丁,与 0.12.0 官方的改法基本一致(
RcgenError变成Error的#[deprecated]别名,description_()的替代和from_pkcs8的第三个参数都已适配)。也就是说我们 vendored 的这些东西,上游已经做完了。本项目对 rcgen 的用法只有
generate_simple_self_signed(src/wallpaper.rs:358、src/ws_transport_tests.rs:193)和vendor/webrtc内部那几处,API 面很窄,升到 0.12.x 的适配成本很低。但我没有在这个 PR 里顺手升级,原因有两个:Cargo.toml的 dev-dependency(第 69 行也写着rcgen = "0.11.3")和Cargo.lock,属于独立的一次依赖升级。vendor/nix是没有这个选项了 —— nix 0.26 已经很久不维护了,而webrtc-util又把它锁在 0.26,除了打补丁没有别的路。测试
CI
loongarch64.yml在本仓库 fork 上跑过 6 次,最新一次(提交b860828,workflow_dispatch)success,耗时 24 分钟;冷缓存(首次)约 1 小时。CI 内的校验项全部通过:GTK3 已链接、 glibc 符号版本 2.38、Architecture: loong64、产物命名与校验和齐全。实机
龙芯 3A6000(Loongson 3A6000-HV),Deepin 23.1,内核 6.12.20-loong64,glibc 2.38:
dpkg -i uu-remote-linux_0.2.62_loong64.deb安装成功,dpkg -l显示ii uu-remote-linux 0.2.62 loong64Depends全部在 Deepin 23 源里可解析(libc6 >= 2.38、libgtk-3-0、libx11-6、libxext6、libxfixes3、libxtst6、ffmpeg等)uuremote-server doctor输出见上,version v0.2.62 loongarch64、build features wayland, portal, engine-pluginslibuu-wayland.so能加载;libuu-portal.so因系统缺libei1加载失败,属预期(见上表)install.sh正常工作(脚本用dirname $0定位,不依赖目录名)x86_64 / aarch64 侧没有回归验证 —— 本 PR 不涉及它们的代码路径,
Cargo.lock里 ring 从 0.16/0.17 双版本收敛为 0.17 单版本,这是 rcgen 补丁的直接结果,vendor/webrtc-dtls本来就在用 0.17。