Warning, ABI breakage from 2.074 to 2.075

Patrick Schluter via Digitalmars-d digitalmars-d at puremagic.com
Thu May 25 09:16:19 PDT 2017


On Thursday, 25 May 2017 at 14:36:43 UTC, Jonathan M Davis wrote:
> On Thursday, May 25, 2017 13:23:57 Joakim via Digitalmars-d 
> wrote:
>> On Thursday, 25 May 2017 at 10:42:44 UTC, Basile B. wrote:
>> > Static libraries that are
>> > - compiled with dmd 2.074 (maybe previous versions too)
>> > - call format() in their API
>> >
>> > will be responsible for strange errors when used by programs 
>> > compiled with dmd 2.075. People will see their software 
>> > raising a FormatException (orphan argument) for no reason. 
>> > When the static library will be recompiled with dmd 2.075 
>> > the errors will disappear.
>> >
>> > I haven't investigated much since there's been a non trivial 
>> > amount of change in std.format() during the this spring. I 
>> > don't know what to do with this facts except to report them 
>> > here.
>>
>> Why is this unexpected?  D has never committed to ABI 
>> stability across compiler versions or the different D 
>> compilers.
>
> Yeah, if you're relying on ABI compatibility across releases, 
> then you're likely to have some weird problems. It may actually 
> work often enough that you can get away with it a good chunk of 
> the time (I don't know), but we certainly don't promised ABI 
> compatibility, and we do break it some percentage of the time. 
> Heck, we frequently do stuff like templatize a function that 
> wasn't templatized before (generally to make it more generic), 
> which breaks all code that was taking it's address to use as a 
> function pointer (but doesn't break most uses of the function). 
> We do try to avoid superfluous breakage, and _most_ code should 
> be fine from release to release, but corner cases do get broken 
> on a regular basis and that's even when you recompile all your 
> code, not even trying to use newly compiled code with code 
> compiled with an older compiler. The sitation is _far_ better 
> than it once was, but we're definitely not ABI stable, and the 
> nature of D actually makes it pretty hard to be.
>
Could someone please explain why people talk always of ABI 
compatibilty while what is described would imo better classified 
as API compatibilty. ABI is the way parameter are passed to 
functions i.e. which parameters go to which register and is 
defined by the platform, while the API is the set of signature of 
a library. I find it a bit disturbing that at each release the 
ABI would change, while that is generally something which is 
(should) be extremely stable.
The only time I have been confronted with an ABI (C) change 
within a platform was in the transition from Solaris 9 to Solaris 
10 where the way structs were returned from functions changed.
TL;DR is there a confusion between ABI and API or does the 
calling conventions change at every release?



More information about the Digitalmars-d mailing list