Opened 12 years ago

Closed 12 years ago

#35153 closed defect (fixed)

Postgresql90, Postgresql91 - /usr/include/unistd.h:689:26: error: expected identifier

Reported by: ilya@… Owned by: mww@…
Priority: Normal Milestone:
Component: ports Version: 2.1.99
Keywords: mountainlion Cc: jyrkiwahlstedt, nicolas.jessel@…, cz@…, ecbrown (Eric Brown), scott@…, tirath@…, jean-philippe.humbert@…, nonstop.server@…, alexander.fortin@…, smirnoffjr@…, philippe.lang@…, mina.macports@…
Port: postgresql84 postgresql90 postgresql91

Description (last modified by ryandesign (Ryan Carsten Schmidt))

usr/bin/clang -pipe -O2 -arch x86_64 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv  -I. -I. -I../../src/include -I/opt/local/include -I/opt/local/include/ossp -I/opt/local/include/libxml2  -I/opt/local/include  -c -o uuid-ossp.o uuid-ossp.c
In file included from uuid-ossp.c:28:
In file included from /opt/local/include/ossp/uuid.h:38:
/usr/include/unistd.h:689:26: error: expected identifier
int      gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
                             ^
In file included from uuid-ossp.c:28:
/opt/local/include/ossp/uuid.h:94:24: error: typedef redefinition with different types ('struct uuid_st' vs '__darwin_uuid_t' (aka 'unsigned char [16]'))
typedef struct uuid_st uuid_t;
                       ^
/usr/include/uuid/uuid.h:42:25: note: previous definition is here
typedef __darwin_uuid_t uuid_t;
                        ^
In file included from uuid-ossp.c:28:
/opt/local/include/ossp/uuid.h:107:22: error: conflicting types for 'uuid_compare'
extern uuid_rc_t     uuid_compare  (const uuid_t  *_uuid, const uuid_t *_uuid2, int *_result);
                     ^
/usr/include/uuid/uuid.h:59:5: note: previous declaration is here
int uuid_compare(const uuid_t uu1, const uuid_t uu2);
    ^
3 errors generated.
make: *** [uuid-ossp.o] Error 1

Attachments (3)

main.log (488.9 KB) - added by ilya@… 12 years ago.
ossp-uuid.patch (330 bytes) - added by patr1ck (Patrick B. Gibson) 12 years ago.
Patch file
Portfile (4.6 KB) - added by patr1ck (Patrick B. Gibson) 12 years ago.
New portfile

Download all attachments as: .zip

Change History (38)

Changed 12 years ago by ilya@…

Attachment: main.log added

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jwa@… added
Description: modified (diff)
Owner: changed from macports-tickets@… to mww@…

comment:2 Changed 12 years ago by jyrkiwahlstedt

Just wonderign, what's happnening here. This port shouldn't be compiled at the moment with clang, where does that come from!?

comment:3 Changed 12 years ago by ilya@…

I installed OSX 10.8 GM, Xcode 4.4 GM with Console Tools. Macports installed from SVN. Then did the instructions - port install postgresql91 ...

comment:4 Changed 12 years ago by jyrkiwahlstedt

Sorry, 10.8 questions are not answered, as, you know, it is still under NDA, not to be discussed in public (and I don't have it yet:), so you'll have to wait…

comment:5 Changed 12 years ago by ilya@…

Of course, I understand! But I want you to be aware of the problem.

comment:6 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: nicolas.jessel@… added

Has duplicate #35157. Looks like 10.8 GM was released to developers today so I guess we'll be getting some more tickets about it now.

comment:7 Changed 12 years ago by nicolas.jessel@…

I have tried to compile with the both methods in

https://trac.macports.org/wiki/ProblemHotlist#compiler

but no result for me.

comment:8 Changed 12 years ago by ilya@…

If someone urgently need - I installed the version from the site Postgresql.org, it works. Then I run "macport edit postgresql91" and deleted ossp-uuid from contrib list - everything compiled with no problems

comment:9 in reply to:  8 Changed 12 years ago by nicolas.jessel@…

Replying to ilya@…:

If someone urgently need - I installed the version from the site Postgresql.org, it works. Then I run "macport edit postgresql91" and deleted ossp-uuid from contrib list - everything compiled with no problems

Command "macport edit postgresql91" doesn't work for me because my system doesn't know "macport" but only "port". I have deleted "--with-ossp-uuid" in "configure.args" line with "sudo port edit postgresql91" command and build failed again.

Thanks in advance for your help because I can't install other package depends of postgresql91

comment:10 Changed 12 years ago by Veence (Vincent)

This is caused by the inclusion of the system uuid.h in pwd.h. Just add the line :

#define _XOPEN_SOURCE

at the first line of uuid-ossp.c, and it should compile fine.

comment:11 Changed 12 years ago by ilya@…

Sorry! Certainly need to enter the "port edit postgresql91", then you must find:

set contribs "adminpack auto_explain dblink file_fdw fuzzystrmatch lo oid2name pageinspect pg_archivecleanup pg_buffercache pg_freespacemap pg_standby pg_stat_statements pg_trgm pg_upgrade pg_upgrade_support pgcrypto pgrowlocks pgstattuple tablefunc vacuumlo ossp-uuid"

and remove ossp-uuid here.

comment:12 in reply to:  11 ; Changed 12 years ago by nicolas.jessel@…

Replying to ilya@…:

Sorry! Certainly need to enter the "port edit postgresql91", then you must find:

set contribs "adminpack auto_explain dblink file_fdw fuzzystrmatch lo oid2name pageinspect pg_archivecleanup pg_buffercache pg_freespacemap pg_standby pg_stat_statements pg_trgm pg_upgrade pg_upgrade_support pgcrypto pgrowlocks pgstattuple tablefunc vacuumlo ossp-uuid"

and remove ossp-uuid here.

That works fine, thanks a lot.

comment:13 in reply to:  12 ; Changed 12 years ago by Veence (Vincent)

Replying to nicolas.jessel@…:

Replying to ilya@…:

Sorry! Certainly need to enter the "port edit postgresql91", then you must find:

set contribs "adminpack auto_explain dblink file_fdw fuzzystrmatch lo oid2name pageinspect pg_archivecleanup pg_buffercache pg_freespacemap pg_standby pg_stat_statements pg_trgm pg_upgrade pg_upgrade_support pgcrypto pgrowlocks pgstattuple tablefunc vacuumlo ossp-uuid"

and remove ossp-uuid here.

That works fine, thanks a lot.

But you’ll be lacking the uuid generator that may be used at runtime…

comment:14 in reply to:  13 Changed 12 years ago by ilya@…

Replying to vince@…:

But you’ll be lacking the uuid generator that may be used at runtime…

Please read them carefully. I installed Postgresql from the official site. Version of macports is needed to compile the dependencies like perl-dbd-pg

comment:15 Changed 12 years ago by cz@…

Cc: cz@… added

Cc Me!

comment:16 Changed 12 years ago by ecbrown (Eric Brown)

Cc: eric.c.brown@… added

Cc Me!

comment:17 Changed 12 years ago by scott@…

Cc: scott@… added

Cc Me!

comment:18 in reply to:  10 Changed 12 years ago by scott@…

Replying to vince@…:

This is caused by the inclusion of the system uuid.h in pwd.h. Just add the line :

#define _XOPEN_SOURCE

at the first line of uuid-ossp.c, and it should compile fine.

This worked for me for postgresql84.

Thanks Vince

comment:19 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Has duplicate #35442.

comment:20 in reply to:  description Changed 12 years ago by ecbrown (Eric Brown)

Should also point out that this is relevant to postgresql92

comment:21 Changed 12 years ago by tirath@…

Cc: tirath@… added

Cc Me!

comment:22 Changed 12 years ago by khelal@…

Any idea when this will make it into the official list?

comment:23 Changed 12 years ago by jean-philippe.humbert@…

Cc: jean-philippe.humbert@… added

Cc Me!

comment:24 Changed 12 years ago by nonstop.server@…

Cc: nonstop.server@… added

Cc Me!

Changed 12 years ago by patr1ck (Patrick B. Gibson)

Attachment: ossp-uuid.patch added

Patch file

Changed 12 years ago by patr1ck (Patrick B. Gibson)

Attachment: Portfile added

New portfile

comment:25 Changed 12 years ago by patr1ck (Patrick B. Gibson)

If this were github I'd send a pull request but since it's not I just went ahead and added the appropriate patch and portfile which uses Vince's fix above.

Cheers, Patrick

comment:26 Changed 12 years ago by patr1ck (Patrick B. Gibson)

Also, btw, if anyone is running this on mountain lion, you probably also wanna bump your SHMALL/SHMMAX, or else you'll hit another error when you try to create the defaultdb:

sudo sysctl -w kern.sysv.shmall=65536 sudo sysctl -w kern.sysv.shmmax=16777216

comment:27 Changed 12 years ago by alexander.fortin@…

Cc Me!

comment:28 Changed 12 years ago by alexander.fortin@…

Cc: alexander.fortin@… added

Cc Me!

comment:29 Changed 12 years ago by smirnoffjr@…

Cc: smirnoffjr@… added

Cc Me!

comment:30 Changed 12 years ago by mf2k (Frank Schima)

Cc: philippe.lang@… added
Port: postgresql84 postgresql90 postgresql91 added; Postgresql90 Postgresql91 removed

Also affects postgresql84. See #35513.

comment:31 Changed 12 years ago by mina.macports@…

Cc: mina.macports@… added

Cc Me!

comment:32 Changed 12 years ago by mina.macports@…

Alternative solution:

port edit postgresql84

find "configure.cppflags-append" and add " -D_XOPEN_SOURCE" at the end of that line.

comment:33 Changed 12 years ago by xeron (Ivan Larionov)

You can do it w/o edit:

sudo port install postgresql91 configure.cppflags-append=" -D_XOPEN_SOURCE"

comment:34 in reply to:  33 Changed 12 years ago by xeron (Ivan Larionov)

Replying to xeron.oskom@…:

You can do it w/o edit:

sudo port install postgresql91 configure.cppflags-append=" -D_XOPEN_SOURCE"

Oh sorry, this doesn't work. But it builds now without port edit or any options.

comment:35 Changed 12 years ago by jyrkiwahlstedt

Resolution: fixed
Status: newclosed

These should all be fixed now, if your port files are up-to-date (r96142, r996175, r96176, r96422). If not, update your ports…

Note: See TracTickets for help on using tickets.