NetBSD Problem Report #52878

From www@NetBSD.org  Sat Dec 30 03:22:32 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 08A787A1BC
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 30 Dec 2017 03:22:32 +0000 (UTC)
Message-Id: <20171230032229.0D2617A1E5@mollari.NetBSD.org>
Date: Sat, 30 Dec 2017 03:22:29 +0000 (UTC)
From: yamajun@ofug.net
Reply-To: yamajun@ofug.net
To: gnats-bugs@NetBSD.org
Subject: pkgsrc/inputmethod/mozc-server: Build failed
X-Send-Pr-Version: www-1.0

>Number:         52878
>Category:       pkg
>Synopsis:       pkgsrc/inputmethod/mozc-server: Build failed
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    tsutsui
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 30 03:25:00 +0000 2017
>Closed-Date:    Sat Feb 24 02:08:20 +0000 2018
>Last-Modified:  Sat Feb 24 02:08:20 +0000 2018
>Originator:     YAMASHIRO, Jun
>Release:        NetBSD-current / Ubuntu 16.04.3 LTS
>Organization:
Okinawa FreeBSD Users Group
>Environment:
NetBSD yamajun 8.99.9 NetBSD 8.99.9 (GENERIC) #16: Mon Dec 11 20:19:06 JST 2017  yamajun@yamajun:/usr/obj/sys/arch/amd64/compile/GENERIC amd64

Linux yamajun-ThinkPad-T410 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

>Description:
Build failed about scope bug of std::sort()

see also:
https://github.com/google/mozc/pull/424/commits/a62bb554024e5e36e93215ee7c5f8ac61e060e61
(Note: rejected this PR about non-technical reason)

>How-To-Repeat:

# cd /usr/pkgsrc/inputmethod/mozc-server
# make

(snip)
../../prediction/user_history_predictor.cc: In static member function 'static bool mozc::UserHistoryPredictor::RomanFuzzyPrefixMatch(const string&, const string&)':
../../prediction/user_history_predictor.cc:844:54: error: 'swap' was not declared in this scope
         swap(swapped_prefix[i], swapped_prefix[i + 1]);
                                                      ^
(snip)
build_tools.util.RunOrDieError:
==========
 ERROR: ninja -C out_bsd/Release mozc_server
==========
*** Error code 1

Stop.
make[1]: stopped in /usr/pkgsrc/inputmethod/mozc-server
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/inputmethod/mozc-server

>Fix:
Apply this patch to pkgsrc/inputmethod/mozc-server and rebuild

# cd /usr/pkgsrc/inputmethod/mozc-server
# patch -p0 < /path/to/this_patch.diff
# rm patches/patch-prediction-user__history__predictor.cc.orig
# make makepatchsum
# make


--- /dev/null	2017-12-30 11:54:46.703872431 +0900
+++ patches/patch-prediction-user__history__predictor.cc	2017-12-30 11:53:59.499766812 +0900
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Fix build problem
+
+see also:
+https://github.com/google/mozc/pull/424
+https://github.com/google/mozc/pull/424/commits/a62bb554024e5e36e93215ee7c5f8ac6
+1e060e61
+
+--- prediction/user_history_predictor.cc.orig	2017-12-30 11:45:53.876922748 +0900
++++ prediction/user_history_predictor.cc	2017-12-30 11:46:15.319414028 +0900
+@@ -841,7 +841,7 @@
+       // swap.
+       if (i + 1 < prefix.size()) {
+         string swapped_prefix = prefix;
+-        swap(swapped_prefix[i], swapped_prefix[i + 1]);
++	std::swap(swapped_prefix[i], swapped_prefix[i + 1]);
+         if (Util::StartsWith(str, swapped_prefix)) {
+           return true;
+         }

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->tsutsui
Responsible-Changed-By: tsutsui@NetBSD.org
Responsible-Changed-When: Sat, 30 Dec 2017 15:48:10 +0000
Responsible-Changed-Why:
I updated to the latest version and applied the same patch.
(I didn't notice this PR before commit. sorry)


State-Changed-From-To: open->needs-pullups
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sat, 30 Dec 2017 15:48:10 +0000
State-Changed-Why:
pkgsrc-2017Q4 also needs this fix.


State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sun, 31 Dec 2017 17:51:15 +0000
State-Changed-Why:
pullup-pkgsrc #5665


State-Changed-From-To: pending-pullups->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sat, 24 Feb 2018 02:08:20 +0000
State-Changed-Why:
Pulled up:
 http://mail-index.netbsd.org/pkgsrc-changes/2018/01/01/msg168542.html


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