tools: --version on every Emb tool, from src/driver/version.h

未关闭
#192 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
c
领域
tooling

调研方向

Read src/driver/version.h first and follow its comment requiring one shared version string. Then inspect the listed tool option loops and each tool’s Makefile rule; the issue allows implementing a few tools per pull request. Done means the covered tools print their name and EMBCC_VERSION with exit code 0, and a test reads the version from the header and checks every tool.

由索引模型根据 Issue 内容生成。

描述

enhancement good first issue

Context. embcc --version prints EmbCC 0.0.1-beta (...). None of the other tools has --version:

$ ./embld --version
embld: unknown option '--version'
$ ./embsim --version
embsim: embsim: unknown option '--version'

The same holds for embsvd, embmap, embpack, embrt, embread and embflash. embtrace and embar print their usage instead, and embdbg prints an old banner (EmbDBG v0 — EmbLinkOS debug-info reader). A bug report should be able to say which version of each tool was used.

Where.

  • src/driver/version.h: EMBCC_VERSION, the one version string. Read its comment: the string must stay defined in one place only.
  • Each tool's option loop: tools/embld/embld.c, tools/embsim/main.c, tools/embsvd/embsvd.c, tools/embmap/embmap.c, tools/embpack/embpack.c, tools/embrt/embrt.c, tools/embread/embread.c, tools/embflash/embflash.c, tools/embtrace/, tools/embar/, tools/embdbg/.
  • The Makefile rule for each tool. Check that the tool's build can see src/driver/version.h, and add it to the rule's prerequisites so a version bump rebuilds the tool.

Steps.

  1. Give each tool --version, printing NAME (EmbCC 0.0.1-beta) from EMBCC_VERSION, and exiting 0.
  2. Add one test, for example tests/golden/tool-versions.sh. It runs every tool with --version and checks that each prints EMBCC_VERSION, read from version.h so the test does not restate it.
  3. It is fine to do a few tools per pull request; say which ones in the PR.

Done when every tool in the README's tools table answers --version with the same version as embcc, the test checks them all, and make check passes.

Before you start: the contributor's guide has the rules. A new test counts only after it has failed against the code before your change, and a commit subject reads area: summary. Questions are welcome in the comments or in Discussions.

主要语言
C
星标
1
派生
2
平均合并
20 小时 55 分钟
30 天内合并 PR
73

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

EmbLinkOs/EmbCC 的其他 Issue

查看 EmbLinkOs/EmbCC 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。