Skip to content

fix: Enhance Windows build process for office_oxide and rag tokenizer - #16223

Merged
JinHai-CN merged 2 commits into
infiniflow:mainfrom
Haruko386:main
Jun 22, 2026
Merged

JinHai-CN merged 2 commits into
infiniflow:mainfrom
Haruko386:main

Conversation

@Haruko386

Copy link
Copy Markdown
Member

What problem does this PR solve?

Updated MSYS2 package list for Windows builds and added Rust target specifications. Modified build steps for office_oxide and rag tokenizer libraries to improve compatibility and streamline the build process.

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

Updated MSYS2 package list for Windows builds and added Rust target specifications. Modified build steps for office_oxide and rag tokenizer libraries to improve compatibility and streamline the build process.
@Haruko386 Haruko386 added 🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration labels Jun 21, 2026
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 21, 2026
@Haruko386
Haruko386 marked this pull request as draft June 21, 2026 23:06
@Haruko386
Haruko386 marked this pull request as ready for review June 21, 2026 23:06
@coderabbitai

coderabbitai Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 98647c06-716e-4c9a-b7ff-5cfa40320c06

📥 Commits

Reviewing files that changed from the base of the PR and between b433ccd and d8c91ab.

📒 Files selected for processing (1)
  • .github/workflows/release.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

The release workflow's Windows build pipeline replaces the prebuilt office_oxide binary download with a from-source cargo build that produces liboffice_oxide.a for the GNU ABI. The build matrix gains per-architecture rust_target fields and expanded MSYS2 package lists. Non-Windows runners get a new native dependency installation step. The Go CLI build is updated to verify static library artifacts and link them with -static flags.

Changes

Windows Native Build Toolchain Overhaul

Layer / File(s) Summary
Matrix rust_target fields and non-Windows native deps
.github/workflows/release.yml
Windows matrix entries gain rust_target per architecture and expanded multiline msys2_packages lists. A new conditional step installs CMake, build-essential, libpcre2-dev, and pkg-config on Linux or pcre2 via Homebrew on macOS.
Windows CC/CXX resolution, office_oxide source build, rag_tokenizer Ninja build
.github/workflows/release.yml
Removes the prebuilt office_oxide download step. Resolves MSYS2 clang/clang++ and exports CC/CXX to GITHUB_ENV. Resolves PCRE2 include/lib paths via pkg-config and exports them to GITHUB_ENV. Installs the Rust toolchain for the configured rust_target, builds office_oxide from source with cargo to produce liboffice_oxide.a, copies headers into OFFICE_OXIDE_PREFIX, and switches the rag_tokenizer CMake build to the Ninja generator with explicit compiler paths.
Go CLI static linking flags and artifact checks
.github/workflows/release.yml
Adds existence checks for liboffice_oxide.a, librag_tokenizer_c_api.a, and PCRE2_LIBDIR before the Go CLI build, and replaces .lib-based CGO_LDFLAGS with static library paths, -static and -static-lib* flags, and Windows system libraries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • infiniflow/ragflow#16078: Modifies the same release.yml Go CLI Windows build to fix office_oxide linking via CGO_LDFLAGS and artifact provisioning.
  • infiniflow/ragflow#16184: Also adjusts the Windows Go CLI build in release.yml to change how liboffice_oxide.a is exposed and consumed for CGO static linking.
  • infiniflow/ragflow#16193: Modifies the same workflow to resolve MSYS2 clang at runtime and export CC for Windows Go/CLI builds, directly overlapping with the CC/CXX export logic in this PR.

Suggested labels

size:XL

Poem

🐇 Hop hop, no more .lib to find,
We build from source and leave old binaries behind!
With cargo and clang the static libs appear,
liboffice_oxide.a is finally here.
Ninja spins wheels on the Windows trail,
This fluffy rabbit's build shall never fail! 🦀

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes required template sections but lacks sufficient detail about the specific problems being solved and the improvements made to the build process. Expand 'What problem does this PR solve?' with specific build compatibility issues encountered and how the changes address them (e.g., compilation failures, linking errors, or MSYS2 package incompatibilities).
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: enhancing the Windows build process for two key libraries (office_oxide and rag_tokenizer), which aligns with the substantial modifications to the build workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 224-228: Replace the `@stable` tag reference in the
`dtolnay/rust-toolchain` action with a specific commit SHA hash. Look up the
latest commit SHA from the dtolnay/rust-toolchain repository and pin the action
to that commit hash in the format `dtolnay/rust-toolchain@<commit-sha>` instead
of using the mutable `@stable` tag to ensure supply chain security.
- Around line 395-407: The Windows build in the release workflow checks for
librag_tokenizer_c_api.a existence but fails to link it because rag_analyzer.go
is missing a Windows-specific cgo directive. Add a `#cgo` windows directive to
rag_analyzer.go alongside the existing linux and darwin cgo directives, ensuring
it links both librag_tokenizer_c_api.a and libpcre2-8 in the same manner as the
other platform-specific directives. This will ensure the required libraries are
properly linked during Windows CLI binary compilation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 115263f4-6527-4e63-89ee-5bca36dca6aa

📥 Commits

Reviewing files that changed from the base of the PR and between 5039f46 and b433ccd.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Comment on lines +224 to +228
- name: Set up Rust for Windows office_oxide staticlib
if: runner.os == 'Windows'
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust_target }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Pin the action to a specific commit SHA for supply chain security.

The dtolnay/rust-toolchain action is referenced by the @stable tag rather than a commit hash. Pinning to a full commit SHA prevents unexpected changes if the tag is moved and mitigates supply-chain attacks.

🔒 Proposed fix
      - name: Set up Rust for Windows office_oxide staticlib
        if: runner.os == 'Windows'
-       uses: dtolnay/rust-toolchain@stable
+       uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # stable
        with:
          targets: ${{ matrix.rust_target }}

Note: Verify the latest commit SHA from the repository before applying.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Set up Rust for Windows office_oxide staticlib
if: runner.os == 'Windows'
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust_target }}
- name: Set up Rust for Windows office_oxide staticlib
if: runner.os == 'Windows'
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # stable
with:
targets: ${{ matrix.rust_target }}
🧰 Tools
🪛 zizmor (1.25.2)

[error] 226-226: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 224 - 228, Replace the `@stable`
tag reference in the `dtolnay/rust-toolchain` action with a specific commit SHA
hash. Look up the latest commit SHA from the dtolnay/rust-toolchain repository
and pin the action to that commit hash in the format
`dtolnay/rust-toolchain@<commit-sha>` instead of using the mutable `@stable` tag
to ensure supply chain security.

Source: Linters/SAST tools

Comment thread .github/workflows/release.yml Resolved
@codecov

codecov Bot commented Jun 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (5039f46) to head (d8c91ab).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16223      +/-   ##
==========================================
- Coverage   94.56%   93.16%   -1.40%     
==========================================
  Files          10       10              
  Lines         717      717              
  Branches      118      118              
==========================================
- Hits          678      668      -10     
- Misses         25       29       +4     
- Partials       14       20       +6     

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JinHai-CN
JinHai-CN merged commit dfe841a into infiniflow:main Jun 22, 2026
3 checks passed
This was referenced Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants