#65622 closed defect (fixed)

samba4: configure freezes on Checking for setproctitle_init

Reported by: barracuda156 Owned by: barracuda156
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: powerpc Cc: mascguy (Christopher Nielsen)
Port: samba4

Description

I tried both existing in Macports v. 4.15.5 and the latest 4.16.4 (I thought to update the port), same failure – configure reaches the following and then freezes, nothing is happening further:

Checking for library setproctitle                                     : no 
Checking for setproctitle                                             : not found 
Checking for library bsd                                              : no 
Checking for setproctitle                                             : not found 
Checking for setproctitle_init                                        : not found 
Checking for library bsd                                              : no 
Checking for setproctitle_init                                        : not found 
Checking for closefrom                                                : not found 
Checking for library bsd                                              : no 

Any idea what is going wrong?

Change History (7)

comment:1 Changed 21 months ago by barracuda156

So it freezes somewhere around this part of configure script:

    # libbsd on some platforms provides strlcpy and strlcat
    if not conf.CHECK_FUNCS('strlcpy strlcat'):
        if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
                               checklibc=True):
            strlcpy_in_bsd = True
    if not conf.CHECK_FUNCS('getpeereid'):
        conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
    if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
        conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
    if not conf.CHECK_FUNCS('setproctitle_init'):
        conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')

    if not conf.CHECK_FUNCS('closefrom'):
        conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')

    conf.CHECK_CODE('''
                struct ucred cred;
                socklen_t cred_len;
                int ret = getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len);''',
                'HAVE_PEERCRED',
                msg="Checking whether we can use SO_PEERCRED to get socket credentials",
                headers='sys/types.h sys/socket.h')

    #Some OS (ie. freebsd) return EINVAL if the conversion could not be done, it's not what we expect
    #Let's detect those cases
    if conf.CONFIG_SET('HAVE_STRTOLL'):
        conf.CHECK_CODE('''
                        long long nb = strtoll("Text", NULL, 0);
                        if (errno == EINVAL) {
                            return 0;
                        } else {
                            return 1;
                        }
                        ''',
                        msg="Checking correct behavior of strtoll",
                        headers = 'errno.h',
                        execute = True,
                        define = 'HAVE_BSD_STRTOLL',
                        )
    conf.CHECK_FUNCS('if_nametoindex strerror_r')
    conf.CHECK_FUNCS('syslog')
    conf.CHECK_FUNCS('gai_strerror get_current_dir_name')
    conf.CHECK_FUNCS('timegm getifaddrs freeifaddrs mmap setgroups syscall setsid')
    conf.CHECK_FUNCS('getgrent_r getgrgid_r getgrnam_r getgrouplist getpagesize')
    conf.CHECK_FUNCS('getpwent_r getpwnam_r getpwuid_r epoll_create')
    conf.CHECK_FUNCS('port_create')
    conf.CHECK_FUNCS('getprogname')
    if not conf.CHECK_FUNCS('copy_file_range'):
        conf.CHECK_CODE('''
syscall(SYS_copy_file_range,0,NULL,0,NULL,0,0);
                        ''',
                        'HAVE_SYSCALL_COPY_FILE_RANGE',
                        headers='sys/syscall.h unistd.h',
                        msg='Checking whether we have copy_file_range system call')

    conf.SET_TARGET_TYPE('attr', 'EMPTY')

    xattr_headers='sys/attributes.h attr/xattr.h sys/xattr.h'

    # default to 1, we set it to 0 if we don't find any EA implementation below:
    conf.DEFINE('HAVE_XATTR_SUPPORT', 1)
    if conf.CHECK_FUNCS_IN('getxattr', 'attr', checklibc=True, headers=xattr_headers):
        conf.DEFINE('HAVE_XATTR_XATTR', 1)
        # Darwin has extra options to xattr-family functions
        conf.CHECK_CODE('getxattr(NULL, NULL, NULL, 0, 0, 0)',
                        headers=xattr_headers, local_include=False,
                        define='XATTR_ADDITIONAL_OPTIONS',
                        msg="Checking whether xattr interface takes additional options")
    elif conf.CHECK_FUNCS_IN('attr_listf', 'attr', checklibc=True, headers=xattr_headers):
        conf.DEFINE('HAVE_XATTR_ATTR', 1)
    elif conf.CHECK_FUNCS('extattr_list_fd'):
        conf.DEFINE('HAVE_XATTR_EXTATTR', 1)
    elif conf.CHECK_FUNCS('flistea'):
        conf.DEFINE('HAVE_XATTR_EA', 1)
    elif not conf.CHECK_FUNCS('attropen'):
            conf.DEFINE('HAVE_XATTR_SUPPORT', 0)


    conf.CHECK_FUNCS_IN('dlopen dlsym dlerror dlclose', 'dl',
                        checklibc=True, headers='dlfcn.h dl.h')

    conf.CHECK_C_PROTOTYPE('dlopen', 'void *dlopen(const char* filename, unsigned int flags)',
                           define='DLOPEN_TAKES_UNSIGNED_FLAGS', headers='dlfcn.h dl.h')

comment:2 Changed 21 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:3 Changed 21 months ago by mascguy (Christopher Nielsen)

Is this happening for legacy 10.5 and/or 10.6...?

comment:4 in reply to:  3 Changed 21 months ago by barracuda156

Replying to mascguy:

Is this happening for legacy 10.5 and/or 10.6...?

I will check Leopard and SL PPC by the end of this month. Rosetta has the problem on 10.6.8. I am quite sure I never had samba4 built on either of three systems, but I don’t recall to what extent I tried.

But btw, if you remember, Ruby31 has troubles on some socket-related stuff on PPC too.

comment:5 in reply to:  3 Changed 11 months ago by barracuda156

Replying to mascguy:

Is this happening for legacy 10.5 and/or 10.6...?

Turned out, it is broken in a similar way on i386: https://build.macports.org/builders/ports-10.6_i386-builder/builds/119056/steps/install-port/logs/stdio (And yeah, native ppc does not work either.)

comment:6 Changed 11 months ago by barracuda156

I tried to update samba4 to current version, but configure fails early on:

--->  Configuring samba4
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_samba4/samba4/work/samba-4.18.2" && ./configure --prefix=/opt/local -C --enable-fhs --mandir=/opt/local/share/man --with-libiconv=/opt/local --without-acl-support --without-ad-dc --disable-avahi --with-gpgme --disable-spotlight 
SyntaxError: Non-UTF-8 code starting with '\xfe' in file /opt/local/bin/python3.10 on line 2, but no encoding declared; see https://python.org/dev/peps/pep-0263/ for details

Any idea what to do about it? Adding coding line to wscript does not seem to help. Python allegedly fixed this bug, but not.

https://bugs.python.org/issue38755 https://bugs.python.org/issue25643 https://peps.python.org/pep-0263

comment:7 Changed 10 months ago by barracuda156

Owner: set to barracuda156
Resolution: fixed
Status: newclosed

In 0c879ef0734c6e3267d67ea8eaa5fc174350c416/macports-ports (master):

samba4: fix build on powerpc

Fixes: #65622

Note: See TracTickets for help on using tickets.