Closed rafalfaro18 closed 1 month ago
I also tried building in WSL instead after much debugging I eventually get this error about ambiguous NoDestructor overload:
ERROR: /home/rafalfaro/iamf-tools/iamf/cli/adm_to_user_metadata/adm/BUILD:43:11: Compiling iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc failed: (Exit 1): gcc failed: error executing CppCompile command (from target //iamf/cli/adm_to_user_metadata/adm:xml_to_adm) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 39 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc: In function 'bool iamf_tools::adm_to_user_metadata::{anonymous}::IsLoudspeakerLayoutValid(absl::string_view)':
iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc:199:8: error: call of overloaded 'NoDestructor(<brace-enclosed initializer list>)' is ambiguous
199 | });
| ^
In file included from iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc:24:
external/com_google_absl/absl/base/no_destructor.h:137:3: note: candidate: 'absl::NoDestructor<T>::NoDestructor(const absl::NoDestructor<T>&) [with T = absl::flat_hash_set<std::__cxx11::basic_string<char> >]' (deleted)
137 | NoDestructor(const NoDestructor&) = delete;
| ^~~~~~~~~~~~
external/com_google_absl/absl/base/no_destructor.h:133:22: note: candidate: 'constexpr absl::NoDestructor<T>::NoDestructor(T&&) [with T = absl::flat_hash_set<std::__cxx11::basic_string<char> >]'
133 | explicit constexpr NoDestructor(T&& x)
| ^~~~~~~~~~~~
external/com_google_absl/absl/base/no_destructor.h:132:22: note: candidate: 'constexpr absl::NoDestructor<T>::NoDestructor(const T&) [with T = absl::flat_hash_set<std::__cxx11::basic_string<char> >]'
132 | explicit constexpr NoDestructor(const T& x) : impl_(x) {}
| ^~~~~~~~~~~~
iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc: In function 'bool iamf_tools::adm_to_user_metadata::{anonymous}::IsHoaLayoutValid(absl::string_view)':
iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc:211:8: error: call of overloaded 'NoDestructor(<brace-enclosed initializer list>)' is ambiguous
211 | });
| ^
external/com_google_absl/absl/base/no_destructor.h:137:3: note: candidate: 'absl::NoDestructor<T>::NoDestructor(const absl::NoDestructor<T>&) [with T = absl::flat_hash_set<std::__cxx11::basic_string<char> >]' (deleted)
137 | NoDestructor(const NoDestructor&) = delete;
| ^~~~~~~~~~~~
external/com_google_absl/absl/base/no_destructor.h:133:22: note: candidate: 'constexpr absl::NoDestructor<T>::NoDestructor(T&&) [with T = absl::flat_hash_set<std::__cxx11::basic_string<char> >]'
133 | explicit constexpr NoDestructor(T&& x)
| ^~~~~~~~~~~~
external/com_google_absl/absl/base/no_destructor.h:132:22: note: candidate: 'constexpr absl::NoDestructor<T>::NoDestructor(const T&) [with T = absl::flat_hash_set<std::__cxx11::basic_string<char> >]'
132 | explicit constexpr NoDestructor(const T& x) : impl_(x) {}
| ^~~~~~~~~~~~
Target //iamf/cli:encoder_main failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 15.515s, Critical Path: 15.07s
INFO: 216 processes: 26 internal, 190 linux-sandbox.
ERROR: Build did NOT complete successfully
I think you may have not tested this project in while in a fresh windows or linux computer, in a fresh install of bazel. You may have been testing with the machine that already has all the dependencies or some specific setup that is not in the documentation for this project.
I also tried building in WSL instead after much debugging I eventually get this error about ambiguous NoDestructor overload:
ERROR: /home/rafalfaro/iamf-tools/iamf/cli/adm_to_user_metadata/adm/BUILD:43:11: Compiling iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc failed: (Exit 1): gcc failed: error executing CppCompile command (from target //iamf/cli/adm_to_user_metadata/adm:xml_to_adm) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 39 arguments skipped) Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc: In function 'bool iamf_tools::adm_to_user_metadata::{anonymous}::IsLoudspeakerLayoutValid(absl::string_view)': iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc:199:8: error: call of overloaded 'NoDestructor(<brace-enclosed initializer list>)' is ambiguous 199 | }); | ^ In file included from iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc:24: external/com_google_absl/absl/base/no_destructor.h:137:3: note: candidate: 'absl::NoDestructor<T>::NoDestructor(const absl::NoDestructor<T>&) [with T = absl::flat_hash_set<std::__cxx11::basic_string<char> >]' (deleted) 137 | NoDestructor(const NoDestructor&) = delete; | ^~~~~~~~~~~~ external/com_google_absl/absl/base/no_destructor.h:133:22: note: candidate: 'constexpr absl::NoDestructor<T>::NoDestructor(T&&) [with T = absl::flat_hash_set<std::__cxx11::basic_string<char> >]' 133 | explicit constexpr NoDestructor(T&& x) | ^~~~~~~~~~~~ external/com_google_absl/absl/base/no_destructor.h:132:22: note: candidate: 'constexpr absl::NoDestructor<T>::NoDestructor(const T&) [with T = absl::flat_hash_set<std::__cxx11::basic_string<char> >]' 132 | explicit constexpr NoDestructor(const T& x) : impl_(x) {} | ^~~~~~~~~~~~ iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc: In function 'bool iamf_tools::adm_to_user_metadata::{anonymous}::IsHoaLayoutValid(absl::string_view)': iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc:211:8: error: call of overloaded 'NoDestructor(<brace-enclosed initializer list>)' is ambiguous 211 | }); | ^ external/com_google_absl/absl/base/no_destructor.h:137:3: note: candidate: 'absl::NoDestructor<T>::NoDestructor(const absl::NoDestructor<T>&) [with T = absl::flat_hash_set<std::__cxx11::basic_string<char> >]' (deleted) 137 | NoDestructor(const NoDestructor&) = delete; | ^~~~~~~~~~~~ external/com_google_absl/absl/base/no_destructor.h:133:22: note: candidate: 'constexpr absl::NoDestructor<T>::NoDestructor(T&&) [with T = absl::flat_hash_set<std::__cxx11::basic_string<char> >]' 133 | explicit constexpr NoDestructor(T&& x) | ^~~~~~~~~~~~ external/com_google_absl/absl/base/no_destructor.h:132:22: note: candidate: 'constexpr absl::NoDestructor<T>::NoDestructor(const T&) [with T = absl::flat_hash_set<std::__cxx11::basic_string<char> >]' 132 | explicit constexpr NoDestructor(const T& x) : impl_(x) {} | ^~~~~~~~~~~~ Target //iamf/cli:encoder_main failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 15.515s, Critical Path: 15.07s INFO: 216 processes: 26 internal, 190 linux-sandbox. ERROR: Build did NOT complete successfully
I was able to compile by doing these changes: I know it's less efficient but hopefully it doesn't change the result.
Hi, thanks for working through this.
Currently this project is supported on Linux, but Windows/MSVC may come in the future. Contributions will be considered according to CONTRIBUTING.md
NoDestructor
issue:It looks like it may be getting confused with the string literals. The original NoDestructor
version may work if string literals are wrapped in std::string()
. Something like the below snippet and similar for the issue in IsLoudspeakerLayoutValid()
.
static const absl::NoDestructor<absl::flat_hash_set<std::string>>
kValidHoaLayouts({
std::string("0001"), // First-order ambisonics.
std::string("0002"), // Second-order ambisonics.
std::string("0003"), // Third-order ambisonics.
});
Can you help gather some information about your compiler settings? Please run these commands in WSL
gcc --version
--verbose_failures
.For the second command I am mainly curious about the flags passed to gcc. The original error message had "39 arguments skipped".
Compiling iamf/cli/adm_to_user_metadata/adm/xml_to_adm.cc failed: (Exit 1): gcc failed: error executing CppCompile command (from target //iamf/cli/adm_to_user_metadata/adm:xml_to_adm) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 39 arguments skipped)
@rafalfaro18, does it work at 57d81681 on WSL without any manual modifications?
I ran into the "NoDestructor" issue when configuring a GitHub Actions CI build. I made a slight change to those sections. I expect the changes will also work in your WSL environment.
I'll test tonight and let you know.
57d8168
Does compile without modifications. I think I just installed sudo apt-get install libexpat1-dev
besides cmake.
gcc --version
gcc --version
gcc (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Does compile without modifications. I think I just installed
sudo apt-get install libexpat1-dev
besides cmake.
60d7fab also builds without changes.
Thanks for working through this. I made a separate issue to track native windows/MSVC builds. Now we have newly added CI which has a very minimal config for Linux.
I'll investigate if libexpat1-dev
and cmake
are required. We try to pull in all dependencies in WORKSPACE and build them with bazel build files. They may or may not be required.
Ok looks like libexpat1-dev
may be required because it provides expat_config.h
. So for now that is a pre-requisite. We may be able to update the build to generate it at build time though.
I keep getting errors about invalid numeric arguments in Windows: