这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Icenowy
Copy link
Contributor

@Icenowy Icenowy commented Mar 25, 2025

Remove the currently broken RISC-V CI flow and add two test targets (GCC and Clang) with toolchain from ubuntu-latest system.

Tests passed with my fixes of RVV-related SIGSEGV -- see https://github.com/Icenowy/zlib-ng/actions/runs/14062430701/job/39376366365 (Clang) and https://github.com/Icenowy/zlib-ng/actions/runs/14054987248/job/39352378603 (GCC) .

Summary by CodeRabbit

  • New Features

    • Enhanced CI pipelines now support RISC-V builds on Ubuntu with both GCC and Clang toolchains.
    • Introduced an updated cross-compilation configuration to optimize RISC-V build performance.
  • Chores

    • Streamlined the build process by removing outdated CI configurations and redundant steps.

Icenowy added 3 commits March 25, 2025 23:04
The SiFive GitHub organization now deploys an IP allowlist which blocked
GitHub Actions, which makes this test always fail. In addition, this is
a quite different test than other non-x86 tests.

Drop it now.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Similar to the GCC one, this test target uses system toolchain and QEMU
too.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2025

Walkthrough

The changes update the CI configuration and toolchain settings for RISC-V targets. Two new jobs—“Ubuntu GCC RISC-V” and “Ubuntu Clang RISC-V”—have been added to the GitHub Actions workflow. The older Clang job and its related download step for a prebuilt toolchain and QEMU have been removed. Additionally, a new CMake toolchain file for Clang-based RISC-V builds has been introduced and the existing toolchain file for GCC-based builds has been streamlined by removing redundant checks and directly detecting compilers.

Changes

File(s) Change Summary
.github/workflows/cmake.yml Added two new CI jobs (“Ubuntu GCC RISC-V” and “Ubuntu Clang RISC-V”) with dedicated CMake toolchain files and package installations; removed an outdated “Ubuntu Clang RISC-V” job and a step that downloaded prebuilt tools.
cmake/toolchain-riscv-clang.cmake
cmake/toolchain-riscv.cmake
Introduced a new toolchain file for Clang targeting RISC-V and updated the existing GCC toolchain file to streamline cross-compilation settings, including direct compiler detection and refined search paths.

Sequence Diagram(s)

sequenceDiagram
    participant CI as CI Runner
    participant ENV as Ubuntu Environment
    participant BUILD as Build Process

    CI->>ENV: Trigger "Ubuntu GCC RISC-V" Job
    ENV->>BUILD: Load gcc toolchain (cmake/toolchain-riscv.cmake)
    BUILD->>ENV: Install packages (qemu-user, crossbuild-essential-riscv64)
    BUILD->>CI: Report build results (with gcov/codecov)

    CI->>ENV: Trigger "Ubuntu Clang RISC-V" Job
    ENV->>BUILD: Load clang toolchain (cmake/toolchain-riscv-clang.cmake)
    BUILD->>ENV: Install packages (qemu-user, crossbuild-essential-riscv64)
    BUILD->>CI: Report build results
Loading

Suggested labels

Continuous Integration, Build Env

Suggested reviewers

  • nmoinvaz
  • Dead2

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd0d263 and a873524.

📒 Files selected for processing (3)
  • .github/workflows/cmake.yml (1 hunks)
  • cmake/toolchain-riscv-clang.cmake (1 hunks)
  • cmake/toolchain-riscv.cmake (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (54)
  • GitHub Check: macOS Clang ASAN (ARM64)
  • GitHub Check: Windows MSVC 2019 v141 Win32
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Windows MSVC 2019 v141 Win64
  • GitHub Check: Ubuntu 20.04 GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat (ARM64)
  • GitHub Check: macOS Clang ASAN (ARM64)
  • GitHub Check: Windows MSVC 2019 v141 Win32
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Windows MSVC 2019 v141 Win64
  • GitHub Check: Ubuntu 20.04 GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat (ARM64)
  • GitHub Check: macOS Clang ASAN (ARM64)
  • GitHub Check: Windows MSVC 2019 v141 Win32
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Windows MSVC 2019 v141 Win64
  • GitHub Check: Ubuntu 20.04 GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat (ARM64)
  • GitHub Check: macOS Clang ASAN (ARM64)
  • GitHub Check: Windows MSVC 2019 v141 Win32
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Windows MSVC 2019 v141 Win64
  • GitHub Check: Ubuntu 20.04 GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat (ARM64)
  • GitHub Check: macOS Clang ASAN (ARM64)
  • GitHub Check: Windows MSVC 2019 v141 Win32
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Windows MSVC 2019 v141 Win64
  • GitHub Check: Ubuntu 20.04 GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat (ARM64)
  • GitHub Check: macOS Clang ASAN (ARM64)
  • GitHub Check: Windows MSVC 2019 v141 Win32
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Windows MSVC 2019 v141 Win64
  • GitHub Check: Ubuntu 20.04 GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat (ARM64)
  • GitHub Check: macOS Clang ASAN (ARM64)
  • GitHub Check: Windows MSVC 2019 v141 Win32
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Windows MSVC 2019 v141 Win64
  • GitHub Check: Ubuntu 20.04 GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat (ARM64)
  • GitHub Check: macOS Clang ASAN (ARM64)
  • GitHub Check: Windows MSVC 2019 v141 Win32
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Windows MSVC 2019 v141 Win64
  • GitHub Check: macOS Clang ASAN (ARM64)
  • GitHub Check: Windows MSVC 2019 v141 Win32
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Windows MSVC 2019 v141 Win64
  • GitHub Check: macOS Clang ASAN (ARM64)
  • GitHub Check: Windows MSVC 2019 v141 Win32
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Windows MSVC 2019 v141 Win64
🔇 Additional comments (7)
cmake/toolchain-riscv.cmake (4)

1-6: System configuration properly defined for RISC-V target.

The system configuration is correctly set up for cross-compiling to a RISC-V 64-bit Linux target with appropriate compiler target triplets.


9-9: Comprehensive QEMU emulation settings for RISC-V.

The QEMU emulator is properly configured with extensive RISC-V features, including the Vector Extension (RVV) with specific parameters that should address the SIGSEGV issues mentioned in the PR objectives.


11-14: Appropriate root path mode configuration for cross-compilation.

The root path mode settings correctly define how CMake should search for programs, libraries, includes, and packages during cross-compilation.


16-25: Robust compiler detection for RISC-V toolchain.

The implementation efficiently finds and verifies the presence of cross-compilers using find_program, with appropriate error handling when the C compiler cannot be found. This approach is more direct and less error-prone than the previous method that was removed.

.github/workflows/cmake.yml (1)

308-319: Well-defined CI jobs for RISC-V targets.

The two new jobs for RISC-V targets (GCC and Clang) are properly configured with:

  1. Appropriate toolchain files
  2. Required packages (qemu-user and cross-compiler tools)
  3. Code coverage setup for the GCC job

This implementation aligns perfectly with the PR objectives to add two new test targets for RISC-V using GCC and Clang.

cmake/toolchain-riscv-clang.cmake (2)

1-11: Well-structured Clang configuration for RISC-V.

The system configuration and compiler settings are correctly defined for Clang cross-compilation to RISC-V. The setup properly:

  1. Defines the target architecture (riscv64)
  2. Sets Clang/Clang++ as compilers with appropriate target triplets
  3. Configures cross-compilation with the same QEMU parameters as the GCC version

This ensures consistent testing between GCC and Clang toolchains.


13-16: Consistent root path mode configuration.

These settings match those in the GCC toolchain file, ensuring consistent behavior for both toolchains when locating dependencies during the build process.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@nmoinvaz
Copy link
Member

nmoinvaz commented Mar 25, 2025

Seems like a simplification that relies more heavily on qemu, which is nice. I don't know enough about the platform though.

@codecov
Copy link

codecov bot commented Mar 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.67%. Comparing base (fd0d263) to head (a873524).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1890      +/-   ##
===========================================
+ Coverage    82.00%   82.67%   +0.67%     
===========================================
  Files          141      138       -3     
  Lines        12666    12371     -295     
  Branches      2906     2811      -95     
===========================================
- Hits         10387    10228     -159     
+ Misses        1290     1216      -74     
+ Partials       989      927      -62     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Icenowy
Copy link
Contributor Author

Icenowy commented Mar 25, 2025

@nmoinvaz It always relies on QEMU -- but I switched from QEMU built (and packaged as tarball) by SiFive (which is already not available to be used in Actions because of restrictions on their GitHub org) to the one shipped by Ubuntu.

Copy link
Member

@Dead2 Dead2 left a comment

Choose a reason for hiding this comment

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

LGTM

@Dead2 Dead2 merged commit 64d16e1 into zlib-ng:develop Mar 27, 2025
146 of 153 checks passed
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