Binary compatibility can be hard to achieve.

Binary compatibility can be hard to achieve.

The Mysterious Case Of The Lost Inherited Call

https://www.uweraabe.de/Blog/2018/05/28/the-mysterious-case-of-the-lost-
inherited-call/

https://www.uweraabe.de/Blog/2018/05/28/the-mysterious-case-of-the-lost-inherited-call/

Comments

  1. In order to solve it for both versions you would need to call the virtual method that it overrides: walking up the inheritance and check that VMT slot for an address that differs from your current method and then call that.

    ReplyDelete
  2. Stefan Glienke Thanks, but no thanks ;)

    ReplyDelete
  3. Frankly, hacking together packages built with different versions of Delphi is a quest for glory beasts with ugly heads per se.

    Because in this specific case the changed behaviour and assumptions got reflected in ABI in an explicitly incompatible way. But there could be much subtler behaviour mismatches likes when functions with changed meaning and list of parameters still retained same mangled names.

    If one wants to make cross-language libraries perhaps one to use COM/interface instead...

    ReplyDelete
  4. Stefan Glienke that perhaps what BPL loading runtime could indeed do instead of statically linking by conpiler, if that had some sense in a larger picture. Persoy i would perhaps prefer instead having BPL's as strict w.r.t. versioning as DCPs are.
    If i can not compile A.DPK before recompiling B.DPK it depends upon due to updated C.DPK/DCP they both depend upon - then runtime should ensure i can load new A.BPL with older B.BPL.

    Either don't bug me with rebuilding when it is not required, or do safenet me from BPL mismatch when required it was.

    ReplyDelete
  5. Arioch The Coulda shoulda woulda :)

    ReplyDelete
  6. Arioch The The straight forward solution in this case would have been to provide different DLLs for Delphi 10.2/10.2.1 and 10.2.2/10.2.3 - with the slight problem to figure out, which version is installed for the individual user and notify him to re-install when updating his Delphi. Not exactly what I would call a comfortable setup.

    ReplyDelete
  7. ....or to deploy it as sources to be compiled.
    Even if most code would be in differently named DCUs and the provided ones would be Condional-compilation chacks of the versions and the specifc units to be used.

    Another can of worms.

    Well, or just make free version totally compiled on install from full sources

    ReplyDelete

Post a Comment