Jump to content
A.M. Hoornweg

How do I find out in which Delphi version a certain RTL/VCL change was implemented?

Recommended Posts

Hello all,

 

Our company uses several Delphi versions and I want my code to compile without warnings on all these versions.

 

When I compile one of my units with Delphi Rio, the compiler emits a warning that "sysutils.searchbuf" is deprecated and has moved to the "ansistrings" unit.   No problem, but how do I find out in which Delphi version this transition was made?  I'd like to write an appropriate {$IF compilerversion} around my code block to suppress the warning and keep it functional across all Delphi versions.  

 

 

Kind regards,

Arthur

 

 

 

 

 

Share this post


Link to post

As my build machine contains all Delphi versions since XE, I make a simple search for the affected source file and text. I have created a specific search configuration in Total Commander with all the sources folders of the different Delphi installations. That way I only need to specify the file name/pattern and the search text and the time for the search is negligible. This way I can usually figure out which version introduced the change in less than a few seconds.

 

In case the change happened before XE I would have to fire up the old build VM that goes back to Delphi 5, but I rarely have a need for that.

Share this post


Link to post

For GExperts I usually just let the compiler figure it out. I have a build script that runs a build for all supported Delphi versions (6 to 10.3) and if there is a hint / warning (or error), I check which versions are affected and put ifdefs / if or unit aliases into the project to make them go away.

 

As far as I know there is no official list of which features were introduced when. There are "What's new" entries in the release announcements and there is a StackOverflow "question" which tries to list them, but nothing official and nothing complete.

Share this post


Link to post
16 minutes ago, dummzeuch said:

but nothing official and nothing complete.

Exactly! Anyway, looking into the source is more reliable and usually also faster.

Share this post


Link to post

Never mind, I've found an easier way to find it out.

 

Look at this page :

 

http://docwiki.embarcadero.com/Libraries/Rio/en/Help_of_Previous_Versions

 

This page lets me browse the help file wiki for older Delphi versions (starting with 2010).  I simply navigated to the unit of interest for a specific Delphi version, such as this one:

 

http://docwiki.embarcadero.com/Libraries/XE7/en/System.AnsiStrings

 

... and by simply replacing  the "XE7" in the link for older versions,  I was able to ascertain that function "searchbuf"  first appeared in the Ansistrings unit in Delphi XE4. 

Problem solved!

Share this post


Link to post
On 2/21/2019 at 9:38 AM, Uwe Raabe said:

As my build machine contains all Delphi versions since XE, ....

One stupid queston: How do you manage all the different versions of related libraries and frameworks ?

(like AndroidStudio, iOS Frameworks, etc.)

 

Wouldn't it be simpler to keep each version into a separate, clean VM ?

Edited by Rollo62

Share this post


Link to post
41 minutes ago, Rollo62 said:

Wouldn't it be simpler to keep each version into a separate, clean VM ?

Not for a build server running a FinalBuilder project with an iterator over the required compiler versions. Compiling in own VMs for each compiler version would be a nightmare. Let alone having to run all those VMs synchronously during the build process.

 

F.i. building MMX Code Explorer for the current 4 compilers, creating the setup, signing and upload is done in about 45 seconds. I doubt that would be possible if I would compile on 4 different VMs. Looking at ProjectMagician, which targets XE3 and up (10 compilers involved) currently needs about 30 seconds to build. Hard to achieve that with 10 separate VMs without significantly extending the build server hardware.

 

To be fair, all these IDE installations are only for building, not for working interactively. and currently I have no mobile projects to be build on that system.

 

Aren't the paths to those libraries and frameworks set individually for each IDE Version? In that case FinalBuilder takes care to adjust the environment accordingly when executing the compile action.

 

What are your specific problems with those?

Share this post


Link to post

Yes, for VCL this should be the right way.
I'm curious about the different versions for Andoid and iOS, which can bring much instability into the builds.
Do you work also with such OS in the FinalBuilder ?

If so, are you working with AndroidStudio, having all the different Versions installed ?
I think this could be quite easy.

For iOS/MacOS this could be more difficult, so probably at least these could be running in separate OSX-VM.

 

Maybe the right way is to have all RadStudio Versions and AndroidStudio on one machine, and the various OSX Versions
in separate, small VMs ?

 

 

Share this post


Link to post
2 hours ago, Rollo62 said:

If so, are you working with AndroidStudio, having all the different Versions installed ?
I think this could be quite easy.

For iOS/MacOS this could be more difficult, so probably at least these could be running in separate OSX-VM.

 

Maybe the right way is to have all RadStudio Versions and AndroidStudio on one machine, and the various OSX Versions
in separate, small VMs ? 

I would expect it to be the other way around. In general I would calculate one build per form factor. Unless the app is highly flexible size wise. So considering the very large Android biosphere as opposed to the three iphones + 4 or 5 iPads that's 8 iOS builds (tops, I don't build for iPhone and need only one iPad build) plus one macOS build. And you can get all those builds from the same XCode i.e. macOS machine. This is not even counting the version problem with Android. For iOS you currently have to develop for 3 versions to get more than 90% device coverage (https://david-smith.org/iosversionstats/). This also means you only need to create a 64Bit iOS 10 binary.

For Android that is a bit more complicated (ignoring the Intel CPUs): You have 5 versions to consider viable for your customers (https://fossbytes.com/most-popular-android-versions-always-updated/). Frankly I don't know the Android build process, but it seems you have to consider a bit more than with iOS.

Share this post


Link to post
3 hours ago, Uwe Raabe said:

Not for a build server running a FinalBuilder project with an iterator over the required compiler versions. Compiling in own VMs for each compiler version would be a nightmare. Let alone having to run all those VMs synchronously during the build process.

 

I use Finalbuilder too, but as far as I can see you can't parametrize the Delphi version in the compile action.

Do you create a separate compile action for each Delphi version?

Share this post


Link to post
1 hour ago, Sherlock said:

ISo considering the very large Android biosphere as opposed to the three iphones + 4 or 5 iPads that's 8 iOS builds (tops, I don't build for iPhone and need only one iPad build) plus one macOS build. And you can get all those builds from the same XCode i.e. macOS machine.

Yes, but I think AndroidStudio does a very good job keeping the different versions all under one hood.
XCode on the other side had already some critical breaks, refusing working together with RadStudio.

On the other hand the yearly Apple provisioning desaster could be a good reason to keep also several XCode versions in one maching.
At least XCode allows several versions side-by-side, using xcode-switch to change between.
But that very clumsy, and I tend to avoid such scenario.
I like the clean installs in VM, which also could be easily updated or completely new build from scratch.

 

Of coarse you have a trillion Android devices, thats another story, and I personally don't think that there is the need to cover them all.
If you focus on the main player (Samsung, LG, etc.) in the market, you already will get 80-90% coverage.

Share this post


Link to post
43 minutes ago, A.M. Hoornweg said:

I use Finalbuilder too, but as far as I can see you can't parametrize the Delphi version in the compile action.

Not in the Action dialog itself, but in the script.

 

The iterator sets a variable CompilerVersion in OnBeforeEachIteration:

CompilerVersion = Delphi10Seattle + Iteration - 1;

and the compiler action sets the Action property in the OnBeforeAction script:

Action.CompilerVersion = CompilerVersion;

 

  • Like 1

Share this post


Link to post
On 2/22/2019 at 5:43 PM, Uwe Raabe said:

Not in the Action dialog itself, but in the script.

 

The iterator sets a variable CompilerVersion in OnBeforeEachIteration:


CompilerVersion = Delphi10Seattle + Iteration - 1;

and the compiler action sets the Action property in the OnBeforeAction script:


Action.CompilerVersion = CompilerVersion;

 

That's cool!  I really need to take a closer look at these event functions.  Thanks for teaching me something new!

Share this post


Link to post
On 2/22/2019 at 12:24 PM, Rollo62 said:

One stupid queston: How do you manage all the different versions of related libraries and frameworks ?

(like AndroidStudio, iOS Frameworks, etc.)

 

Wouldn't it be simpler to keep each version into a separate, clean VM ?

They are all in different directories (if you need the units) or have different suffixes (if you need packages). No big deal. Never had any problems with that.

Edited by Rudy Velthuis

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×