kuzudb / kuzu

Embeddable property graph database management system built for query speed and scalability. Implements Cypher.
https://kuzudb.com/
MIT License
1.16k stars 85 forks source link

[MSVC] serializeValue: no matching overloaded function found #3480

Open zaddach opened 1 month ago

zaddach commented 1 month ago

I'm getting a couple of those compile errors:

C:\dev\kuzu\src\include\common/serializer/serializer.h(59,17): error C2672: 'kuzu::common::Serializer::serializeValue': no matching overloaded function found [C:\dev\kuzu\build\src\catalog\catalog_entry\kuzu_catalog_entry.vcxproj]
C:\dev\kuzu\src\include\common/serializer/serializer.h(21,10): message : could be 'void kuzu::common::Serializer::serializeValue(const T &)' [C:\dev\kuzu\build\src\catalog\catalog_entry\kuzu_catalog_entry.vcxproj]
C:\dev\kuzu\src\include\common/serializer/serializer.h(59,17): message : the associated constraints are not satisfied [C:\dev\kuzu\build\src\catalog\catalog_entry\kuzu_catalog_entry.vcxproj]
C:\dev\kuzu\src\include\common/serializer/serializer.h(20,18): message : the constraint was not satisfied [C:\dev\kuzu\build\src\catalog\catalog_entry\kuzu_catalog_entry.vcxproj]
C:\dev\kuzu\src\include\common/serializer/serializer.h(20,62): message : the constraint was not satisfied [C:\dev\kuzu\build\src\catalog\catalog_entry\kuzu_catalog_entry.vcxproj]
C:\dev\kuzu\src\catalog\catalog_entry\table_catalog_entry.cpp(109,42): message : see reference to function template instantiation 'void kuzu::common::Serializer::serializeVector<kuzu::catalog::Property>(const std::vector<kuzu::catalog::Property,std::allocator<kuzu::cat
alog::Property>> &)' being compiled [C:\dev\kuzu\build\src\catalog\catalog_entry\kuzu_catalog_entry.vcxproj]

while compiling on MSVC for Windows 11 x64:

MSBuild version 17.9.8+b34f75857 for .NET Framework
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- The CXX compiler identification is MSVC 19.34.31948.0
-- The C compiler identification is MSVC 19.34.31948.0

All of the missing serializer implementations (for kuzu::common::Serializer::serializeVector) here:

with current master (and starting from v0.4.0). d946982e7 still built fine.

acquamarin commented 1 month ago

Hi @zaddach Thanks for reporting to us!

We will take a look soon.

benjaminwinger commented 1 month ago

The issue shouldn't be with Serializer::serializeValue, but with the requires expression in Serializer::serializeVector as it should be using Property::serialize instead of serializeValue, but evidently value.serialize(ser) is not compiling and its falling back to serializeValue, which fails because the type is not trivial.

https://github.com/kuzudb/kuzu/blob/e38b01d95da3dd68e8aa51dbf7a3aef1e9deac75/src/include/common/serializer/serializer.h#L56-L60

I'm not able to reproduce this with either MSVC 19.38.33130 or MSVC 19.39.33523.0, which are admittedly newer. I've tried reproducing it in isolation here+%7B%0A++++++++++++value.serialize(*this)%3B%0A++++++++%7D+else+%7B%0A++++++++++++serializeValue%3CT%3E(value)%3B%0A++++++++%7D%0A++++%7D%0A%7D%0A%7D%3B%0A%0Aclass+Property+%7B%0A++++void+serialize(Serializer+%26ser)+%7B%0A++++++++ser.serializeValue(val)%3B%0A++++%7D%0Aint+val%3B%0A%7D%3B%0A%0Aint+main()+%7B%0A++++std::vector%3CProperty%3E+properties%3B%0A++++Serializer+ser%3B%0A++++ser.serializeVector(properties)%3B%0A%7D%3B'),l:'5',n:'0',o:'C%2B%2B+source+%231',t:'0')),k:45.96459645964597,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:vcpp_v19_34_x86,filters:(b:'0',binary:'1',binaryObject:'1',commentOnly:'0',debugCalls:'1',demangle:'0',directives:'0',execute:'1',intel:'0',libraryCode:'0',trim:'1',verboseDemangling:'0'),flagsViewOpen:'1',fontScale:14,fontUsePx:'0',j:1,lang:c%2B%2B,libs:!(),options:'/std:c%2B%2B20',overrides:!(),selection:(endColumn:1,endLineNumber:1,positionColumn:1,positionLineNumber:1,selectionStartColumn:1,selectionStartLineNumber:1,startColumn:1,startLineNumber:1),source:1),l:'5',n:'0',o:'+x86+msvc+v19.34+(Editor+%231)',t:'0')),k:16.87105377204387,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:output,i:(compilerName:'x86+msvc+v19.34',editorid:1,fontScale:14,fontUsePx:'0',j:1,wrap:'1'),l:'5',n:'0',o:'Output+of+x86+msvc+v19.34+(Compiler+%231)',t:'0')),k:37.16434976831016,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4), but it works even with MSVC 19.34; it must be something subtler than just that the particular requires expression used doesn't work with that version of MSVC. The Serializer class hasn't changed since d946982e77af0f8a0bf41e7fea701c61db6f098f either.

I wonder if it's only happening with the three you listed, or if it's just stopping before reporting the others and everything which should use the serialize(Serializer&) method is failing.

Is it possible for you to try with a newer version of MSVC?