Skip to content

Commit

Permalink
Fix compile error for old gcc-4.8 (facebook#7358)
Browse files Browse the repository at this point in the history
Summary:
gcc-4.8 returns error when using the constructor. Not sure if it's a compiler bug/limitation or code issue:
```
table/block_based/block_based_table_reader.cc:3183:67: error: use of deleted function ‘rocksdb::WritableFileStringStreamAdapter::WritableFileStringStreamAdapter(rocksdb::WritableFileStringStreamAdapter&&)’
```

Pull Request resolved: facebook#7358

Reviewed By: pdillinger

Differential Revision: D23577651

Pulled By: jay-zhuang

fbshipit-source-id: b0197e3d3538da61a6f3866410d88d2047fb9695
  • Loading branch information
jay-zhuang authored and codingrhythm committed Mar 5, 2021
1 parent 63e9f3f commit 3984ce4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ jobs:
- run: apt-get update -y && apt-get install -y libgflags-dev
- run: TEST_TMPDIR=/dev/shm && make V=1 -j16 unity_test | .circleci/cat_ignore_eagain

build-linux-gcc-4-8:
machine:
image: ubuntu-1604:201903-01
resource_class: large
steps:
- checkout
- run: pyenv global 3.5.2
- run: sudo apt-get update -y && sudo apt-get install gcc-4.8 g++-4.8 libgflags-dev
- run: CC=gcc-4.8 CXX=g++-4.8 V=1 SKIP_LINK=1 make -j4 all | .circleci/cat_ignore_eagain # Linking broken because libgflags compiled with newer ABI

build-windows:
executor: windows-2xlarge
parameters:
Expand Down Expand Up @@ -360,3 +370,6 @@ workflows:
- build-linux-non-shm:
start_test: "compact_on_deletion_collector_test" # make sure unique in src.mk
end_test: ""
build-linux-gcc-4-8:
jobs:
- build-linux-gcc-4-8
2 changes: 1 addition & 1 deletion table/block_based/block_based_table_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3180,7 +3180,7 @@ Status BlockBasedTable::GetKVPairsFromDataBlocks(
}

Status BlockBasedTable::DumpTable(WritableFile* out_file) {
auto out_file_wrapper = WritableFileStringStreamAdapter(out_file);
WritableFileStringStreamAdapter out_file_wrapper(out_file);
std::ostream out_stream(&out_file_wrapper);
// Output Footer
out_stream << "Footer Details:\n"
Expand Down
4 changes: 2 additions & 2 deletions tools/sst_dump_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class SSTDumpToolTest : public testing::Test {
}

void createSST(const Options& opts, const std::string& file_name) {
Env* env = opts.env;
Env* test_env = opts.env;
EnvOptions env_options(opts);
ReadOptions read_options;
const ImmutableCFOptions imoptions(opts);
Expand All @@ -102,7 +102,7 @@ class SSTDumpToolTest : public testing::Test {
std::unique_ptr<TableBuilder> tb;

std::unique_ptr<WritableFile> file;
ASSERT_OK(env->NewWritableFile(file_name, &file, env_options));
ASSERT_OK(test_env->NewWritableFile(file_name, &file, env_options));

std::vector<std::unique_ptr<IntTblPropCollectorFactory> >
int_tbl_prop_collector_factories;
Expand Down

0 comments on commit 3984ce4

Please sign in to comment.