Skip to content

Fix sed -i compatibility on macOS in configure#1598

Merged
yjhjstz merged 1 commit intoapache:mainfrom
zhangyue1818:macos
Mar 3, 2026
Merged

Fix sed -i compatibility on macOS in configure#1598
yjhjstz merged 1 commit intoapache:mainfrom
zhangyue1818:macos

Conversation

@zhangyue1818
Copy link
Contributor

@zhangyue1818 zhangyue1818 commented Mar 3, 2026

macOS BSD sed requires an explicit empty string argument after -i (sed -i '' 'script' file), unlike GNU sed which takes -i without a suffix argument. Without this fix, BSD sed misinterprets the sed script as a backup suffix and treats the filename as the script, causing "unterminated substitute pattern" error.

Fixes #28, #1335

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


@avamingli
Copy link
Contributor

Thanks! While we don't officially support building CBDB on macOS, it's still great to see this fix.

Copy link
Member

@yjhjstz yjhjstz left a comment

Choose a reason for hiding this comment

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

LGTM

macOS BSD sed requires an explicit empty string argument after
-i (sed -i '' 'script' file), unlike GNU sed which takes -i
without a suffix argument. Without this fix, BSD sed misinterprets
the sed script as a backup suffix and treats the filename as the
script, causing "unterminated substitute pattern" error.
@yjhjstz yjhjstz merged commit 7e867f6 into apache:main Mar 3, 2026
84 of 87 checks passed
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.

[Bug] config error: sed: 1: "src/include/pg_config.h": unterminated substitute pattern

4 participants