Skip to content

feat: add linux riscv64 package support & downloading resources from multiple providers - #112

Merged
yxsj245 merged 7 commits into
GSManagerXZ:mainfrom
xiwangly2:feat/linux-riscv64-package-support
Oct 2, 2026
Merged

yxsj245 merged 7 commits into
GSManagerXZ:mainfrom
xiwangly2:feat/linux-riscv64-package-support

Conversation

@xiwangly2

Copy link
Copy Markdown
Contributor

Summary

  • Add a linux-riscv64 package target and release artifact wiring.
  • Treat riscv64 as a degraded portable package that uses system Node.js and system unzip/zip/7z tools instead of unavailable bundled native assets.
  • Document the support boundary and update contributor guidance so new architectures do not overstate unsupported PTY, ZipTools, 7z, SteamCMD, or game-server assets.

Validation

  • npm run package:linux:riscv64:no-zip
  • cd server && npm test -- --runTestsByPath src/__tests__/7z-extract-compress.test.ts src/__tests__/7z-binary-name.test.ts src/__tests__/7z-property.test.ts
  • RevyOS / Lichee Pi 4A (10.31.0.225, riscv64): installed distro Node.js 20.18.0 plus zip/7z tools, started the generated linux-riscv64 package on port 39031, and verified the web UI returned HTML over HTTP. Logs showed expected PTY degradation and system ZIP/7z fallback.

Notes

Docker is intentionally left at amd64/arm64 because the current Dockerfile still depends on architecture-specific SteamCMD, Java, PTY, ZipTools, and 7z assumptions that are not ready for riscv64.

@xiwangly2
xiwangly2 marked this pull request as draft September 26, 2026 06:39
@xiwangly2

Copy link
Copy Markdown
Contributor Author

追加了一轮 Java/包管理器架构边界修正:

  • 后端 Java 下载产物判断抽到 javaDownloadArtifacts,riscv64、macOS 和未知 Linux 架构不再回退到 Linux x64 JDK。
  • 前端 Java 卡片按真实平台/架构禁用下载式安装,并提示改用系统 OpenJDK。
  • Linux 包管理器在非 x86 架构隐藏 :i386 包,避免 riscv64/arm64 打开包列表时尝试启用错误架构;同时加入 OpenJDK headless 包候选。

验证:

  • cd server; npm test -- --runTestsByPath src/__tests__/java-download-artifacts.test.ts src/__tests__/7z-extract-compress.test.ts src/__tests__/7z-binary-name.test.ts src/__tests__/7z-property.test.ts:4 suites / 33 tests passed。
  • npm run package:linux:riscv64:no-zip:通过,仍按预期跳过内置 Node.js、PTY、Zip-Tools 和 7z。
  • RevyOS Lichee Pi 4A (10.31.0.225, riscv64):打包产物导入 javaDownloadArtifacts 后 linux/riscv64 返回 UnsupportedJavaDownloadError;APT 包列表 APT_I386_VISIBLE 0,可见 default-jre-headless,openjdk-11-jre-headless,openjdk-17-jre-headless,openjdk-21-jre-headless;启动打包面板后 HTTP_OK,日志显示预期的 PTY 不支持和系统 /usr/bin/7z 降级。

@xiwangly2

Copy link
Copy Markdown
Contributor Author

追加更新:已继续收敛 x64-only 游戏部署路径,当前 Draft PR 分支更新到 a6978ae。

本次新增:

  • 后端新增统一架构守卫,SteamCMD 相关安装、分支查询、更新入口在非 x64 平台会提前返回明确的 400 错误。
  • Factorio headless 自动部署也加了平台/架构保护,只允许 Linux x86_64;非 x86_64 建议走手动文件部署。
  • 前端从原来的 ARM-only 判断泛化为 non-x64 limited architecture,riscv64/arm64 等特殊架构会隐藏 SteamCMD/市场/在线部署等不适用入口,并在安装向导中跳过 SteamCMD 在线安装。
  • docs/多架构支持说明.md 补充 SteamCMD 和 Factorio 的限制说明。

验证:

  • git diff --check
  • cd server; npm test -- --runTestsByPath src/__tests__/architecture-support.test.ts src/__tests__/java-download-artifacts.test.ts src/__tests__/7z-extract-compress.test.ts src/__tests__/7z-binary-name.test.ts src/__tests__/7z-property.test.ts
  • cd server; npm run build
  • cd client; npm run build
  • npm run package:linux:riscv64:no-zip
  • RevyOS Lichee Pi 4A / riscv64 (10.31.0.225) 解包运行验证:服务 HTTP OK,SteamCMD/Factorio 守卫均返回 UnsupportedArchitectureError,7z 走系统 /usr/bin/7z 降级,PTY 不可用仍为预期降级行为。

@xiwangly2 xiwangly2 changed the title feat: add linux riscv64 package support feat: add linux riscv64 package support & downloading resources from multiple providers Oct 1, 2026
@xiwangly2
xiwangly2 marked this pull request as ready for review October 1, 2026 11:22
@xiwangly2
xiwangly2 force-pushed the feat/linux-riscv64-package-support branch from a6978ae to 38350a6 Compare October 1, 2026 12:01
@xiwangly2

Copy link
Copy Markdown
Contributor Author

Update after rebasing onto upstream bb66efb:

  • Resolved the build workflow conflict by keeping upstream fixed artifact names and adding gsm3-management-panel-linux-riscv64.tar.gz.
  • Moved Java downloads to a backend-driven catalog instead of frontend hardcoded URLs.
    • Providers now include sponsor source, Eclipse Temurin via Adoptium API, and Linux system package presets.
    • The install API resolves provider/version server-side; old downloadUrl payloads remain compatible.
    • linux/riscv64 is kept separate from x64/arm64. Temurin downloads are offered for Java 17/21/25; Java 8/11 remain unavailable for Temurin riscv64 and can use system package presets when available.
  • Added frontend provider/preset selection for Java installs.
  • Added a SteamCMD temp-task directory fallback so a root-owned /tmp/gsm3-steamcmd no longer prevents ordinary-user portable-package startup.

Validation performed:

  • npm test -- --runTestsByPath src/__tests__/java-download-artifacts.test.ts -> 9 tests passed.
  • npm run build in server -> passed.
  • npm run build in client -> passed, with existing Vite chunk warnings only.
  • npm run package:linux:riscv64:no-zip -> passed. Windows host still warns that chmod is unavailable, as expected.
  • RevyOS/LicheePi 4A at 10.31.0.225:
    • uname -m -> riscv64.
    • system Node -> v20.18.0.
    • system Java -> Temurin 25.0.4.1.
    • copied the new linux-riscv64 package, started it on port 31991, and GET /api/health returned status: ok.
    • Retried without setting TMPDIR; startup still succeeded, confirming the SteamCMD temp fallback.
    • PTY remains unavailable on linux/riscv64, matching the current documented/expected degradation.

Temporary files copied to the RevyOS host for validation were removed afterwards.

@xiwangly2
xiwangly2 marked this pull request as draft October 1, 2026 12:03
@xiwangly2
xiwangly2 marked this pull request as ready for review October 1, 2026 12:28
@xiwangly2

Copy link
Copy Markdown
Contributor Author

可能需要更广泛的实际体验验证

@yxsj245

yxsj245 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

PR #112 审查报告

  • PR: feat: add linux riscv64 package support & downloading resources from multiple providers #112
  • 标题: feat: add linux riscv64 package support & downloading resources from multiple providers
  • 作者: xiwangly2 · 状态: open(非草稿)
  • 审查 base: GSManagerXZ:main PR 记录 base bb66efb;上游 main 当前 tip 3f82101
  • 审查 head: xiwangly2:feat/linux-riscv64-package-support @ 38350a60e3e208393650b7ac4bec356f116be66b(已 fetch 并核对一致)
  • merge-base: bb66efb · 规模: 38 文件,+1768/−529,5 个提交
  • 审查快照: 结论仅绑定上述 head SHA

结论:暂不可合并

理由:

  1. 存在合并冲突(P1):git merge-tree 实测与上游 main 3f82101 冲突,涉及 5 个文件:client/src/pages/EnvironmentManagerPage.tsx、docs/Java赞助版下载链接说明.md、server/src/modules/environment/javaManager.ts、server/src/routes/environment.ts、server/src/routes/gameDeployment.ts。平台 mergeable_state: dirty 佐证。
  2. 语义重叠需作者 rebase 整合(P1):上游 main 在 PR base 之后新增 3e0eb04(本地赞助者密钥管理 + server/src/utils/sponsorDownload.ts 下载会话 + java27 支持)与 cb4d956(server/src/utils/remoteSources.ts 统一远程资源链接)。PR 的后端 catalog(javaDownloadArtifacts.ts,版本仅 java8/11/17/21/25)与赞助通道基于旧架构实现;若按 PR 方案解冲突,将丢失 java27 支持和新赞助通道机制。这不是简单的文本冲突,需要作者基于新 base 重新设计整合。

无 CI 必需检查阻塞(该仓库 PR 无 check-runs),无未解决的 review 讨论。

按模块改动汇总

模块 改动 说明
打包/发布 scripts/package.js、package.json、.github/workflows/build.yml 新增 linux-riscv64 打包目标:不内置 Node.js/PTY/Zip-Tools/7z,运行时降级;CI 增加 riscv64 artifact 与 Release 产物
安装脚本 install-gsm3.sh、start.sh riscv64 走系统 Node.js(校验 >= 18)与系统 PATH;PTY 资产缺失时明确提示降级;systemd ExecStart 使用 $NODE_BIN
架构守卫(新增) server/src/utils/architectureSupport.ts、client/src/utils/architectureSupport.ts SteamCMD 仅 win32/Linux x64;Factorio headless 仅 Linux x64;前端“非 x64 受限架构”统一判断,替换原先 arm64 硬编码
Java 下载目录(新增) server/src/utils/javaDownloadArtifacts.ts(541 行) 后端驱动 catalog:sponsor/adoptium/system 三类提供方;riscv64/macOS/未知架构不回退 x64 JDK;adoptium 走官方 latest GA API
路由守卫 gameDeployment.ts、moreGames.ts、steamcmd.ts、environment.ts SteamCMD/分支查询/更新/安装、Factorio 部署在非 x64 平台提前返回 400;/java/install 支持 provider 参数,UnsupportedJavaDownloadError 返回 400
SteamCMD 临时目录 server/src/utils/steamcmdRunScript.ts tmpdir 不可写(EACCES/EPERM)时回退 data/tmp/...,保留 0o700 权限
系统工具降级 server/src/utils/zipToolsManager.ts 内置二进制不支持的平台上,ZIP 走系统 unzip/zip、7z 走系统 7z/7zz;PATH 探测含 Windows PATHEXT 处理;失败信息给出安装建议
包管理器 server/src/modules/environment/packageManager.ts 非 x86 架构跳过/拒绝 :i386 包;新增 OpenJDK headless 候选包
前端 EnvironmentManagerPage 等 9 个文件 Java 卡片改为后端 catalog 驱动的“下载源/预设”下拉;ARM 判断泛化为非 x64;onboarding/市场/SteamCMD 标签页按新判断隐藏
文档 docs/多架构支持说明.md 等 5 篇、AGENTS.md 架构支持矩阵重写,明确 riscv64 降级边界;AGENTS.md 新增第 21/22 条架构支持规范

用户可见影响:riscv64 设备(如 RevyOS/Lichee Pi 4A)可安装便携包用作 Web 管理面板;终端 PTY 在 riscv64 不可用,ZIP/7z 需系统工具;非 x64 主机隐藏 SteamCMD/在线部署/市场入口。

问题清单

P1(阻塞)

  1. 合并冲突 5 文件(见结论)。触发条件:与当前 main 合并。建议:作者 rebase 到 3f82101 并重跑构建/测试。
  2. java27/赞助通道语义回退风险:main 3e0eb04 新增 java27(environment.ts 的 getJavaArchiveFileName 与 client/.../EnvironmentManagerPage.tsx、javaManager.ts 均含 java27)与本地赞助密钥 + createSponsorDownloadSession 下载会话;PR catalog 无 java27,/java/install 旧路径仍用旧 validateSponsorKey() 语义。若解冲突时以 PR 版本为准会同时丢失 java27 与新赞助通道。建议:作者将 catalog 方案与新赞助机制、java27 合并后再请求复审。

P2

无。

P3(非阻塞)

  1. getUnsupportedArchitectureResponse 在 server/src/routes/gameDeployment.ts 与 moreGames.ts 中重复定义,建议抽到 architectureSupport.ts。
  2. EnvironmentManagerPage.tsx L287:tabDataLoaded.java 仅在环境列表与 catalog 两个请求都成功时置位;catalog 接口异常时 Java 标签页会停留在加载态(前后端同版发布场景影响低)。
  3. 前端 checkArmArchitecture 判断范围从 arm/aarch64 扩大为“所有非 x64”(含 ia32),属有意为之且文档已说明,提请知悉。
  4. 既有问题(非本 PR 引入):/java/install 未传 provider 时仍接受请求体中的任意 downloadUrl 由服务端下载;PR 新增的 provider 路径反而收紧了 URL 来源。

验证表

项目 命令/来源 结果
head SHA 核对 git fetch + git rev-parse ✅ 与平台 head 38350a6 一致
合并冲突检测 git merge-tree --write-tree main...head ❌ 5 文件冲突(exit 1)
服务端构建 cd server && npm run build ✅ exit 0
相关测试 cd server && npm test -- --runTestsByPath architecture-support / java-download-artifacts / 7z-extract-compress / 7z-binary-name / 7z-property ✅ 5 套件 41 用例全部通过
客户端构建 cd client && npm run build ✅ exit 0(14.76s)
平台 CI GitHub API check-runs @ head 0 条检查(无必需检查可核)
riscv64 实机验证 作者自述 RevyOS/Lichee Pi 4A 启动并访问 Web UI ⚠️ 未复核(本机无 riscv64 环境)

未验证项与剩余风险

  • 未在真实 riscv64 环境运行打包产物;作者提交了验证记录但本审查无法复现。
  • 未执行全量 npm run test(按局部测试原则,仅跑改动相关套件)。
  • 打包脚本(package.js)的实际 riscv64 打包流程未本机复跑(属构建机操作,无网络资产下载必要)。
  • 冲突解决后的代码会与本次审查的 head 不同,届时结论作废需复审。

审查资源与清理状态

  • 审查分支: review/pr-112-38350a6-r1(本地,未推送)
  • 审查 worktree: C:\Users\17737\Code\Opensource\GameServerManager3\dsh-pr-review-wt\pr-112-38350a6
  • state: .git/dsh-pr-reviews/pr-112-38350a6-r1/state.json
  • 清理状态: 未合并,资源保留待复查

@xiwangly2
xiwangly2 force-pushed the feat/linux-riscv64-package-support branch from 38350a6 to fbcdd23 Compare October 2, 2026 06:48
@xiwangly2

Copy link
Copy Markdown
Contributor Author

Update after rebasing and addressing the environment panel/provider concerns:

  • Rebased this PR onto upstream 3f82101; GitHub now reports mergeable_state: clean for head fbcdd23.
  • Integrated upstream's local sponsor-key/session download flow and kept the new Java 27 support instead of reverting to the older sponsor URL behavior.
  • Expanded the Java catalog from fixed cards into provider/channel choices:
    • providers: sponsor source, Eclipse Temurin via Adoptium, Azul Zulu via Azul Metadata API, and Linux system package presets;
    • channels: GA/stable and EA/preview where the provider supports it;
    • presets now include Java 27 and Java 28 EA;
    • custom Java major input supports future versions (java28-ea, java30, etc.) without needing a frontend release for every new Java version.
  • The Environment page now has a custom Java version panel with provider/channel/version controls, while the existing version cards show provider + release-channel labels.
  • Custom installed directories matching java<N> / java<N>-ea are detected so future/custom installs remain visible after refresh.
  • Fixed the Java tab loading-state issue from the review by using Promise.allSettled; one failed catalog/env request no longer leaves the tab stuck in loading state.

Validation:

  • git diff --check -> passed.
  • npm test --prefix server -- --runTestsByPath src/__tests__/java-download-artifacts.test.ts src/__tests__/architecture-support.test.ts -> 2 suites / 14 tests passed.
  • npm run build --prefix server -> passed.
  • npm run build --prefix client -> passed, with existing Vite dynamic-import/chunk-size warnings only.
  • Azul Metadata API smoke check returned valid packages for Java 21 GA and Java 28 EA on Linux x64.
  • Current head has no GitHub check-runs (total_count: 0), so there are still no CI checks attached to this PR.

@xiwangly2

Copy link
Copy Markdown
Contributor Author

Follow-up UX tweak for the Java provider/version selector:

  • Custom Java now defaults to Java 25 GA/stable instead of Java 28 EA/preview.
  • The main Java card list renders GA/stable versions only, so new users see the safer preset path first.
  • EA/preview and future custom versions remain available through the collapsed "高级:自定义 Java 版本" entry.
  • Added a catalog test assertion for the custom default major/channel.

Additional validation:

  • git diff --check -> passed.
  • npm test --prefix server -- --runTestsByPath src/__tests__/java-download-artifacts.test.ts -> 10 tests passed.
  • npm run build --prefix server -> passed.
  • npm run build --prefix client -> passed, with existing Vite dynamic-import/chunk-size warnings only.

@yxsj245
yxsj245 merged commit 1c5dc2a into GSManagerXZ:main Oct 2, 2026
@xiwangly2

Copy link
Copy Markdown
Contributor Author

Follow-up after checking the upstream author comments/history around sponsor downloads:

  • Aligned the catalog behavior with server/src/utils/sponsorDownload.ts from upstream 3e0eb04: missing/invalid sponsor key or unavailable session service should fall back to the ordinary download channel, not disable the source.
  • Sponsor/high-speed source is now installable without a local sponsor key on platforms where that artifact exists.
  • A local sponsor key only enables the optional session Cookie path for the same direct link; if that fails, installation still continues through the ordinary channel.
  • On unsupported platforms such as riscv64 when the sponsor artifact is missing, the first option falls through to an actually available provider such as Temurin or system packages.
  • Updated the Environment page copy and Java sponsor-download documentation so it no longer implies the source requires sponsorship to be usable.

Validation:

  • git diff --check -> passed.
  • npm test --prefix server -- --runTestsByPath src/__tests__/java-download-artifacts.test.ts src/__tests__/architecture-support.test.ts -> 2 suites / 16 tests passed.
  • npm run build --prefix server -> passed.
  • npm run build --prefix client -> passed, with existing Vite dynamic-import/chunk-size warnings only.

Pushed to xiwangly2:feat/linux-riscv64-package-support at 10953ea.

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.

2 participants