Skip to content

Conversation

@opsiff
Copy link
Member

@opsiff opsiff commented Feb 25, 2025

chore for github CI pipeline

Summary by Sourcery

CI:

  • Add a new CI job to build the kernel with clang for both x86-64 and arm64 architectures.

@sourcery-ai
Copy link

sourcery-ai bot commented Feb 25, 2025

Reviewer's Guide by Sourcery

This pull request adds a new CI job to build the kernel with clang for both x86-64 and arm64 architectures. This change aims to ensure kernel compatibility and stability across different architectures when compiled with clang.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Added a new CI job to build the kernel with clang for arm64 architecture.
  • Added a new job to the build-kernel-arm64.yml workflow.
  • The new job configures the kernel using deepin_arm64_desktop_defconfig.
  • The new job compiles the kernel using make LLVM=1 -j$(nproc).
.github/workflows/build-kernel-arm64.yml
Added a new CI job to build the kernel with clang for x86-64 architecture.
  • Added a new job to the build-kernel.yml workflow.
  • The new job configures the kernel using deepin_x86_desktop_defconfig.
  • The new job compiles the kernel using make LLVM=1 -j$(nproc).
.github/workflows/build-kernel.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from opsiff. For more information see the Code Review Process.

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

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

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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @opsiff - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a step to check for build errors, failing the CI if any are found.
  • It might be helpful to cache the build outputs to speed up subsequent CI runs.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@opsiff opsiff force-pushed the linux-6.6.y-2025-02-25-ci branch from 291bb0d to 71e1b4a Compare February 25, 2025 13:28
@Avenger-285714
Copy link
Member

Different Linux distributions default to varying Clang versions, although they usually offer a selection of Clang versions in their repositories. It is therefore recommended that you specify CC=clang-19 to take advantage of the latest Clang available on the Deepin distribution. Otherwise, the default Clang version is 17. Incidentally, the LoongArch CI was taken offline previously due to unforeseen circumstances, and I will reinstate it as quickly as I can.

@opsiff
Copy link
Member Author

opsiff commented Feb 25, 2025

Different Linux distributions default to varying Clang versions, although they usually offer a selection of Clang versions in their repositories. It is therefore recommended that you specify CC=clang-19 to take advantage of the latest Clang available on the Deepin distribution. Otherwise, the default Clang version is 17. Incidentally, the LoongArch CI was taken offline previously due to unforeseen circumstances, and I will reinstate it as quickly as I can.

OK, but in release repo, the llvm and clang version is max 18, I will update LLVM=1 to LLVM=18.

Use LLVM=18 build kernel to cover compile test.

Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
@opsiff opsiff force-pushed the linux-6.6.y-2025-02-25-ci branch from 71e1b4a to f51bf60 Compare February 25, 2025 17:27
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见如下:

  1. 代码格式和风格

    • 在新添加的 Clang build kernel 任务中,-j$(nproc) 后面缺少空格,建议添加空格以提高可读性。
    • make LLVM=18 deepin_arm64_desktop_defconfigmake LLVM=18 -j$(nproc) 之间缺少空行,建议添加空行以提高代码的可读性。
  2. 代码逻辑

    • 检查 make LLVM=18 deepin_arm64_desktop_defconfigmake LLVM=18 -j$(nproc) 是否有依赖关系,如果有,确保它们按正确的顺序执行。
    • 确认 $(nproc) 是否在所有环境中都可用,如果不可用,建议提供一个默认值。
  3. 代码性能

    • 使用 -j$(nproc) 可以提高构建速度,但需要确保构建环境中的 CPU 核心数足够多,否则可能不会带来性能提升。
  4. 代码安全

    • 检查 make 命令是否正确处理了所有可能的输入,避免潜在的命令注入攻击。
    • 确保所有环境变量和配置文件都是安全的,不会泄露敏感信息。
  5. 其他建议

    • 如果 make 命令的输出很重要,建议添加日志输出,以便于调试和跟踪。
    • 考虑添加错误处理机制,例如在 make 命令失败时,自动重试或通知相关人员。

综上所述,建议对代码进行如下修改:

      - name: 'Clang build kernel'
        run: |
          # .config
          make LLVM=18 deepin_arm64_desktop_defconfig
          make LLVM=18 -j$(nproc)

修改后的代码:

      - name: 'Clang build kernel'
        run: |
          # .config
          make LLVM=18 deepin_arm64_desktop_defconfig
          make LLVM=18 -j $(nproc)

并添加适当的错误处理和日志输出。

@Avenger-285714
Copy link
Member

Different Linux distributions default to varying Clang versions, although they usually offer a selection of Clang versions in their repositories. It is therefore recommended that you specify CC=clang-19 to take advantage of the latest Clang available on the Deepin distribution. Otherwise, the default Clang version is 17. Incidentally, the LoongArch CI was taken offline previously due to unforeseen circumstances, and I will reinstate it as quickly as I can.

The LoongArch CI is now operational and back in service! You may wish to integrate Clang-18 checks into the LoongArch infrastructure during this deployment! @opsiff

@opsiff
Copy link
Member Author

opsiff commented Feb 26, 2025

Different Linux distributions default to varying Clang versions, although they usually offer a selection of Clang versions in their repositories. It is therefore recommended that you specify CC=clang-19 to take advantage of the latest Clang available on the Deepin distribution. Otherwise, the default Clang version is 17. Incidentally, the LoongArch CI was taken offline previously due to unforeseen circumstances, and I will reinstate it as quickly as I can.

The LoongArch CI is now operational and back in service! You may wish to integrate Clang-18 checks into the LoongArch infrastructure during this deployment! @opsiff

The machine for LonngArch runs very slow(3A6000) machine, after analyze the problem, will add clang build kernel in CI for the port,OK?

@Avenger-285714
Copy link
Member

Different Linux distributions default to varying Clang versions, although they usually offer a selection of Clang versions in their repositories. It is therefore recommended that you specify CC=clang-19 to take advantage of the latest Clang available on the Deepin distribution. Otherwise, the default Clang version is 17. Incidentally, the LoongArch CI was taken offline previously due to unforeseen circumstances, and I will reinstate it as quickly as I can.

The LoongArch CI is now operational and back in service! You may wish to integrate Clang-18 checks into the LoongArch infrastructure during this deployment! @opsiff

The machine for LonngArch runs very slow(3A6000) machine, after analyze the problem, will add clang build kernel in CI for the port,OK?

Okay, let's proceed with this for the time being. While it appears that increasing build capacity is the only real option.

@Avenger-285714
Copy link
Member

/lgtm

@opsiff opsiff merged commit fd66d9b into deepin-community:linux-6.6.y Feb 26, 2025
5 checks passed
@Avenger-285714
Copy link
Member

Different Linux distributions default to varying Clang versions, although they usually offer a selection of Clang versions in their repositories. It is therefore recommended that you specify CC=clang-19 to take advantage of the latest Clang available on the Deepin distribution. Otherwise, the default Clang version is 17. Incidentally, the LoongArch CI was taken offline previously due to unforeseen circumstances, and I will reinstate it as quickly as I can.

The LoongArch CI is now operational and back in service! You may wish to integrate Clang-18 checks into the LoongArch infrastructure during this deployment! @opsiff

The machine for LonngArch runs very slow(3A6000) machine, after analyze the problem, will add clang build kernel in CI for the port,OK?

Would it be beneficial if I were to add a further new 3A6000 solely for Clang compilation verification? @opsiff

@opsiff
Copy link
Member Author

opsiff commented Feb 26, 2025

Different Linux distributions default to varying Clang versions, although they usually offer a selection of Clang versions in their repositories. It is therefore recommended that you specify CC=clang-19 to take advantage of the latest Clang available on the Deepin distribution. Otherwise, the default Clang version is 17. Incidentally, the LoongArch CI was taken offline previously due to unforeseen circumstances, and I will reinstate it as quickly as I can.

The LoongArch CI is now operational and back in service! You may wish to integrate Clang-18 checks into the LoongArch infrastructure during this deployment! @opsiff

The machine for LonngArch runs very slow(3A6000) machine, after analyze the problem, will add clang build kernel in CI for the port,OK?

Would it be beneficial if I were to add a further new 3A6000 solely for Clang compilation verification? @opsiff

I think the key problem is the online rate of the runner instread of many runner but droping from server everyday.

@Avenger-285714
Copy link
Member

Different Linux distributions default to varying Clang versions, although they usually offer a selection of Clang versions in their repositories. It is therefore recommended that you specify CC=clang-19 to take advantage of the latest Clang available on the Deepin distribution. Otherwise, the default Clang version is 17. Incidentally, the LoongArch CI was taken offline previously due to unforeseen circumstances, and I will reinstate it as quickly as I can.

The LoongArch CI is now operational and back in service! You may wish to integrate Clang-18 checks into the LoongArch infrastructure during this deployment! @opsiff

The machine for LonngArch runs very slow(3A6000) machine, after analyze the problem, will add clang build kernel in CI for the port,OK?

Would it be beneficial if I were to add a further new 3A6000 solely for Clang compilation verification? @opsiff

I think the key problem is the online rate of the runner instread of many runner but droping from server everyday.

This is irrelevant to the current discussion. Runner online availability is inherently unpredictable across all machines. Only by adding more runners will we increase the sheer number of concurrently active runners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants