Open mrz1836 opened 4 years ago
Tried to run a second time and got a slightly different error:
==> Installing timescaledb from timescale/tap
==> Downloading https://timescalereleases.blob.core.windows.net/homebrew/timescaledb-1.7.4.tar.lzma
Already downloaded: /Users/MrZ/Library/Caches/Homebrew/downloads/2d1cd731a55fc74cedf70df9c74e773eabb25de83db216e8fdace69155ffbb4f--timescaledb-1.7.4.tar.lzma
==> ./bootstrap -DREGRESS_CHECKS=OFF -DPROJECT_INSTALL_METHOD="brew"
==> cd ./build && make
Last 15 lines from /Users/MrZ/Library/Logs/Homebrew/timescaledb/02.build:
make[2]: *** [src/CMakeFiles/timescaledb.dir/cache_invalidate.c.o] Error 1
/tmp/timescaledb-20201120-25271-1fvwrqv/timescaledb/src/catalog.c:6:10: fatal error: 'postgres.h' file not found
#include <postgres.h>
^~~~~~~~~~~~
[ 36%] Generating /tmp/timescaledb-20201120-25271-1fvwrqv/timescaledb/build/sql/timescaledb--0.1.0--1.7.4.sql
/tmp/timescaledb-20201120-25271-1fvwrqv/timescaledb/src/continuous_agg.c:12:10: fatal error: 'postgres.h' file not found
#include <postgres.h>
^~~~~~~~~~~~
1 error generated.
make[2]: *** [src/CMakeFiles/timescaledb.dir/catalog.c.o] Error 1
1 error generated.
make[2]: *** [src/CMakeFiles/timescaledb.dir/continuous_agg.c.o] Error 1
make[1]: *** [src/CMakeFiles/timescaledb.dir/all] Error 2
[ 36%] Built target sqlupdatescripts
make: *** [all] Error 2
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/timescale/homebrew-tap/issues
I was able to get it to install by doing this one additional command before installing timescaledb:
ln -s /usr/local/Cellar/postgresql@12/12.5/include/postgresql/server /usr/local/Cellar/postgresql@12/12.5/include/server
Also related to #13
@mrz1836 Your symlink worked for me as well on MacOS 11/Big Sur. Thanks for the comment!
I'm actually having the same issue on big sur but the workaround above didn't fix it for me https://github.com/timescale/timescaledb/issues/2690
Also I have homebrew installed in /opt/homebrew
though
Actually nevermind, that did work, just hadn't created the symlink properly. /opt/homebrew/Cellar/postgresql@12/12.5/include/server
did the trick 👍
Also for the record, stuff like timescaledb_move.sh
and timescaledb-tune
don't work well with a nonstandard homebrew installation path (eg.: /opt
instead of /usr
), so you have to set up some symlinks manually so it can find postgres files
Also related to #13
@mrz1836 Your symlink worked for me as well on MacOS 11/Big Sur. Thanks for the comment!
Yes- this worked for me as well after facing similar issues..as below - after I ran install for 2nd time. 1st time was a different error. Thank you @mrz1836 !!
==> cd ./build && make Last 15 lines from /Users/udaynaik/Library/Logs/Homebrew/timescaledb/02.build: make[2]: [src/CMakeFiles/timescaledb.dir/func_cache.c.o] Error 1 1 error generated. 1 error generated. make[2]: [src/CMakeFiles/timescaledb.dir/continuous_agg.c.o] Error 1 make[2]: [src/CMakeFiles/timescaledb.dir/catalog.c.o] Error 1 1 error generated. 1 error generated. make[2]: [src/CMakeFiles/timescaledb.dir/chunk_dispatch.c.o] Error 1 make[2]: [src/CMakeFiles/timescaledb.dir/cache_invalidate.c.o] Error 1 make[2]: [src/CMakeFiles/timescaledb.dir/chunk_constraint.c.o] Error 1 make[2]: [src/CMakeFiles/timescaledb.dir/chunk_adaptive.c.o] Error 1 1 error generated. make[2]: [src/CMakeFiles/timescaledb.dir/chunk.c.o] Error 1 make[1]: [src/CMakeFiles/timescaledb.dir/all] Error 2 make: [all] Error 2
what a mess :( i also had to do this:
ln -s /usr/local/Cellar/postgresql@12/12.5/include/libpq-fe.h /usr/local/Cellar/postgresql@12/12.5/include/server/libpq-fe.h
Now i am past missing header issues but now I have this:
Last 15 lines from /Users/taf2/Library/Logs/Homebrew/timescaledb/02.build:
make[2]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/deparse.c.o] Error 1
error: unknown warning option '-Wno-format-truncation' [clang-diagnostic-unknown-warning-option]
1 error generated.
Error while processing /tmp/timescaledb-20210117-21187-yz0b7o/timescaledb/tsl/src/data_node_dispatch.c.
make[2]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/data_node_dispatch.c.o] Error 1
error: unknown warning option '-Wno-format-truncation' [clang-diagnostic-unknown-warning-option]
1 error generated.
Error while processing /tmp/timescaledb-20210117-21187-yz0b7o/timescaledb/tsl/src/data_node.c.
make[2]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/data_node.c.o] Error 1
error: unknown warning option '-Wno-format-truncation' [clang-diagnostic-unknown-warning-option]
1 error generated.
Error while processing /tmp/timescaledb-20210117-21187-yz0b7o/timescaledb/tsl/src/dist_util.c.
make[2]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/dist_util.c.o] Error 1
make[1]: *** [tsl/src/CMakeFiles/timescaledb-tsl.dir/all] Error 2
make: *** [all] Error 2
looks like timescale has given up on brew ?
https://docs.timescale.com/latest/getting-started/installation
Seems like checking out timescaledb and running the same commands - the main things missing is that postgresql@12 must be linked so things like pg_config are found...
git checkout 2.0.x
Branch '2.0.x' set up to track remote branch '2.0.x' from 'origin'.
Switched to a new branch '2.0.x'
taf2~/work/timescaledb (2.0.x)> vim ../homebrew-tap/
.git/ timescaledb-tools.rb timescaledb.rb
taf2~/work/timescaledb (2.0.x)> vim ../homebrew-tap/timescaledb.rb
[1]+ Stopped vim ../homebrew-tap/timescaledb.rb
taf2~/work/timescaledb (2.0.x)> ./bootstrap -DREGRESS_CHECKS=OFF -DPROJECT_INSTALL_METHOD=\"brew\"#{ossvar}^C
taf2~/work/timescaledb (2.0.x)> fg
vim ../homebrew-tap/timescaledb.rb
[1]+ Stopped vim ../homebrew-tap/timescaledb.rb
taf2~/work/timescaledb (2.0.x)> ./bootstrap -DREGRESS_CHECKS=OFF -DPROJECT_INSTALL_METHOD=brew -DAPACHE_ONLY=1
-- The C compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- TimescaleDB version 2.0.0. Can be updated from version 2.0.0-rc4
-- Build type is Release
-- Install method is 'brew'
-- Performing Test CC_SUPPORTS_NO_FORMAT_TRUNCATION
-- Performing Test CC_SUPPORTS_NO_FORMAT_TRUNCATION - Failed
-- Compiler does not support -Wno-format-truncation
-- Performing Test CC_SUPPORTS_IMPLICIT_FALLTHROUGH
-- Performing Test CC_SUPPORTS_IMPLICIT_FALLTHROUGH - Success
-- Performing Test CC_SUPPORTS_VISIBILITY_HIDDEN
-- Performing Test CC_SUPPORTS_VISIBILITY_HIDDEN - Success
-- Using compiler AppleClang
CMake Error at CMakeLists.txt:178 (message):
Unable to find 'pg_config'
-- Configuring incomplete, errors occurred!
See also "/Users/taf2/work/timescaledb/build/CMakeFiles/CMakeOutput.log".
See also "/Users/taf2/work/timescaledb/build/CMakeFiles/CMakeError.log".
taf2~/work/timescaledb (2.0.x)> brew link postgresql@12
Linking /usr/local/Cellar/postgresql@12/12.5... 377 symlinks created
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/postgresql@12/bin:$PATH"' >> /Users/taf2/.bash_profile
taf2~/work/timescaledb (2.0.x)> pg_config
BINDIR = /usr/local/Cellar/postgresql@12/12.5/bin
DOCDIR = /usr/local/Cellar/postgresql@12/12.5/share/doc/postgresql@12
HTMLDIR = /usr/local/Cellar/postgresql@12/12.5/share/doc/postgresql@12
INCLUDEDIR = /usr/local/opt/postgresql@12/include
PKGINCLUDEDIR = /usr/local/opt/postgresql@12/include
INCLUDEDIR-SERVER = /usr/local/opt/postgresql@12/include/server
LIBDIR = /usr/local/opt/postgresql@12/lib
PKGLIBDIR = /usr/local/Cellar/postgresql@12/12.5/lib/postgresql
LOCALEDIR = /usr/local/Cellar/postgresql@12/12.5/share/locale
MANDIR = /usr/local/Cellar/postgresql@12/12.5/share/man
SHAREDIR = /usr/local/opt/postgresql@12/share/postgresql@12
SYSCONFDIR = /usr/local/etc/postgresql
PGXS = /usr/local/Cellar/postgresql@12/12.5/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--disable-debug' '--prefix=/usr/local/Cellar/postgresql@12/12.5' '--datadir=/usr/local/opt/postgresql@12/share/postgresql@12' '--libdir=/usr/local/opt/postgresql@12/lib' '--includedir=/usr/local/opt/postgresql@12/include' '--sysconfdir=/usr/local/etc' '--docdir=/usr/local/Cellar/postgresql@12/12.5/share/doc/postgresql@12' '--enable-thread-safety' '--with-bonjour' '--with-gssapi' '--with-icu' '--with-ldap' '--with-libxml' '--with-libxslt' '--with-openssl' '--with-pam' '--with-perl' '--with-tcl' '--with-uuid=e2fs' 'PG_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk' 'CC=clang' 'LDFLAGS=-L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib' 'CPPFLAGS=-I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include' 'CXX=clang++' 'PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig:/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig' 'PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/11.0'
CC = clang
CPPFLAGS = -I/usr/local/Cellar/icu4c/67.1/include -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2
CFLAGS_SL =
LDFLAGS = -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib -Wl,-dead_strip_dylibs
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm
VERSION = PostgreSQL 12.5
taf2~/work/timescaledb (2.0.x)> ./bootstrap -DREGRESS_CHECKS=OFF -DPROJECT_INSTALL_METHOD=brew -DAPACHE_ONLY=1
Build system already initialized in ./build
Do you want to remove it (this is IMMEDIATE and PERMANENT), y/n? y
-- The C compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- TimescaleDB version 2.0.0. Can be updated from version 2.0.0-rc4
-- Build type is Release
-- Install method is 'brew'
-- Performing Test CC_SUPPORTS_NO_FORMAT_TRUNCATION
-- Performing Test CC_SUPPORTS_NO_FORMAT_TRUNCATION - Failed
-- Compiler does not support -Wno-format-truncation
-- Performing Test CC_SUPPORTS_IMPLICIT_FALLTHROUGH
-- 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/bin/git (found version "2.26.1")
-- Using pg_config /usr/local/bin/pg_config
-- Compiling against PostgreSQL version 12.5
CMake Warning at CMakeLists.txt:316 (message):
clang-format version 7 or 8 required
-- Using docker based clang-format
-- Linter support (clang-tidy) enabled
-- Assertion checks are OFF
-- Found OpenSSL: /usr/local/Cellar/openssl@1.1/1.1.1i/lib/libcrypto.dylib (found version "1.1.1i")
-- OPENSSL_LIBRARIES: /usr/local/Cellar/openssl@1.1/1.1.1i/lib/libssl.dylib;/usr/local/Cellar/openssl@1.1/1.1.1i/lib/libcrypto.dylib
-- Using OpenSSL version 1.1.1i
-- Using nm /usr/bin/nm
-- Using pg_regress /usr/local/Cellar/postgresql@12/12.5/lib/postgresql/pgxs/src/test/regress/pg_regress
-- Skipping isolation regress checks since program 'pg_isolation_regress' was not found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/taf2/work/timescaledb/build
TimescaleDB build system initialized in ./build. To compile, do:
cd ./build && make
taf2~/work/timescaledb (2.0.x)>
taf2~/work/timescaledb (2.0.x)> fg
vim ../homebrew-tap/timescaledb.rb
taf2~/work/timescaledb (2.0.x)> cd ./build && make
Scanning dependencies of target sqlupdatescripts
[ 0%] Generating /Users/taf2/work/timescaledb/build/sql/updates/post-update.sql.processed
[ 1%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--2.0.0-rc4--2.0.0.sql
[ 2%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--2.0.0-rc3--2.0.0.sql
[ 3%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--2.0.0-rc2--2.0.0.sql
[ 4%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--2.0.0-rc1--2.0.0.sql
[ 5%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.7.4--2.0.0.sql
[ 5%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.7.3--2.0.0.sql
[ 6%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.7.2--2.0.0.sql
[ 7%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.7.1--2.0.0.sql
[ 8%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.7.0--2.0.0.sql
[ 9%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.6.1--2.0.0.sql
[ 10%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.6.0--2.0.0.sql
[ 10%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.5.1--2.0.0.sql
[ 11%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.5.0--2.0.0.sql
[ 12%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.4.2--2.0.0.sql
[ 13%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.4.1--2.0.0.sql
[ 14%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.4.0--2.0.0.sql
[ 15%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.3.2--2.0.0.sql
[ 15%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.3.1--2.0.0.sql
[ 16%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.3.0--2.0.0.sql
[ 17%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.2.2--2.0.0.sql
[ 18%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.2.1--2.0.0.sql
[ 19%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.2.0--2.0.0.sql
[ 20%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.1.1--2.0.0.sql
[ 21%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--1.1.0--2.0.0.sql
[ 21%] Built target sqlupdatescripts
Scanning dependencies of target sqlfile
[ 21%] Generating /Users/taf2/work/timescaledb/build/sql/timescaledb--2.0.0.sql
[ 21%] Built target sqlfile
Scanning dependencies of target timescaledb
[ 22%] Building C object src/CMakeFiles/timescaledb.dir/agg_bookend.c.o
[ 23%] Building C object src/CMakeFiles/timescaledb.dir/func_cache.c.o
[ 24%] Building C object src/CMakeFiles/timescaledb.dir/cache.c.o
[ 25%] Building C object src/CMakeFiles/timescaledb.dir/cache_invalidate.c.o
[ 26%] Building C object src/CMakeFiles/timescaledb.dir/catalog.c.o
[ 26%] Building C object src/CMakeFiles/timescaledb.dir/continuous_agg.c.o
[ 27%] Building C object src/CMakeFiles/timescaledb.dir/chunk.c.o
[ 28%] Building C object src/CMakeFiles/timescaledb.dir/chunk_adaptive.c.o
[ 29%] Building C object src/CMakeFiles/timescaledb.dir/chunk_constraint.c.o
[ 30%] Building C object src/CMakeFiles/timescaledb.dir/chunk_dispatch.c.o
[ 31%] Building C object src/CMakeFiles/timescaledb.dir/chunk_dispatch_plan.c.o
[ 31%] Building C object src/CMakeFiles/timescaledb.dir/chunk_dispatch_state.c.o
[ 32%] Building C object src/CMakeFiles/timescaledb.dir/chunk_index.c.o
[ 33%] Building C object src/CMakeFiles/timescaledb.dir/chunk_insert_state.c.o
[ 34%] Building C object src/CMakeFiles/timescaledb.dir/chunk_data_node.c.o
[ 35%] Building C object src/CMakeFiles/timescaledb.dir/constraint.c.o
[ 36%] Building C object src/CMakeFiles/timescaledb.dir/constraint_aware_append.c.o
[ 36%] Building C object src/CMakeFiles/timescaledb.dir/cross_module_fn.c.o
[ 37%] Building C object src/CMakeFiles/timescaledb.dir/copy.c.o
[ 38%] Building C object src/CMakeFiles/timescaledb.dir/compression_chunk_size.c.o
[ 39%] Building C object src/CMakeFiles/timescaledb.dir/compression_with_clause.c.o
[ 40%] Building C object src/CMakeFiles/timescaledb.dir/dimension.c.o
[ 41%] Building C object src/CMakeFiles/timescaledb.dir/dimension_slice.c.o
[ 42%] Building C object src/CMakeFiles/timescaledb.dir/dimension_vector.c.o
[ 42%] Building C object src/CMakeFiles/timescaledb.dir/estimate.c.o
[ 43%] Building C object src/CMakeFiles/timescaledb.dir/event_trigger.c.o
[ 44%] Building C object src/CMakeFiles/timescaledb.dir/extension.c.o
[ 45%] Building C object src/CMakeFiles/timescaledb.dir/gapfill.c.o
[ 46%] Building C object src/CMakeFiles/timescaledb.dir/guc.c.o
[ 47%] Building C object src/CMakeFiles/timescaledb.dir/histogram.c.o
[ 47%] Building C object src/CMakeFiles/timescaledb.dir/hypercube.c.o
[ 48%] Building C object src/CMakeFiles/timescaledb.dir/hypertable.c.o
[ 49%] Building C object src/CMakeFiles/timescaledb.dir/hypertable_cache.c.o
[ 50%] Building C object src/CMakeFiles/timescaledb.dir/hypertable_compression.c.o
[ 51%] Building C object src/CMakeFiles/timescaledb.dir/hypertable_insert.c.o
[ 52%] Building C object src/CMakeFiles/timescaledb.dir/hypertable_restrict_info.c.o
[ 52%] Building C object src/CMakeFiles/timescaledb.dir/hypertable_data_node.c.o
[ 53%] Building C object src/CMakeFiles/timescaledb.dir/indexing.c.o
[ 54%] Building C object src/CMakeFiles/timescaledb.dir/init.c.o
[ 55%] Building C object src/CMakeFiles/timescaledb.dir/metadata.c.o
[ 56%] Building C object src/CMakeFiles/timescaledb.dir/jsonb_utils.c.o
[ 57%] Building C object src/CMakeFiles/timescaledb.dir/license_guc.c.o
[ 57%] Building C object src/CMakeFiles/timescaledb.dir/partitioning.c.o
[ 58%] Building C object src/CMakeFiles/timescaledb.dir/planner.c.o
[ 59%] Building C object src/CMakeFiles/timescaledb.dir/plan_expand_hypertable.c.o
[ 60%] Building C object src/CMakeFiles/timescaledb.dir/plan_add_hashagg.c.o
[ 61%] Building C object src/CMakeFiles/timescaledb.dir/plan_agg_bookend.c.o
[ 62%] Building C object src/CMakeFiles/timescaledb.dir/plan_partialize.c.o
[ 63%] Building C object src/CMakeFiles/timescaledb.dir/process_utility.c.o
[ 63%] Building C object src/CMakeFiles/timescaledb.dir/scanner.c.o
[ 64%] Building C object src/CMakeFiles/timescaledb.dir/scan_iterator.c.o
[ 65%] Building C object src/CMakeFiles/timescaledb.dir/sort_transform.c.o
[ 66%] Building C object src/CMakeFiles/timescaledb.dir/subspace_store.c.o
/Users/taf2/work/timescaledb/src/subspace_store.c:119:18: error: Access to field 'storage' results in a dereference of a null pointer (loaded from variable 'last') [clang-analyzer-core.NullDereference,-warnings-as-errors]
last->storage = subspace_store_internal_node_create(i == (hc->num_slices - 1));
^
/Users/taf2/work/timescaledb/src/subspace_store.c:98:2: note: 'last' initialized to a null pointer value
DimensionSlice *last = NULL;
^
/Users/taf2/work/timescaledb/src/subspace_store.c:104:14: note: Assuming 'i' is < field 'num_slices'
for (i = 0; i < hc->num_slices; i++)
^
/Users/taf2/work/timescaledb/src/subspace_store.c:104:2: note: Loop condition is true. Entering loop body
for (i = 0; i < hc->num_slices; i++)
^
/Users/taf2/work/timescaledb/src/subspace_store.c:111:7: note: Assuming 'node' is equal to NULL
if (node == NULL)
^
/Users/taf2/work/timescaledb/src/subspace_store.c:111:3: note: Taking true branch
if (node == NULL)
^
/Users/taf2/work/timescaledb/src/subspace_store.c:119:56: note: Assuming the condition is false
last->storage = subspace_store_internal_node_create(i == (hc->num_slices - 1));
^
/Users/taf2/work/timescaledb/src/subspace_store.c:119:18: note: Access to field 'storage' results in a dereference of a null pointer (loaded from variable 'last')
last->storage = subspace_store_internal_node_create(i == (hc->num_slices - 1));
^
/Users/taf2/work/timescaledb/src/subspace_store.c:192:16: error: Access to field 'storage' results in a dereference of a null pointer (loaded from variable 'last') [clang-analyzer-core.NullDereference,-warnings-as-errors]
last->storage = object; /* at the end we store the object */
^
/Users/taf2/work/timescaledb/src/subspace_store.c:98:2: note: 'last' initialized to a null pointer value
DimensionSlice *last = NULL;
^
/Users/taf2/work/timescaledb/src/subspace_store.c:104:14: note: Assuming 'i' is >= field 'num_slices'
for (i = 0; i < hc->num_slices; i++)
^
/Users/taf2/work/timescaledb/src/subspace_store.c:104:2: note: Loop condition is false. Execution continues on line 191
for (i = 0; i < hc->num_slices; i++)
^
/Users/taf2/work/timescaledb/src/subspace_store.c:192:16: note: Access to field 'storage' results in a dereference of a null pointer (loaded from variable 'last')
last->storage = object; /* at the end we store the object */
^
/Users/taf2/work/timescaledb/src/subspace_store.c:216:9: error: Access to field 'storage' results in a dereference of a null pointer (loaded from variable 'match') [clang-analyzer-core.NullDereference,-warnings-as-errors]
return match->storage;
^
/Users/taf2/work/timescaledb/src/subspace_store.c:202:2: note: 'match' initialized to a null pointer value
DimensionSlice *match = NULL;
^
/Users/taf2/work/timescaledb/src/subspace_store.c:206:14: note: Assuming 'i' is >= field 'cardinality'
for (i = 0; i < target->cardinality; i++)
^
/Users/taf2/work/timescaledb/src/subspace_store.c:206:2: note: Loop condition is false. Execution continues on line 215
for (i = 0; i < target->cardinality; i++)
^
/Users/taf2/work/timescaledb/src/subspace_store.c:216:9: note: Access to field 'storage' results in a dereference of a null pointer (loaded from variable 'match')
return match->storage;
^
3 warnings generated.
make[2]: *** [src/CMakeFiles/timescaledb.dir/subspace_store.c.o] Error 1
make[1]: *** [src/CMakeFiles/timescaledb.dir/all] Error 2
make: *** [all] Error 2
Yeah - timescaledb is very frustrating 🤦 - probably clang updates etc...
after reworking all the possible NULL errors in /Users/taf2/work/timescaledb/src/subspace_store.c - i have it built... i guess these should be bugs reported to the core timescaledb project but feels like it's not being well maintained 😟
Here's what I did to get this working... git clone timescaledb git checkout 2.x
diff --git a/src/subspace_store.c b/src/subspace_store.c
index 88f5f5a5..6c492a26 100644
--- a/src/subspace_store.c
+++ b/src/subspace_store.c
@@ -115,11 +115,18 @@ ts_subspace_store_add(SubspaceStore *store, const Hypercube *hc, void *object,
* hypertable. If we don't have one for the current dimension,
* create one now. (There will always be one for time)
*/
- Assert(last != NULL);
- last->storage = subspace_store_internal_node_create(i == (hc->num_slices - 1));
- last->storage_free = subspace_store_internal_node_free;
- node = last->storage;
+ if (last) {
+ Assert(last != NULL);
+ last->storage = subspace_store_internal_node_create(i == (hc->num_slices - 1));
+ last->storage_free = subspace_store_internal_node_free;
+ node = last->storage;
+ } else {
+ return;
+ }
}
+ if (last == NULL) {
+ return;
+ }
Assert(store->max_items == 0 || node->descendants <= (size_t) store->max_items);
@@ -184,13 +191,17 @@ ts_subspace_store_add(SubspaceStore *store, const Hypercube *hc, void *object,
Assert(store->max_items == 0 || node->descendants <= (size_t) store->max_items);
last = match;
- /* internal slices point to the next SubspaceStoreInternalNode */
- node = last->storage;
+ if (last) {
+ /* internal slices point to the next SubspaceStoreInternalNode */
+ node = last->storage;
+ }
}
- Assert(last != NULL && last->storage == NULL);
- last->storage = object; /* at the end we store the object */
- last->storage_free = object_free;
+ if (last) {
+ Assert(last != NULL && last->storage == NULL);
+ last->storage = object; /* at the end we store the object */
+ last->storage_free = object_free;
+ }
MemoryContextSwitchTo(old);
}
@@ -213,7 +224,11 @@ ts_subspace_store_get(SubspaceStore *store, Point *target)
vec = ((SubspaceStoreInternalNode *) match->storage)->vector;
}
Assert(match != NULL);
- return match->storage;
+ if (match) {
+ return match->storage;
+ } else {
+ return NULL;
+ }
}
void
cd build make make install DESTDIR=/usr/local/Cellar/
all that said.. yikes works maybe mileage will vary 👍
use my shell script install ok!
ln -s /usr/local/Cellar/postgresql@12/12.4_1/include/postgresql/server /usr/local/Cellar/postgresql@12/12.4_1/include/server
think's @mrz1836
I'm getting
Last 15 lines from /Users/sparc5/Library/Logs/Homebrew/timescaledb/02.build:
#include <postgres.h>
^~~~~~~~~~~~
Homebrew installed Postgres v13.1 and the Cellar folder is at: /System/Volumes/Data/opt/homebrew/Cellar/postgresql@12/12.5 oddly there is a v12 folder and a v13 at /System/Volumes/Data/opt/homebrew/Cellar/postgresql/13.1
Running macOS Big Sur. I feel like I'm close, maybe I need to add something to my .bash_profile. I had the same problem on Catalina and I solved it by
using brew install postgresql@12
and using the symlink trick above. Seems like someone needs to update the timescale package for postgresql v13.
Just upgraded timescaledb - and it's broken again:
$ createuser postgres -s createuser: error: query failed: ERROR: could not access file "$libdir/timescaledb-1.7.4": No such file or directory createuser: query was: SELECT pg_catalog.set_config('search_path', '', false);
Anyone have any ideas?
@mrz1836 not saying it's correct or pretty ( would definitely not deploy to a production env with this) but my patches are working for me for local development...
Correcting the symbolic link to use 12.6 instead of 12.5 or 12.4 did the trick for me:
brew tap timescale/tap
ln -s /usr/local/Cellar/postgresql@12/12.6/include/postgresql/server /usr/local/Cellar/postgresql@12/12.6/include/server
brew install timescaledb
@sparc5 I think I found the way to solve your case:
The reason behind is due to the obsolete of openssl
after macOS 10.11. The progress of building timescaledb actually tries to refer openssl from Xcode command tools rather than the one mentioned in user profile (somehow I don't know the reason why).
So the solution is simple: we can install openssl through brew firestly. Find a openssl
folder under /usr/local/Cellar/openssl@1.1/1.1.1j/include/
(this folder contains all files like ssl.h
) and copy the folder into Xcode.app. The path under the Xcode.app is /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
@taf2 I encountered the same issue once trying to install timescaledb through brew. So I downloaded the source code and build up the package by myself...
During the progress of build && make, I encountered another issue due to the obsolete of openssl
under Big Sur
. My pleasure if my previous comment helps to solve the issue during the compiling.
I'm unable to install Timescaledb, after being asked by brew to update my OS to Big Sur. Running
brew install timescaledb
Gives me the following output:
==> Installing timescaledb from timescale/tap
==> Downloading https://timescalereleases.blob.core.windows.net/homebrew/timescaledb-2.1.0.tar.lzma
Already downloaded: /Users/tranlm/Library/Caches/Homebrew/downloads/be6d0eb95979b0059990a759b7dea1a2eb6a88179401c7a94be3e7a7e61a4d90--timescaledb-2.1.0.tar.lzma
==> ./bootstrap -DREGRESS_CHECKS=OFF -DPROJECT_INSTALL_METHOD="brew"
==> cd ./build && make
Last 15 lines from /Users/tranlm/Library/Logs/Homebrew/timescaledb/02.build:
make[2]: *** Waiting for unfinished jobs....
/tmp/timescaledb-20210226-6864-132asu0/timescaledb/src/net/http_response.c:185:8: warning: Call to function 'sscanf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sscanf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
if (sscanf(raw_buf, "%127s%*[ ]%d%*[ ]%*s", state->version, &state->status_code) == 2)
^
/tmp/timescaledb-20210226-6864-132asu0/timescaledb/src/net/http_response.c:185:8: note: Call to function 'sscanf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sscanf_s' in case of C11
/tmp/timescaledb-20210226-6864-132asu0/timescaledb/src/net/http_response.c:237:9: warning: Call to function 'sscanf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sscanf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
if (sscanf(state->cur_header_value, "%d", &temp_length) == 1)
^
/tmp/timescaledb-20210226-6864-132asu0/timescaledb/src/net/http_response.c:237:9: note: Call to function 'sscanf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sscanf_s' in case of C11
/tmp/timescaledb-20210226-6864-132asu0/timescaledb/src/net/http_request.c:194:3: warning: Call to function 'sscanf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sscanf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
sscanf(header->value, "%d", &content_length);
^
/tmp/timescaledb-20210226-6864-132asu0/timescaledb/src/net/http_request.c:194:3: note: Call to function 'sscanf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sscanf_s' in case of C11
make[1]: *** [src/CMakeFiles/timescaledb.dir/all] Error 2
make: *** [all] Error 2
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
I'm guessing that there's some kind of incompatibility with 'sscanf'. Anyone have ideas for workarounds?
@tranlm I got the same issue. You can, perhaps the only way to, install the timescaledb by compiling the source code by yourself.
./bootstrap
command as the page mentioned, suggest to install openssl
through brew, using brew install openssl
openssl
tool. We need to move the openssl folder (just the folder but not files under this folder) we installed in Step 2. /usr/local/Cellar/openssl@1.1/1.1.1j/include/openssl
, to Xcode folder /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
./bootstrap -DREGRESS_CHECKS=OFF -DUSE_OPENSSL=0 -DLINTER=OFF
this command instead of ./bootstrap
. The parameters will skip some verification steps to provide a loose environment for a successful compiling.cd ./build && make
as the official page mentioned to start the compiling.make install DESTDIR=<path>
to install the timescaledb to the path you pointed to.<path>
to ~/Desktop
for example, you'll get a folder named usr
on the desktop. This folder contains all timescaledb components as the same by using brew install timescaledb
. You can also copy those files to corresponding folders under postgres@12
timescaledb-tools -conf-path <your postgresql.conf path>
to adjust your PostgreSQL instance settings to get the best performance.Thanks @volvo007. Your solution worked for me. I wasn't sure what you meant in Step 3, so I moved the entire Cellar folder to the Xcode folder.
@tranlm Glad to hear that helps and your action is what I expected but not clarified well 👏
I needed to execute the following command to get it to compile on Catalina with pgsql 12.6.1
ln -s /usr/local/Cellar/postgresql@12/12.6_1 /usr/local/Cellar/postgresql@12/12.6
ln -s /usr/local/Cellar/postgresql@12/12.6/include/postgresql/server /usr/local/Cellar/postgresql@12/12.6/include/server
I solved the problem with brew doctor
and brew tap homebrew/core
, maybe you can try?
Using
postgres@12
and ran:Here is the brew output: