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

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

Open
betasve opened this issue Jan 13, 2025 · 2 comments

Comments

@betasve
Copy link

betasve commented Jan 13, 2025

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. 🙇
pg_query-2.2.0-error-log.txt

@lfittl
Copy link
Member

lfittl commented Jan 13, 2025

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?

@betasve
Copy link
Author

betasve commented Jan 14, 2025

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.

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

No branches or pull requests

2 participants