google-deepmind / code_contests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error running Bazel on Windows 11 in Visual Studio Code

wvaughn409 opened this issue · comments

I've made some significant progress, but when I attempt to "...print the source and name of each problem in the validation data by installing bazel and then running:..."

bazel run -c opt :print_names_and_sources /tmp/dm-code_contests/code_contests_train.riegeli*

I am running up against some issues with Riegeli:
ERROR: C:/users/XXXXX/_bazel_XXXXX/eqdzh4xg/external/com_google_riegeli/riegeli/bytes/BUILD:478:11: Compiling riegeli/bytes/chain_writer.cc failed: (Exit 2): cl.exe failed: error executing command C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE ... (remaining 26 arguments skipped) external/com_google_riegeli\riegeli/bytes/chain_writer.h(275): error C2512: 'riegeli::Writer': no appropriate default constructor available external/com_google_riegeli\riegeli/bytes/writer.h(58): note: see declaration of 'riegeli::Writer' ERROR: C:/users/XXXXX/_bazel_XXXXX/eqdzh4xg/external/com_google_riegeli/riegeli/brotli/BUILD:26:11: Compiling riegeli/brotli/brotli_reader.cc failed: (Exit 2): cl.exe failed: error executing command C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE ... (remaining 29 arguments skipped) ERROR: C:/users/XXXXX/_bazel_XXXXX/eqdzh4xg/external/com_google_riegeli/riegeli/snappy/BUILD:5:11: Compiling riegeli/snappy/snappy_writer.cc failed: (Exit 2): cl.exe failed: error executing command C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE ... (remaining 28 arguments skipped) external/com_google_riegeli\riegeli/snappy/snappy_writer.h(298): error C2512: 'riegeli::Writer': no appropriate default constructor available external/com_google_riegeli\riegeli/bytes/writer.h(58): note: see declaration of 'riegeli::Writer' external/com_google_absl\absl/types/compare.h(49): error C2338: Only literal 0is allowed. external/com_google_absl\absl/types/optional.h(701): note: see reference to class template instantiation 'absl::lts_20211102::compare_internal::Fail<T>' being compiled with [ T=riegeli::Position ] ERROR: C:/users/XXXXX/_bazel_XXXXX/eqdzh4xg/external/com_google_riegeli/riegeli/chunk_encoding/BUILD:88:11: Compiling riegeli/chunk_encoding/compressor_options.cc failed: (Exit 2): cl.exe failed: error executing command C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE ... (remaining 31 arguments skipped) external/com_google_riegeli\riegeli/bytes/buffered_writer.h(151): error C2512: 'riegeli::Writer': no appropriate default constructor available external/com_google_riegeli\riegeli/bytes/writer.h(58): note: see declaration of 'riegeli::Writer'external/com_google_absl\absl/types/compare.h(49): error C2338: Only literal0 is allowed. external/com_google_absl\absl/types/optional.h(711): note: see reference to class template instantiation 'absl::lts_20211102::compare_internal::Fail<T>' being compiled with [ T=riegeli::Position ] Target //:print_names_and_sources failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 14.362s, Critical Path: 1.56s INFO: 35 processes: 16 internal, 19 local. FAILED: Build did NOT complete successfully FAILED: Build did NOT complete successfully

Hi, we've only tested on Linux and clang (and don't have Windows machines available to test other setups), but I think the most common causes of errors are old compiler versions that don't support C++ 17, other outdated libraries, or missing Python 2.7. Based on this error, I might guess that you need to update to a more recent version of VS studio? But I'm not entirely sure.