facebook / facebook/rocksdb

rocksdbjavastatic build target fails on gcc 6.2.1

Open
#4,759 2 comments 0 reactions 0 assignees View on GitHub
java-api question
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

### Expected behavior
Building the static jar file with gcc 6.2.1. RocksDB release 5.17.2.

### Actual behavior
```
In file included from /usr/include/c++/6.2.1/memory:81:0,
from ./java/./rocksjni/compaction_filter_factory_jnicallback.h:13,
from java/rocksjni/compaction_filter_factory_jnicallback.cc:9:
/usr/include/c++/6.2.1/bits/unique_ptr.h: In instantiation of ‘void std::unique_ptr<_Tp [], _Dp>::reset(_Up) [with _Up = char*; = void; _Tp = const char; _Dp = std::default_delet
e]’:
/usr/include/c++/6.2.1/bits/unique_ptr.h:539:9: required from ‘typename std::enable_if, std::is_same::_Pointer::type, _T
p*>, std::is_same::pointer, typename std::unique_ptr<_Up, _Ep>::element_type*>, std::is_convertible::element_type (*)[], _Tp (*)[]>,
std::__or_, std::is_same<_Dp, _Ep> >, std::__and_ >, std::is_convertible<_Ep, _Dp> > > >, std::is_assignable<_Dp&, _Ep&&> >::value, s
td::unique_ptr<_Tp [], _Dp>&>::type std::unique_ptr<_Tp [], _Dp>::operator=(std::unique_ptr<_Up, _Ep>&&) [with _Up = char []; _Ep = std::default_delete; _Tp = const char; _Dp = std::default_dele
te; typename std::enable_if, std::is_same::_Pointer::type, _Tp*>, std::is_same::pointer, typename std::unique_ptr<_Up, _Ep>::element_type*>, std::is_convertible::element_type (*)[], _Tp (*)[]>, std::__or_,
std::is_same<_Dp, _Ep> >, std::__and_ >, std::is_convertible<_Ep, _Dp> > > >, std::is_assignable<_Dp&, _Ep&&> >::value, std::unique_ptr<_Tp [], _Dp>&>::type = std::uni
que_ptr&]’
java/rocksjni/compaction_filter_factory_jnicallback.cc:33:58: required from here
/usr/include/c++/6.2.1/bits/unique_ptr.h:614:6: error: no matching function for call to ‘swap(const char*&, char*&)’
swap(std::get<0>(_M_t), __p);
~~~~^~~~~~~~~~~~~~~~~~~~~~~~
```

Upgrading to gcc 6.4.1 made the problem go away for me, but that may not be an option for others.

### Steps to reproduce the behavior

This occurs with the gcc-6.2.1 package in Fedora 25: `gcc-6.2.1-2.fc25.x86_64`

```bash
make clean && JAVA_HOME=/etc/alternatives/java_sdk make rocksdbjavastatic -j$(nproc)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.