NetBSD Problem Report #53581

From ef@math.uni-bonn.de  Thu Sep  6 15:27:10 2018
Return-Path: <ef@math.uni-bonn.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C65E67A1ED
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  6 Sep 2018 15:27:10 +0000 (UTC)
Message-Id: <20180906152707.B51391BF1E@trave.math.uni-bonn.de>
Date: Thu,  6 Sep 2018 17:27:07 +0200 (CEST)
From: ef@math.uni-bonn.de
Reply-To: ef@math.uni-bonn.de
To: gnats-bugs@gnats.NetBSD.org
Subject: devel/lua-posix build problems: CLOCK_{PROCESS,THREAD}_CPUTIME_ID undefined
X-Send-Pr-Version: 3.95

>Number:         53581
>Category:       pkg
>Synopsis:       devel/lua-posix build problems: CLOCK_{PROCESS,THREAD}_CPUTIME_ID undefined
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ryoon
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 06 15:30:00 +0000 2018
>Last-Modified:  Fri Sep 07 08:15:00 +0000 2018
>Originator:     Edgar Fuß
>Release:        pkgsrc-2018Q2
>Organization:
Mathematisches Institur der Universität Bonn
>Environment:

>Description:
	If _POSIX_TIMERS is defined and not -1, lua-posix tries to use CLOCK_{PROCESS,THREAD}_CPUTIME_ID. On NetBSD 6/7, these are not defined.
>How-To-Repeat:
	Build devel/lua-posix on NetBSD<8
>Fix:
	I don't know whether the fault is with luaposix to infer CLOCK_{PROCESS,THREAD}_CPUTIME_ID being defined when _POSIX_TIMERS is or with NetBSD to define the latter, but not the former, so I haven't (yet) reported this upstream.
	However, the following patch seems to work:

	$NetBSD: patch-ext_posix_time.c$

	Only use CLOCK_{PROCESS,THREAD}_CPUTIME_ID if defined

	--- ext/posix/time.c.orig      2018-02-21 03:29:31.000000000 +0100
	+++ ext/posix/time.c   2018-08-31 19:43:01.000000000 +0200
	@@ -350,10 +350,14 @@ luaopen_posix_time(lua_State *L)

	 #if defined _POSIX_TIMERS && _POSIX_TIMERS != -1
	       LPOSIX_CONST( CLOCK_MONOTONIC           );
	+#if defined CLOCK_PROCESS_CPUTIME_ID
	       LPOSIX_CONST( CLOCK_PROCESS_CPUTIME_ID  );
	+#endif
	       LPOSIX_CONST( CLOCK_REALTIME            );
	+#if defined CLOCK_THREAD_CPUTIME_ID
	       LPOSIX_CONST( CLOCK_THREAD_CPUTIME_ID   );
	 #endif
	+#endif

	       return 1;
	 }

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->ryoon
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Thu, 06 Sep 2018 22:02:49 +0000
Responsible-Changed-Why:
Over to maintainer


From: Edgar =?iso-8859-1?B?RnXf?= <ef@math.uni-bonn.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53581: devel/lua-posix build problems:
 CLOCK_{PROCESS,THREAD}_CPUTIME_ID undefined
Date: Fri, 7 Sep 2018 10:11:26 +0200

 I now think the problem is with luaposix, not pkgsrc or NetBSD, and reported it upstream: https://github.com/luaposix/luaposix/issues/313.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.