release 载荷二进制内嵌 CI 构建机绝对路径(strip 后仍残留于 .rodata)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start by reading the release build workflow and the configuration that builds mcppls/bin/mcppls; the issue identifies the embedded paths as coming from dependency __FILE__ macros. Check how compiler flags are passed to the release build, then add an appropriate prefix map and inspect a rebuilt binary with strings -a for /home/runner paths. Done when the release payload no longer exposes those build paths.
Written by the indexing model from the issue text.
Description
环境
- mcppls v0.0.16
payload-linux-x64.tar.gz(官方 release 载荷,非源码自建) - Linux x86_64
现象
mcppls/bin/mcppls 为静态链接且已 strip 的 ELF,但 strings 仍可见构建机绝对路径。它们来自依赖包源码中断言宏的 __FILE__,位于只读数据段,strip 无法去除:
$ strings -a bin/mcppls | grep -E '^/home/runner' | sort -u | head -4
/home/runner/.mcpp/registry/data/xpkgs/mcpplibs-x-openkal-llvm-runtime/0.15.1/openkal-llvm-runtime-0.15.1/llvm/libcxxabi/src/cxa_demangle.cpp
/home/runner/.mcpp/registry/data/xpkgs/mcpplibs-x-openkal-llvm-runtime/0.15.1/openkal-llvm-runtime-0.15.1/llvm/libcxxabi/src/demangle/ItaniumDemangle.h
/home/runner/.mcpp/registry/data/xpkgs/nlohmann-x-json/3.12.0/json-3.12.0/single_include/nlohmann/json.hpp
影响
- 断言/诊断消息会把 CI 机器路径打印给最终用户。
- 下游再分发的产物隐私/供应链扫描会因嵌入构建机路径而拒绝发布(meditor 的发布门禁即如此,无法放行包含构建环境路径的载荷)。
建议
release 构建加入 -ffile-prefix-map=<abs>=.(或等价的相对路径编译),使 __FILE__/断言消息不含 CI 绝对路径。参照:同载荷中 clangd/bin/clangd 使用 $ORIGIN 相对 RUNPATH 且无内嵌构建路径,说明流程上可以做到干净。
背景
meditor(https://github.com/speak-agent/meditor ,GPL-3.0-only,专注 mcpp 与 C++ Modules 的编辑器)按 SHA-256 固定引用 mcppls 官方 release 载荷随包分发。下游已用打包期处理临时解决,但希望上游在 release 流程根治,之后下游可直接升级 pin。
- Dominant language
- C++
- Stars
- 25
- Forks
- 2
- Avg merge
- 21h 5m
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Sunrisepeak/mcpp-language-server
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Sunrisepeak/mcpp-language-server#80 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 1/100
Sunrisepeak/mcpp-language-server#77 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Sunrisepeak/mcpp-language-server#71 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
Sunrisepeak/mcpp-language-server#59 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Sunrisepeak/mcpp-language-server#52 ·
Maintainers usually reply within 1 day
All issues in Sunrisepeak/mcpp-language-server
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
xiaoyifang/goldendict-ng#3148 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
triton-inference-server/server#9069 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 4 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100