Build of RocksDB for pack RocksDB fails and is reproducible.
OS: Ubuntu 22.04 LTS on WSL 2 on Windows 10
SWI-Prolog: 8.5.13
After first fail of building RocksDB pack, downloaded RocksDB into ~\rocksdb
and successfully ran make all
from rocksdb
directory, all test were run during build.
Retired installing RocksDB pack again.
?- pack_remove(rocksdb).
true.
Verified that ~/.local/share/swi-prolog/pack
was empty.
?- pack_install(rocksdb).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
Install rocksdb@0.8.0 from GIT at https://github.com/JanWielemaker/rocksdb.git Y/n?
% Cloning into '/home/groot/.local/share/swi-prolog/pack/rocksdb'...
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
% "rocksdb.git" was downloaded 5 times
Package: rocksdb
Title: SWI-Prolog interface to RocksDB
Installed version: 0.8.0
Author: Jan Wielemaker <J.Wielemaker@vu.nl>
Maintainer: Jan Wielemaker <J.Wielemaker@cwi.nl>
Packager: Jan Wielemaker <J.Wielemaker@cwi.nl>
Home page: https://github.com/JanWielemaker/rocksdb
Download URL: https://github.com/JanWielemaker/rocksdb.git
Run post installation scripts for pack "rocksdb" Y/n?Y
% git submodule update --init rocksdb
% Submodule 'rocksdb' (https://github.com/facebook/rocksdb) registered for path 'rocksdb'
% Cloning into '/home/groot/.local/share/swi-prolog/pack/rocksdb/rocksdb'...
% Submodule path 'rocksdb': checked out 'bd68bfb41b58dba4332045392cdbda4664b01e81'
% ROCKSDB_DISABLE_JEMALLOC=1 ROCKSDB_DISABLE_TCMALLOC=1 /usr/bin/gmake -j4 -C rocksdb static_lib EXTRA_CXXFLAGS=-fPIC EXTRA_CFLAGS=-fPIC USE_RTTI=1 DEBUG_LEVEL=0
% gmake[1]: Entering directory '/home/groot/.local/share/swi-prolog/pack/rocksdb/rocksdb'
% $DEBUG_LEVEL is 0
% Makefile:235: Warning: /usr/lib/swi-prolog/include" does not exist
% GEN util/build_version.cc
% $DEBUG_LEVEL is 0
% Makefile:235: Warning: /usr/lib/swi-prolog/include" does not exist
% GEN util/build_version.cc
% CC cache/clock_cache.o
...
% CC options/options_helper.o
ERROR: options/options_helper.cc: In function ârocksdb::Status rocksdb::GetStringFromStruct(const rocksdb::ConfigOptions&, const void*, const std::unordered_map<std::__cxx11::basic_string<char>, rocksdb::OptionTypeInfo>&, std::string*)â:
ERROR: options/options_helper.cc:767:19: error: loop variable âiterâ creates a copy from type âconst std::pair<const std::__cxx11::basic_string<char>, rocksdb::OptionTypeInfo>â [-Werror=range-loop-construct]
ERROR: 767 | for (const auto iter : type_info) {
ERROR: | ^~~~
% options/options_helper.cc:767:19: note: use reference type to prevent copying
% 767 | for (const auto iter : type_info) {
% | ^~~~
% | &
% CC options/options_parser.o
...
% CC table/block_based/block_based_filter_block.o
% cc1plus: all warnings being treated as errors
% gmake[1]: *** [Makefile:2258: options/options_helper.o] Error 1
% gmake[1]: *** Waiting for unfinished jobs....
% gmake[1]: Leaving directory '/home/groot/.local/share/swi-prolog/pack/rocksdb/rocksdb'
% gmake: *** [Makefile:20: rocksdb/librocksdb.a] Error 2
ERROR: Process "process(/usr/bin/gmake,[])": exit status: 2
ERROR: In:
ERROR: [25] throw(error(process_error(...,...),_17810))
ERROR: [21] build_tools:build_step(build,_17854{env:[...|...],git:true,inquiry:true,pack:rocksdb,pack_version:1,src_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb',url:'https://github.com/JanWielemaker/rocksdb.git'},_17854{bin_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb',env:[...|...],git:true,inquiry:true,pack:rocksdb,pack_version:1,src_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb',url:'https://github.com/JanWielemaker/rocksdb.git'}) at /usr/lib/swi-prolog/library/build/tools.pl:110
ERROR: [20] apply:foldl_([build,...|...],build_tools:build_step,_17854{env:[...|...],git:true,inquiry:true,pack:rocksdb,pack_version:1,src_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb',url:'https://github.com/JanWielemaker/rocksdb.git'},_17966) at /usr/lib/swi-prolog/library/apply.pl:316
ERROR: [14] prolog_pack:pack_post_install(rocksdb,'/home/groot/.local/share/swi-prolog/pack/rocksdb',[git(true),...|...]) at /usr/lib/swi-prolog/library/prolog_pack.pl:1102
ERROR: [9] toplevel_call('<garbage_collected>') at /usr/lib/swi-prolog/boot/toplevel.pl:1162
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
Exception: (21) build_tools:build_step(build, _14752{env:['PATH'='/usr/lib/swi-prolog/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin', 'SWIPL'='/usr/lib/swi-prolog/bin/x86_64-linux/swipl', 'SWIPL_PACK_VERSION'=1, 'SWIPLVERSION'=80513, 'SWIHOME'='/usr/lib/swi-prolog', ... = ...|...], git:true, inquiry:true, pack:rocksdb, pack_version:1, src_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb', url:'https://github.com/JanWielemaker/rocksdb.git'}, _15194) ?
Full output
?- pack_install(rocksdb).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
Install rocksdb@0.8.0 from GIT at https://github.com/JanWielemaker/rocksdb.git Y/n?
% Cloning into '/home/groot/.local/share/swi-prolog/pack/rocksdb'...
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
% "rocksdb.git" was downloaded 5 times
Package: rocksdb
Title: SWI-Prolog interface to RocksDB
Installed version: 0.8.0
Author: Jan Wielemaker <J.Wielemaker@vu.nl>
Maintainer: Jan Wielemaker <J.Wielemaker@cwi.nl>
Packager: Jan Wielemaker <J.Wielemaker@cwi.nl>
Home page: https://github.com/JanWielemaker/rocksdb
Download URL: https://github.com/JanWielemaker/rocksdb.git
Run post installation scripts for pack "rocksdb" Y/n?Y
% git submodule update --init rocksdb
% Submodule 'rocksdb' (https://github.com/facebook/rocksdb) registered for path 'rocksdb'
% Cloning into '/home/groot/.local/share/swi-prolog/pack/rocksdb/rocksdb'...
% Submodule path 'rocksdb': checked out 'bd68bfb41b58dba4332045392cdbda4664b01e81'
% ROCKSDB_DISABLE_JEMALLOC=1 ROCKSDB_DISABLE_TCMALLOC=1 /usr/bin/gmake -j4 -C rocksdb static_lib EXTRA_CXXFLAGS=-fPIC EXTRA_CFLAGS=-fPIC USE_RTTI=1 DEBUG_LEVEL=0
% gmake[1]: Entering directory '/home/groot/.local/share/swi-prolog/pack/rocksdb/rocksdb'
% $DEBUG_LEVEL is 0
% Makefile:235: Warning: /usr/lib/swi-prolog/include" does not exist
% GEN util/build_version.cc
% $DEBUG_LEVEL is 0
% Makefile:235: Warning: /usr/lib/swi-prolog/include" does not exist
% GEN util/build_version.cc
% CC cache/clock_cache.o
% CC cache/lru_cache.o
% CC cache/cache.o
% CC cache/sharded_cache.o
% CC db/arena_wrapped_db_iter.o
% CC db/blob/blob_file_addition.o
% CC db/blob/blob_file_garbage.o
% CC db/blob/blob_file_meta.o
% CC db/builder.o
% CC db/c.o
% CC db/column_family.o
% CC db/compacted_db_impl.o
% CC db/compaction/compaction.o
% CC db/compaction/compaction_iterator.o
% CC db/compaction/compaction_job.o
% CC db/compaction/compaction_picker.o
% CC db/compaction/compaction_picker_fifo.o
% CC db/compaction/compaction_picker_level.o
% CC db/compaction/compaction_picker_universal.o
% CC db/convenience.o
% CC db/db_filesnapshot.o
% CC db/db_impl/db_impl.o
% CC db/db_impl/db_impl_compaction_flush.o
% CC db/db_impl/db_impl_debug.o
% CC db/db_impl/db_impl_experimental.o
% CC db/db_impl/db_impl_files.o
% CC db/db_impl/db_impl_open.o
% CC db/db_impl/db_impl_readonly.o
% CC db/db_impl/db_impl_secondary.o
% CC db/db_impl/db_impl_write.o
% CC db/db_info_dumper.o
% CC db/db_iter.o
% CC db/dbformat.o
% CC db/error_handler.o
% CC db/event_helpers.o
% CC db/experimental.o
% CC db/external_sst_file_ingestion_job.o
% CC db/file_indexer.o
% CC db/flush_job.o
% CC db/flush_scheduler.o
% CC db/forward_iterator.o
% CC db/import_column_family_job.o
% CC db/internal_stats.o
% CC db/logs_with_prep_tracker.o
% CC db/log_reader.o
% CC db/log_writer.o
% CC db/malloc_stats.o
% CC db/memtable.o
% CC db/memtable_list.o
% CC db/merge_helper.o
% CC db/merge_operator.o
% CC db/range_del_aggregator.o
% CC db/range_tombstone_fragmenter.o
% CC db/repair.o
% CC db/snapshot_impl.o
% CC db/table_cache.o
% CC db/table_properties_collector.o
% CC db/transaction_log_impl.o
% CC db/trim_history_scheduler.o
% CC db/version_builder.o
% CC db/version_edit.o
% CC db/version_edit_handler.o
% CC db/version_set.o
% CC db/wal_manager.o
% CC db/write_batch.o
% CC db/write_batch_base.o
% CC db/write_controller.o
% CC db/write_thread.o
% CC env/env.o
% CC env/env_chroot.o
% CC env/env_encryption.o
% CC env/env_hdfs.o
% CC env/env_posix.o
% CC env/file_system.o
% CC env/fs_posix.o
% CC env/io_posix.o
% CC env/mock_env.o
% CC file/delete_scheduler.o
% CC file/file_util.o
% CC file/filename.o
% CC file/random_access_file_reader.o
% CC file/read_write_util.o
% CC file/readahead_raf.o
% CC file/sequence_file_reader.o
% CC file/sst_file_manager_impl.o
% CC file/writable_file_writer.o
% CC logging/auto_roll_logger.o
% CC logging/event_logger.o
% CC logging/log_buffer.o
% CC memory/arena.o
% CC memory/concurrent_arena.o
% CC memory/jemalloc_nodump_allocator.o
% CC memory/memkind_kmem_allocator.o
% CC memtable/alloc_tracker.o
% CC memtable/hash_linklist_rep.o
% CC memtable/hash_skiplist_rep.o
% CC memtable/skiplistrep.o
% CC memtable/vectorrep.o
% CC memtable/write_buffer_manager.o
% CC monitoring/histogram.o
% CC monitoring/histogram_windowing.o
% CC monitoring/in_memory_stats_history.o
% CC monitoring/instrumented_mutex.o
% CC monitoring/iostats_context.o
% CC monitoring/perf_context.o
% CC monitoring/perf_level.o
% CC monitoring/persistent_stats_history.o
% CC monitoring/statistics.o
% CC monitoring/thread_status_impl.o
% CC monitoring/thread_status_updater.o
% CC monitoring/thread_status_updater_debug.o
% CC monitoring/thread_status_util.o
% CC monitoring/thread_status_util_debug.o
% CC options/cf_options.o
% CC options/db_options.o
% CC options/options.o
% CC options/options_helper.o
ERROR: options/options_helper.cc: In function ârocksdb::Status rocksdb::GetStringFromStruct(const rocksdb::ConfigOptions&, const void*, const std::unordered_map<std::__cxx11::basic_string<char>, rocksdb::OptionTypeInfo>&, std::string*)â:
ERROR: options/options_helper.cc:767:19: error: loop variable âiterâ creates a copy from type âconst std::pair<const std::__cxx11::basic_string<char>, rocksdb::OptionTypeInfo>â [-Werror=range-loop-construct]
ERROR: 767 | for (const auto iter : type_info) {
ERROR: | ^~~~
% options/options_helper.cc:767:19: note: use reference type to prevent copying
% 767 | for (const auto iter : type_info) {
% | ^~~~
% | &
% CC options/options_parser.o
% CC port/port_posix.o
% CC port/stack_trace.o
% CC table/adaptive/adaptive_table_factory.o
% CC table/block_based/binary_search_index_reader.o
% CC table/block_based/block.o
% CC table/block_based/block_based_filter_block.o
% cc1plus: all warnings being treated as errors
% gmake[1]: *** [Makefile:2258: options/options_helper.o] Error 1
% gmake[1]: *** Waiting for unfinished jobs....
% gmake[1]: Leaving directory '/home/groot/.local/share/swi-prolog/pack/rocksdb/rocksdb'
% gmake: *** [Makefile:20: rocksdb/librocksdb.a] Error 2
ERROR: Process "process(/usr/bin/gmake,[])": exit status: 2
ERROR: In:
ERROR: [25] throw(error(process_error(...,...),_17810))
ERROR: [21] build_tools:build_step(build,_17854{env:[...|...],git:true,inquiry:true,pack:rocksdb,pack_version:1,src_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb',url:'https://github.com/JanWielemaker/rocksdb.git'},_17854{bin_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb',env:[...|...],git:true,inquiry:true,pack:rocksdb,pack_version:1,src_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb',url:'https://github.com/JanWielemaker/rocksdb.git'}) at /usr/lib/swi-prolog/library/build/tools.pl:110
ERROR: [20] apply:foldl_([build,...|...],build_tools:build_step,_17854{env:[...|...],git:true,inquiry:true,pack:rocksdb,pack_version:1,src_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb',url:'https://github.com/JanWielemaker/rocksdb.git'},_17966) at /usr/lib/swi-prolog/library/apply.pl:316
ERROR: [14] prolog_pack:pack_post_install(rocksdb,'/home/groot/.local/share/swi-prolog/pack/rocksdb',[git(true),...|...]) at /usr/lib/swi-prolog/library/prolog_pack.pl:1102
ERROR: [9] toplevel_call('<garbage_collected>') at /usr/lib/swi-prolog/boot/toplevel.pl:1162
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
Exception: (21) build_tools:build_step(build, _14752{env:['PATH'='/usr/lib/swi-prolog/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin', 'SWIPL'='/usr/lib/swi-prolog/bin/x86_64-linux/swipl', 'SWIPL_PACK_VERSION'=1, 'SWIPLVERSION'=80513, 'SWIHOME'='/usr/lib/swi-prolog', ... = ...|...], git:true, inquiry:true, pack:rocksdb, pack_version:1, src_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb', url:'https://github.com/JanWielemaker/rocksdb.git'}, _15194) ?
Also checked that lastest version of RocksDB pack was installed by checking against latest commit.
groot@Galaxy:~/.local/share/swi-prolog/pack/rocksdb$ sed -n '1084,1089p' cpp/rocksdb4pl.cpp
typedef enum
{ ENUM_ALL,
ENUM_FROM,
ENUM_PREFIX
} enum_type;
For % Makefile:235: Warning: /usr/lib/swi-prolog/include" does not exist
checked
groot@Galaxy:/usr/lib/swi-prolog/include$ ll
total 124
drwxr-xr-x 4 root root 4096 Jun 27 16:54 ./
drwxr-xr-x 12 root root 4096 Jun 27 16:54 ../
-rw-r--r-- 1 root root 53564 Jun 22 04:51 SWI-Prolog.h
-rw-r--r-- 1 root root 16706 Jun 22 04:51 SWI-Stream.h
-rw-r--r-- 1 root root 29358 Jun 15 11:11 SWI-cpp.h
drwxr-xr-x 2 root root 4096 Jun 27 16:54 Yap/
drwxr-xr-x 2 root root 4096 Jun 27 16:54 sicstus/
EDIT
Running make in RocksDB directory for SWI-Prolog pack without clean first
groot@Galaxy:~/.local/share/swi-prolog/pack/rocksdb$ make
ROCKSDB_DISABLE_JEMALLOC=1 ROCKSDB_DISABLE_TCMALLOC=1 make -j4 -C rocksdb static_lib EXTRA_CXXFLAGS=-fPIC EXTRA_CFLAGS=-fPIC USE_RTTI=1 DEBUG_LEVEL=0
make[1]: Entering directory '/home/groot/.local/share/swi-prolog/pack/rocksdb/rocksdb'
$DEBUG_LEVEL is 0
GEN util/build_version.cc
CC options/options_helper.o
CC table/block_based/block_based_table_builder.o
CC table/block_based/block_based_table_factory.o
CC table/block_based/block_based_table_iterator.o
options/options_helper.cc: In function ârocksdb::Status rocksdb::GetStringFromStruct(const rocksdb::ConfigOptions&, const void*, const std::unordered_map<std::__cxx11::basic_string<char>, rocksdb::OptionTypeInfo>&, std::string*)â:
options/options_helper.cc:767:19: error: loop variable âiterâ creates a copy from type âconst std::pair<const std::__cxx11::basic_string<char>, rocksdb::OptionTypeInfo>â [-Werror=range-loop-construct]
767 | for (const auto iter : type_info) {
| ^~~~
options/options_helper.cc:767:19: note: use reference type to prevent copying
767 | for (const auto iter : type_info) {
| ^~~~
| &
CC table/block_based/block_based_table_reader.o
CC table/block_based/block_builder.o
table/block_based/block_based_table_builder.cc: In member function âvoid rocksdb::BlockBasedTableBuilder::EnterUnbuffered()â:
table/block_based/block_based_table_builder.cc:1590:30: error: âblock_repâ may be used uninitialized [-Werror=maybe-uninitialized]
1590 | std::swap(*(block_rep->data), data_block);
| ~~~~~~~~~~~~^~~~~
table/block_based/block_based_table_builder.cc:1587:41: note: âblock_repâ declared here
1587 | ParallelCompressionRep::BlockRep* block_rep;
| ^~~~~~~~~
CC table/block_based/block_prefetcher.o
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:2258: options/options_helper.o] Error 1
make[1]: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:2258: table/block_based/block_based_table_builder.o] Error 1
make[1]: Leaving directory '/home/groot/.local/share/swi-prolog/pack/rocksdb/rocksdb'
make: *** [Makefile:20: rocksdb/librocksdb.a] Error 2
EDIT
Found this RocksDB issue which might be related.
Noted on GitHub issues: #7
Any hints or solutions on how to get to a successful build?