Skip to content

fuzztest/internal/subprocess.cc compile fail #1845

@Mizux

Description

@Mizux

Context, in google/or-tools when bumping abseil-cpp to 20250814.0 we had to bump fuzztest to 2025-08-05 to avoid compilation error in our bazel build BUT in cmake based build (which compile everything ie all cmake targets) I got this trace:

CMake Trace

# from ortools super build project
$ cmake -S. -Bbuild -DBUILD_DEPS=ON
$ cmake --build build --config Release
...
[ 82%] Building CXX object _deps/fuzztest-build/fuzztest/internal/CMakeFiles/fuzztest_subprocess.dir/subprocess.cc.o
In file included from /usr/local/google/home/corentinl/work/main/build/_deps/fuzztest-src/fuzztest/internal/subprocess.cc:15:
/usr/local/google/home/corentinl/work/main/build/_deps/fuzztest-src/./fuzztest/internal/subprocess.h:112:27: error: converting to ‘const std::optional<absl::lts_20250814::flat_hash_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >’ from initializer list would use explicit constructor ‘constexpr std::optional<_Tp>::optional(std::in_place_t, _Args&& ...) [with _Args = {}; typename std::enable_if<__and_v<std::is_constructible<_Tp, _Args ...> >, bool>::type <anonymous> = false; _Tp = absl::lts_20250814::flat_hash_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >]’
  112 |         environment = {{}});
      |                           ^
In file included from /usr/local/google/home/corentinl/work/main/build/_deps/fuzztest-src/./fuzztest/internal/subprocess.h:19:
/usr/include/c++/14/optional:813:9: note: ‘constexpr std::optional<_Tp>::optional(std::in_place_t, _Args&& ...) [with _Args = {}; typename std::enable_if<__and_v<std::is_constructible<_Tp, _Args ...> >, bool>::type <anonymous> = false; _Tp = absl::lts_20250814::flat_hash_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >]’ declared here
  813 |         optional(in_place_t, _Args&&... __args)
      |         ^~~~~~~~
/usr/local/google/home/corentinl/work/main/build/_deps/fuzztest-src/./fuzztest/internal/subprocess.h:112:27: error: converting to ‘std::in_place_t’ from initializer list would use explicit constructor ‘constexpr std::in_place_t::in_place_t()’
  112 |         environment = {{}});
      |                           ^
In file included from /usr/include/c++/14/bits/stl_pair.h:62,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from /usr/local/google/home/corentinl/work/main/build/_deps/fuzztest-src/./fuzztest/internal/subprocess.h:18:
/usr/include/c++/14/bits/utility.h:196:14: note: ‘constexpr std::in_place_t::in_place_t()’ declared here
  196 |     explicit in_place_t() = default;
      |              ^~~~~~~~~~
/usr/local/google/home/corentinl/work/main/build/_deps/fuzztest-src/./fuzztest/internal/subprocess.h:124:54: error: converting to ‘const std::optional<absl::lts_20250814::flat_hash_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >’ from initializer list would use explicit constructor ‘constexpr std::optional<_Tp>::optional(std::in_place_t, _Args&& ...) [with _Args = {}; typename std::enable_if<__and_v<std::is_constructible<_Tp, _Args ...> >, bool>::type <anonymous> = false; _Tp = absl::lts_20250814::flat_hash_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >]’
  124 |     absl::Duration timeout = absl::InfiniteDuration());
      |                                                      ^
/usr/include/c++/14/optional:813:9: note: ‘constexpr std::optional<_Tp>::optional(std::in_place_t, _Args&& ...) [with _Args = {}; typename std::enable_if<__and_v<std::is_constructible<_Tp, _Args ...> >, bool>::type <anonymous> = false; _Tp = absl::lts_20250814::flat_hash_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >]’ declared here
  813 |         optional(in_place_t, _Args&&... __args)
      |         ^~~~~~~~
/usr/local/google/home/corentinl/work/main/build/_deps/fuzztest-src/./fuzztest/internal/subprocess.h:124:54: error: converting to ‘std::in_place_t’ from initializer list would use explicit constructor ‘constexpr std::in_place_t::in_place_t()’
  124 |     absl::Duration timeout = absl::InfiniteDuration());
      |                                                      ^
/usr/include/c++/14/bits/utility.h:196:14: note: ‘constexpr std::in_place_t::in_place_t()’ declared here
  196 |     explicit in_place_t() = default;
      |              ^~~~~~~~~~
gmake[2]: *** [_deps/fuzztest-build/fuzztest/internal/CMakeFiles/fuzztest_subprocess.dir/build.make:76: _deps/fuzztest-build/fuzztest/internal/CMakeFiles/fuzztest_subprocess.dir/subprocess.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:13802: _deps/fuzztest-build/fuzztest/internal/CMakeFiles/fuzztest_subprocess.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2

note: In CMake we had to apply a patch to fuzztest
https://github.com/google/or-tools/blob/main/patches/fuzztest-2025-08-05.patch

Bazel trace

I can also reproduce in our Bazel based build using the following cmd:

$ bazel build -c opt @fuzztest//fuzztest/internal:subprocess
INFO: Reading 'startup' options from /usr/local/google/home/corentinl/work/main/.bazelrc: --windows_enable_symlinks
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=255
INFO: Reading rc options for 'build' from /usr/local/google/home/corentinl/work/main/.bazelrc:
  Inherited 'common' options: --announce_rc
INFO: Reading rc options for 'build' from /usr/local/google/home/corentinl/work/main/.bazelrc:
  'build' options: --flag_alias=with_bop=//ortools/linear_solver:with_bop --flag_alias=with_cbc=//ortools/linear_solver:with_cbc --flag_alias=with_clp=//ortools/linear_solver:with_clp --flag_alias=with_cp_sat=//ortools/linear_solver:with_cp_sat --flag_alias=with_glop=//ortools/linear_solver:with_glop --flag_alias=with_glpk=//ortools/linear_solver:with_glpk --flag_alias=with_highs=//ortools/linear_solver:with_highs --flag_alias=with_pdlp=//ortools/linear_solver:with_pdlp --flag_alias=with_scip=//ortools/linear_solver:with_scip --flag_alias=with_cplex=//ortools/linear_solver:with_cplex --flag_alias=with_xpress=//ortools/linear_solver:with_xpress --apple_platform_type=macos --enable_platform_specific_config --@rules_python//python/config_settings:python_version=3.12 --define absl=1
INFO: Found applicable config definition build:linux in file /usr/local/google/home/corentinl/work/main/.bazelrc: --cxxopt=-std=c++17 --cxxopt=-Wno-sign-compare --host_cxxopt=-std=c++17 --host_cxxopt=-Wno-sign-compare
INFO: Analyzed target @@fuzztest+//fuzztest/internal:subprocess (32 packages loaded, 160 targets configured).
ERROR: /usr/local/google/home/corentinl/.cache/bazel/_bazel_corentinl/c0610bdf3f9b7ba3884cc6008a86d79e/external/fuzztest+/fuzztest/internal/BUILD:453:11: Compiling fuzztest/internal/subprocess.cc failed: (Exit 1): gcc failed: error executing CppCompile command (from target @@fuzztest+//fuzztest/internal:subprocess) /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 26 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/fuzztest+/fuzztest/internal/subprocess.cc:15:
external/fuzztest+/./fuzztest/internal/subprocess.h:112:27: error: converting to 'const std::optional<absl::lts_20250814::flat_hash_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >' from initializer list would use explicit constructor 'constexpr std::optional<_Tp>::optional(std::in_place_t, _Args&& ...) [with _Args = {}; typename std::enable_if<__and_v<std::is_constructible<_Tp, _Args ...> >, bool>::type <anonymous> = false; _Tp = absl::lts_20250814::flat_hash_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >]'
  112 |         environment = {{}});
      |                           ^
In file included from external/fuzztest+/./fuzztest/internal/subprocess.h:19:
/usr/include/c++/14/optional:813:9: note: 'constexpr std::optional<_Tp>::optional(std::in_place_t, _Args&& ...) [with _Args = {}; typename std::enable_if<__and_v<std::is_constructible<_Tp, _Args ...> >, bool>::type <anonymous> = false; _Tp = absl::lts_20250814::flat_hash_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >]' declared here
  813 |         optional(in_place_t, _Args&&... __args)
      |         ^~~~~~~~
external/fuzztest+/./fuzztest/internal/subprocess.h:112:27: error: converting to 'std::in_place_t' from initializer list would use explicit constructor 'constexpr std::in_place_t::in_place_t()'
  112 |         environment = {{}});
      |                           ^
In file included from /usr/include/c++/14/bits/stl_pair.h:62,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from external/fuzztest+/./fuzztest/internal/subprocess.h:18:
/usr/include/c++/14/bits/utility.h:196:14: note: 'constexpr std::in_place_t::in_place_t()' declared here
  196 |     explicit in_place_t() = default;
      |              ^~~~~~~~~~
external/fuzztest+/./fuzztest/internal/subprocess.h:124:54: error: converting to 'const std::optional<absl::lts_20250814::flat_hash_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >' from initializer list would use explicit constructor 'constexpr std::optional<_Tp>::optional(std::in_place_t, _Args&& ...) [with _Args = {}; typename std::enable_if<__and_v<std::is_constructible<_Tp, _Args ...> >, bool>::type <anonymous> = false; _Tp = absl::lts_20250814::flat_hash_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >]'
  124 |     absl::Duration timeout = absl::InfiniteDuration());
      |                                                      ^
/usr/include/c++/14/optional:813:9: note: 'constexpr std::optional<_Tp>::optional(std::in_place_t, _Args&& ...) [with _Args = {}; typename std::enable_if<__and_v<std::is_constructible<_Tp, _Args ...> >, bool>::type <anonymous> = false; _Tp = absl::lts_20250814::flat_hash_map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >]' declared here
  813 |         optional(in_place_t, _Args&&... __args)
      |         ^~~~~~~~
external/fuzztest+/./fuzztest/internal/subprocess.h:124:54: error: converting to 'std::in_place_t' from initializer list would use explicit constructor 'constexpr std::in_place_t::in_place_t()'
  124 |     absl::Duration timeout = absl::InfiniteDuration());
      |                                                      ^
/usr/include/c++/14/bits/utility.h:196:14: note: 'constexpr std::in_place_t::in_place_t()' declared here
  196 |     explicit in_place_t() = default;
      |              ^~~~~~~~~~
Target @@fuzztest+//fuzztest/internal:subprocess failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.762s, Critical Path: 1.25s
INFO: 4 processes: 4 internal.
ERROR: Build did NOT complete successfully

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions