root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
https://root.cern
Other
2.7k stars 1.28k forks source link

`runtime_cxxmodules` fails to build with GCC12 #10478

Closed dennisklein closed 2 years ago

dennisklein commented 2 years ago
❯ cat reproducer.def
Bootstrap: docker
From: fedora:36

%post
    dnf -y update
    dnf -y install git make cmake gcc-c++ gcc binutils ninja-build \
      libX11-devel libXpm-devel libXft-devel libXext-devel python openssl-devel
    dnf -y clean all

    mkdir /reproducer && cd /reproducer
    git clone -b master --depth 1 http://github.com/root-project/root source
    git -C source log
    gcc --version
    cmake -GNinja -S source -B build -Dxrootd=OFF
    cmake --build build
❯ singularity --version
singularity version 3.8.7-1.fc35
❯ singularity build -f reproducer.sif reproducer.def
(...skip...)
+ mkdir /reproducer
+ cd /reproducer
+ git clone -b master --depth 1 http://github.com/root-project/root source
Cloning into 'source'...
(...skip...)
+ git -C source log
commit 9c12a2a4e707ee75f37bde96772ab53e94f01033 (grafted, HEAD -> master, origin/master, origin/HEAD)
Author: Jonas Rembser <jonas.rembser@cern.ch>
Date:   Mon Apr 25 11:58:45 2022 +0200

    [RF] Also compare parameter errors in RooFitResult::isIdentical(NoCov)

    The `RooFitResult::isIdentical` method so far only compared parameter
    values and covariance matrix values. Even though comparing the final
    parameter errors would be redundant with the covariance matrix checks,
    it's still important to check parameter errors for two reasons:

      1. Initial parameter errors need to be compared, because the the
         initial error determins the initial step size which influences the
         minimization path. If initial errors are different, the final
         parameter values are almost never identical.

         Catching differences in initial parameter errors informs the user
         that differences in fit result are because of the starting
         conditions.

      2. In the case of `RooFitResult::isIdenticalNoCov`, we need to check
         the error of final parameters because there is no comparison of
         covariance matrix values.

    The signature of the public function `isIdenticalNoCov` is extended by a
    tolerance parameter for the error comparison. This is expected to not
    break user code, because the function was only introduced in 6.26 and is
    so far only used in a single unit test (`testSumW2Error`).

    The `testRooAbsPdf` unit test didn't reset the initial parameter errors
    correctly, which is now fixed.
+ gcc --version
gcc (GCC) 12.0.1 20220413 (Red Hat 12.0.1-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.

+ cmake -GNinja -S source -B build -Dxrootd=OFF
(...skip...)
-- ROOT Configuration

System          Linux-5.16.9-200.rog.fc35.x86_64
Processor       8 core AMD Ryzen 7 5800HS with Radeon Graphics (x86_64)
Build type      Release
Install path    /usr/local
Compiler        GNU 12.0.1
Compiler flags:
C                -fdiagnostics-color=always -Wno-implicit-fallthrough -pipe -Wall -W -pthread -O3 -DNDEBUG
C++              -fdiagnostics-color=always -std=c++17 -Wno-implicit-fallthrough -Wno-noexcept-type -pipe  -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -DNDEBUG
Linker flags:
Executable       -rdynamic
Module
Shared           -Wl,--no-undefined -Wl,--hash-style="both"

-- Enabled support for:  asimage builtin_afterimage builtin_clang builtin_cling builtin_llvm builtin_lz4 builtin_nlohmannjson builtin_openui5 builtin_tbb builtin_vdt builtin_xxhash builtin_zstd clad dataframe exceptions gdml http imt mlp minuit2 roofit webgui root7 rpath runtime_cxxmodules shared ssl tmva spectrum vdt x11 xml
-- Configuring done
-- Generating done
-- Build files have been written to: /reproducer/build
+ cmake --build build
(...skip...)
[7047/9103] Generating G__Core.cxx, ../lib/Core.pcm
FAILED: core/G__Core.cxx lib/Core.pcm /reproducer/build/core/G__Core.cxx /reproducer/build/lib/Core.pcm
cd /reproducer/build/core && /usr/bin/cmake -E env LD_LIBRARY_PATH=/reproducer/build/lib:/.singularity.d/libs /reproducer/build/core/rootcling_stage1/src/rootcling_stage1 -v2 -f G__Core.cxx -cxxmodule -s /reproducer/build/lib/libCore.so -excludePath /reproducer/source -excludePath /reproducer/build/ginclude -excludePath /reproducer/build/externals -excludePath /reproducer/build/builtins -writeEmptyRootPCM -m _Builtin_intrinsics -mByproduct _Builtin_intrinsics -mByproduct ROOT_Foundation_Stage1_NoRTTI -mByproduct ROOT_Foundation_C -mByproduct ROOT_Rtypes -D__STDC_NO_COMPLEX__ -D__COMPLEX_H__ -D_COMPLEX_H -D__CLANG_STDATOMIC_H -compilerI/usr/include/c++/12 -compilerI/usr/include/c++/12/x86_64-redhat-linux -compilerI/usr/include/c++/12/backward -compilerI/usr/lib/gcc/x86_64-redhat-linux/12/include -compilerI/usr/local/include -compilerI/usr/include -compilerI/usr/lib/gcc/x86_64-redhat-linux/12/include -compilerI/usr/local/include -compilerI/usr/include -I/reproducer/build/include -I/reproducer/build/ginclude -I/reproducer/source/core/base/inc -I/reproducer/source/core/foundation/inc -I/reproducer/source/core/cont/inc -I/reproducer/source/core/gui/inc -I/reproducer/source/core/meta/inc -I/reproducer/source/core/clib/inc -I/reproducer/source/core/rint/inc -I/reproducer/source/core/zip/inc -I/reproducer/source/core/thread/inc -I/reproducer/source/core/textinput/inc -I/reproducer/source/core/clingutils/inc -I/reproducer/source/core/base/v7/inc -I/reproducer/source/core/foundation/v7/inc -I/reproducer/source/core/unix/inc -I/usr/include -I/reproducer/source/builtins/xxhash -I/reproducer/source/builtins/lz4 -I/reproducer/source/builtins/zstd ROOT/TErrorDefaultHandler.hxx ROOT/TSequentialExecutor.hxx ROOT/StringConv.hxx Buttons.h Bytes.h Byteswap.h KeySymbols.h MessageTypes.h Riostream.h Rtypes.h TApplication.h TAtt3D.h TAttAxis.h TAttBBox2D.h TAttBBox.h TAttFill.h TAttLine.h TAttMarker.h TAttPad.h TAttText.h TBase64.h TBenchmark.h TBuffer3D.h TBuffer3DTypes.h TBuffer.h TColor.h TColorGradient.h TDatime.h TDirectory.h TEnv.h TException.h TExec.h TFileCollection.h TFileInfo.h TFolder.h TInetAddress.h TMacro.h TMathBase.h TMD5.h TMemberInspector.h TMessageHandler.h TNamed.h TNotifyLink.h TObject.h TObjString.h TParameter.h TPluginManager.h TPoint.h TPRegexp.h TProcessID.h TProcessUUID.h TQClass.h TQCommand.h TQConnection.h TQObject.h TRedirectOutputGuard.h TRefCnt.h TRef.h TRegexp.h TRemoteObject.h TROOT.h TRootIOCtor.h TStopwatch.h TStorage.h TString.h TStringLong.h TStyle.h TSysEvtHandler.h TSystemDirectory.h TSystemFile.h TSystem.h TTask.h TThreadSlots.h TTime.h TTimer.h TTimeStamp.h TUri.h TUrl.h TUUID.h TVersionCheck.h TVirtualAuth.h TVirtualFFT.h TVirtualGL.h TVirtualMonitoring.h TVirtualMutex.h TVirtualPadEditor.h TVirtualPad.h TVirtualPadPainter.h TVirtualPerfStats.h TVirtualPS.h TVirtualQConnection.h TVirtualRWMutex.h TVirtualTableInterface.h TVirtualViewer3D.h TVirtualX.h ROOT/RDirectoryEntry.hxx ROOT/RIndexIter.hxx strlcpy.h snprintf.h strtok.h ROOT/TSeq.hxx TArrayC.h TArrayD.h TArrayF.h TArray.h TArrayI.h TArrayL64.h TArrayL.h TArrayS.h TBits.h TBtree.h TClassTable.h TClonesArray.h TCollection.h TCollectionProxyInfo.h TExMap.h THashList.h THashTable.h TIterator.h TList.h TMap.h TObjArray.h TObjectTable.h TOrdCollection.h TRefArray.h TRefTable.h TSeqCollection.h TSortedList.h TVirtualCollectionProxy.h ESTLType.h RStringView.h TClassEdit.h TError.h ROOT/RLogger.hxx ROOT/RNotFn.hxx ROOT/RRangeCast.hxx ROOT/RSpan.hxx ROOT/RStringView.hxx ROOT/StringUtils.hxx ROOT/span.hxx ROOT/TypeTraits.hxx TUnixSystem.h root_std_complex.h GuiTypes.h TApplicationImp.h TBrowser.h TBrowserImp.h TCanvasImp.h TClassMenuItem.h TContextMenu.h TContextMenuImp.h TControlBarImp.h TGuiFactory.h TInspectorImp.h TObjectSpy.h TToggleGroup.h TToggle.h TBaseClass.h TClassGenerator.h TClass.h TClassRef.h TClassStreamer.h TDataMember.h TDataType.h TDictAttributeMap.h TDictionary.h TEnumConstant.h TEnum.h TFileMergeInfo.h TFunction.h TFunctionTemplate.h TGenericClassInfo.h TGlobal.h TInterpreter.h TInterpreterValue.h TIsAProxy.h TListOfDataMembers.h TListOfEnums.h TListOfEnumsWithLock.h TListOfFunctions.h TListOfFunctionTemplates.h TMemberStreamer.h TMethodArg.h TMethodCall.h TMethod.h TProtoClass.h TRealData.h TSchemaHelper.h TSchemaRule.h TSchemaRuleSet.h TStatusBitsChecker.h TStreamerElement.h TStreamer.h TVirtualIsAProxy.h TVirtualRefProxy.h TVirtualStreamerInfo.h TVirtualArray.h TVirtualObject.h Getline.h /reproducer/source/core/base/inc/LinkDef.h
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:2:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/array:43:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:62:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/utility.h:220:27: error: redefinition of '__is_in_place_type_v<in_place_type_t<_Tp> >'
    inline constexpr bool __is_in_place_type_v<in_place_type_t<_Tp>> = true;
                          ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:62:11: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/utility.h' included multiple times, additional include site in header from module 'std.algorithm'
# include <bits/utility.h> // for std::tuple_element, std::tuple_size
          ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:62:11: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/utility.h' included multiple times, additional include site in header from module 'std.array'
# include <bits/utility.h> // for std::tuple_element, std::tuple_size
          ^
/reproducer/build/etc/cling/std.modulemap:9:10: note: std.array defined here
  module "array" {
         ^
(...skip many more...)

Building with -Druntime_cxxmodules=OFF succeeds.

Note: Details for the GCC 12.0.1 used above.

full_log.txt

vgvassilev commented 2 years ago

@dennisklein, thanks for the report. Can you apply this patch and check if it still does not work for you?

diff --git a/interpreter/cling/include/cling/std.modulemap b/interpreter/cling/include/cling/std.modulemap
index 5498b949c5..c82959a440 100644
--- a/interpreter/cling/include/cling/std.modulemap
+++ b/interpreter/cling/include/cling/std.modulemap
@@ -428,4 +428,8 @@ module "std" [system] {
     export *
     header "bits/stl_tree.h"
   }
+  module "bits/utility.h" {
+    export *
+    header "bits/utility.h"
+  }
 }
dennisklein commented 2 years ago

The error message changed, but there is more needed, it seems:

❯ cat reproducer.def
Bootstrap: docker
From: fedora:36

%post
    dnf -y update
    dnf -y install git make cmake gcc-c++ gcc binutils ninja-build patch \
      libX11-devel libXpm-devel libXft-devel libXext-devel python openssl-devel
    dnf -y clean all

    mkdir /reproducer && cd /reproducer
    git clone -b master --depth 1 http://github.com/root-project/root source
    git -C source log
    patch -d source -p1 <<EoF
diff --git a/interpreter/cling/include/cling/std.modulemap b/interpreter/cling/include/cling/std.modulemap
index 5498b949c5..c82959a440 100644
--- a/interpreter/cling/include/cling/std.modulemap
+++ b/interpreter/cling/include/cling/std.modulemap
@@ -428,4 +428,8 @@ module "std" [system] {
     export *
     header "bits/stl_tree.h"
   }
+  module "bits/utility.h" {
+    export *
+    header "bits/utility.h"
+  }
 }
EoF
    cmake -GNinja -S source -B build -Dxrootd=OFF
    cmake --build build

-->

FAILED: core/G__Core.cxx lib/Core.pcm /reproducer/build/core/G__Core.cxx /reproducer/build/lib/Core.pcm
cd /reproducer/build/core && /usr/bin/cmake -E env LD_LIBRARY_PATH=/reproducer/build/lib:/.singularity.d/libs /reproducer/build/core/rootcling_stage1/src/rootcling_stage1 -v2 -f G__Core.cxx -cxxmodule -s /reproducer/build/lib/libCore.so -excludePath /reproducer/source -excludePath /reproducer/build/ginclude -excludePath /reproducer/build/externals -excludePath /reproducer/build/builtins -writeEmptyRootPCM -m _Builtin_intrinsics -mByproduct _Builtin_intrinsics -mByproduct ROOT_Foundation_Stage1_NoRTTI -mByproduct ROOT_Foundation_C -mByproduct ROOT_Rtypes -D__STDC_NO_COMPLEX__ -D__COMPLEX_H__ -D_COMPLEX_H -D__CLANG_STDATOMIC_H -compilerI/usr/include/c++/12 -compilerI/usr/include/c++/12/x86_64-redhat-linux -compilerI/usr/include/c++/12/backward -compilerI/usr/lib/gcc/x86_64-redhat-linux/12/include -compilerI/usr/local/include -compilerI/usr/include -compilerI/usr/lib/gcc/x86_64-redhat-linux/12/include -compilerI/usr/local/include -compilerI/usr/include -I/reproducer/build/include -I/reproducer/build/ginclude -I/reproducer/source/core/base/inc -I/reproducer/source/core/foundation/inc -I/reproducer/source/core/cont/inc -I/reproducer/source/core/gui/inc -I/reproducer/source/core/meta/inc -I/reproducer/source/core/clib/inc -I/reproducer/source/core/rint/inc -I/reproducer/source/core/zip/inc -I/reproducer/source/core/thread/inc -I/reproducer/source/core/textinput/inc -I/reproducer/source/core/clingutils/inc -I/reproducer/source/core/base/v7/inc -I/reproducer/source/core/foundation/v7/inc -I/reproducer/source/core/unix/inc -I/usr/include -I/reproducer/source/builtins/xxhash -I/reproducer/source/builtins/lz4 -I/reproducer/source/builtins/zstd ROOT/TErrorDefaultHandler.hxx ROOT/TSequentialExecutor.hxx ROOT/StringConv.hxx Buttons.h Bytes.h Byteswap.h KeySymbols.h MessageTypes.h Riostream.h Rtypes.h TApplication.h TAtt3D.h TAttAxis.h TAttBBox2D.h TAttBBox.h TAttFill.h TAttLine.h TAttMarker.h TAttPad.h TAttText.h TBase64.h TBenchmark.h TBuffer3D.h TBuffer3DTypes.h TBuffer.h TColor.h TColorGradient.h TDatime.h TDirectory.h TEnv.h TException.h TExec.h TFileCollection.h TFileInfo.h TFolder.h TInetAddress.h TMacro.h TMathBase.h TMD5.h TMemberInspector.h TMessageHandler.h TNamed.h TNotifyLink.h TObject.h TObjString.h TParameter.h TPluginManager.h TPoint.h TPRegexp.h TProcessID.h TProcessUUID.h TQClass.h TQCommand.h TQConnection.h TQObject.h TRedirectOutputGuard.h TRefCnt.h TRef.h TRegexp.h TRemoteObject.h TROOT.h TRootIOCtor.h TStopwatch.h TStorage.h TString.h TStringLong.h TStyle.h TSysEvtHandler.h TSystemDirectory.h TSystemFile.h TSystem.h TTask.h TThreadSlots.h TTime.h TTimer.h TTimeStamp.h TUri.h TUrl.h TUUID.h TVersionCheck.h TVirtualAuth.h TVirtualFFT.h TVirtualGL.h TVirtualMonitoring.h TVirtualMutex.h TVirtualPadEditor.h TVirtualPad.h TVirtualPadPainter.h TVirtualPerfStats.h TVirtualPS.h TVirtualQConnection.h TVirtualRWMutex.h TVirtualTableInterface.h TVirtualViewer3D.h TVirtualX.h ROOT/RDirectoryEntry.hxx ROOT/RIndexIter.hxx strlcpy.h snprintf.h strtok.h ROOT/TSeq.hxx TArrayC.h TArrayD.h TArrayF.h TArray.h TArrayI.h TArrayL64.h TArrayL.h TArrayS.h TBits.h TBtree.h TClassTable.h TClonesArray.h TCollection.h TCollectionProxyInfo.h TExMap.h THashList.h THashTable.h TIterator.h TList.h TMap.h TObjArray.h TObjectTable.h TOrdCollection.h TRefArray.h TRefTable.h TSeqCollection.h TSortedList.h TVirtualCollectionProxy.h ESTLType.h RStringView.h TClassEdit.h TError.h ROOT/RLogger.hxx ROOT/RNotFn.hxx ROOT/RRangeCast.hxx ROOT/RSpan.hxx ROOT/RStringView.hxx ROOT/StringUtils.hxx ROOT/span.hxx ROOT/TypeTraits.hxx TUnixSystem.h root_std_complex.h GuiTypes.h TApplicationImp.h TBrowser.h TBrowserImp.h TCanvasImp.h TClassMenuItem.h TContextMenu.h TContextMenuImp.h TControlBarImp.h TGuiFactory.h TInspectorImp.h TObjectSpy.h TToggleGroup.h TToggle.h TBaseClass.h TClassGenerator.h TClass.h TClassRef.h TClassStreamer.h TDataMember.h TDataType.h TDictAttributeMap.h TDictionary.h TEnumConstant.h TEnum.h TFileMergeInfo.h TFunction.h TFunctionTemplate.h TGenericClassInfo.h TGlobal.h TInterpreter.h TInterpreterValue.h TIsAProxy.h TListOfDataMembers.h TListOfEnums.h TListOfEnumsWithLock.h TListOfFunctions.h TListOfFunctionTemplates.h TMemberStreamer.h TMethodArg.h TMethodCall.h TMethod.h TProtoClass.h TRealData.h TSchemaHelper.h TSchemaRule.h TSchemaRuleSet.h TStatusBitsChecker.h TStreamerElement.h TStreamer.h TVirtualIsAProxy.h TVirtualRefProxy.h TVirtualStreamerInfo.h TVirtualArray.h TVirtualObject.h Getline.h /reproducer/source/core/base/inc/LinkDef.h
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:2:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/array:43:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:781:29: error: redefinition of 'tuple_size_v<pair<_Tp1, _Tp2> >'
    inline constexpr size_t tuple_size_v<pair<_Tp1, _Tp2>> = 2;
                            ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.array'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:9:10: note: std.array defined here
  module "array" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:2:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/array:43:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:784:29: error: redefinition of 'tuple_size_v<const pair<_Tp1, _Tp2> >'
    inline constexpr size_t tuple_size_v<const pair<_Tp1, _Tp2>> = 2;
                            ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.array'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:9:10: note: std.array defined here
  module "array" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:2:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/array:43:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:790:27: error: redefinition of '__is_pair<pair<_Tp, _Up> >'
    inline constexpr bool __is_pair<pair<_Tp, _Up>> = true;
                          ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.array'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:9:10: note: std.array defined here
  module "array" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:2:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/array:43:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:793:27: error: redefinition of '__is_pair<const pair<_Tp, _Up> >'
    inline constexpr bool __is_pair<const pair<_Tp, _Up>> = true;
                          ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.array'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:9:10: note: std.array defined here
  module "array" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:4:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bitset:47:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/string:50:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:781:29: error: redefinition of 'tuple_size_v<pair<_Tp1, _Tp2> >'
    inline constexpr size_t tuple_size_v<pair<_Tp1, _Tp2>> = 2;
                            ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.string'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:306:10: note: std.string defined here
  module "string" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:4:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bitset:47:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/string:50:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:784:29: error: redefinition of 'tuple_size_v<const pair<_Tp1, _Tp2> >'
    inline constexpr size_t tuple_size_v<const pair<_Tp1, _Tp2>> = 2;
                            ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.string'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:306:10: note: std.string defined here
  module "string" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:4:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bitset:47:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/string:50:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:790:27: error: redefinition of '__is_pair<pair<_Tp, _Up> >'
    inline constexpr bool __is_pair<pair<_Tp, _Up>> = true;
                          ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.string'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:306:10: note: std.string defined here
  module "string" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:4:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bitset:47:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/string:50:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:793:27: error: redefinition of '__is_pair<const pair<_Tp, _Up> >'
    inline constexpr bool __is_pair<const pair<_Tp, _Up>> = true;
                          ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.string'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:306:10: note: std.string defined here
  module "string" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:5:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/ccomplex:39:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/complex:44:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/cmath:1935:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/specfun.h:45:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:781:29: error: redefinition of 'tuple_size_v<pair<_Tp1, _Tp2> >'
    inline constexpr size_t tuple_size_v<pair<_Tp1, _Tp2>> = 2;
                            ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.cmath'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:62:10: note: std.cmath defined here
  module "cmath" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:5:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/ccomplex:39:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/complex:44:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/cmath:1935:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/specfun.h:45:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:784:29: error: redefinition of 'tuple_size_v<const pair<_Tp1, _Tp2> >'
    inline constexpr size_t tuple_size_v<const pair<_Tp1, _Tp2>> = 2;
                            ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.cmath'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:62:10: note: std.cmath defined here
  module "cmath" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:5:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/ccomplex:39:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/complex:44:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/cmath:1935:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/specfun.h:45:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:790:27: error: redefinition of '__is_pair<pair<_Tp, _Up> >'
    inline constexpr bool __is_pair<pair<_Tp, _Up>> = true;
                          ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.cmath'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:62:10: note: std.cmath defined here
  module "cmath" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:5:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/ccomplex:39:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/complex:44:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/cmath:1935:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/specfun.h:45:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:793:27: error: redefinition of '__is_pair<const pair<_Tp, _Up> >'
    inline constexpr bool __is_pair<const pair<_Tp, _Up>> = true;
                          ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.cmath'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:62:10: note: std.cmath defined here
  module "cmath" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:18:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/condition_variable:42:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/shared_ptr.h:53:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/shared_ptr_base.h:59:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:36:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/tuple:38:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:781:29: error: redefinition of 'tuple_size_v<pair<_Tp1, _Tp2> >'
    inline constexpr size_t tuple_size_v<pair<_Tp1, _Tp2>> = 2;
                            ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/tuple:38:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.tuple'
#include <bits/stl_pair.h>              // for std::pair
         ^
/reproducer/build/etc/cling/std.modulemap:332:10: note: std.tuple defined here
  module "tuple" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:18:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/condition_variable:42:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/shared_ptr.h:53:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/shared_ptr_base.h:59:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:36:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/tuple:38:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:784:29: error: redefinition of 'tuple_size_v<const pair<_Tp1, _Tp2> >'
    inline constexpr size_t tuple_size_v<const pair<_Tp1, _Tp2>> = 2;
                            ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/tuple:38:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.tuple'
#include <bits/stl_pair.h>              // for std::pair
         ^
/reproducer/build/etc/cling/std.modulemap:332:10: note: std.tuple defined here
  module "tuple" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:18:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/condition_variable:42:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/shared_ptr.h:53:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/shared_ptr_base.h:59:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:36:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/tuple:38:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:790:27: error: redefinition of '__is_pair<pair<_Tp, _Up> >'
    inline constexpr bool __is_pair<pair<_Tp, _Up>> = true;
                          ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/tuple:38:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.tuple'
#include <bits/stl_pair.h>              // for std::pair
         ^
/reproducer/build/etc/cling/std.modulemap:332:10: note: std.tuple defined here
  module "tuple" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:18:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/condition_variable:42:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/shared_ptr.h:53:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/shared_ptr_base.h:59:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:36:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/tuple:38:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:793:27: error: redefinition of '__is_pair<const pair<_Tp, _Up> >'
    inline constexpr bool __is_pair<const pair<_Tp, _Up>> = true;
                          ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/tuple:38:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.tuple'
#include <bits/stl_pair.h>              // for std::pair
         ^
/reproducer/build/etc/cling/std.modulemap:332:10: note: std.tuple defined here
  module "tuple" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:33:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/deque:60:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:781:29: error: redefinition of 'tuple_size_v<pair<_Tp1, _Tp2> >'
    inline constexpr size_t tuple_size_v<pair<_Tp1, _Tp2>> = 2;
                            ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.deque'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:149:10: note: std.deque defined here
  module "deque" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:33:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/deque:60:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:784:29: error: redefinition of 'tuple_size_v<const pair<_Tp1, _Tp2> >'
    inline constexpr size_t tuple_size_v<const pair<_Tp1, _Tp2>> = 2;
                            ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.deque'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:149:10: note: std.deque defined here
  module "deque" {
         ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:33:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/deque:60:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h:790:27: error: redefinition of '__is_pair<pair<_Tp, _Up> >'
    inline constexpr bool __is_pair<pair<_Tp, _Up>> = true;
                          ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.algorithm'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:5:10: note: std.algorithm defined here
  module "algorithm" {
         ^
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algobase.h:64:10: note: '/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_pair.h' included multiple times, additional include site in header from module 'std.deque'
#include <bits/stl_pair.h>
         ^
/reproducer/build/etc/cling/std.modulemap:149:10: note: std.deque defined here
  module "deque" {
         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
input_line_1:1:10: fatal error: could not build module 'std'
#include <new>
 ~~~~~~~~^
Warning in cling::IncrementalParser::CheckABICompatibility():
  Failed to extract C++ standard library version.
While building module 'Core':
While building module 'Cling_Runtime' imported from input_line_2:1:
While building module 'Cling_Runtime_Extra' imported from /reproducer/build/etc/cling/Interpreter/RuntimeUniverse.h:27:
In file included from <module-includes>:1:
/reproducer/build/etc/cling/Interpreter/DynamicExprInfo.h:13:10: fatal error: could not build module 'std'
#include <string>
 ~~~~~~~~^
/reproducer/build/etc/cling/Interpreter/RuntimeUniverse.h:27:10: fatal error: could not build module 'Cling_Runtime_Extra'
#include "cling/Interpreter/Visibility.h"
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from input_line_3:1:
In file included from /reproducer/build/etc/cling/lib/clang/9.0.1/include/assert.h:8:
In file included from /usr/include/assert.h:35:
In file included from /usr/include/features.h:514:
/usr/include/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found
# include <gnu/stubs-32.h>
          ^~~~~~~~~~~~~~~~
While building module 'Core':
While building module 'ROOT_Rtypes' imported from /reproducer/build/include/Rtypes.h:23:
In file included from <module-includes>:1:
/reproducer/build/include/RtypesCore.h:28:10: fatal error: could not build module 'std'
#include <cstddef> // size_t, NULL
 ~~~~~~~~^
/reproducer/build/include/ThreadLocalStorage.h:60:10: fatal error: could not build module 'ROOT_Rtypes'
#include "RtypesCore.h"
 ~~~~~~~~^~~~~~~~~~~~~~
While building module 'Core':
While building module 'ROOT_Foundation_Stage1_NoRTTI' imported from /reproducer/build/include/Rtypes.h:195:
In file included from <module-includes>:2:
In file included from /reproducer/build/include/ROOT/RStringView.hxx:25:
/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/string_view:40:10: fatal error: could not build module 'std'
#include <iosfwd>
 ~~~~~~~~^
Error: Error loading the default rootcling header files.
[7048/9103] Building CXX object core/metacling/src/CMakeFiles/MetaCling.dir/TCling.cxx.o
ninja: build stopped: subcommand failed.
FATAL:   While performing build: while running engine: exit status 1

full_log.txt

vgvassilev commented 2 years ago

@dennisklein, can you do the same but this time for bits/stl_algobase.h?

dennisklein commented 2 years ago

sure, it's running. but some questions:

dennisklein commented 2 years ago

The following patch makes the reproducer above compile. However, one would have to test this now with all ROOT features enabled to be sure it is enough (for ROOT)...

--- a/interpreter/cling/include/cling/std.modulemap
+++ b/interpreter/cling/include/cling/std.modulemap
@@ -428,4 +428,16 @@ module "std" [system] {
     export *
     header "bits/stl_tree.h"
   }
+  module "bits/utility.h" {
+    export *
+    header "bits/utility.h"
+  }
+  module "bits/stl_algobase.h" {
+    export *
+    header "bits/stl_algobase.h"
+  }
+  module "bits/stl_pair.h" {
+    export *
+    header "bits/stl_pair.h"
+  }
 }
vgvassilev commented 2 years ago

sure, it's running. but some questions:

* Shouldn't this `std.modulemap` be generated from the state of the STL include tree?

It should but there are headers which are not modules friendly and (at least in the old days) required quite a bit of manual work.

  * Let's say, even if ROOT will compile then with this approach, how does it help an experiment library that uses something from the STL that ROOT does not (by chance), isn't that file then missing from the `std.modulemap`, too?

Not really, the module std.pcm contains all of STL, however, some header files (which are implementation details such as the ones in bits) are re-exported from the submodules, that is, the submodule keeps a textual duplicate of the internal header. This in principle should only affect performance, however clang-9 has bugs when merging two definitions coming from the same textual header but re-exported by a different submodule.

* Also, isn't this compiler version dependent?

STL is vendor dependent to the extent of the internal implemenation. The std.modulemap is the modulemap that ships with the gnu libstdc++. libc++ (used in osx) comes with its own modulemap which we happily find and use. The std.modulemap works (with minor tweaks from time to time) with libstdc++ from 5.1 to 11 (now you just enabled it for 12). In practice, it libstdc++ rarely removes headers and that's what we are exploiting ;)

github-actions[bot] commented 2 years ago

Hi @vgvassilev, @Axel-Naumann,

It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

Sincerely, :robot:

Axel-Naumann commented 2 years ago

@vgvassilev does this need to be backported to 6.26 and/or 6.24?

ChristianTackeGSI commented 2 years ago

I think, this affects 6.26 at least (that's how we found it). So unless I am wrong (always a possibility), I would appreciate a backport to that version at least.

petrstepanov commented 2 years ago

I can confirm this affects the 6.26.02