guedes / pgxn-utils

A set of task that help developers to create PostgreSQL's extensions
http://pgxn.org
Other
37 stars 15 forks source link

Problems installing on Ubuntu 20.04 #51

Open beargiles opened 2 years ago

beargiles commented 2 years ago

This occurs on an updated copy of Ubuntu 20.04, with pgxn 1.3.2 installed in a virtualenv.

If I usesudo pgxn install pgxn_utils

(venv) root@u2004:/home/bgiles# pgxn install pgxn_utils
INFO: best version: pgxn_utils 0.1.4
INFO: saving /tmp/tmpzcgdpqtt/pgxn_utils-0.1.4.zip
INFO: unpacking: /tmp/tmpzcgdpqtt/pgxn_utils-0.1.4.zip
INFO: building extension
make: Nothing to be done for 'all'.
INFO: installing extension
gem install --no-rdoc --no-ri ./pkg/pgxn_utils-0.1.4.gem
ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --no-rdoc
Did you mean?  no-force
make: *** [Makefile:3: install] Error 1
ERROR: command returned 2: make PG_CONFIG=/usr/bin/pg_config install

If I use sudo gem install pgxn_utils I get

(venv) root@u2004:/home/bgiles# gem install pgxn_utils
Building native extensions. This could take a while...
ERROR:  Error installing pgxn_utils:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.7.0/gems/json-1.6.8/ext/json/ext/generator
/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20211021-95425-nsptdk.rb extconf.rb
creating Makefile

current directory: /var/lib/gems/2.7.0/gems/json-1.6.8/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /var/lib/gems/2.7.0/gems/json-1.6.8/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
../fbuffer/fbuffer.h: In function ‘fbuffer_to_s’:
../fbuffer/fbuffer.h:151:47: error: macro "rb_str_new" requires 2 arguments, but only 1 given
  151 |     VALUE result = rb_str_new(FBUFFER_PAIR(fb));
      |                                               ^
In file included from /usr/include/ruby-2.7.0/ruby/ruby.h:2148,
                 from /usr/include/ruby-2.7.0/ruby.h:33,
                 from ../fbuffer/fbuffer.h:6,
                 from generator.c:1:
/usr/include/ruby-2.7.0/ruby/intern.h:841: note: macro "rb_str_new" defined here
  841 | #define rb_str_new(str, len) RB_GNUC_EXTENSION_BLOCK( \
      | 
In file included from generator.c:1:
../fbuffer/fbuffer.h:151:20: warning: initialization of ‘VALUE’ {aka ‘long unsigned int’} from ‘VALUE (*)(const char *, long int)’ {aka ‘long unsigned int (*)(const char *, long int)’} makes integer from pointer without a cast [-Wint-conversion]
  151 |     VALUE result = rb_str_new(FBUFFER_PAIR(fb));
      |                    ^~~~~~~~~~
In file included from generator.c:2:
generator.c: In function ‘cState_aref’:
generator.h:96:27: warning: variable ‘state’ set but not used [-Wunused-but-set-variable]
   96 |     JSON_Generator_State *state;              \
      |                           ^~~~~
generator.c:632:5: note: in expansion of macro ‘GET_STATE’
  632 |     GET_STATE(self);
      |     ^~~~~~~~~
generator.c: In function ‘generate_json’:
generator.c:800:25: error: ‘rb_cFixnum’ undeclared (first use in this function); did you mean ‘mFixnum’?
  800 |     } else if (klass == rb_cFixnum) {
      |                         ^~~~~~~~~~
      |                         mFixnum
generator.c:800:25: note: each undeclared identifier is reported only once for each function it appears in
generator.c:802:25: error: ‘rb_cBignum’ undeclared (first use in this function); did you mean ‘mBignum’?
  802 |     } else if (klass == rb_cBignum) {
      |                         ^~~~~~~~~~
      |                         mBignum
generator.c: In function ‘isArrayOrObject’:
generator.c:867:22: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
  867 |     return *p == '[' && *q == ']' || *p == '{' && *q == '}';
      |            ~~~~~~~~~~^~~~~~~~~~~~
make: *** [Makefile:245: generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.7.0/gems/json-1.6.8 for inspection.
Results logged to /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/json-1.6.8/gem_make.out

The installed packages are

(venv) root@u2004:/home/bgiles# dpkg -l | grep ruby
ii  libruby2.7:amd64                           2.7.0-5ubuntu1.5                      amd64        Libraries necessary to run Ruby 2.7
ii  rake                                       13.0.1-4                              all          ruby make-like utility
ii  ruby                                       1:2.7+1                               amd64        Interpreter of object-oriented scripting language Ruby (default version)
ii  ruby-dev:amd64                             1:2.7+1                               amd64        Header files for compiling extension modules for Ruby (default version)
ii  ruby-minitest                              5.13.0-1                              all          Ruby test tools supporting TDD, BDD, mocking, and benchmarking
ii  ruby-net-telnet                            0.1.1-2                               all          telnet client library
ii  ruby-power-assert                          1.1.7-1                               all          library showing values of variables and method calls in an expression
ii  ruby-test-unit                             3.3.5-1                               all          unit testing framework for Ruby
ii  ruby-xmlrpc                                0.3.0-2                               all          XMLRPC library for Ruby
ii  ruby2.7                                    2.7.0-5ubuntu1.5                      amd64        Interpreter of object-oriented scripting language Ruby
ii  ruby2.7-dev:amd64                          2.7.0-5ubuntu1.5                      amd64        Header files for compiling extension modules for the Ruby 2.7
ii  ruby2.7-doc                                2.7.0-5ubuntu1.5                      all          Documentation for Ruby 2.7
ii  rubygems-integration                       1.16                                  all          integration of Debian Ruby packages with Rubygems
ardentperf commented 1 year ago

FYI, I'm having the same problem on 22.04

root@ip-172-31-94-230:/var/lib/postgresql# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:    22.04
Codename:   jammy

root@ip-172-31-94-230:/var/lib/postgresql# pgxn install pgxn_utils
INFO: best version: pgxn_utils 0.1.4
INFO: saving /tmp/tmpj_hr2x8h/pgxn_utils-0.1.4.zip
INFO: unpacking: /tmp/tmpj_hr2x8h/pgxn_utils-0.1.4.zip
INFO: building extension
gmake: Nothing to be done for 'all'.
INFO: installing extension
gem install --no-rdoc --no-ri ./pkg/pgxn_utils-0.1.4.gem
ERROR:  While executing gem ... (Gem::OptionParser::InvalidOption)
    invalid option: --no-rdoc
Did you mean?  no-force
gmake: *** [Makefile:3: install] Error 1
ERROR: command returned 2: gmake PG_CONFIG=/usr/bin/pg_config install

ruby packages:

root@ip-172-31-94-230:/var/lib/postgresql# dpkg -l | grep ruby
ii  libruby3.0:amd64                   3.0.2-7ubuntu2.3                        amd64        Libraries necessary to run Ruby 3.0
ii  rake                               13.0.6-2                                all          ruby make-like utility
ii  ruby                               1:3.0~exp1                              amd64        Interpreter of object-oriented scripting language Ruby (default version)
ii  ruby-net-telnet                    0.1.1-2                                 all          telnet client library
ii  ruby-rubygems                      3.3.5-2                                 all          Package management framework for Ruby
ii  ruby-webrick                       1.7.0-3                                 all          HTTP server toolkit in Ruby
ii  ruby-xmlrpc                        0.3.2-1ubuntu0.1                        all          XMLRPC library for Ruby
ii  ruby3.0                            3.0.2-7ubuntu2.3                        amd64        Interpreter of object-oriented scripting language Ruby
ii  rubygems-integration               1.18                                    all          integration of Debian Ruby packages with Rubygems