Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure pg_config --cppflags are passed #5786

Merged
merged 1 commit into from
Jun 15, 2023
Merged

Conversation

sumerman
Copy link
Contributor

CMAKE_CPP_FLAGS is not a thing at all. Furthermore, CMAKE_CXX_FLAGS is not passed to a C compiler.
pg_config uses CPPGLAGS for all includes, and needs to be propagated into CMAKE_C_FLAGS as well.

I ran into #2777 on my system and that's what prompted this PR.

@github-actions
Copy link

@mkindahl, @lkshminarayanan: please review this pull request.

Powered by pull-review

@@ -7,8 +7,8 @@ if(UNIX)
set(CMAKE_C_STANDARD 11)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${PG_LIBDIR}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -L${PG_LIBDIR}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PG_CFLAGS}")
set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} ${PG_CPPFLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PG_CFLAGS} ${PG_CPPFLAGS}")
Copy link
Member

Choose a reason for hiding this comment

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

What are you building that needs C++ flags? TimescaleDB itself doesn't use them IIRC. Postgres only uses them for the JIT engine if you configure it with --with-llvm

This line in particular doesn't look correct, you can't generally put the C++ flags into the C ones.

Copy link
Contributor Author

@sumerman sumerman Jun 14, 2023

Choose a reason for hiding this comment

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

pg_config passes include paths in the CPPFLAGS. On my system it looks like this:

-I/opt/homebrew/Cellar/icu4c/72.1/include -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/Cellar/lz4/1.9.4/include

while OpenSSL and MacOSX13.sdk are correctly discovered in by CMake, it knows nothing about icu4c and gettext leading to #2777

Copy link
Member

Choose a reason for hiding this comment

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

I realized that CPPFLAGS are C preprocessor flags, not C++ flags. CMake doesn't have support for them, so it's OK to just paste them with the rest of the C flags. So this line looks correct.

@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Merging #5786 (2146e10) into main (14d0857) will increase coverage by 0.00%.
The diff coverage is n/a.

❗ Current head 2146e10 differs from pull request most recent head 54f2eb1. Consider uploading reports for the commit 54f2eb1 to get more accurate results

@@           Coverage Diff           @@
##             main    #5786   +/-   ##
=======================================
  Coverage   87.85%   87.85%           
=======================================
  Files         239      239           
  Lines       55483    55478    -5     
  Branches    12288    12287    -1     
=======================================
- Hits        48743    48739    -4     
+ Misses       4866     4843   -23     
- Partials     1874     1896   +22     

see 25 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

src/build-defs.cmake Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@sumerman sumerman force-pushed the vm/fixing-cppfags-not-passed branch 3 times, most recently from f12f62d to 5c263dd Compare June 14, 2023 17:17
CMAKE_CPP_FLAGS is not a thing at all. Furthermore,
CMAKE_CXX_FLAGS is not passed to a C compiler.
pg_config uses CPPGLAGS for all includes, and needs
to be passed into CMAKE_C_FLAGS as well.
@sumerman sumerman force-pushed the vm/fixing-cppfags-not-passed branch from 2146e10 to 54f2eb1 Compare June 15, 2023 09:04
@sumerman sumerman enabled auto-merge (rebase) June 15, 2023 09:07
@sumerman sumerman merged commit 4273a27 into main Jun 15, 2023
@sumerman sumerman deleted the vm/fixing-cppfags-not-passed branch June 15, 2023 09:31
@konskov konskov added this to the TimescaleDB 2.11.2 milestone Aug 8, 2023
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.0 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks
* timescale#5923 Feature flags for TimescaleDB features
**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation
**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks
* timescale#5923 Feature flags for TimescaleDB features
**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation
**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
@konskov konskov mentioned this pull request Aug 9, 2023
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5909 CREATE INDEX ONLY ON hypertable creates index on chunks
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit that referenced this pull request Aug 9, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* #5923 Feature flags for TimescaleDB features

**Bugfixes**
* #5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* #5774 Fixed two bugs in decompression sorted merge code
* #5786 Ensure pg_config --cppflags are passed
* #5906 Fix quoting owners in sql scripts.
* #5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 10, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit to konskov/timescaledb that referenced this pull request Aug 10, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* timescale#5923 Feature flags for TimescaleDB features

**Bugfixes**
* timescale#5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* timescale#5774 Fixed two bugs in decompression sorted merge code
* timescale#5786 Ensure pg_config --cppflags are passed
* timescale#5906 Fix quoting owners in sql scripts.
* timescale#5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit that referenced this pull request Aug 10, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* #5923 Feature flags for TimescaleDB features

**Bugfixes**
* #5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* #5774 Fixed two bugs in decompression sorted merge code
* #5786 Ensure pg_config --cppflags are passed
* #5906 Fix quoting owners in sql scripts.
* #5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
svenklemm pushed a commit that referenced this pull request Aug 15, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* #5923 Feature flags for TimescaleDB features

**Bugfixes**
* #5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* #5774 Fixed two bugs in decompression sorted merge code
* #5786 Ensure pg_config --cppflags are passed
* #5906 Fix quoting owners in sql scripts.
* #5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
konskov added a commit that referenced this pull request Aug 16, 2023
This release contains bug fixes since the 2.11.1 release.
We recommend that you upgrade at the next available opportunity.

**Features**
* #5923 Feature flags for TimescaleDB features

**Bugfixes**
* #5680 Fix DISTINCT query with JOIN on multiple segmentby columns
* #5774 Fixed two bugs in decompression sorted merge code
* #5786 Ensure pg_config --cppflags are passed
* #5906 Fix quoting owners in sql scripts.
* #5912 Fix crash in 1-step integer policy creation

**Thanks**
* @mrksngl for submitting a PR to fix extension upgrade scripts
* @ericdevries for reporting an issue with DISTINCT queries using
segmentby columns of compressed hypertable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants