NetBSD Problem Report #52648

From www@NetBSD.org  Tue Oct 24 07:35:59 2017
Return-Path: <www@NetBSD.org>
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 60F807A1CD
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 24 Oct 2017 07:35:59 +0000 (UTC)
Message-Id: <20171024073558.303207A1E7@mollari.NetBSD.org>
Date: Tue, 24 Oct 2017 07:35:58 +0000 (UTC)
From: bsiegert@gmail.com
Reply-To: bsiegert@gmail.com
To: gnats-bugs@NetBSD.org
Subject: pkg_install does not build on Linux, breaks bootstrap
X-Send-Pr-Version: www-1.0

>Number:         52648
>Category:       pkg
>Synopsis:       pkg_install does not build on Linux, breaks bootstrap
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 24 07:40:00 +0000 2017
>Closed-Date:    Tue Oct 24 15:55:05 +0000 2017
>Last-Modified:  Sun Feb 04 09:05:01 +0000 2018
>Originator:     Benny Siegert
>Release:        pkgsrc-current as of 2017-10-24
>Organization:
The NetBSD Foundation
>Environment:
Linux [redacted] 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux
>Description:
Bootstrapping current pkgsrc on Debian GNU/Linux fails because pkg_install fails to build. (Perhaps I am missing some headers, but which ones?)

--- gpgsig.o ---
gpgsig.c: In function 'detached_gpg_sign':
gpgsig.c:126:4: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
    write(STDERR_FILENO, err_msg, sizeof(err_msg) - 1);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gpgsig.c:136:4: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
    write(STDERR_FILENO, err_msg, sizeof(err_msg) - 1);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- pkcs7.o ---
pkcs7.c: In function 'check_ca':
pkcs7.c:63:11: error: dereferencing pointer to incomplete type 'X509 {aka struct x509_st}'
  if ((cert->ex_flags & EXFLAG_KUSAGE) != 0 &&
           ^~
*** [pkcs7.o] Error code 1

bmake[1]: stopped in /home/bsiegert/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/pkg_install-20170419/lib
1 error

>How-To-Repeat:
My command line was

./bootstrap --make-jobs=12 --unprivileged --prefix=$HOME/pkg --pkgdbdir=$HOME/pkg/pkgdb --varbase=$HOME/pkg/var
>Fix:

>Release-Note:

>Audit-Trail:
From: Benny Siegert <bsiegert@gmail.com>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/52648: pkg_install does not build on Linux, breaks bootstrap
Date: Tue, 24 Oct 2017 10:11:21 +0200

 As a followup, the patch sent by Maya in
 https://mail-index.netbsd.org/pkgsrc-users/2017/07/02/msg025136.html
 fixes the compilation.

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 24 Oct 2017 15:55:05 +0000
State-Changed-Why:
fixed


From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52648 CVS commit: pkgsrc/pkgtools/pkg_install/files/lib
Date: Tue, 24 Oct 2017 15:54:31 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Tue Oct 24 15:54:31 UTC 2017

 Modified Files:
 	pkgsrc/pkgtools/pkg_install/files/lib: pkcs7.c

 Log Message:
 pkg_install: Fix OpenSSL 1.1.0 build

 OpenSSL 1.1.0 makes xkusage and ex_flags opaque.

 Use X509_check_ca rather than a custom and nearly identical implementation.
 This is available since OpenSSL 0.9.8 (even in RHEL5).

 This is also done because we cannot implement it identically under
 OpenSSL 1.1.0 due to missing getters.

 Test EXFLAG_XKUSAGE rather than zero xkusage test no usage to avoid openssl
 1.1.0 getter returning a different code on this case.

 Use getter for xkusage in the non-zero test case.

 Provide fallback definitions for getters.

 PR pkg/52298, PR pkg/52648


 To generate a diff of this commit:
 cvs rdiff -u -r1.5 -r1.6 pkgsrc/pkgtools/pkg_install/files/lib/pkcs7.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52648 CVS commit: src/external/bsd/pkg_install/dist/lib
Date: Sun, 4 Feb 2018 09:00:51 +0000

 Module Name:	src
 Committed By:	maya
 Date:		Sun Feb  4 09:00:51 UTC 2018

 Modified Files:
 	src/external/bsd/pkg_install/dist/lib: license.c pkcs7.c pkg_io.c
 	    version.h

 Log Message:
 Merge pkg_install-20171030

 Bump version to 20171030 for netpgpverify fixes.
 Add zsh to default_acceptable_licenses.
 Undef bootstrap hack.

 Fix OpenSSL 1.1.0 build
 OpenSSL 1.1.0 makes xkusage and ex_flags opaque.
 Use X509_check_ca rather than a custom and nearly identical implementation.
 This is available since OpenSSL 0.9.8 (even in RHEL5).
 This is also done because we cannot implement it identically under
 OpenSSL 1.1.0 due to missing getters.
 Test EXFLAG_XKUSAGE rather than zero xkusage test no usage to avoid openssl
 1.1.0 getter returning a different code on this case.
 Use getter for xkusage in the non-zero test case.
 Provide fallback definitions for getters.

 PR pkg/52298, PR pkg/52648


 To generate a diff of this commit:
 cvs rdiff -u -r1.5 -r1.6 src/external/bsd/pkg_install/dist/lib/license.c
 cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pkg_install/dist/lib/pkcs7.c \
     src/external/bsd/pkg_install/dist/lib/pkg_io.c
 cvs rdiff -u -r1.11 -r1.12 src/external/bsd/pkg_install/dist/lib/version.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>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.