Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#53143 closed defect (wontfix)

libuv @1.10.1 does not build on PPC Tiger, Mac OS X

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version:
Keywords: tiger powerpc Cc: ballapete (Peter "Pete" Dyballa), michaelld (Michael Dickens)
Port: libuv

Description

src/unix/fs.c uses unknown struct members, dst->st_birthtim.tv_sec and dst->st_birthtim.tv_nsec, and src/unix/tty.c uses an unknown macro TIOCPTYGNAME. These and can easily be fixed with the provided patch files.

src/unix/fsevents.c is a bit harder to fix. It includes /System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OpenTransportProviders.h, which has

/* TCP Level Options*/

enum {
  TCP_NODELAY                   = 0x01, 
  TCP_MAXSEG                    = 0x02, 
  TCP_NOTIFY_THRESHOLD          = 0x10, /** not a real XTI option */
  TCP_ABORT_THRESHOLD           = 0x11, /** not a real XTI option */
  TCP_CONN_NOTIFY_THRESHOLD     = 0x12, /** not a real XTI option */
  TCP_CONN_ABORT_THRESHOLD      = 0x13, /** not a real XTI option */
  TCP_OOBINLINE                 = 0x14, /** not a real XTI option */
  TCP_URGENT_PTR_TYPE           = 0x15, /** not a real XTI option */
  TCP_KEEPALIVE                 = 0x0008 /* keepalive defined in OpenTransport.h */
};

The C pre-processor generates

enum {
  0x01 = 0x01, 
  0x02 = 0x02, 
  TCP_NOTIFY_THRESHOLD = 0x10, 
  TCP_ABORT_THRESHOLD = 0x11, 
  TCP_CONN_NOTIFY_THRESHOLD = 0x12, 
  TCP_CONN_ABORT_THRESHOLD = 0x13, 
  TCP_OOBINLINE = 0x14, 
  TCP_URGENT_PTR_TYPE = 0x15, 
  0x10 = 0x0008
};

which of course leads to an error:

In /System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OpenTransportProviders.h:108: error: expected identifier before numeric constant

The reason for is presumingly /usr/include/netinet/tcp.h:

#ifndef _NETINET_TCP_H_
#define _NETINET_TCP_H_
.
.
.
/*
 * User-settable options (used with setsockopt).
 */
#define TCP_NODELAY     0x01    /* don't delay send to coalesce packets */
#ifndef _POSIX_C_SOURCE
#define TCP_MAXSEG              0x02    /* set maximum segment size */ 
#define TCP_NOPUSH              0x04    /* don't push last block of write */
#define TCP_NOOPT               0x08    /* don't use TCP options */
#define TCP_KEEPALIVE   0x10    /* idle time used when SO_KEEPALIVE is enabled */
#endif /* _POSIX_C_SOURCE */

#endif

For this I cannot imagine a fix…

Attachments (5)

main1.log (19.1 KB) - added by ballapete (Peter "Pete" Dyballa) 7 years ago.
main.log with st_birthtim.tv error
main3.log (43.9 KB) - added by ballapete (Peter "Pete" Dyballa) 7 years ago.
main.log with the enum bug
st_birthtim.tv.patch (818 bytes) - added by ballapete (Peter "Pete" Dyballa) 7 years ago.
Patch to delete st_birthtim.tv_*
tty_TIOCGPTN.patch (330 bytes) - added by ballapete (Peter "Pete" Dyballa) 7 years ago.
Patch to delete TIOCPTYGNAME
patch-cmake-371-Portfile-Tigerfix.diff (491 bytes) - added by kencu (Ken) 7 years ago.
a patch for cmake-371 for tiger to disable need for libuv

Download all attachments as: .zip

Change History (26)

Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main1.log added

main.log with st_birthtim.tv error

Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main3.log added

main.log with the enum bug

Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: st_birthtim.tv.patch added

Patch to delete st_birthtim.tv_*

Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: tty_TIOCGPTN.patch added

Patch to delete TIOCPTYGNAME

comment:1 Changed 7 years ago by mf2k (Frank Schima)

Cc: michaelld added
Owner: set to raimue
Status: newassigned

In the future, please Cc the port maintainers (port info --maintainers libuv), if any.

comment:2 in reply to:  1 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to mf2k:

In the future, please Cc the port maintainers (port info --maintainers libuv), if any.

This was my first try *not* to add the maintainer(s), since I've seen so often that my additions were removed later. And the look, which is not available in Tiger, does not have a maintainer field, just a watcher (?) field. And I learned that I have to my own name there when I want to receive eMails about thing that happen to my report.

OK, I'll continue adding watchers!

comment:3 Changed 7 years ago by kencu (Ken)

Although you are completely correct in pointing out the libuv @1.10.1 does not build on Tiger (at least at this moment -- these things usually have a way of working out in the end), I might guess that the reason you now need libuv is because of the change in cmake-3.7.1; the portfile now specifies the system-library versions of most libraries, one of which is libuv.

Cmake also includes it's own versions of the needed system libraries, however, and these internal versions still build on Tiger (go figure).

So one way around your libuv issue is to edit the cmake portflle, remove the requirement for libuv by commenting it out like this:

#depends_lib-append  path:lib/pkgconfig/libuv.pc:libuv

and change the following configure arguments from this:

--init=${worksrcpath}/macports.cmake \
--system-libs \
 --no-system-jsoncpp

to this

--init=${worksrcpath}/macports.cmake

then, when upgrading cmake, the system libuv is not required, and cmake 3.7.1 builds through to completion on Tiger without trouble.

$ port -v installed | grep cmake
 cmake @3.6.3_0 platform='darwin 8' archs='ppc'
 cmake @3.7.1_0 (active) platform='darwin 8' archs='ppc'

if you actually needed libuv for some other reason besides cmake - well, obviously this won't help you. K.

comment:4 in reply to:  3 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

So one way around your libuv issue is to edit the cmake portflle, remove the requirement for libuv by commenting it out like this:

Presumingly next week I can try… Now GCC6 is building – for days!

if you actually needed libuv for some other reason besides cmake - well, obviously this won't help you. K.

For decades (1¼?) I could live on Tiger without libuv. I am willing to continue…

Thanks for the information!

comment:5 Changed 7 years ago by raimue (Rainer Müller)

As Mac OS X 10.4 Tiger is a legacy platform and over 10 years old, I will not investigate myself or take action to fix this. Patches are welcome, but please also include the necessary changes to the Portfile. I do not know and cannot test whether this affects specifically only Mac OS X 10.4 Tiger and no later version, or only PPC, etc.

You could also get help with this by contacting upstream and maybe even incorporate the patches there directly.

comment:6 Changed 7 years ago by kencu (Ken)

This port does build on both 10.5 PPC and 10.5 Intel, and up. The issues with it building on 10.4 PPC are probably something that could be overcome (usually these things are POSIX define mixups on 10.4 -- this didn't really get straightened out until 10.5).

As there is no real need for libuv at the moment other than Cmake (which has a good workaround as above) I don't imagine I'll be spending any time on this to fix it.

So as far as I'm personally concerned, this could be closed as 'wontfix'.

I'll pass along the cmake tiger fix to michael and see what he thinks about incorporating it into macports. For the moment, it sits in my custom TigerPorts repo at <https://github.com/kencu/TigerPorts> for anyone who might want it (along with lots of other Tiger fixes).

Last edited 7 years ago by kencu (Ken) (previous) (diff)

comment:7 Changed 7 years ago by mojca (Mojca Miklavec)

I wouldn't necessarily bother fixing libuv, but it would make sense to fix cmake in a way that it would use the internal library rather than the external one if that helps. That should be easy enough to do and it affects a lot of ports (the system without cmake is nearly useless).

comment:8 Changed 7 years ago by kencu (Ken)

this works in the cmake portfile

platform darwin 8 {
    configure.args-delete --system-libs \
                          --no-system-jsoncpp
    depends_lib-delete    path:lib/pkgconfig/libuv.pc:libuv
}
Last edited 7 years ago by kencu (Ken) (previous) (diff)

Changed 7 years ago by kencu (Ken)

a patch for cmake-371 for tiger to disable need for libuv

comment:9 Changed 7 years ago by michaelld (Michael Dickens)

In 1d68d187/macports-ports:

cmake: on Tiger (10.4), just use cmake internal system libraries, since those provided by the system and/or macPorts do not build or work as desired. Partly addresses ticket #53143 .

comment:10 Changed 7 years ago by michaelld (Michael Dickens)

I've integrated Ken's patch. Does that fix this ticket?

comment:11 in reply to:  5 ; Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to raimue:

You could also get help with this by contacting upstream and maybe even incorporate the patches there directly.

This is not easy … GitHub does not accept old Safaris.

comment:12 in reply to:  10 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to michaelld:

I've integrated Ken's patch. Does that fix this ticket?

Libuv now is not listed as being outdated. So the cmake port is fixed.

comment:13 in reply to:  11 ; Changed 7 years ago by kencu (Ken)

Replying to ballapete:

This is not easy … GitHub does not accept old Safaris.

Use TenFourFox <http://www.floodgap.com/software/tenfourfox/> for a reasonably current browser for PPC 10.4 and 10.5

comment:14 Changed 7 years ago by michaelld (Michael Dickens)

So ... does fixing cmake address the needs of this ticket?

comment:15 Changed 7 years ago by raimue (Rainer Müller)

I guess libuv is still broken on 10.4, but the original goal of the reporter to get cmake was fulfilled. If nobody is going to provide a proper patch against libuv, I would close this as a wontfix.

comment:16 Changed 7 years ago by michaelld (Michael Dickens)

Resolution: wontfix
Status: assignedclosed

Sounds good. Thx.

comment:17 in reply to:  13 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

Use TenFourFox <http://www.floodgap.com/software/tenfourfox/> for a reasonably current browser for PPC 10.4 and 10.5

Yeah, it's quite slow, but it works with GitHub and even Macports!

comment:18 in reply to:  5 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to raimue:

You could also get help with this by contacting upstream and maybe even incorporate the patches there directly.

I have the feeling that before TenFourFox had refreshed the window of issue https://github.com/libuv/libuv/issues/1180 someone had responded with: 10.4 is not supported. Please see https://github.com/libuv/libuv/blob/v1.x/SUPPORTED_PLATFORMS.md.

comment:19 in reply to:  15 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to raimue:

I guess libuv is still broken on 10.4, but the original goal of the reporter to get cmake was fulfilled. If nobody is going to provide a proper patch against libuv, I would close this as a wontfix.

I thinks that's correct. In reporting the issue on GitHub it looks as if Tiger is missing some newer system APIs, for example FSEventStreamRef.

comment:20 Changed 6 years ago by kencu (Ken)

You can prevent including /usr/include/netinet/tcp.h by defining the header blocker in the Portfile:

configure.cppflags-append -D_NETINET_TCP_H_

This gets around the first error of the error: expected identifier before numeric constant issue.

That then leads to some other errors, though:

src/unix/fs.c:574: warning: implicit declaration of function 'sendfile'
src/unix/fs.c: In function 'uv__to_stat':
src/unix/fs.c:711: error: 'struct stat' has no member named 'st_birthtimespec'

comment:21 Changed 5 years ago by ballapete (Peter "Pete" Dyballa)

Since libuv @1.24.0_0 (active) platform='darwin 8' archs='ppc' date='2018-11-15T01:12:55+0100' could be built (and installed), this case can be closed.

Note: See TracTickets for help on using tickets.