Skip to content

fix to allow compilation on mac os x#82

Merged
JoshInnis merged 1 commit intoapache:masterfrom
deem0n:master
Nov 8, 2021
Merged

fix to allow compilation on mac os x#82
JoshInnis merged 1 commit intoapache:masterfrom
deem0n:master

Conversation

@deem0n
Copy link
Copy Markdown
Contributor

@deem0n deem0n commented Jun 7, 2021

without this fix I see the following error:

 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/parser/cypher_parser.o src/backend/parser/cypher_parser.c
 src/backend/parser/cypher_parser.c:133:16: error: implicit declaration of function 'cypher_yyparse' is invalid in C99
       [-Werror,-Wimplicit-function-declaration]
     yyresult = cypher_yyparse(scanner, &extra);
                ^
 src/backend/parser/cypher_parser.c:133:16: note: did you mean 'cypher_yyerror'?
 src/backend/parser/cypher_parser.c:115:6: note: 'cypher_yyerror' declared here
 void cypher_yyerror(YYLTYPE *llocp, ag_scanner_t scanner,

my pg_config is:

BINDIR = /Applications/Postgres.app/Contents/Versions/11/bin
DOCDIR = /Applications/Postgres.app/Contents/Versions/11/share/doc/postgresql
HTMLDIR = /Applications/Postgres.app/Contents/Versions/11/share/doc/postgresql
INCLUDEDIR = /Applications/Postgres.app/Contents/Versions/11/include
PKGINCLUDEDIR = /Applications/Postgres.app/Contents/Versions/11/include/postgresql
INCLUDEDIR-SERVER = /Applications/Postgres.app/Contents/Versions/11/include/postgresql/server
LIBDIR = /Applications/Postgres.app/Contents/Versions/11/lib
PKGLIBDIR = /Applications/Postgres.app/Contents/Versions/11/lib/postgresql
LOCALEDIR = /Applications/Postgres.app/Contents/Versions/11/share/locale
MANDIR = /Applications/Postgres.app/Contents/Versions/11/share/man
SHAREDIR = /Applications/Postgres.app/Contents/Versions/11/share/postgresql
SYSCONFDIR = /Applications/Postgres.app/Contents/Versions/11/etc/postgresql
PGXS = /Applications/Postgres.app/Contents/Versions/11/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/Applications/Postgres.app/Contents/Versions/11' '--with-includes=/Applications/Postgres.app/Contents/Versions/11/include' '--with-libraries=/Applications/Postgres.app/Contents/Versions/11/lib' '--enable-thread-safety' '--with-openssl' '--with-gssapi' '--with-bonjour' '--with-libxml' '--with-libxslt' '--with-perl' '--with-tcl' '--with-python' '--with-readline' '--with-uuid=e2fs' '--with-icu' 'CFLAGS= -mmacosx-version-min=10.12' 'CXXFLAGS= -mmacosx-version-min=10.12 -mmacosx-version-min=10.12' 'PKG_CONFIG_LIBDIR=/Applications/Postgres.app/Contents/Versions/11/lib/pkgconfig' 'ICU_CFLAGS=-I/Applications/Postgres.app/Contents/Versions/11/share/icu' 'ICU_LIBS=-licui18n -licuuc'
CC = gcc
CPPFLAGS = -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2 -I/Applications/Postgres.app/Contents/Versions/11/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12
CFLAGS_SL =
LDFLAGS = -L/Applications/Postgres.app/Contents/Versions/11/lib -L/Applications/Postgres.app/Contents/Versions/11/lib -Wl,-dead_strip_dylibs
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm
VERSION = PostgreSQL 11.11

gcc version:

 gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@emotionbug
Copy link
Copy Markdown
Contributor

emotionbug commented Jun 8, 2021

This would not be the perfect solution.
because, cypher_gram.y generate cypher_gram_def.h, cypher_gram.c that defined cypher_yyparse function.

maybe, it is build order problem.
so, make src/backend/parser/cypher_gram.c command will be generate that files. after than, it can be buildable.
https://github.com/apache/incubator-age/blob/a389bbcf1979cb0c991441dad4faced81f7a2923/Makefile#L91

but, there is also a problem with the "cypher_gram.c" file that generated in my environment, which is looking for an invalid header location like behind.

// actual
#include "cypher_gram_def.h"

// except
#include "parser/cypher_gram_def.h

Summary

  1. Bison build order problem.
  2. invalid header location problem

Envoriment
Ubuntu 21.04
bison (GNU Bison) 3.7.5

@deem0n
Copy link
Copy Markdown
Contributor Author

deem0n commented Jun 8, 2021

The log from the latest master shows the bison invocation

/usr/bin/bison --defines=.//src/include/parser/cypher_gram_def.h -o src/backend/parser/cypher_gram.c src/backend/parser/cypher_gram.y

Interesting enough, the file I changed (cyther_parser.c) is not generated by bison and is a part of the repo. So it seems like a correct patch.

the full log:

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/age.o src/backend/age.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/catalog/ag_catalog.o src/backend/catalog/ag_catalog.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/catalog/ag_graph.o src/backend/catalog/ag_graph.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/catalog/ag_label.o src/backend/catalog/ag_label.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/catalog/ag_namespace.o src/backend/catalog/ag_namespace.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/commands/graph_commands.o src/backend/commands/graph_commands.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/commands/label_commands.o src/backend/commands/label_commands.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/executor/cypher_create.o src/backend/executor/cypher_create.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/executor/cypher_set.o src/backend/executor/cypher_set.c
src/backend/executor/cypher_set.c:118:42: warning: variable 'saved_resultRelInfo' is uninitialized when used within its own initialization
      [-Wuninitialized]
    ResultRelInfo *saved_resultRelInfo = saved_resultRelInfo;;
                   ~~~~~~~~~~~~~~~~~~~   ^~~~~~~~~~~~~~~~~~~
1 warning generated.
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/executor/cypher_utils.o src/backend/executor/cypher_utils.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/nodes/ag_nodes.o src/backend/nodes/ag_nodes.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/nodes/cypher_copyfuncs.o src/backend/nodes/cypher_copyfuncs.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/nodes/cypher_outfuncs.o src/backend/nodes/cypher_outfuncs.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/nodes/cypher_readfuncs.o src/backend/nodes/cypher_readfuncs.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/optimizer/cypher_createplan.o src/backend/optimizer/cypher_createplan.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/optimizer/cypher_pathnode.o src/backend/optimizer/cypher_pathnode.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/optimizer/cypher_paths.o src/backend/optimizer/cypher_paths.c
/usr/bin/flex -b  -o'src/backend/parser/ag_scanner.c' src/backend/parser/ag_scanner.l
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/parser/ag_scanner.o src/backend/parser/ag_scanner.c
src/backend/parser/ag_scanner.c:3668:23: warning: unused variable 'yyg' [-Wunused-variable]
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
                      ^
src/backend/parser/ag_scanner.c:4103:5: warning: no previous prototype for function 'ag_yyget_column' [-Wmissing-prototypes]
int ag_yyget_column  (yyscan_t yyscanner)
    ^
src/backend/parser/ag_scanner.c:4103:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int ag_yyget_column  (yyscan_t yyscanner)
^
static
src/backend/parser/ag_scanner.c:4131:6: warning: no previous prototype for function 'ag_yyset_column' [-Wmissing-prototypes]
void ag_yyset_column (int  column_no , yyscan_t yyscanner)
     ^
src/backend/parser/ag_scanner.c:4131:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void ag_yyset_column (int  column_no , yyscan_t yyscanner)
^
static
3 warnings generated.
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/parser/cypher_analyze.o src/backend/parser/cypher_analyze.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/parser/cypher_clause.o src/backend/parser/cypher_clause.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/executor/cypher_delete.o src/backend/executor/cypher_delete.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/parser/cypher_expr.o src/backend/parser/cypher_expr.c
/usr/bin/bison --defines=.//src/include/parser/cypher_gram_def.h -o src/backend/parser/cypher_gram.c src/backend/parser/cypher_gram.y
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/parser/cypher_gram.o src/backend/parser/cypher_gram.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/parser/cypher_item.o src/backend/parser/cypher_item.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/parser/cypher_keywords.o src/backend/parser/cypher_keywords.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/parser/cypher_parse_agg.o src/backend/parser/cypher_parse_agg.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/parser/cypher_parse_node.o src/backend/parser/cypher_parse_node.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/parser/cypher_parser.o src/backend/parser/cypher_parser.c
src/backend/parser/cypher_parser.c:133:16: error: implicit declaration of function 'cypher_yyparse' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
    yyresult = cypher_yyparse(scanner, &extra);
               ^
src/backend/parser/cypher_parser.c:133:16: note: did you mean 'cypher_yyerror'?
src/backend/parser/cypher_parser.c:115:6: note: 'cypher_yyerror' declared here
void cypher_yyerror(YYLTYPE *llocp, ag_scanner_t scanner,
     ^
1 error generated.
make[1]: *** [src/backend/parser/cypher_parser.o] Error 1
make: *** [/Applications/Postgres.app/Contents/Versions/11/share/postgresql/extension/age.control] Error 2

@emotionbug
Copy link
Copy Markdown
Contributor

@deem0n interesting.
which bison version are you using?

@deem0n
Copy link
Copy Markdown
Contributor Author

deem0n commented Jun 11, 2021

@deem0n interesting.
which bison version are you using?

I guess it is version provided by Apple:

bison (GNU Bison) 2.3
Written by Robert Corbett and Richard Stallman.

@emotionbug
Copy link
Copy Markdown
Contributor

emotionbug commented Jun 14, 2021

Ok, I tested with bison version that you installed.
It seems not compatible with 2.3.

how about try the latest version that you can download from brew?

root@0529b47f9958:/age/incubator-age#  cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
root@0529b47f9958:/age/incubator-age# bison --version
bison (GNU Bison) 2.3
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@0529b47f9958:/age/incubator-age# bison --version^C
root@0529b47f9958:/age/incubator-age# make -j16
/usr/bin/bison -Wno-deprecated  --defines=.//src/include/parser/cypher_gram_def.h -o src/backend/parser/cypher_gram.c src/backend/parser/cypher_gram.y
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie -fno-omit-frame-pointer -fPIC -I.//src/include -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal -I/usr/include/x86_64-linux-gnu -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o src/backend/parser/cypher_item.o src/backend/parser/cypher_item.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie -fno-omit-frame-pointer -fPIC -I.//src/include -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal -I/usr/include/x86_64-linux-gnu -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o src/backend/parser/cypher_keywords.o src/backend/parser/cypher_keywords.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie -fno-omit-frame-pointer -fPIC -I.//src/include -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal -I/usr/include/x86_64-linux-gnu -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o src/backend/parser/cypher_parse_agg.o src/backend/parser/cypher_parse_agg.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie -fno-omit-frame-pointer -fPIC -I.//src/include -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal -I/usr/include/x86_64-linux-gnu -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o src/backend/parser/cypher_parse_node.o src/backend/parser/cypher_parse_node.c
/usr/bin/bison: invalid option -- 'W'
Try `/usr/bin/bison --help' for more information.
/usr/lib/postgresql/11/lib/pgxs/src/makefiles/../../src/Makefile.global:736: recipe for target 'src/backend/parser/cypher_gram.c' failed
make: *** [src/backend/parser/cypher_gram.c] Error 1
make: *** Waiting for unfinished jobs....
In file included from src/backend/parser/cypher_keywords.c:30:0:
.//src/include/parser/cypher_gram.h:66:36: fatal error: parser/cypher_gram_def.h: No such file or directory
compilation terminated.
<builtin>: recipe for target 'src/backend/parser/cypher_keywords.o' failed
make: *** [src/backend/parser/cypher_keywords.o] Error 1
root@0529b47f9958:/age/incubator-age# make
/usr/bin/bison -Wno-deprecated  --defines=.//src/include/parser/cypher_gram_def.h -o src/backend/parser/cypher_gram.c src/backend/parser/cypher_gram.y
/usr/bin/bison: invalid option -- 'W'
Try `/usr/bin/bison --help' for more information.
/usr/lib/postgresql/11/lib/pgxs/src/makefiles/../../src/Makefile.global:736: recipe for target 'src/backend/parser/cypher_gram.c' failed
make: *** [src/backend/parser/cypher_gram.c] Error 1
root@0529b47f9958:/age/incubator-age# 

@deem0n
Copy link
Copy Markdown
Contributor Author

deem0n commented Jun 16, 2021

I used bison from brew with export PATH="/usr/local/opt/bison/bin:$PATH", but the same error. I see only one bison invocation:

/usr/bin/bison --defines=.//src/include/parser/cypher_gram_def.h -o src/backend/parser/cypher_gram.c src/backend/parser/cypher_gram.y
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -mmacosx-version-min=10.12  -I.//src/include -I. -I./ -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/server -I/Applications/Postgres.app/Contents/Versions/11/include/postgresql/internal -I/Applications/Postgres.app/Contents/Versions/11/share/icu -I/Applications/Postgres.app/Contents/Versions/11/include/libxml2  -I/Applications/Postgres.app/Contents/Versions/11/include  -c -o src/backend/parser/cypher_gram.o src/backend/parser/cypher_gram.c

And it runs without problem. Both bison 3.7 from brew and bison 2.3 on Mac OS X do the job. The problem is that compiler can not handle function use without prior declaration: implicit declaration of function 'cypher_yyparse' is invalid in C99

The error is in the cypher_parser.c which is part of the git repo and is not generated by bison during the build.

@JoshInnis JoshInnis added the bug Something isn't working label Jun 25, 2021
Copy link
Copy Markdown
Contributor

@muhammadshoaib muhammadshoaib left a comment

Choose a reason for hiding this comment

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

This worked for me on mac. but it shall be tested if making it permanent permanent part of the code will create any other problem or not.

@JoshInnis JoshInnis merged commit 6b89996 into apache:master Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants