pg_query icon indicating copy to clipboard operation
pg_query copied to clipboard

I can't install pg_query 2.2.0 on Ubuntu 24.04 with neither GCC 13, nor GCC 14

Open betasve opened this issue 11 months ago • 2 comments

Hi, I'm trying to install pg_query version 2.2.0 on my machine. It runs:

  • Ubuntu 24.04
  • Ruby 3.2.2
  • Gem 3.6.2
  • Bundler 2.5.6
  • gcc 14.0.2 (but initially I've tried with 13.02 as well)
  • clang 18.1.3

When I'm trying to install the gem, it errors with the following erros:

Building native extensions. This could take a while...
ERROR:  Error installing pg_query:
	ERROR: Failed to build gem native extension.

    current directory: /home/sve/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/pg_query-2.2.0/ext/pg_query
/home/sve/.rbenv/versions/3.2.2/bin/ruby extconf.rb
creating Makefile

current directory: /home/sve/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/pg_query-2.2.0/ext/pg_query
make DESTDIR\= sitearchdir\=./.gem.20250113-6458-mwoy0p sitelibdir\=./.gem.20250113-6458-mwoy0p clean

current directory: /home/sve/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/pg_query-2.2.0/ext/pg_query
make DESTDIR\= sitearchdir\=./.gem.20250113-6458-mwoy0p sitelibdir\=./.gem.20250113-6458-mwoy0p
compiling /home/sve/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/pg_query-2.2.0/ext/pg_query/guc-file.c
compiling /home/sve/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/pg_query-2.2.0/ext/pg_query/pg_query.c
In file included from /home/sve/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/pg_query-2.2.0/ext/pg_query/include/postgres.h:46,
                 from /home/sve/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/pg_query-2.2.0/ext/pg_query/pg_query_internal.h:4,
                 from /home/sve/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/pg_query-2.2.0/ext/pg_query/pg_query.c:2:
/home/sve/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/pg_query-2.2.0/ext/pg_query/include/c.h:119:5: warning: "__clang_major__" is not defined, evaluates to 0 [-Wundef]
  119 | #if __clang_major__ >= 7 || __GNUC__ >= 8
      |     ^~~~~~~~~~~~~~~
/home/sve/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/pg_query-2.2.0/ext/pg_query/pg_query.c: In function ‘pg_query_enter_memory_context’:
/home/sve/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/pg_query-2.2.0/ext/pg_query/pg_query.c:69:15: warning: old-style function definition [-Wold-style-definition]
   69 | MemoryContext pg_query_enter_memory_context()
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At top level:
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics

And some other issues related to warnings and errors as well. I tried turning off the no-undef warning, but couldn't fix the other issues.

Full error log is attached.

Thanks in advance for your help. :bow: pg_query-2.2.0-error-log.txt

betasve avatar Jan 13 '25 20:01 betasve

And some other issues related to warnings and errors as well.

Thanks for the report - unfortunately it looks like you skipped the part of the output that was the actual error, so its not clear what happened.

However, given you're noting you're on Ubuntu 24.04, you might have run into #203 - can you try installing a newer pg_query version (this was fixed in 4.2.3, latest is 6.0.0) and confirm whether the error still occurs?

lfittl avatar Jan 13 '25 22:01 lfittl

Hello, I've pasted the whole log into the file. That's what I get in my terminal. The issues is that a project I'm working on requires as a dependency the pg_query 2.2.0.

I'll try some workarounds and see where I get. I was just wanting to check if there's a known issue with my kind of setup.

Thanks.

betasve avatar Jan 14 '25 05:01 betasve