GitHub 热榜实测|worktrunk 环境部署实录

0 阅读1分钟

GitHub 热榜实测|worktrunk 环境部署实录

环境准备

本次实测机器为 macOS,登录用户 aresen,工作目录 /tmp/ght-smoke/。工具链情况:

  • Rust / Cargo 版本:1.80.1
  • 目标仓库:max-sixty/worktrunk(Rust 项目,Git worktree 管理工具)
  • 克隆方式:--depth 1 浅克隆,只取最新一次提交,省磁盘也省时间

没有额外装任何 Rust 依赖或预编译产物,裸跑 cargo 命令。

逐步执行

第一步:克隆仓库

$ git clone --depth 1 https://github.com/max-sixty/worktrunk

输出:

Cloning into '/tmp/ght-smoke/max-sixty__worktrunk'...
exit=0

这步很干净,浅克隆秒级完成,项目落在 /tmp/ght-smoke/max-sixty__worktrunk。

第二步:cargo build

$ cargo build

输出(exit=101):

/.bash_profile: line 10: alias: -A: not found
/Users/aresen/.bash_profile: line 11: alias: -CF: not found
error: failed to parse manifest at `/private/tmp/ght-smoke/max-sixty__worktrunk/Cargo.toml`

Caused by:
  feature `edition2024` is required

  The package requires the Cargo feature called `edition2024`, but that feature is not stabilized in this version of Cargo (1.80.1).
  Consider trying a newer version of Cargo (this may require the nightly release).
  See https://doc.rust-lang.org/night

一句话解释:cargo build 要读 Cargo.toml,但当前 1.80.1 的 Cargo 还不认 edition2024 这个关键字,直接拒绝解析 manifest,编译根本没开始。

第三步:cargo run

$ cargo run

输出(exit=101):

/.bash_profile: line 10: alias: -A: not found
/Users/aresen/.bash_profile: line 11: alias: -CF: not found
error: failed to parse manifest at `/private/tmp/ght-smoke/max-sixty__worktrunk/Cargo.toml`

Caused by:
  feature `edition2024` is required
  ...(同上)

cargo run 内部先走 cargo build,所以报的是同一个错——manifest 解析都过不了,后面什么编译、链接、运行全都不会发生。

遇到的问题与处理

问题一:Cargo 版本不够(核心阻塞)

worktrunk 的 Cargo.toml 声明了 edition = "2024",这个 edition 在 Cargo 里属于尚未稳定(unstable)的特性,1.80.1 不支持。当时判断:这不是代码 bug,是工具链版本代差。解法就一条——升级 Rust 工具链。具体命令:

rustup update stable

或者锁定一个已知支持 edition2024 的 nightly:

rustup toolchain install nightly
cargo +nightly build

实测环境里没执行这一步(记录到 cargo run 失败即停),所以下面的"验证结果"只能如实写:未通过。

问题二:.bash_profile 里两行 alias 报错(噪音)

/.bash_profile: line 10: alias: -A: not found
/Users/aresen/.bash_profile: line 11: alias: -CF: not found

这是 macOS 的 alias 命令语法问题(-A、-CF 是 zsh 的参数,bash 不认识)。不影响构建逻辑,纯粹是 shell 初始化时多嘴了两行,可以忽略,但看着烦。当时判断:与本次部署无关,先不处理。

验证结果

步骤命令结果
克隆git clone --depth 1 …✅ exit 0
编译cargo build❌ exit 101(edition2024 不兼容)
运行cargo run❌ exit 101(同上)

结论:项目本身没问题,卡点 100% 在本地 Cargo 版本。升级工具链后预期可一次通过(worktrunk 是纯 Rust 项目,没有系统级依赖),但本条记录里未执行升级动作,以上结果就是当前真实状态。

写在后面

本周我拿 GitHub 热榜上 7 个不同语言、不同复杂度的项目做了真机实测,每天放一篇,全是上面这种"命令 + 逐字输出 + 一句话解释"的写法,你可以直接复制敲。这篇是 worktrunk,后续 6 篇会覆盖更多技术栈,踩坑和修复过程一个不删。

关注我,跟着热榜项目练手。


小问题(评论区一句话就能答): 你平时升级 Rust 工具链,更习惯 rustup update stable 一把梭,还是 rustup toolchain install nightly 单独挂一条?我这边实测 1.80 已经追不上 edition2024,大概率得等 stable 再跟——你是哪种派?


做自动化这几年,最耗时间的从来不是写代码,是摸清每个平台的脾气。

这篇里提到的坑,都是真金白银踩出来的。 这类坑我还攒了不少,下一篇准备写批量发布的幂等与重试。 想先看哪块,评论区点个名。