Skip to content

[fix](build) Keep relocated storage sources out of unity builds - #66846

Open
hoshinojyunn wants to merge 1 commit into
apache:masterfrom
hoshinojyunn:fix/storage-unity-collection-statistics
Open

[fix](build) Keep relocated storage sources out of unity builds#66846
hoshinojyunn wants to merge 1 commit into
apache:masterfrom
hoshinojyunn:fix/storage-unity-collection-statistics

Conversation

@hoshinojyunn

@hoshinojyunn hoshinojyunn commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: #66052

Problem Summary:

PR #66052 moved collection_statistics.cpp from be/src/storage/compaction/ to be/src/storage/index/inverted/similarity/. The Storage unity-build skip list still used the old path. The doris_skip_unity_inclusion helper intentionally rejects nonexistent entries, so a clean BE CMake configuration fails before compilation.

The relocated source must remain excluded from the unity batch. After updating the path, CMake repacks the remaining Storage sources and puts variant_assembler.cpp and variant_storage_cell.cpp in one generated unity translation unit. Both files define an implementation-local publish_encoded helper in an anonymous namespace; this is valid when compiled independently but becomes a redefinition in one unity translation unit.

This PR updates the collection-statistics exclusion to its new source path and excludes variant_storage_cell.cpp from unity builds, preserving the independent compilation boundary for both Variant files. It changes only build grouping and does not alter runtime behavior.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
      • Run DORIS_HOME=/mnt/disk1/ganderun/doris cmake --build be/build_Release --target Storage -j192.
      • Verify CMake accepts the relocated skip entry and the Storage target builds with unity builds enabled.
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

### What problem does this PR solve?

Issue Number: None

Related PR: apache#66052

Problem Summary: The Storage unity-build exclusions still referenced collection_statistics.cpp under storage/compaction after the source moved to storage/index/inverted/similarity. CMake rejects the stale path during configuration. Restoring the exclusion at its relocated path also changes unity batch composition and exposes duplicate anonymous-namespace helper names in variant_assembler.cpp and variant_storage_cell.cpp. Exclude variant_storage_cell.cpp from unity batching so the sources keep independent translation units.

### Release note

None

### Check List (For Author)

- Test: BE build target
    - cmake --build be/build_Release --target Storage -j192
- Behavior changed: No
- Does this need documentation: No
@hoshinojyunn
hoshinojyunn force-pushed the fix/storage-unity-collection-statistics branch from 5dad395 to df9b3e2 Compare August 17, 2026 10:06
@hoshinojyunn

Copy link
Copy Markdown
Contributor Author

run buildall

@hoshinojyunn hoshinojyunn changed the title [fix](be) Keep relocated storage sources out of unity builds [fix](build) Keep relocated storage sources out of unity builds Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants