Created attachment 168978 [details] Fix several std::map declarations in databases/mysql57-server During the exp-run in bug 208158, it was found that databases/mysql57-server gives errors with libc++ 3.8.0 [1]: In file included from /wrkdirs/usr/ports/databases/mysql57-server/work/mysql-5.7.10/storage/innobase/buf/buf0buf.cc:33: In file included from /wrkdirs/usr/ports/databases/mysql57-server/work/mysql-5.7.10/storage/innobase/include/ha_prototypes.h:32: In file included from /wrkdirs/usr/ports/databases/mysql57-server/work/mysql-5.7.10/storage/innobase/include/univ.i:594: In file included from /wrkdirs/usr/ports/databases/mysql57-server/work/mysql-5.7.10/storage/innobase/include/sync0types.h:32: In file included from /wrkdirs/usr/ports/databases/mysql57-server/work/mysql-5.7.10/storage/innobase/include/ut0new.h:124: /usr/include/c++/v1/map:837:5: error: implicit instantiation of undefined template '__static_assert_test<false>' static_assert((is_same<typename allocator_type::value_type, value_type>::value), ^ /usr/include/c++/v1/__config:632:35: note: expanded from macro 'static_assert' typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \ ^ /wrkdirs/usr/ports/databases/mysql57-server/work/mysql-5.7.10/storage/innobase/buf/buf0buf.cc:359:19: note: in instantiation of template class 'std::__1::map<const unsigned char *, buf_chunk_t *, std::__1::less<const unsigned char *>, ut_allocator<std::__1::pair<const unsigned char *, buf_chunk_t *> > >' requested here buf_chunk_map_reg->insert(buf_pool_chunk_map_t::value_type( ^ This is because the value_type for a std::map<> should have a const key argument. Fix a number of std::map declarations and typedefs by sprinling const in the right places. [1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-03-22_18h30m05s/logs/errors/mysql57-server-5.7.10_3.log
Hi, I've checked your patch, i like to ask some points: Doesn't it cause errors for other builds (that doesn't use libc++3.8) ? [if yes i think there's a solution to apply the patch conditionally :D] You can now successfully build both mysql57 server and client after you apply this patch ? I'm okay to approve patch :), if you confirm both. if you didn't tried to build (or you're busy and cant try it now), tell me and i'll do it ;)
(In reply to Mahdi Mokhtari from comment #1) > Hi, I've checked your patch, i like to ask some points: > > Doesn't it cause errors for other builds (that doesn't use libc++3.8) ? [if > yes i think there's a solution to apply the patch conditionally :D] This shouldn't change anything for systems with earlier versions of libc++, or with libstdc++. The only reason this issue now pops up with libc++ 3.8 is that they've put a static assertion in the std::map class, which checks at compile time whether the value_type was defined correctly. It turns out a lot of software makes mistakes in this area. :) > You can now successfully build both mysql57 server and client after you > apply this patch ? Yes, I verified that, both with the old and new libc++. > I'm okay to approve patch :), if you confirm both. > if you didn't tried to build (or you're busy and cant try it now), tell me > and i'll do it ;) It would be nice if you double-checked on your system(s), to see if it also works OK for you. I could have made a mistake... :)
(In reply to Dimitry Andric from comment #2) > It would be nice if you double-checked on your system(s), to see if it also works OK for you. I could have made a mistake... :) Okay, i'll inform you on my test results tomorrow (in my time :D [it's now near mid-night] ) ;) > Yes, I verified that, both with the old and new libc++. Okay. Another small thing is, with this patch 'portlint' screams me about [FATAL] warning that is about patch formats. I think we should just regenerate the patch with 'make makepatch' to keep it (portlint) satisfied and happy (it's small stuff we can do at end ;D after the current patch verified works with libc on 10.X and 11.X)
Created attachment 169038 [details] Dimitry's patch + some format handling to satisft portlint Hi. I applied your previous patch on my tree and tested building it with poudriere. It was okay for me. Just to satisfy portlint about some errors (warnings) about patch formats, i used to reword it. I approve+ ed it :) Just waiting for a port-committer to commit it ;) [do it if you're a port-committer] Thanks for your patch/help :D
A commit references this bug: Author: dim Date: Thu Apr 7 22:23:20 UTC 2016 New revision: 412695 URL: https://svnweb.freebsd.org/changeset/ports/412695 Log: In the exp-run for bug 208158, building databases/mysql57-server resulted in errors with libc++ 3.8.0, because it declares the allocators for several std::map declarations incorrectly. Fix this by sprinkling const in the right places. Approved by: mokhi64@gmail.com (maintainer) PR: 208525 MFH: 2016Q2 Changes: head/databases/mysql57-server/Makefile head/databases/mysql57-server/files/patch-include_CMakeLists.txt head/databases/mysql57-server/files/patch-man_CMakeLists.txt head/databases/mysql57-server/files/patch-sql_json__dom.h head/databases/mysql57-server/files/patch-storage_innobase_buf_buf0buf.cc head/databases/mysql57-server/files/patch-storage_innobase_dict_dict0stats.cc head/databases/mysql57-server/files/patch-storage_innobase_sync_sync0debug.cc
Double records in the patches (see attachment)! Part error log: ... ===> Patching for mysql57-server-5.7.10_4 ===> Applying FreeBSD patches for mysql57-server-5.7.10_4 Ignoring previously applied (or reversed) patch. 1 out of 1 hunks ignored--saving rejects to sql/json_dom.h.rej => Patch patch-sql_json__dom.h failed to apply cleanly. ... *** Error code 1 Stop. make[1]: stopped in /usr/ports/databases/mysql57-server *** Error code 1 Stop. make: stopped in /usr/ports/databases/mysql57-server ** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20160408-5050-1jqwal7 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=mysql57-server-5.7.10_4 UPGRADE_PORT_VER=5.7.10_4 make ** Fix the problem and try again. ** Listing the failed packages (-:ignored / *:skipped / !:failed) ! databases/mysql57-server (mysql57-server-5.7.10_4) (patch error)
Created attachment 169098 [details] patches_error
A commit references this bug: Author: dim Date: Fri Apr 8 08:42:35 UTC 2016 New revision: 412723 URL: https://svnweb.freebsd.org/changeset/ports/412723 Log: Fix patches that were accidentally concatenated twice in r412695. Reported by: Vladimir Omelchuk <admin@vladiom.com.ua> Pointy hat to: dim PR: 208525 MFH: 2016Q2 Changes: head/databases/mysql57-server/files/patch-sql_json__dom.h head/databases/mysql57-server/files/patch-storage_innobase_buf_buf0buf.cc head/databases/mysql57-server/files/patch-storage_innobase_dict_dict0stats.cc head/databases/mysql57-server/files/patch-storage_innobase_sync_sync0debug.cc
(In reply to Vladimir Omelchuk from comment #6) > Double records in the patches (see attachment)! Sorry about that, fixed in r412723.
(In reply to Dimitry Andric from comment #9) May i know, what was removed with last patch ?
To explain more, build fail reported on 10.3 amd_64. "http://package19.nyi.freebsd.org/data/103i386-default-build-as-user/412698/logs/mysql57-server-5.7.10_4.log" Is it after commiting second, or before that?
as i am seeing the reason of failure is "=> Patch patch-sql_json__dom.h failed to apply cleanly." Im gonna test it myself too :)
(In reply to Mahdi Mokhtari from comment #12) > as i am seeing the reason of failure is "=> Patch patch-sql_json__dom.h > failed to apply cleanly." Yes, since you modified the patch in comment 4, I downloaded your version, svn reverted my changes and applied your patch instead. However, I had apparently forgotten that I already had the added files in my tree, so then the patch program will happily append another copy at the end of each file.
(In reply to Dimitry Andric from comment #13) It has been corrected with the second patch that Vladimir submitted ?
(In reply to Mahdi Mokhtari from comment #14) > (In reply to Dimitry Andric from comment #13) > It has been corrected with the second patch that Vladimir submitted ? I committed a fix in r412723, see comment 8.
After committed a fix in r412723, patches work is fine! Thanks Dimitry! Part build log: ... root@vladiom:~ # portupgrade -f 'mysql57-s*' [Reading data from pkg(8) ... - 975 packages found - done] ---> Reinstalling 'mysql57-server-5.7.10_4' (databases/mysql57-server) ---> Building '/usr/ports/databases/mysql57-server' ===> Cleaning for mysql57-server-5.7.10_4 ===> License GPLv2 accepted by the user ===> Found saved configuration for mysql57-server-5.7.10_3 ===> mysql57-server-5.7.10_4 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by mysql57-server-5.7.10_4 for building ===> Extracting for mysql57-server-5.7.10_4 => SHA256 Checksum OK for mysql-5.7.10.tar.gz. => SHA256 Checksum OK for boost_1_59_0.tar.gz. /usr/ports/databases/mysql57-server/work/mysql-5.7.10/sql/sql_hints.yy.cc /usr/ports/databases/mysql57-server/work/mysql-5.7.10/sql/sql_hints.yy.h ===> Patching for mysql57-server-5.7.10_4 ===> Applying FreeBSD patches for mysql57-server-5.7.10_4 ===> mysql57-server-5.7.10_4 depends on file: /usr/local/bin/cmake - found ===> mysql57-server-5.7.10_4 depends on executable: bison - found ===> mysql57-server-5.7.10_4 depends on file: /usr/local/bin/ccache - found ===> mysql57-server-5.7.10_4 depends on shared library: libmysqlclient.so.20 - found (/usr/local/lib/mysql/libmysqlclient.so.20) ===> Configuring for mysql57-server-5.7.10_4 ...
(In reply to Dimitry Andric from comment #15) Aha yeah I see. All good. Thanks a lot again guys.