Bug 251271 - net-p2p/openethereum: fails to build with clang10
Summary: net-p2p/openethereum: fails to build with clang10
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alex Dupre
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-20 14:36 UTC by Mikael Urankar
Modified: 2020-11-21 10:48 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (ale)


Attachments
v1 (1.59 KB, patch)
2020-11-20 15:49 UTC, Mikael Urankar
no flags Details | Diff
v2 (1.78 KB, patch)
2020-11-20 17:40 UTC, Mikael Urankar
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Urankar freebsd_committer freebsd_triage 2020-11-20 14:36:01 UTC
In file included from /wrkdirs/usr/ports/net-p2p/openethereum/work/openethereum-3.1.0/cargo-crates/parity-rocksdb-sys-0.5.6/rocksdb/utilities/backupable/backupable_db.cc:16:
  /wrkdirs/usr/ports/net-p2p/openethereum/work/openethereum-3.1.0/cargo-crates/parity-rocksdb-sys-0.5.6/rocksdb/util/channel.h:35:33: error: no matching constructor for initialization of 'std::lock_guard<std::mutex>'
      std::lock_guard<std::mutex> lk(lock_);
                                  ^  ~~~~~
  /usr/include/c++/v1/__mutex_base:90:14: note: candidate constructor not viable: 1st argument ('const std::mutex') would lose const qualifier
      explicit lock_guard(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
               ^
  /usr/include/c++/v1/__mutex_base:100:5: note: candidate constructor not viable: no known conversion from 'const std::mutex' to 'const std::__1::lock_guard<std::__1::mutex>' for 1st argument
      lock_guard(lock_guard const&) _LIBCPP_EQUAL_DELETE;
      ^
  /usr/include/c++/v1/__mutex_base:94:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
      lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
      ^
  1 error generated.


probably fixed with:
https://github.com/cockroachdb/rocksdb/pull/79
Comment 1 Alex Dupre freebsd_committer freebsd_triage 2020-11-20 15:03:30 UTC
Thanks for the link to a possible patch, but why haven't you tried it to confirm it fixes the issue and it's enough?
Comment 2 Mikael Urankar freebsd_committer freebsd_triage 2020-11-20 15:05:44 UTC
(In reply to Alex Dupre from comment #1)
I'm updating rust to 1.48, I don't have much time / resources to test the mentioned patch:

Nov 20 15:41:46 acheron kernel: pid 9880 (rustc), jid 189, uid 0, was killed: out of swap space
Nov 20 15:41:48 acheron kernel: pid 14403 (rustc), jid 190, uid 0, was killed: out of swap space
Nov 20 15:41:49 acheron kernel: pid 17476 (rustc), jid 211, uid 0, was killed: out of swap space
Nov 20 15:41:51 acheron kernel: pid 16765 (rustc), jid 220, uid 0, was killed: out of swap space
Nov 20 15:41:52 acheron kernel: pid 91368 (firefox), jid 0, uid 1001, was killed: out of swap space
Nov 20 15:41:52 acheron kernel: swp_pager_getswapspace(1): failed
Nov 20 15:41:52 acheron kernel: swap_pager: out of swap space
Nov 20 15:41:52 acheron kernel: swp_pager_getswapspace(1): failed
Nov 20 15:41:52 acheron kernel: swap_pager: out of swap space
Nov 20 15:41:52 acheron kernel: swp_pager_getswapspace(3): failed
Nov 20 15:42:08 acheron kernel: swap_pager: out of swap space
Nov 20 15:42:08 acheron kernel: swp_pager_getswapspace(2): failed
Nov 20 15:44:20 acheron kernel: pid 20801 (clang-11), jid 220, uid 0, was killed: out of swap space
Nov 20 15:44:33 acheron kernel: pid 20584 (clang-9), jid 190, uid 0, was killed: out of swap space
Nov 20 15:44:42 acheron kernel: pid 22269 (clang-9), jid 190, uid 0, was killed: out of swap space
Nov 20 15:45:03 acheron kernel: pid 20960 (c++), jid 205, uid 0, was killed: out of swap space
Nov 20 15:45:22 acheron kernel: pid 22487 (clang-11), jid 220, uid 0, was killed: out of swap space
Nov 20 15:45:34 acheron kernel: pid 23243 (clang-11), jid 211, uid 0, was killed: out of swap space
Nov 20 15:45:49 acheron kernel: pid 23217 (clang-11), jid 189, uid 0, was killed: out of swap space
Nov 20 15:45:55 acheron kernel: swp_pager_getswapspace(11): failed
Nov 20 15:46:16 acheron kernel: pid 23164 (clang-11), jid 189, uid 0, was killed: out of swap space
Nov 20 15:46:20 acheron kernel: pid 23166 (clang-11), jid 220, uid 0, was killed: out of swap space
Nov 20 15:46:22 acheron kernel: pid 22223 (clang-9), jid 190, uid 0, was killed: out of swap space
Nov 20 15:46:25 acheron kernel: pid 23780 (clang-9), jid 190, uid 0, was killed: out of swap space
Nov 20 15:46:26 acheron kernel: pid 23516 (clang-11), jid 220, uid 0, was killed: out of swap space
Nov 20 15:46:28 acheron kernel: pid 23312 (clang-11), jid 220, uid 0, was killed: out of swap space
Comment 3 Mikael Urankar freebsd_committer freebsd_triage 2020-11-20 15:49:38 UTC
Created attachment 219831 [details]
v1

it builds fine with the attached patch
Comment 4 Alex Dupre freebsd_committer freebsd_triage 2020-11-20 16:34:59 UTC
Just to know, did you set LLVM_DEFAULT=10 or are you simply using -CURRENT ?
Comment 5 Mikael Urankar freebsd_committer freebsd_triage 2020-11-20 17:40:08 UTC
Created attachment 219833 [details]
v2

fix build on 11 while here
Comment 6 Mikael Urankar freebsd_committer freebsd_triage 2020-11-20 17:40:35 UTC
(In reply to Alex Dupre from comment #4)
it's on -current and 11.4, so clang10 by default
Comment 7 commit-hook freebsd_committer freebsd_triage 2020-11-20 18:06:49 UTC
A commit references this bug:

Author: ale
Date: Fri Nov 20 18:06:08 UTC 2020
New revision: 555775
URL: https://svnweb.freebsd.org/changeset/ports/555775

Log:
  Fix build with clang 10 and FreeBSD 11.
  Remove unused clang build dependency.

  PR:		251271
  Submitted by:	mikael

Changes:
  head/net-p2p/openethereum/Makefile
  head/net-p2p/openethereum/files/
  head/net-p2p/openethereum/files/patch-cargo-crates_parity-rocksdb-sys-0.5.6_rocksdb_util_channel.h
Comment 8 Mikael Urankar freebsd_committer freebsd_triage 2020-11-20 18:37:33 UTC
(In reply to commit-hook from comment #7)
FreeBSD 12.1 still uses clang8, I haven't tried if it builds with the stock compiler, maybe llvm9+ is required for this version.
Comment 9 Alex Dupre freebsd_committer freebsd_triage 2020-11-20 19:06:43 UTC
I compiled it with 12.1 and clang 8.

clang 9 was a leftover from a previous release that required llvm-config, that is not installed in base.
Comment 10 Mikael Urankar freebsd_committer freebsd_triage 2020-11-21 10:42:29 UTC
(In reply to Alex Dupre from comment #9)
Ok

FYI, it builds fine on 11.4 i386 and 13 i386
Comment 11 Alex Dupre freebsd_committer freebsd_triage 2020-11-21 10:48:17 UTC
Thanks, I was going to try again, I remove the BROKEN line then.