pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14334: vacuumdb.c build failure on openbsd
10+ messages / 3 participants
[nested] [flat]

* BUG #14334: vacuumdb.c build failure on openbsd
@ 2016-09-21 17:18  jungleboogie0+psql@gmail.com
  0 siblings, 1 reply; 10+ messages in thread

From: jungleboogie0+psql@gmail.com @ 2016-09-21 17:18 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      14334
Logged by:          sean farrell
Email address:      jungleboogie0+psql@gmail.com
PostgreSQL version: 9.6rc1
Operating system:   openbsd current
Description:        

Hello,

I'm attempting to build postgresql on OpenBSD current with this config
option:
./configure --enable-cassert --enable-debug  --with-perl \
        --with-python --with-tcl --with-openssl  --with-libxml \
        --with-libxslt --with-includes=/usr/local/include



Here's part of the build where it fails:
gmake[5]: Entering directory '/home/sean/bin/postgres/src/backend'
gmake[5]: Nothing to be done for 'submake-errcodes'.
gmake[5]: Leaving directory '/home/sean/bin/postgres/src/backend'
gmake[4]: Leaving directory '/home/sean/bin/postgres/src/port'
/usr/local/bin/gmake -C ../../../src/common all
gmake[4]: Entering directory '/home/sean/bin/postgres/src/common'
/usr/local/bin/gmake -C ../backend submake-errcodes
gmake[5]: Entering directory '/home/sean/bin/postgres/src/backend'
gmake[5]: Nothing to be done for 'submake-errcodes'.
gmake[5]: Leaving directory '/home/sean/bin/postgres/src/backend'
gmake[4]: Leaving directory '/home/sean/bin/postgres/src/common'
/usr/local/bin/gmake -C ../../../src/fe_utils all
gmake[4]: Entering directory '/home/sean/bin/postgres/src/fe_utils'
gmake[4]: Nothing to be done for 'all'.
gmake[4]: Leaving directory '/home/sean/bin/postgres/src/fe_utils'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
-Wendif-labels -Wmissing-format-attribute -Wformat-security
-fno-strict-aliasing -fwrapv -g -O2 -I../../../src/interfaces/libpq
-I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include 
-I/usr/local/include  -c -o vacuumdb.o vacuumdb.c
vacuumdb.c:70: error: expected declaration specifiers or '...' before
'fd_set'
vacuumdb.c: In function 'main':
vacuumdb.c:193: error: 'FD_SETSIZE' undeclared (first use in this
function)
vacuumdb.c:193: error: (Each undeclared identifier is reported only once
vacuumdb.c:193: error: for each function it appears in.)
vacuumdb.c: In function 'GetIdleSlot':
vacuumdb.c:733: error: 'fd_set' undeclared (first use in this function)
vacuumdb.c:733: error: expected ';' before 'slotset'
vacuumdb.c:734: warning: ISO C90 forbids mixed declarations and code
vacuumdb.c:740: warning: implicit declaration of function 'FD_ZERO'
vacuumdb.c:740: error: 'slotset' undeclared (first use in this function)
vacuumdb.c:745: warning: implicit declaration of function 'FD_SET'
vacuumdb.c:759: error: too many arguments to function 'select_loop'
vacuumdb.c:775: warning: implicit declaration of function 'FD_ISSET'
vacuumdb.c: At top level:
vacuumdb.c:870: error: expected declaration specifiers or '...' before
'fd_set'
vacuumdb.c: In function 'select_loop':
vacuumdb.c:873: error: 'fd_set' undeclared (first use in this function)
vacuumdb.c:873: error: expected ';' before 'saveSet'
vacuumdb.c:898: error: 'workerset' undeclared (first use in this function)
vacuumdb.c:898: error: 'saveSet' undeclared (first use in this function)
vacuumdb.c:899: warning: implicit declaration of function 'select'
gmake[3]: *** [<builtin>: vacuumdb.o] Error 1
gmake[3]: Leaving directory '/home/sean/bin/postgres/src/bin/scripts'
gmake[2]: *** [Makefile:40: all-scripts-recurse] Error 2
gmake[2]: Leaving directory '/home/sean/bin/postgres/src/bin'
gmake[1]: *** [Makefile:35: all-bin-recurse] Error 2
gmake[1]: Leaving directory '/home/sean/bin/postgres/src'
gmake: *** [GNUmakefile:11: all-src-recurse] Error 2
*** Error 2 in /home/sean/bin/postgres (Makefile:36 'all')  



Vacuumdb.c was last updated earlier last month:
https://github.com/postgres/postgres/commits/master/src/bin/scripts/vacuumdb.c



Is there something I need to do differently to get Postgresql to build?



Currently installed:
# select version();
                                           version
----------------------------------------------------------------------------------------------
 PostgreSQL 10devel on i386-unknown-openbsd6.0, compiled by gcc (GCC) 4.2.1
20070719 , 32-bit



Thanks,
Sean


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: BUG #14334: vacuumdb.c build failure on openbsd
@ 2016-09-21 17:57  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: jungleboogie0+psql@gmail.com
  0 siblings, 1 reply; 10+ messages in thread

From: Alvaro Herrera @ 2016-09-21 17:57 UTC (permalink / raw)
  To: jungleboogie0+psql@gmail.com; +Cc: pgsql-bugs

jungleboogie0+psql@gmail.com wrote:

> gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
> -Wendif-labels -Wmissing-format-attribute -Wformat-security
> -fno-strict-aliasing -fwrapv -g -O2 -I../../../src/interfaces/libpq
> -I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include 
> -I/usr/local/include  -c -o vacuumdb.o vacuumdb.c
> vacuumdb.c:70: error: expected declaration specifiers or '...' before
> 'fd_set'
> vacuumdb.c: In function 'main':
> vacuumdb.c:193: error: 'FD_SETSIZE' undeclared (first use in this
> function)

What does your select(2) manpage say about what includes are required?
My manpage says

       /* According to POSIX.1-2001 */
       #include <sys/select.h>

       /* According to earlier standards */
       #include <sys/time.h>
       #include <sys/types.h>
       #include <unistd.h>

and we're not including <sys/select.h> anywhere that I can see;
apparently we should add something like

#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: BUG #14334: vacuumdb.c build failure on openbsd
@ 2016-09-21 18:35  jungle Boogie <jungleboogie0@gmail.com>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 10+ messages in thread

From: jungle Boogie @ 2016-09-21 18:35 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: jungleboogie0+psql@gmail.com; pgsql-bugs

Hi Alvaro,
On 21 September 2016 at 10:57, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> jungleboogie0+psql@gmail.com wrote:
>
>> gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
>> -Wendif-labels -Wmissing-format-attribute -Wformat-security
>> -fno-strict-aliasing -fwrapv -g -O2 -I../../../src/interfaces/libpq
>> -I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include
>> -I/usr/local/include  -c -o vacuumdb.o vacuumdb.c
>> vacuumdb.c:70: error: expected declaration specifiers or '...' before
>> 'fd_set'
>> vacuumdb.c: In function 'main':
>> vacuumdb.c:193: error: 'FD_SETSIZE' undeclared (first use in this
>> function)
>
> What does your select(2) manpage say about what includes are required?
> My manpage says
>
>        /* According to POSIX.1-2001 */
>        #include <sys/select.h>
>
>        /* According to earlier standards */
>        #include <sys/time.h>
>        #include <sys/types.h>
>        #include <unistd.h>
>

http://man.openbsd.org/OpenBSD-current/man2/select.2

Also has #include <sys/select.h>

I'm checking out commit
https://github.com/postgres/postgres/commit/be7f7ee5ea73626c037600b515087e8f98038140

(day for the vacuum changes) to see if this will build. If not, maybe
it was a change within openbsd.


> and we're not including <sys/select.h> anywhere that I can see;
> apparently we should add something like
>
> #ifdef HAVE_SYS_SELECT_H
> #include <sys/select.h>
> #endif
>
> --
> Álvaro Herrera                https://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



-- 
-------
inum: 883510009027723
sip: jungleboogie@sip2sip.info


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: BUG #14334: vacuumdb.c build failure on openbsd
@ 2016-09-21 19:22  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: jungle Boogie <jungleboogie0@gmail.com>
  0 siblings, 2 replies; 10+ messages in thread

From: Alvaro Herrera @ 2016-09-21 19:22 UTC (permalink / raw)
  To: jungle Boogie <jungleboogie0@gmail.com>; +Cc: jungleboogie0+psql@gmail.com; pgsql-bugs

jungle Boogie wrote:

> http://man.openbsd.org/OpenBSD-current/man2/select.2
> 
> Also has #include <sys/select.h>

So "current" is 6.0?  We don't have a lot of OpenBSD machines in the
buildfarm; would you be able to contribute one?  The one we have
(curculio) runs 5.9 and has been running fine with the committed code.
https://wiki.postgresql.org/wiki/Buildfarm

It makes portability work easier if we see right away that a commit has
broken something.

Can you try HEAD with the following patch applied and let me know if it
works?

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachments:

vacuumdb.patch (text/x-diff, 366B) download diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c index c10b58b..32cb0fc 100644 --- a/src/bin/scripts/vacuumdb.c +++ b/src/bin/scripts/vacuumdb.c @@ -12,6 +12,10 @@ #include "postgres_fe.h" +#ifdef HAVE_SYS_SELECT_H +#include <sys/select.h> +#endif + #include "common.h" #include "fe_utils/simple_list.h" #include "fe_utils/string_utils.h"
^ permalink raw reply [nested|flat] 10+ messages in thread

* Re: BUG #14334: vacuumdb.c build failure on openbsd
@ 2016-09-21 20:25  jungle Boogie <jungleboogie0@gmail.com>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  1 sibling, 1 reply; 10+ messages in thread

From: jungle Boogie @ 2016-09-21 20:25 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: jungleboogie0+psql@gmail.com; pgsql-bugs

Hi Alvaro,
On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> jungle Boogie wrote:
>
>> http://man.openbsd.org/OpenBSD-current/man2/select.2
>>
>> Also has #include <sys/select.h>
>
> So "current" is 6.0?  We don't have a lot of OpenBSD machines in the
> buildfarm; would you be able to contribute one?  The one we have
> (curculio) runs 5.9 and has been running fine with the committed code.
> https://wiki.postgresql.org/wiki/Buildfarm
>

6.0 is a release version and will only receive patches for the base OS.

-current/snapshot is what I'm running and it's the development version
of openbsd. In a few months, current will be marked and released as
6.1. Basically I'm following the development branch of OpenBSD:
http://www.openbsd.org/faq/current.html


> It makes portability work easier if we see right away that a commit has
> broken something.
>
> Can you try HEAD with the following patch applied and let me know if it
> works?

I wrote to the maintainer of postgresql on openbsd and asked if he
could take a look at this email and see if he can reproduce the
problem.

Meanwhile, I came across this.
It looks like 8 days ago select.h was modified, but I have no idea if
this is causing the postgresql failure.
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/select.h


I will checkout buildfarm and see what it takes to run it!

>
> --
> Álvaro Herrera                https://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



-- 
-------
inum: 883510009027723
sip: jungleboogie@sip2sip.info


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: BUG #14334: vacuumdb.c build failure on openbsd
@ 2016-09-21 20:33  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: jungle Boogie <jungleboogie0@gmail.com>
  0 siblings, 0 replies; 10+ messages in thread

From: Alvaro Herrera @ 2016-09-21 20:33 UTC (permalink / raw)
  To: jungle Boogie <jungleboogie0@gmail.com>; +Cc: jungleboogie0+psql@gmail.com; pgsql-bugs

jungle Boogie wrote:
> Hi Alvaro,
> On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

> > So "current" is 6.0?  We don't have a lot of OpenBSD machines in the
> > buildfarm; would you be able to contribute one?  The one we have
> > (curculio) runs 5.9 and has been running fine with the committed code.
> > https://wiki.postgresql.org/wiki/Buildfarm
> 
> 6.0 is a release version and will only receive patches for the base OS.

I see.

> -current/snapshot is what I'm running and it's the development version
> of openbsd. In a few months, current will be marked and released as
> 6.1. Basically I'm following the development branch of OpenBSD:
> http://www.openbsd.org/faq/current.html

I think it'd be valuable to have a system running something that tracks
"current"; we already have a few "rolling" Linux distros and this seems
similar in spirit.  It might even provide more feedback for those crazy
patches ...

> > Can you try HEAD with the following patch applied and let me know if it
> > works?
> 
> I wrote to the maintainer of postgresql on openbsd and asked if he
> could take a look at this email and see if he can reproduce the
> problem.

Good.

> Meanwhile, I came across this.
> It looks like 8 days ago select.h was modified, but I have no idea if
> this is causing the postgresql failure.
> http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/select.h

Sounds very likely to me.

> I will checkout buildfarm and see what it takes to run it!

Great.  It's just a cron Perl script that builds Postgres and runs the
tests (plus a commitment that you'll give a look in case things fail for
odd reasons.  We try not to bother you if your animal finds portability
issues in Postgres.)

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: BUG #14334: vacuumdb.c build failure on openbsd
@ 2016-09-21 23:15  jungle Boogie <jungleboogie0@gmail.com>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  1 sibling, 1 reply; 10+ messages in thread

From: jungle Boogie @ 2016-09-21 23:15 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: jungleboogie0+psql@gmail.com; pgsql-bugs

On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> Can you try HEAD with the following patch applied and let me know if it
> works?

Your patch works!!

You probably made the patch on a Windows system because there were ^M
characters but I copied your three lines to vacuumdb.c and recompiled.

Is there a method to report the exact git commit postgresql is running?




-- 
-------
inum: 883510009027723
sip: jungleboogie@sip2sip.info


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: BUG #14334: vacuumdb.c build failure on openbsd
@ 2016-09-21 23:25  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: jungle Boogie <jungleboogie0@gmail.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Alvaro Herrera @ 2016-09-21 23:25 UTC (permalink / raw)
  To: jungle Boogie <jungleboogie0@gmail.com>; +Cc: jungleboogie0+psql@gmail.com; pgsql-bugs

jungle Boogie wrote:
> On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> > Can you try HEAD with the following patch applied and let me know if it
> > works?
> 
> Your patch works!!
> 
> You probably made the patch on a Windows system because there were ^M
> characters but I copied your three lines to vacuumdb.c and recompiled.

Windows!?!? I haven't touched that in two decades now (oh my).  I just
":read" the patch file into the email body instead of using an
attachment.  I got lazy there, sorry about that.

Anyway thanks for following up.  I will push this, probably tomorrow.

> Is there a method to report the exact git commit postgresql is running?

Not that I know of.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: BUG #14334: vacuumdb.c build failure on openbsd
@ 2016-09-27 04:09  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Alvaro Herrera @ 2016-09-27 04:09 UTC (permalink / raw)
  To: jungle Boogie <jungleboogie0@gmail.com>; +Cc: jungleboogie0+psql@gmail.com; pgsql-bugs

Alvaro Herrera wrote:
> jungle Boogie wrote:
> > On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> > > Can you try HEAD with the following patch applied and let me know if it
> > > works?
> > 
> > Your patch works!!
> > 
> > You probably made the patch on a Windows system because there were ^M
> > characters but I copied your three lines to vacuumdb.c and recompiled.

> Anyway thanks for following up.  I will push this, probably tomorrow.

It took me a few more days than I intended, which meant this missed
9.6.0, but it's out now.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: BUG #14334: vacuumdb.c build failure on openbsd
@ 2016-09-27 14:55  jungle Boogie <jungleboogie0@gmail.com>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 0 replies; 10+ messages in thread

From: jungle Boogie @ 2016-09-27 14:55 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: jungleboogie0+psql@gmail.com; pgsql-bugs

On 26 September 2016 at 21:09, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> Alvaro Herrera wrote:
>> jungle Boogie wrote:
>> > On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>> > > Can you try HEAD with the following patch applied and let me know if it
>> > > works?
>> >
>> > Your patch works!!
>> >
>> > You probably made the patch on a Windows system because there were ^M
>> > characters but I copied your three lines to vacuumdb.c and recompiled.
>
>> Anyway thanks for following up.  I will push this, probably tomorrow.
>
> It took me a few more days than I intended, which meant this missed
> 9.6.0, but it's out now.
>

I don't know what the will mean in terms of the OpenBSD package/port
of it, but I'll let the maintainer know that it's now patched in
Postgres.

By the way, I updated to Postgres' master and installed without
problems. Thanks for quickly patching it!
I haven't forgotten about the buildfarm!

Best,
sean


> --
> Álvaro Herrera                https://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



-- 
-------
inum: 883510009027723
sip: jungleboogie@sip2sip.info


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2016-09-27 14:55 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-09-21 17:18 BUG #14334: vacuumdb.c build failure on openbsd jungleboogie0+psql@gmail.com
2016-09-21 17:57 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2016-09-21 18:35   ` jungle Boogie <jungleboogie0@gmail.com>
2016-09-21 19:22     ` Alvaro Herrera <alvherre@2ndquadrant.com>
2016-09-21 20:25       ` jungle Boogie <jungleboogie0@gmail.com>
2016-09-21 20:33         ` Alvaro Herrera <alvherre@2ndquadrant.com>
2016-09-21 23:15       ` jungle Boogie <jungleboogie0@gmail.com>
2016-09-21 23:25         ` Alvaro Herrera <alvherre@2ndquadrant.com>
2016-09-27 04:09           ` Alvaro Herrera <alvherre@2ndquadrant.com>
2016-09-27 14:55             ` jungle Boogie <jungleboogie0@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox