You are not logged in.
By the way, I like the idea of embedding detail data within the record (sharding). Would be interesting to know what other people use, just schemaless TDocVariant?
I mostly (always) use sharding, together with json storage. Keeps the raw database data in a format that also can be read by other applications not based on the mORMot.
Hello Ab,
Due to the de-coupling of features in mORMot2, it can be used for more than only database [ORM] stuff.
On- and offline, I am advising people to consider using mORMot2 for their tasks.
However, the use of static libs and the linking of these libs is something that always leads to errors about missing libs.
I know, RTFM, but anyhow.
To give an example.
The chat-client and -server examples (on Windows) need libkernel32 and libdeflatepas.
Would it be possible to have a soft-version of the mORMot2 that does not need these libs and compiles and runs out-of-the-box.
(e.g. from a simple Github clone)
Thanks for taking the time.
Thank you very much for sharing !! Much appreciated. Will have a very close look.
@trx
If you are willing to share your efforts, I would be very pleased.
The ddd folder is still empty ... ;-)
was built for newer macOS version (11.0) than being linked (10.8)
Please have a look at your fpc.cfg. Fpcupdeluxe might have added a -WM define (somewhere at the bottom of the cfg). You might try to remove it and build the mORMot again. I do not know if it will improve anything, but its worth the try.
but the lists of FPC and Lazarus version numbers are invisible or incompletely populated
This is probably due to the fact that fpcupdeluxe is not able to create some initial settings files. Create a folder somewhere (desktop) and please move fpcupdeluxe to this directory of your choice. The same is needed on Apple (when fpcupdeluxe is run from the Download folder).
Just for your info. The bug-report related to this FPC 3.2.2 issue. Conclusion: FPC 3.2.2 is not suited for the mORMot[2] due to this bugger.
https://gitlab.com/freepascal.org/fpc/s … sues/39438
Ok. Thanks.
Problem reproduced. Its FPC 3.2.2 itself, so current stable gives this error. FPC 3.2.3 (as per fixes on your laptop) gives all greens.
Don't worry. You are not wasting anybody's time.
You gave good info. Except for the manner in which you installed the mORMot2.
So, how did you install mORMot2 ?
With this info, I will try to reproduce your issue.
Few minutes ago, I installed FPC fixes with Lazarus fixes through fpcupdeluxe on a win11 pc.
Also installed latest mORMot2 sources with fpcupdeluxe.
Result: all greens on win32 mormot2tests !
With FPC trunk and mORMot2 from just a few minutes ago, I cannot reproduce your errors.
All greens on my system: win11, mORMot2 for win32 and win64.
Your "trick" works !
Thanks.
Bugger solved.
https://gitlab.com/freepascal.org/fpc/s … 1dfbc523a8
All greens now on Linux AArch64 with FPC trunk. Very good !
However, a small workaround for the FPC source parser was needed.
In function GetJsonField, a label (lit) is used for a goto. This results in code errors on AArch64.
If the label is removed, all is ok and 100% error free mORMot2 can be enjoyed.
Bugger reported.
https://gitlab.com/freepascal.org/fpc/s … sues/39569
When will you publish the next 2.2.0i release?
Should be within a week. Still waiting for confirmation of some fixes.
@ab.
Yes, 38018 is supported by your commit ! Its not a mORMot2 problem.
However, as stated, this is a FPC problem. It seems that the calculation of the header size in the compiler sources is not correct for aarch64.
Lazarus trunk crashes within few minutes. Its memory consumption goes up with an MB per second whenever the source editor is used.
@ab
Is the current fpcupdeluxe able to cross-compile from Linux to Darwin AArch64?
Yes !
Final Aarch64 Linux FPC trunk update.
This issue: https://gitlab.com/freepascal.org/fpc/s … sues/38018
This commit: https://gitlab.com/freepascal.org/fpc/s … bdd0018f2e
Are the cause of the failures and memory leaks on current FPC trunk.
If I run the mORMot2 on the previous (see below) commit, all greens, no leaks.
Previous: https://gitlab.com/freepascal.org/fpc/s … 84d1432048
So, no mORMot2 issue !
Update about FPC trunk + mORMot2 on AArch64 (Odroid C2 running Arch Linux).
The memory leak reported by me earlier seems to be caused by FPC. Even Lazarus crashes (and gets killed) due to huge and increasing memory consumption, even when idle.
Will keep you informed.
@ab
Yes, in theory all should work. That is why I am still looking into the real source of the issues mentioned.
Sidenote:
FPC trunk has
TAnsiRec = {packed} Record
TUnicodeRec = {packed} Record
tdynarray = { packed } Record
The packed is not used anymore of these records.
I can confirm the described problem(s) on aarch64. And, I have a hard time debugging the issue(s).
At the moment, most severe problems (on my system) stem from a memory leak on fastsetstring (and derivatives). String-memory is not released, causing a (out-of-memory) system-crash.
Still looking into this. Will report if any news.
The latest mORMot2 (with sqlite3-statics) with the latest FPC trunk (both today) works very well on ARM32 bit.
Will try ARM64 also, if time permits.
There ae some more (also runtime) errors on Windows with latest sources.
I am looking into them right now. Nearly all solved. Stay tuned. Will do a pull-request.
I have found the cause of this issue. If corrected, all mORMot tests run green !
Its a change in ncal.pas.
FPC 3.2.0 and earlier have: tcb.emit_pchar_const(pchar(methodname),length(methodname),true);
FPC 3.2.2 and newer have: tcb.emit_pchar_const(pchar(methodname),length(methodname)-1,true);
The change is commented by:
{ length-1, because the following names variable *always* starts
with #0 which will be the terminator for methodname }
If this change is reverted, all test run green on 3.2.3 and trunk.
Greetings, Alf.
Just tested with FPC 3.2.3
Same problems still seem to be present unfortunately.
FPC trunk (main) on win32 : no problem.
It would be nice if you could share the changes that were needed to get things working again.
Thanks !
@yogiyang
You might ask for help with fpcupdeluxe.
https://synopse.info/forum/viewforum.php?id=10
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/issues
Nice find. This is good to know ! Lets try to use this "feature" ...
From the book:
Otherwise, the caller shall reserve a block of memory of sufficient size and alignment to hold the result. The
address of the memory block shall be passed as an additional argument to the function in x8. The callee may
modify the result memory block at any point during the execution of the subroutine (there is no requirement for
the callee to preserve the value stored in x8).
From the assembler:
TEST.SOA.CORE$_$TSERVICECOMPLEXCALCULATOR_$__$$_ECHORECORD$TCONSULTANAV$$TCONSULTANAV:
// [548] begin
stp x29,x30,[sp, #-16]!
mov x29,sp
// Var $self located in register x0
// Var $result located in register x8
It seems we have to take care of results passed in x8 !
As an in-between test, you could add the EchoRecord function into mORMot1.18 and see if it works with that version.
(skip this post if it is already there)
Well, this isn't the case here. This one works fine.
Please state the system you used to test. I presume you used 64bit FPC trunk of today running on Windows 10 64 bit ?
You report an error. I did have a look at this error. And tested the mORMot2 with FPC trunk. On my system, the error seems to be related to a particular statement. If the same is valid on your system, you have helped us in isolating this error. And making the bug-hunt and bug-solving a bit easier. If the bug is fixed, the test-suit will run again at 100% greens.
Compiler FPC 3.0.2
I guess and hope you mean FPC 3.2.0 ?
Crossing from win64 to win32 is very ill advised and not supported by both FPC and mORMot[2].
As I am myself running the mORMot[2] with FPC trunk on various systems, it would be interesting (for me) to see your results when using trunk.
As a sidenote: with trunk I am also experiencing some errors with Core Script at 3.1 ! Its caused by this line (test.core.script.pas):
v := Run('Date() + "=" + new Date().toString()');
If I comment this line (and the accompanying next line), the tests run fine.
And where can I read, what change in fpc was done?
Dunno. Its a FPC compiler error. Hard to isolate. Easy to work around.
I guess L_VV compiles with FPC trunk.
https://synopse.info/forum/viewtopic.ph … 542#p34542
I have compiled some sqlite3 Android libs v3.35.0000
Use them as you see fit. Greetings.
https://github.com/LongDirtyAnimAlf/fpc … 350000.zip
Try this:
if not Assigned(OnMatch) or
(not (Assigned(KeyCompare) or
Assigned(ValueCompare))) then
exit;
Hi songshuang,
Thanks for sharing your code. Looks very interesting and welcome. A mORMot based MQTT server (and client) is very much appreciated (by me) !
Hi Ab,
At the moment, mORMot2 does not run on arm. It gives a "property has no RTTI"-error. Naturally, this can be solved.
The question however:
Is mORMot2 suitable and mature now to perform deep debugging these errors ? If yes, I will dig into this and start porting my apps towards mORMot2.
Thanks.
I would (also) welcome the implementation of sqlite3-json features. Trying to be future-proof, all my complex objects are stored as json in sqlite3. Would be good to have dedicated json-features for speed-reasons.
Thanks very much. Will look into this. I guess this will serve my needs.
Hi Ab,
I have a (feature) request (if needed). My projects now use DDD. For storing product information.
TProduct = class(TSynAutoCreateFields)
protected
fProductCode : RawUTF8;
fDetail : TDetails;
published
property ProductCode : RawUTF8 read fProductCode write fProductCode;
property Detail : TDetails read fDetail;
end;
TDetails = class(TPersistent)
...
end;
The TDetails are flattened by default. But I would like to have them more compact as JSON in the database file.
I succeeded in doing so by disabling the "pilSubClassesFlattening" options in mORMotDDD.pas (and adding an autocreated TDetails-field in the record and with RegisterClassForJSON for TDetails).
Could this be made info an options to flatten by default or not in special cases ? Or can this already be accomplished ?
Thanks.
Edit:
Perhaps an idea: scan the ORM instance for a field with the same signature (and name) as the field in the aggregate itself.
Teasing presentations !! Clear explanations also. Looking forward to mORMot2.
Thanks Ab, I have completely overlooked the links you provided.
These provide enough info.
For me, REST is enough. And DDD makes all abstractions worthwile.
The question was based on the fact that Pimcore (a nice PIM) will change its api towards GraphQL. And I am using the mORMot to provide Pimcore some realtime data.
Hello Ab,
Hello All,
There is an ongoing discussion about GraphQL being better (more efficient) than REST.
I would value the opinions of the mORMot boss and users ?
Thanks, Alfred.
Happy coding and speeding ... :-) ... thanks !
Some (better) improvements might be expected from the advices that are shown here:
https://www.sqlite.org/compile.html