From boris at codesynthesis.com Tue Oct 1 04:35:22 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Oct 1 04:34:39 2024 Subject: [odb-users] Re: Cross-compiling from x86 to ARM on Windows In-Reply-To: References: Message-ID: Sunny Sun writes: > It got error: unable to translate target triplet CPU aarch64 to /MACHINE Ok, there were some missing pieces in build2 for MSVC ARM64 support which I have now added. If you get the latest staged version of the build2 toolchain: https://build2.org/community.xhtml#stage You should be able to build for ARM64 with MSVC. You don't need to specify /MACHINE:ARM64 and the bpkg-create command line could be just: bpkg create -d libodb-msvc-release cc^ config.cxx=cl^ "config.cc.coptions=/std:c++20 /O2 /MD /Zi /arch:armv8.0"^ "config.bin.lib=static"^ config.install.root="%CurrentFolder%output\Release" And, for completeness, if you need to build for ARM64EC instead: bpkg create -d libodb-msvc-release cc^ "config.cxx=cl /arm64EC"^ "config.cc.coptions=/std:c++20 /O2 /MD /Zi /arch:armv8.0"^ "config.cc.loptions=/MACHINE:ARM64EC"^ "config.bin.lib=static"^ config.install.root="%CurrentFolder%output\Release" From michael.dembroge at leica-geosystems.com Thu Oct 3 17:26:06 2024 From: michael.dembroge at leica-geosystems.com (DEMBROGE Michael) Date: Thu Oct 3 17:26:28 2024 Subject: [odb-users] How to execute odb-compiler without installing build2 Message-ID: Hello, Is it possible to build the ODB compiler and libraries and publish them somewhere so that others can just use them without having to install the entire build2 infrastructure? The issue we are having is that after I build ODB and publish to a central location (shared disk), it is failing on other's computers because they don't have the g++ compiler installed. So, the odb compiler (odb.exe) fails. It works on my system because I installed build2 which creates the /bin folder with all of the support binaries and executables including g++.exe. So, what can I do so that other developers on my team can just use ODB that I produced without having them all install build2? Possible? Thank you so much for any assistance, Mike Dembroge Leica Geosystems From michael.dembroge at leica-geosystems.com Fri Oct 4 18:43:09 2024 From: michael.dembroge at leica-geosystems.com (DEMBROGE Michael) Date: Fri Oct 4 18:43:31 2024 Subject: [odb-users] Question regarding ODB on windows without gcc compiler In-Reply-To: References: Message-ID: Hello Boris, I'm unable to produce a version of the ODB compiler on a Windows system with no dependency on the g++ compiler. The issue is that the odb compiler must be built with a gcc compiler (see error message below in red). But, building the odb compiler using gcc as the compiler (i.e. "config.cxx=g++") creates a dependency on g++.exe which is not available on Windows. Here is an overview of my steps: 1. install build2 using the build2-install-msvc-0.17.0.bat file. 2. Build odb compiler using the following commands: * bpkg create -d odb-msvc cc config.cxx=cl config.cc.coptions=-O2 config.install.root=d:\odb * cd odb-msvc * odb-msvc> bpkg build odb@https://pkg.cpget.org/1/beta * bpkg install odb I get the following error due to passing visual studio's "cl" as the compiler: db-2.5.0-b.27\build\root.build:51:5: error: ODB compiler can only be built with GCC So, I then reinstalled build2 using the build2-install-mingw-0.17.0.bat followed by these steps: 1. Build odb compiler using the following command: 2. D:\odb-build>bpkg create -d odb-mingw cc config.cxx=g++ config.cc.coptions=-O2 config.install.root=c:\odb 3. D:\odb-build>cd odb-mingw 4. D:\odb-build>bpkg build odb@https://pkg.cppget.org/1/beta 5. D:\odb-build>bpkg install odb Then, as a test, I tried to run the odb compiler manually from it's local bin folder and I get the following error message: C:\odb\bin>odb.exe --std c++17 --database sqlite g++: error: file not found I realize that installing build2 via the mingw-based .bat file will generate g++.exe in the build2/bin folder, but we are not supposed to be dependent on build/bin. Odb.exe should run in the target /bin folder as a standalone. This is consistent with the error message we get when we try to build our project in Visual Studio. It's complaining the g++.exe cannot be found. Any ideas? Thank you in advance, Mike Dembroge Leica Geosystems From gilles.benepougoue at gmail.com Sun Oct 6 01:10:24 2024 From: gilles.benepougoue at gmail.com (Gilles BENE POUGOUE) Date: Sun Oct 6 01:10:56 2024 Subject: [odb-users] Re: odb-users Digest, Vol 167, Issue 3 In-Reply-To: <202410051600.495G03Hh028974@extra.codesynthesis.com> References: <202410051600.495G03Hh028974@extra.codesynthesis.com> Message-ID: Hi , Regarding your issue on using odb without g++.exe on Windows, I think it may not be possible because odb works as a frontend for g++ , invoking it in the compilation process on your database files (entity classes) to generate the AST that it needs to reason about your code. It then uses it to generate c++ code (*-odb.hxx) that is automatically passed to msvc cl.exe. It uses the plugging support of g++ to do all this magic. I don't think it's a feature provided by msvc On Sat, Oct 5, 2024, 17:00 wrote: > Send odb-users mailing list submissions to > odb-users@codesynthesis.com > > To subscribe or unsubscribe via the World Wide Web, visit > https://codesynthesis.com/mailman/listinfo/odb-users > or, via email, send a message with subject or body 'help' to > odb-users-request@codesynthesis.com > > You can reach the person managing the list at > odb-users-owner@codesynthesis.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of odb-users digest..." > > > Today's Topics: > > 1. Question regarding ODB on windows without gcc compiler > (DEMBROGE Michael) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 4 Oct 2024 22:43:09 +0000 > From: DEMBROGE Michael > Subject: [odb-users] Question regarding ODB on windows without gcc > compiler > To: "odb-users@codesynthesis.com" > Message-ID: > < > AS8PR06MB810289E992378FB976C45BFDB9722@AS8PR06MB8102.eurprd06.prod.outlook.com > > > > Content-Type: text/plain; charset="us-ascii" > > Hello Boris, > > I'm unable to produce a version of the ODB compiler on a Windows system > with no dependency on the g++ compiler. The issue is that the odb compiler > must be built with a gcc compiler (see error message below in red). But, > building the odb compiler using gcc as the compiler (i.e. "config.cxx=g++") > creates a dependency on g++.exe which is not available on Windows. > > Here is an overview of my steps: > > 1. install build2 using the build2-install-msvc-0.17.0.bat file. > 2. Build odb compiler using the following commands: > * bpkg create -d odb-msvc cc config.cxx=cl config.cc.coptions=-O2 > config.install.root=d:\odb > * cd odb-msvc > * odb-msvc> bpkg build odb@https://pkg.cpget.org/1/beta https://pkg.cpget.org/1/beta> > * bpkg install odb > > > I get the following error due to passing visual studio's "cl" as the > compiler: > db-2.5.0-b.27\build\root.build:51:5: error: ODB compiler can only be built > with GCC > > So, I then reinstalled build2 using the build2-install-mingw-0.17.0.bat > followed by these steps: > > 1. Build odb compiler using the following command: > 2. D:\odb-build>bpkg create -d odb-mingw cc config.cxx=g++ > config.cc.coptions=-O2 config.install.root=c:\odb > 3. D:\odb-build>cd odb-mingw > 4. D:\odb-build>bpkg build odb@https://pkg.cppget.org/1/beta odb@https://pkg.cppget.org/1/beta> > 5. D:\odb-build>bpkg install odb > > > Then, as a test, I tried to run the odb compiler manually from it's local > bin folder and I get the following error message: > C:\odb\bin>odb.exe --std c++17 --database sqlite > g++: error: file not found > > I realize that installing build2 via the mingw-based .bat file will > generate g++.exe in the build2/bin folder, but we are not supposed to be > dependent on build/bin. Odb.exe should run in the target /bin folder as a > standalone. This is consistent with the error message we get when we try to > build our project in Visual Studio. It's complaining the g++.exe cannot be > found. > > Any ideas? > > Thank you in advance, > > Mike Dembroge > Leica Geosystems > > > ------------------------------ > > _______________________________________________ > odb-users mailing list > odb-users@codesynthesis.com > https://codesynthesis.com/mailman/listinfo/odb-users > > > End of odb-users Digest, Vol 167, Issue 3 > ***************************************** > From tony at rightsoft.com.au Sun Oct 6 01:50:16 2024 From: tony at rightsoft.com.au (Tony Rietwyk) Date: Sun Oct 6 01:50:43 2024 Subject: [odb-users] How to execute odb-compiler without installing build2 In-Reply-To: References: Message-ID: <985df031-a339-4566-8018-594bfedf0f76@rightsoft.com.au> Hi Mike, If the other developers do not have the ODB, then they cannot reproduce the C++ files.? It means that only you can use ODB, then check-in the resultant C++ files for the other developers. Regards, Tony On 4/10/2024 7:26 am, DEMBROGE Michael wrote: > Hello, > > Is it possible to build the ODB compiler and libraries and publish them somewhere so that others can just use them without having to install the entire build2 infrastructure? > > The issue we are having is that after I build ODB and publish to a central location (shared disk), it is failing on other's computers because they don't have the g++ compiler installed. So, the odb compiler (odb.exe) fails. It works on my system because I installed build2 which creates the /bin folder with all of the support binaries and executables including g++.exe. > > So, what can I do so that other developers on my team can just use ODB that I produced without having them all install build2? Possible? > > Thank you so much for any assistance, > > Mike Dembroge > Leica Geosystems From boris at codesynthesis.com Mon Oct 7 06:49:55 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 7 06:49:09 2024 Subject: [odb-users] How to execute odb-compiler without installing build2 In-Reply-To: References: Message-ID: DEMBROGE Michael writes: > Is it possible to build the ODB compiler and libraries and publish them > somewhere so that others can just use them without having to install > the entire build2 infrastructure? You can do that though it will require some effort to separate MinGW GCC from the rest of build2. We are planning to provide such a .zip file (i.e., ODB + MinGW GCC) once the ODB 2.5.0 final is released (hopefully in a month or two). So I would suggest that in the meantime you install ODB into the build2 installation directory, zip everything up, and distribute that. And once 2.5.0 is released, you can switch to the minimal archive. > The issue we are having is that after I build ODB and publish > to a central location (shared disk), it is failing on other's > computers because they don't have the g++ compiler installed. Right, is Gilles mentioned in another reply, ODB is implemented as a GCC plugin (it uses GCC to parse C++). The only way around this is to distribute pre-generate *-odb.?xx files, as Tony has suggested. From enmarantispam at gmail.com Mon Oct 7 04:09:11 2024 From: enmarantispam at gmail.com (NIkolai Marchenko) Date: Mon Oct 7 07:49:29 2024 Subject: [odb-users] version b.27 seems to be broken in cppget Message-ID: It cannot correctly detect the compiler on windows and requires manual edit of .build files inside the downloaded folders and when you try working with the compiled result you get "The system cannot find the path specified" For a while I thought that I am doing something wrong, but then I downloaded b.25+1 and it just works, so it;s clearly something wrong with 27 specifically From enmarantispam at gmail.com Mon Oct 7 00:36:33 2024 From: enmarantispam at gmail.com (NIkolai Marchenko) Date: Mon Oct 7 08:08:22 2024 Subject: [odb-users] "The system cannot find the path specified" while trying to use b27 installed from bpkg Message-ID: All I've done is install odb according to instructions, this error is even present if you do bpkg test but it certainly is present if you do: odb -d pgsql I am a bit at a loss... the only custom step I did was installing fresh msys and editing the root.build with addition of "config.odb.gxx_name = /w/tools/msys/mingw64/bin/g++" since I don't know how to configure from command line From boris at codesynthesis.com Mon Oct 7 08:30:01 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 7 08:29:16 2024 Subject: [odb-users] "The system cannot find the path specified" while trying to use b27 installed from bpkg In-Reply-To: References: Message-ID: NIkolai Marchenko writes: > I am a bit at a loss... the only custom step I did was installing fresh > msys and editing the root.build with addition of "config.odb.gxx_name = > /w/tools/msys/mingw64/bin/g++" Firstly, ODB is not an an MSYS2 application so you cannot use POSIX paths with it. You will need to do: config.odb.gxx_name = 'W:\tools\msys\mingw64\bin\g++' Secondly, we only officially support ODB on Windows when used with the MinGW GCC that we prepare and distribute. In particular, we make sure that it is built with plugins support. The most recent GCC from MSYS2 (14.2.0) happens to have plugins enabled. The previous version (13.2.0) did not. Thirdly, if you decide to replace MinGW GCC used by ODB (at your own risk), make sure that you also build ODB with this version. Only specifying it in config.odb.gxx_name may not be enough. From boris at codesynthesis.com Mon Oct 7 08:32:35 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 7 08:31:48 2024 Subject: [odb-users] version b.27 seems to be broken in cppget In-Reply-To: References: Message-ID: NIkolai Marchenko writes: > It cannot correctly detect the compiler on windows and requires manual edit > of .build files inside the downloaded folders and when you try working with > the compiled result you get "The system cannot find the path specified" > > For a while I thought that I am doing something wrong, but then I > downloaded b.25+1 and it just works, so it;s clearly something wrong with > 27 specifically Are you using both with the officially supported MinGW GCC from the build2-mingw package or are you using your own MinGW GCC (per the previous email)? Also which version of build2 are you using? From enmarantispam at gmail.com Mon Oct 7 08:34:42 2024 From: enmarantispam at gmail.com (NIkolai Marchenko) Date: Mon Oct 7 08:38:22 2024 Subject: [odb-users] version b.27 seems to be broken in cppget In-Reply-To: References: Message-ID: I installed build2- migw from your "Installing" page. it builds b25 just fine, but not b27 I only started deviating from this page: https://codesynthesis.com/products/odb/doc/install-build2.xhtml because the version pulled from bpkg build odb@https://pkg.cppget.org/1/beta errored out with: "if you are cross compiling set gcc explicitly" This doesn't happened with b25+1 On Mon, Oct 7, 2024 at 3:31?PM Boris Kolpackov wrote: > NIkolai Marchenko writes: > > > It cannot correctly detect the compiler on windows and requires manual > edit > > of .build files inside the downloaded folders and when you try working > with > > the compiled result you get "The system cannot find the path specified" > > > > For a while I thought that I am doing something wrong, but then I > > downloaded b.25+1 and it just works, so it;s clearly something wrong with > > 27 specifically > > Are you using both with the officially supported MinGW GCC from the > build2-mingw package or are you using your own MinGW GCC (per the > previous email)? > > Also which version of build2 are you using? > From boris at codesynthesis.com Mon Oct 7 08:51:29 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 7 08:50:42 2024 Subject: [odb-users] version b.27 seems to be broken in cppget In-Reply-To: References: Message-ID: NIkolai Marchenko writes: > because the version pulled from bpkg build odb@https://pkg.cppget.org/1/beta > > errored out with: > > "if you are cross compiling set gcc explicitly" Hm, I don't see this error message anywhere in the codebase. Do you perhaps mean this: "g++ executable name must be specified explicitly with config.odb.gxx_name when cross-compiling" > This doesn't happened with b25+1 I don't see any difference in that logic between b27 and b25+1. Also, repeating my second question from earlier email: which version of build2 are you using? From enmarantispam at gmail.com Mon Oct 7 08:49:43 2024 From: enmarantispam at gmail.com (NIkolai Marchenko) Date: Mon Oct 7 08:51:58 2024 Subject: [odb-users] version b.27 seems to be broken in cppget In-Reply-To: References: Message-ID: Just to reiterate: This compiles perfectly fine and works: bpkg build odb/2.5.0-b.25+1@https://pkg.cppget.org/1/beta This produces an error (which sent me deviating from the manual as I didn't realize the version itself is faulty): bpkg build odb@https://pkg.cppget.org/1/stable On Mon, Oct 7, 2024 at 3:34?PM NIkolai Marchenko wrote: > I installed build2- migw from your "Installing" page. it builds b25 just > fine, but not b27 > > I only started deviating from this page: > https://codesynthesis.com/products/odb/doc/install-build2.xhtml > > because the version pulled from bpkg build odb@ > https://pkg.cppget.org/1/beta > > errored out with: > > "if you are cross compiling set gcc explicitly" > > This doesn't happened with b25+1 > > > On Mon, Oct 7, 2024 at 3:31?PM Boris Kolpackov > wrote: > >> NIkolai Marchenko writes: >> >> > It cannot correctly detect the compiler on windows and requires manual >> edit >> > of .build files inside the downloaded folders and when you try working >> with >> > the compiled result you get "The system cannot find the path specified" >> > >> > For a while I thought that I am doing something wrong, but then I >> > downloaded b.25+1 and it just works, so it;s clearly something wrong >> with >> > 27 specifically >> >> Are you using both with the officially supported MinGW GCC from the >> build2-mingw package or are you using your own MinGW GCC (per the >> previous email)? >> >> Also which version of build2 are you using? >> > From enmarantispam at gmail.com Mon Oct 7 09:14:23 2024 From: enmarantispam at gmail.com (NIkolai Marchenko) Date: Mon Oct 7 10:08:07 2024 Subject: [odb-users] version b.27 seems to be broken in cppget In-Reply-To: References: Message-ID: Weird, I have wiped everything and reissued all the commands and somehow now it worked. I have no idea what I did differently because I have done this like two times already but I guess problem solved? On Mon, Oct 7, 2024 at 3:51?PM NIkolai Marchenko wrote: > gimme a sec, I will repro the whole cycle and post all of the commands and > errors. > > On Mon, Oct 7, 2024 at 3:50?PM Boris Kolpackov > wrote: > >> NIkolai Marchenko writes: >> >> > because the version pulled from bpkg build odb@ >> https://pkg.cppget.org/1/beta >> > >> > errored out with: >> > >> > "if you are cross compiling set gcc explicitly" >> >> Hm, I don't see this error message anywhere in the codebase. Do you >> perhaps mean this: >> >> "g++ executable name must be specified explicitly with >> config.odb.gxx_name when cross-compiling" >> >> >> > This doesn't happened with b25+1 >> >> I don't see any difference in that logic between b27 and b25+1. >> >> >> Also, repeating my second question from earlier email: which version >> of build2 are you using? >> > From boris at codesynthesis.com Wed Oct 9 08:24:23 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Oct 9 08:23:37 2024 Subject: [odb-users] Containers of containers In-Reply-To: References: Message-ID: MM writes: > Trying to compile and understand the experimental facility of vectors of > vectors, I can't odb compile the example here [...] We have added a complete example that shows how to do this: https://git.codesynthesis.com/cgit/odb/odb/tree/odb-examples/container-nested Note that you will need to grab the updated odb/nested-container.hxx header (until the next release of ODB) since we tweaked it a bit to streamline the mapping: https://git.codesynthesis.com/cgit/odb/odb/tree/libodb/odb/nested-container.hxx From sunny.sun at ringcentral.com Sat Oct 12 03:46:42 2024 From: sunny.sun at ringcentral.com (Sunny Sun) Date: Mon Oct 14 04:32:09 2024 Subject: [odb-users] Re: Cross-compiling from x86 to ARM on Windows In-Reply-To: References: Message-ID: You should be able to build for ARM64 with MSVC. You don't need to specify /MACHINE:ARM64 and the bpkg-create command line could be just: bpkg create -d libodb-msvc-release cc^ config.cxx=cl^ "config.cc.coptions=/std:c++20 /O2 /MD /Zi /arch:armv8.0"^ "config.bin.lib=static"^ config.install.root="%CurrentFolder%output\Release" I tried, but I got cl: command line warning D9002: ignoring unknown option "/arch:armv8.0" If I remove the /arch:armv8.0 option, it seems it dose not specify arm arch anywhere. Thank you in advance. ________________________________ From: Boris Kolpackov Sent: Tuesday, October 1, 2024 4:35 PM To: Sunny Sun Cc: odb-users@codesynthesis.com Subject: Re: [odb-users] Re: Cross-compiling from x86 to ARM on Windows [EXTERNAL] Sunny Sun writes: > It got error: unable to translate target triplet CPU aarch64 to /MACHINE Ok, there were some missing pieces in build2 for MSVC ARM64 support which I have now added. If you get the latest staged version of the build2 toolchain: https://urldefense.com/v3/__https://build2.org/community.xhtml*stage__;Iw!!J-1DKIBqn-Pi!E1oLGaK7HPZhx-W1QPIXwAoLWxUcnnkEy0h0U0Wip2R7mmG0qC7eMErE_8r5UOYB_LAHRXLSMCwVX4u2320iwA$ You should be able to build for ARM64 with MSVC. You don't need to specify /MACHINE:ARM64 and the bpkg-create command line could be just: bpkg create -d libodb-msvc-release cc^ config.cxx=cl^ "config.cc.coptions=/std:c++20 /O2 /MD /Zi /arch:armv8.0"^ "config.bin.lib=static"^ config.install.root="%CurrentFolder%output\Release" And, for completeness, if you need to build for ARM64EC instead: bpkg create -d libodb-msvc-release cc^ "config.cxx=cl /arm64EC"^ "config.cc.coptions=/std:c++20 /O2 /MD /Zi /arch:armv8.0"^ "config.cc.loptions=/MACHINE:ARM64EC"^ "config.bin.lib=static"^ config.install.root="%CurrentFolder%output\Release" From boris at codesynthesis.com Mon Oct 14 04:52:11 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 14 04:51:24 2024 Subject: [odb-users] Re: Cross-compiling from x86 to ARM on Windows In-Reply-To: References: Message-ID: Sunny Sun writes: > bpkg create -d libodb-msvc-release cc^ > config.cxx=cl^ > "config.cc.coptions=/std:c++20 /O2 /MD /Zi /arch:armv8.0"^ > "config.bin.lib=static"^ > config.install.root="%CurrentFolder%output\Release" > > I tried, but I got > cl: command line warning D9002: ignoring unknown option "/arch:armv8.0" This most likely means you are not running ARM64 variant of cl.exe. Can you run just cl.exe without any options and see what it prints? The output should contain "for ARM64" (and not "for x64" or "for x86"). There are two ways to ensure you are using the correct cl.exe variant: 1. Use the developer command prompt for ARM64. This is the easiest option. 2. By specifying the absolute path to cl.exe in config.cxx, for example (you will need to adjust the path to match your Visual Studio edition and version): "config.cxx='C:\Program Files\Microsoft Visual Studio\2002\Community\VC\Tools\MSVC\14.32.313225\bin\Hostx64\arm64\cl.exe'" From finjulhich at gmail.com Sun Oct 27 08:22:36 2024 From: finjulhich at gmail.com (MM) Date: Sun Oct 27 08:23:08 2024 Subject: [odb-users] std::variant of raw pointers Message-ID: Hello Is there support for loading/persisting members that are std::variant ? By using a virtual member like std::string, assuming each of those objects has a string has id, is there a way to cause the persistence or loading ? Rds, From gracjan.olbinski-ext at hexagon.com Tue Oct 29 03:39:22 2024 From: gracjan.olbinski-ext at hexagon.com (OLBINSKI Gracjan) Date: Tue Oct 29 04:08:56 2024 Subject: [odb-users] ODB Compiler v2.5.0-b.27 issue Message-ID: Dear Support, During integration of version v2.5.0-b.27 of ODB Compiler we faced the issue with release version of compiler generating C++ instrumented code with small issue causing issue during compilation. Few std::basic_string were generated with double namespace delimiter (i.e. as ::std::::basic_string). Quick analysis shown that the issue is correlated with NDEBUG flag passed to compiler in release version. Therefore our guess was some assertion macro hiding some business logic inside. The following patch fix the issue: diff --git a/odb/odb/semantics/elements.cxx b/odb/odb/semantics/elements.cxx index b5793d09..562d48d3 100644 --- a/odb/odb/semantics/elements.cxx +++ b/odb/odb/semantics/elements.cxx @@ -254,7 +254,8 @@ namespace semantics // namespace) but we only use this function to print names // of anonymous types. // - assert (l.next (t) == CPP_SCOPE); + cpp_ttype ignore = l.next (t); + assert (ignore == CPP_SCOPE); continue; } } As you see the cxx_string_lexer::next() with side effects (e.g. next() changes the state of the cxx_string_lexer instance) is called under assert macro. Best Reagards, Gracjan Olbinski From boris at codesynthesis.com Tue Oct 29 05:21:52 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Oct 29 05:21:00 2024 Subject: [odb-users] ODB Compiler v2.5.0-b.27 issue In-Reply-To: References: Message-ID: OLBINSKI Gracjan writes: > Quick analysis shown that the issue is correlated with NDEBUG flag > passed to compiler in release version. Therefore our guess was some > assertion macro hiding some business logic inside. The following > patch fix the issue: > > - assert (l.next (t) == CPP_SCOPE); > + cpp_ttype ignore = l.next (t); > + assert (ignore == CPP_SCOPE); > continue; Thanks for the report and the patch, this is quite embarrassing. I've audited all the calls to assert() in the ODB codebase, and while there were a few suspicious cases, all except this one turned out to be ok. I've committed the fix: https://git.codesynthesis.com/cgit/odb/odb/commit/?id=3a7727864e3ef603e2dccac259af768c9d9fd454 From boris at codesynthesis.com Wed Oct 30 06:51:15 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Oct 30 06:50:23 2024 Subject: [odb-users] std::variant of raw pointers In-Reply-To: References: Message-ID: MM writes: > Is there support for loading/persisting members that are > std::variant ? > By using a virtual member like std::string, assuming each of those objects > has a string has id, is there a way to cause the persistence or loading ? No, the closest we have to something like this is support for Polymorphism Inheritance: https://www.codesynthesis.com/products/odb/doc/manual.xhtml#8.2 That's is, you would nee to replace std::variant<...> with PTRBASE* with PRT1, PTR2, etc., all deriving (polymorphically) from PTRBASE.