Skip to content

[enhancement](thirdparty) fix arrow build bug and clear dangerous env… - #67535

Merged
yiguolei merged 1 commit into
apache:masterfrom
yiguolei:f1
Sep 5, 2026
Merged

yiguolei merged 1 commit into
apache:masterfrom
yiguolei:f1

Conversation

@yiguolei

@yiguolei yiguolei commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

… (#67523)

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

None

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • 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.

  • Confirm the release note

  • Confirm test cases

  • Confirm document

  • Add branch pick label

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • 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

…apache#67523)

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

None

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] 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 <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
@yiguolei
yiguolei requested a review from morningman as a code owner September 4, 2026 11:30
@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?

@yiguolei

yiguolei commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 63.04% (29566/46901)
Line Coverage 48.10% (310171/644801)
Region Coverage 43.68% (250561/573643)
Branch Coverage 45.25% (116562/257581)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.37% (34692/45427)
Line Coverage 61.38% (391232/637438)
Region Coverage 57.48% (328458/571459)
Branch Coverage 58.38% (149952/256842)

@yiguolei
yiguolei merged commit b58b2c5 into apache:master Sep 5, 2026
32 of 33 checks passed
yiguolei pushed a commit that referenced this pull request Sep 7, 2026
…angled in the #64093 backport (#67564)

### What problem does this PR solve?

Problem Summary:

Every branch-4.1 PR that touches `thirdparty/` fails `Build Third Party
Libraries (macOS-arm64)` after two to three minutes, inside
`download-thirdparty.sh`, long before anything is compiled:

```
patching file 'src/dwarf/Gfind_proc_info-lsb.c'
2 out of 2 hunks failed--saving rejects to 'src/dwarf/Gfind_proc_info-lsb.c.rej'
##[error]Process completed with exit code 1.
```

| PR | base | `Build Third Party Libraries (macOS-arm64)` |
|---|---|---|
| #67378 | branch-4.1 | fail, 5m18s — these hunks |
| #67356 | branch-4.1 | fail, 3m11s — these hunks |
| #67523 | branch-4.1 | fail, 2m43s — these hunks |
| #67554 | branch-4.1 | fail, 2m43s — these hunks |
| **#67535** — same change as #67523 | **master** | **pass, 2h26m full
build** |

The last row is the point: the same content passes on master and dies in
the patch step on branch-4.1.

**Root cause.**
`thirdparty/patches/libunwind-1.6.2-doris-phdr-cache.patch` is corrupt
on this branch. It arrived that way in `4439e6f6b46` (the backport of
#64093) and does not match the file master carries (`dc70115a432`) —
even though both branches pin the same libunwind 1.6.2 with the same md5
and run byte-identical patching code in `download-thirdparty.sh`.

In master's copy the blank lines around the change are **context**
lines, each a line holding a single space. In this branch's copy they
are **deletion** lines (`-` with nothing after it), with the hunk
headers renumbered to match that reading (`@@ -46,3 +46,8 @@` instead of
`@@ -47,6 +47,14 @@`, `@@ -805,5 +810,6 @@` instead of `@@ -804,7
+812,10 @@`) and the trailing context dropped. That is what a
trailing-whitespace strip followed by a hand repair leaves behind. The
patch now asks `patch(1)` to delete blank lines that the real source
does not have at those offsets.

**Why only macOS.** GNU patch on the Linux runner recovers from it —
`Hunk #1 succeeded at 12 with fuzz 1` — and the Linux job passes, which
is why this went unnoticed for a week. The macOS runner's `patch`
rejects both hunks and `download-thirdparty.sh` exits 1.

**Fix.** Take master's copy verbatim. One file, nothing else.

### Release note

None

### Check List (For Author)

- Test
    - [ ] Regression test
    - [ ] Unit Test
    - [x] Manual test (add detailed scripts or steps below)

Verified against the pinned tarball (`libunwind-1.6.2.tar.gz`, md5
`f625b6a98ac1976116c71708a73dc44a`) with the same patch implementation
the runner uses (`patch 2.0-12u11-Apple`), on two pristine copies of the
extracted source:

| patch file | exit | result |
|---|---|---|
| this branch's current file | **1** | `2 out of 2 hunks failed` —
byte-identical to the CI message |
| this PR's file | **0** | applies cleanly, no `.rej` |

After applying, the weak declaration and the fork land where
`be/src/common/phdr_cache.cpp` expects them:

```
54:extern int doris_unwind_iterate_phdr (int (*callback) (struct dl_phdr_info *, size_t, void *),
55:                                      void *data, unw_word_t ip) __attribute__ ((weak));
...
815:  if (doris_unwind_iterate_phdr)
816:    ret = doris_unwind_iterate_phdr (dwarf_callback, &cb_data, ip);
817:  else
818:    ret = dl_iterate_phdr (dwarf_callback, &cb_data);
```

This branch does define that symbol
(`be/src/common/phdr_cache.cpp:249`), so the fix restores the intended
behaviour rather than being a no-op. Linux builds were already getting
it via fuzz, so no behaviour changes there.

- Behavior changed:
- [x] No. Linux already applied this patch (with fuzz); this only makes
the macOS thirdparty build stop failing.

- Does this need documentation?
    - [x] No.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01DzUYFcGHQH3bnLGCjpncVj

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

3 participants