Return-Path:
+ We have written a document to explain the + version numbering concepts for the + libraries in the APR project. +
1.1 apr-site/versioning.html Index: versioning.html ===================================================================
This document covers how the APR projects are versioned. Since the APR projects are libraries, it is very important to define a stable API for users of the libraries. However, we also need to move the libraries forward, technologically. To balance these two needs, a strict policy of versioning is required, which users can rely upon to understand the limitations, restrictions, and the changes that can occur from one release of APR to the next.
Versions are denoted using a standard triplet of integers: MAJOR.MINOR.PATCH. The basic intent is that MAJOR versions are incompatible, large-scale upgrades of the API. MINOR versions retain source and binary compatibility with older minor versions, and changes in the PATCH level are perfectly compatible, forwards and backwards.
We define "source compatible" to mean that an application will continue to build without error, and that the semantics will remain unchanged.
Applications that write against a particular version will remain source-compatible against later versions, until the major number changes. However, if an application uses an API which has become available in a particular minor version, it (obviously) will no longer build against previous minor versions.
We define "binary compatible" to mean that a compiled application can be linked (possibly dynamically) against the library and continue to function properly.
Similar to source compatibility, an application that has been compiled against a particular version will continue to be linkable against later versions (unless the major number changes). It is possible that an application will not be able to successfully link against a previous minor version.
Here are some examples to demonstrate the compatibility:
Original Version | New Version | Compatible? |
---|---|---|
2.2.3 | 2.2.4 |
Yes
Compatibility across patch versions is guaranteed. |
2.2.3 | 2.2.1 |
Yes
Compatibility across patch versions is guaranteed. |
2.2.3 | 2.3.1 |
Yes
Compatibility with later minor versions is guaranteed. |
2.2.3 | 2.1.7 |
No
Compatibility with prior minor versions is not guaranteed. |
2.2.3 | 3.0.0 |
No
Compatibility with different major versions is not guaranteed. |
2.2.3 | 1.4.7 |
No
Compatibility with different major versions is not guaranteed. |
Note: while some of the cells say "no", it is possible that the versions may be compatible, depending very precisely upon the particular APIs used by the application.
This section details how we will build the code to meet the above requirements and guidelines.
To retain perfect source and binary compatibility, a patch release can only change function implementations. Changes to the API, to the signatures of public functions, or to the interpretation of function parameters is not allowed. Effectively, these releases are pure bug fix releases.
Minor releases can introduce new functions, new symbolic and enumerated constants, and (with restrictions) replace existing functions.
For example, let's say that in version 1.2.x, we had a function defined like this:
void some_function(const char *arg1);
In version 1.3.x, we want to add a parameter to the function, so we define the new function and map the old one using a macro:
void some_function2(const char *arg1, int arg2);
#define some_function(a) some_function2((a), 0)
Within the implementation, we would have the following code:
#undef some_function
void some_function(const char *arg1)
{
some_function2(arg1, 0);
}
This strategy adds the new functionality for applications, yet retains the necessary source and binary compatibility for applications designed or built against previous minor releases.
Constants are not allowed to change since an older application will still be using them. Similarly, function signatures at the link-level may not change, so that support for older, compiled applications is maintained.
Any kind of change can be made during a major version release. Particular types of changes that might occur:
It is expected that other libraries, besides those in the APR project, will want to use the above definitions of versioning. This is quite fine, and those libraries can simply reference this document. Its canonical location is:
http://apr.apache.org/versioning.html
It is also important to note that a library that has not reached 1.0.0 is not subject to the above guidelines. Before a 1.0 release, the API can and will be changing freely, without regard to the restrictions noted in this document.