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

brew install timescaledb tries to compile against PG14 which is not yet supported #3660

Closed
rkazak opened this issue Oct 6, 2021 · 3 comments

Comments

@rkazak
Copy link

rkazak commented Oct 6, 2021

Background:
I am using OSX to do some learning/testing on Timescale. I am also using the package manager 'brew' as described on this page installation-homebrew on doing this I have run into a couple of issues.

Results:

  1. Installing ts via brew actually pulled in pg14 and as they are incompatible failed.
  2. Building ( after fixing above ) fails as the file postgres.h was reported as missing.

Workarounds:
I traced the first issue to the brew install script for timescale. It looks like the file
/usr/local/Homebrew/Library/Taps/timescale/homebrew-tap/timescaledb.rb maybe incorrect. In this file there is line 10;

9 depends_on "cmake" => :build 10 depends_on "postgresql" => :build 11 depends_on "openssl" => :build
modifying that to

9 depends_on "cmake" => :build 10 depends_on "postgresql@13" => :build 11 depends_on "openssl" => :build
prevents the timescale installation from pulling in the pg-14 as a dependency and hence failing.

The second issue was reported as follows:

==> ./bootstrap -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DWARNINGS_AS_ERRORS=OFF -DLINTER=OFF -DPROJECT_INSTALL_METHOD="brew" -DOPENSS ==> make -C build Last 15 lines from /Users/rkazak/Library/Logs/Homebrew/timescaledb/02.make: 1 error generated. [ 14%] Generating /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/build/sql/timescaledb--2.0.0-rc2--2.4.2.sql make[2]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/chunk_copy.c.o] Error 1 [ 15%] Generating /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/build/sql/timescaledb--2.0.0-rc1--2.4.2.sql [ 16%] Generating /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/build/sql/timescaledb--1.7.5--2.4.2.sql [ 16%] Generating /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/build/sql/timescaledb--1.7.4--2.4.2.sql 1 error generated. [ 17%] Generating /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/build/sql/timescaledb--1.7.3--2.4.2.sql make[2]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/data_node.c.o] Error 1 make[1]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/all] Error 2 [ 17%] Generating /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/build/sql/timescaledb--1.7.2--2.4.2.sql [ 17%] Generating /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/build/sql/timescaledb--1.7.0--2.4.2.sql [ 18%] Generating /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/build/sql/timescaledb--1.7.1--2.4.2.sql [ 18%] Built target sqlupdatescripts make: *** [all] Error 2 /usr/local/Homebrew/Library/Homebrew/shims/shared/git --version /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --version /usr/local/Homebrew/Library/Homebrew/ignorable.rb:29:inblock in raise'
BuildError: Failed executing: make -C build

  1. raise
  2. ignore
    The above was generated usingbrew -d install` when the error is hit you can go into the shell and try the make command which then shows

[ 15%] Building C object tsl/src/CMakeFiles/timescaledb-tsl.dir/chunk_api.c.o /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/src/loader/bgw_message_queue.c:6:10: fatal error: /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/tsl/src/async_append.c:6/tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/src/agg_bookend.c:'postgres.h'10: :6file: 10not: fatal error : foundfatal error : 'postgres.h' file 'postgres.h'not filefound not found #include <postgres.h> ^~~~~~~~~~~~ #include <postgres.h> #include <postgres.h> ^~~~~~~~~~~~ ^~~~~~~~~~~~ /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/src/loader/bgw_launcher.c:6:10: fatal error: 'postgres.h' file not found #include <postgres.h> ^~~~~~~~~~~~ /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/src/func_cache.c:6:10: fatal error: 'postgres.h' file not found #include <postgres.h> ^~~~~~~~~~~~ /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/src/loader/loader.c:6:10: fatal error: 'postgres.h' file not found #include <postgres.h> ^~~~~~~~~~~~ /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/src/loader/bgw_counter.c:7:10: fatal error: 'postgres.h' file not found #include <postgres.h> ^~~~~~~~~~~~ /tmp/timescaledb-20211006-39283-x4malg/timescaledb-2.4.2/tsl/src/chunk_api.c:6:10: fatal error: 'postgres.h' file not found #include <postgres.h> ^~~~~~~~~~~~ 1 error generated. 1 error generated. 1 error generated. 1 error generated. 1 error generated. 1 error generated. make[2]: *** [src/CMakeFiles/timescaledb.dir/agg_bookend.c.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: *** [src/CMakeFiles/timescaledb.dir/func_cache.c.o] Error 1 make[2]: *** [src/loader/CMakeFiles/timescaledb-loader.dir/bgw_counter.c.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: *** [src/loader/CMakeFiles/timescaledb-loader.dir/bgw_message_queue.c.o] Error 1 make[1]: *** [src/CMakeFiles/timescaledb.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... make[2]: *** [src/loader/CMakeFiles/timescaledb-loader.dir/loader.c.o] Error 1 make[2]: *** [src/loader/CMakeFiles/timescaledb-loader.dir/bgw_launcher.c.o] Error 1 make[1]: *** [src/loader/CMakeFiles/timescaledb-loader.dir/all] Error 2 [ 16%] Building C object tsl/src/CMakeFiles/timescaledb-tsl.dir/chunk.c.o
Looking at the source directory I see that the missing file is actually in the directory
/usr/local/opt/postgresql@13/include/postgresql/server, sym-linking the server directory into the include directory fixes the location to the path expected by the compile command.

Interestingly pg_config shows the correct location

INCLUDEDIR-SERVER = /usr/local/opt/postgresql@13/include/server

@afiskon afiskon changed the title Timescale installation issues on OSX brew install timescaledb tries to compile against PG14 which is not yet supported Oct 8, 2021
@afiskon
Copy link
Contributor

afiskon commented Oct 8, 2021

@rkazak Thanks for the report. This didn't suppose to happen because TSDB doesn't support PG14 yet (it was just released).

@afiskon
Copy link
Contributor

afiskon commented Oct 8, 2021

Yep, I can reproduce it:

$ which pg_config
/usr/local/bin/pg_config
$ pg_config --version
PostgreSQL 14.0
brew tap timescale/tap && brew install timescaledb

output:

==> Installing timescaledb from timescale/tap
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 12.4.

==> ./bootstrap -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DWARNINGS_AS_ERRORS=OFF -DLINTER=OFF -DPROJECT_INSTALL_METHOD="brew" -DOPENSSL_ROO
Last 15 lines from /Users/eax/Library/Logs/Homebrew/timescaledb/01.openssl@3":
-- Performing Test CC_SUPPORTS_IMPLICIT_FALLTHROUGH - Success
-- Performing Test CC_SUPPORTS_VISIBILITY_HIDDEN
-- Performing Test CC_SUPPORTS_VISIBILITY_HIDDEN - Success
-- Using compiler AppleClang
-- Found Git: /usr/local/Homebrew/Library/Homebrew/shims/shared/git (found version "2.31.1")
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
-- Unable to get git commit information
CMake Error at CMakeLists.txt:348 (message):
  TimescaleDB only supports PostgreSQL 12 and 13


-- Configuring incomplete, errors occurred!

@afiskon
Copy link
Contributor

afiskon commented Oct 8, 2021

The following workaround SUPPOSED to help:

brew remove timescaledb
brew remove timescaledb-tools
brew install postgresql@13
export PATH="/usr/local/opt/postgresql@13/bin:$PATH"
brew install timescaledb

However, I got:

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/timescale/homebrew-tap/issues

These open issues may also help:
Unable to install Timescaledb, mac Catalina https://github.com/timescale/homebrew-tap/issues/15
Error "Unsupported PostgreSQL version" with timescaleDB 2.2 and postgresql 13.1 https://github.com/timescale/homebrew-tap/issues/19

Apparently, there are some open issues the homebrew tap maintainers are already aware of. See timescale/homebrew-tap#15 and timescale/homebrew-tap#19

@rkazak I'm sorry but I have to redirect you to these issues and close this one as a duplicate. As a temporary workaround I can suggest building TSDB from the source code:

./bootstrap -DGENERATE_DOWNGRADE_SCRIPT=1 && cd build && make && make install && make installcheck

Also, FYI support of PG14 will be added in TSDB 2.5 which is going to be released soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants