GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: embed prerelease and build metadata in version string by reddevillg · Pull Request #1747 · OpenAtom-Linyaps/linyaps

Conversation

@reddevillg

@reddevillg reddevillg commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Introduce LINGLONG_PRERELEASE, LINGLONG_GIT_HASH, and LINGLONG_BUILD_CHANNEL CMake cache variables adn derive LINGLONG_VERSION_FULL as major.minor.patch[-prerelease][+buildinfo]. For prerelease builds the git short hash is auto-detected and tracked via CMAKE_CONFIGURE_DEPENDS so CMake reconfigures when HEAD changes.

Start development of version 1.14.0

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
gemini-code-assist[bot]
gemini-code-assist Bot reviewed Jul 15, 2026
View reviewed changes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the project version to 1.14.0 and introduces a dynamic versioning scheme (LINGLONG_VERSION_FULL) that incorporates prerelease identifiers, build channels, and Git commit hashes. This full version is now used across various CLI tools, dialogs, and libraries. Feedback on the changes suggests using find_package(Git QUIET) and checking if(GIT_FOUND) in CMakeLists.txt instead of hardcoding the git command, which can cause build failures in environments where Git is missing. Additionally, using STREQUAL "0" instead of EQUAL 0 is recommended to safely handle non-numeric error strings from execute_process.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread CMakeLists.txt Outdated
Comment on lines +37 to +85
if(LINGLONG_GIT_HASH STREQUAL "" AND NOT LINGLONG_PRERELEASE STREQUAL "")
execute_process(
COMMAND git rev-parse --git-path HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE LINGLONG_GIT_HEAD_FILE
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE LINGLONG_GIT_HEAD_RESULT
ERROR_QUIET)
if(LINGLONG_GIT_HEAD_RESULT EQUAL 0)
get_filename_component(
LINGLONG_GIT_HEAD_FILE "${LINGLONG_GIT_HEAD_FILE}" ABSOLUTE
BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set_property(
DIRECTORY APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS "${LINGLONG_GIT_HEAD_FILE}")

execute_process(
COMMAND git symbolic-ref -q HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE LINGLONG_GIT_REF
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE LINGLONG_GIT_REF_RESULT
ERROR_QUIET)
if(LINGLONG_GIT_REF_RESULT EQUAL 0)
execute_process(
COMMAND git rev-parse --git-path "${LINGLONG_GIT_REF}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE LINGLONG_GIT_REF_FILE
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE LINGLONG_GIT_REF_FILE_RESULT
ERROR_QUIET)
if(LINGLONG_GIT_REF_FILE_RESULT EQUAL 0)
get_filename_component(
LINGLONG_GIT_REF_FILE "${LINGLONG_GIT_REF_FILE}" ABSOLUTE
BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set_property(
DIRECTORY APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS "${LINGLONG_GIT_REF_FILE}")
endif()
endif()
endif()

execute_process(
COMMAND git rev-parse --short=7 HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE LINGLONG_GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
endif()

@gemini-code-assist gemini-code-assist Bot Jul 15, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Hardcoding the git command and using EQUAL for numeric comparison can cause build failures in environments where Git is not installed or not in the PATH (such as clean chroot build environments or containerized builds). If Git is missing, RESULT_VARIABLE will contain an error string, causing CMake to fail with a numeric comparison error when evaluating EQUAL 0.

It is highly recommended to use find_package(Git QUIET) to locate the Git executable and use ${GIT_EXECUTABLE} instead of the raw git command. Additionally, checking if(GIT_FOUND) ensures Git commands are only run when available, and using STREQUAL "0" safely handles any non-numeric error strings.

find_package(Git QUIET)

if(GIT_FOUND AND LINGLONG_GIT_HASH STREQUAL "" AND NOT LINGLONG_PRERELEASE STREQUAL "")
  execute_process(
    COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD
    WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
    OUTPUT_VARIABLE LINGLONG_GIT_HEAD_FILE
    OUTPUT_STRIP_TRAILING_WHITESPACE
    RESULT_VARIABLE LINGLONG_GIT_HEAD_RESULT
    ERROR_QUIET)
  if(LINGLONG_GIT_HEAD_RESULT STREQUAL "0")
    get_filename_component(
      LINGLONG_GIT_HEAD_FILE "${LINGLONG_GIT_HEAD_FILE}" ABSOLUTE
      BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
    set_property(
      DIRECTORY APPEND
      PROPERTY CMAKE_CONFIGURE_DEPENDS "${LINGLONG_GIT_HEAD_FILE}")

    execute_process(
      COMMAND ${GIT_EXECUTABLE} symbolic-ref -q HEAD
      WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
      OUTPUT_VARIABLE LINGLONG_GIT_REF
      OUTPUT_STRIP_TRAILING_WHITESPACE
      RESULT_VARIABLE LINGLONG_GIT_REF_RESULT
      ERROR_QUIET)
    if(LINGLONG_GIT_REF_RESULT STREQUAL "0")
      execute_process(
        COMMAND ${GIT_EXECUTABLE} rev-parse --git-path "${LINGLONG_GIT_REF}"
        WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
        OUTPUT_VARIABLE LINGLONG_GIT_REF_FILE
        OUTPUT_STRIP_TRAILING_WHITESPACE
        RESULT_VARIABLE LINGLONG_GIT_REF_FILE_RESULT
        ERROR_QUIET)
      if(LINGLONG_GIT_REF_FILE_RESULT STREQUAL "0")
        get_filename_component(
          LINGLONG_GIT_REF_FILE "${LINGLONG_GIT_REF_FILE}" ABSOLUTE
          BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
        set_property(
          DIRECTORY APPEND
          PROPERTY CMAKE_CONFIGURE_DEPENDS "${LINGLONG_GIT_REF_FILE}")
      endif()
    endif()
  endif()

  execute_process(
    COMMAND ${GIT_EXECUTABLE} rev-parse --short=7 HEAD
    WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
    OUTPUT_VARIABLE LINGLONG_GIT_HASH
    OUTPUT_STRIP_TRAILING_WHITESPACE
    ERROR_QUIET)
endif()

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@reddevillg
reddevillg requested review from dengbo11 and myml and removed request for dengbo11 July 15, 2026 08:57
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/ll-cli/src/main.cpp 0.00% 2 Missing ⚠️
apps/ll-builder/src/main.cpp 0.00% 1 Missing ⚠️
apps/ll-dialog/src/main.cpp 0.00% 1 Missing ⚠️
...linglong/src/linglong/builder/linglong_builder.cpp 0.00% 1 Missing ⚠️
libs/linglong/src/linglong/repo/ostree_repo.cpp 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
libs/linglong/src/linglong/repo/client_factory.h 11.53% <ø> (ø)
apps/ll-builder/src/main.cpp 0.00% <0.00%> (ø)
apps/ll-dialog/src/main.cpp 0.00% <0.00%> (ø)
...linglong/src/linglong/builder/linglong_builder.cpp 8.71% <0.00%> (ø)
libs/linglong/src/linglong/repo/ostree_repo.cpp 16.64% <0.00%> (ø)
apps/ll-cli/src/main.cpp 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@reddevillg
feat: embed prerelease and build metadata in version string
afa143d
Introduce LINGLONG_RELEASE, LINGLONG_GIT_HASH, and
LINGLONG_BUILD_CHANNEL CMake cache variables and derive
LINGLONG_VERSION_FULL as major.minor.patch[-dev][+buildinfo]. For
prerelease builds the git short hash is auto-detected and tracked via
CMAKE_CONFIGURE_DEPENDS so CMake reconfigures when HEAD changes.

Start development of version 1.14.0

Signed-off-by: reddevillg <[email protected]>
@reddevillg
reddevillg force-pushed the feat_verstr branch from 9cf136c to afa143d Compare July 16, 2026 03:29
@deepin-ci-robot

deepin-ci-robot commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

deepin pr auto review

★ 总体评分:100分

■ 【总体评价】

代码实现了版本号管理机制重构及版本号升级,逻辑严谨且符合规范
逻辑正确且无安全漏洞,代码质量优秀,保持满分

■ 【详细分析】

  • 1.语法逻辑完全正确✓

在 CMakeLists.txt 中,版本号格式校验、git hash 获取及 LINGLONG_VERSION_FULL 拼接逻辑正确无误。C++ 代码中宏替换正确,configure.h.in 宏定义声明完整。
潜在问题:无
建议:无需修改

  • 2.代码质量优秀✓

变量命名规范,构建逻辑清晰,注释和版权信息更新及时。CMake 脚本中条件判断优化了字符串比较方式,提升了代码健壮性。
潜在问题:无
建议:无需修改

  • 3.代码性能无性能问题✓

构建配置阶段执行 git 命令获取 hash 属于常规操作,不影响运行时性能。C++ 代码仅替换宏定义,无额外性能开销。
潜在问题:无
建议:无需修改

  • 4.代码安全存在0个安全漏洞✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次变更仅涉及版本号管理和宏替换,构建脚本中的 git 命令执行在配置阶段且参数固定,不存在命令注入风险,无攻击面。

  • 建议:无需修改

■ 【改进建议代码示例】

// 无需修改,代码已符合最佳实践
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dengbo11
dengbo11 approved these changes Jul 16, 2026
View reviewed changes
@deepin-ci-robot

deepin-ci-robot commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dengbo11, reddevillg

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:
  • OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dengbo11
dengbo11 merged commit 653f19a into OpenAtom-Linyaps:master Jul 16, 2026
14 of 16 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@reddevillg
reddevillg deleted the feat_verstr branch July 16, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dengbo11 dengbo11 dengbo11 approved these changes
@myml myml Awaiting requested review from myml
+1 more reviewer
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@reddevillg @deepin-ci-robot @dengbo11
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.