pyscripter 689 Posted September 4, 2020 LIBSUFFIX AUTO has been a much requested feature for ages. The Delphi 10.4.1 announcement said: Quote Package AUTO libsuffix: packages can now have an automatic version suffix, instead of manually updating and specifying the right version suffix with each new release. (The compiler quietly supported this in 10.4, but full support for the feature in the IDE and package project settings is introduced in 10.4.1.) Sounded interesting so I decided to try that. I first searched the documentation and found the following: Quote Note: In RAD Studio Sydney 10.4, the $LIBSUFFIX directive allows the use of an AUTO option. This option makes the compiler use the current release number for packages, it also allows to upgrade a package to a new release, with no need to update the libsuffix value. So I added {$LIBSUFFIX AUTO} to a package of mine say xyz.dpk and the bpl file generated was indeed xyz270.bpl. However I got an error message saying: Quote [Fatal Error] Can't load package xyzAUTO.bpl. The system cannot find the file specified This much for "full support" for this feature. Am I missing something?? 1 Share this post Link to post
Anders Melander 1775 Posted September 4, 2020 6 hours ago, pyscripter said: However I got an error message saying: When did you get that message? On package install? I don't have 10.4.1 installed at the moment (tested the uninstaller yesterday and haven't had time to install again) so I can't try myself. Share this post Link to post
pyscripter 689 Posted September 4, 2020 During building the package from inside the IDE, Share this post Link to post
Koru 2 Posted September 4, 2020 Did the same test and same problem, but on Win32. On Win64 it works properly for me Share this post Link to post
Remy Lebeau 1390 Posted September 4, 2020 (edited) 18 hours ago, pyscripter said: This much for "full support" for this feature. Am I missing something?? The actual {$LIBSUFFIX AUTO} directive was added to the compiler in 10.4, but they didn't advertise its existence yet, so nobody has really played with it until now. So, if the linkage is broken now, it was probably broken in 10.4 to begin with and nobody noticed. 10.4.1 just adds the ability to set the libsuffix to AUTO in the Project Options dialog. I don't have 10.4 or 10.4.1 installed, so I can't test this myself. I created a ticket for this: RSP-30820: Fail to load package with LIBSUFFIX AUTO Edited September 4, 2020 by Remy Lebeau Share this post Link to post
Darian Miller 361 Posted September 4, 2020 18 hours ago, pyscripter said: LIBSUFFIX AUTO has been a much requested feature for ages. The Delphi 10.4.1 announcement said: Sounded interesting so I decided to try that. I first searched the documentation and found the following: So I added {$LIBSUFFIX AUTO} to a package of mine say xyz.dpk and the bpl file generated was indeed xyz270.bpl. However I got an error message saying: This much for "full support" for this feature. Am I missing something?? The new drop down inserts $(Auto) Have you tried that text? Share this post Link to post
pyscripter 689 Posted September 4, 2020 (edited) 23 minutes ago, Darian Miller said: The new drop down inserts $(Auto) Have you tried that text? Thanks Darian. I did. The problem only happens when you have a dpk file without a project file. If the dpk file contains the new directive {$LIBSUFFIX AUTO} the IDE does not recognize that and thinks the actual suffix is "AUTO". Edited September 4, 2020 by pyscripter Share this post Link to post
pyscripter 689 Posted September 4, 2020 Already reported by @Remy Lebeau!😀 https://quality.embarcadero.com/browse/RSP-30820?jql= Share this post Link to post
Darian Miller 361 Posted September 4, 2020 11 minutes ago, pyscripter said: Thanks Darian. I did. The problem happens when you have a dpk file without a project file. If the dpk file contains the new directive {$LIBSUFFIX AUTO} the IDE does not recognize that and thinks the actual suffix is "AUTO". Ah, ok. I didn't try that yet. Share this post Link to post
FreeDelphiPascal 19 Posted November 4 (edited) $(Auto) is a new environment variable, introduced in Delphi 10.4. Embarcadero didn’t make a big show around it so it went unnoticed by most programmers. But don’t ignore it! It is extremely useful for packages, where it can be used as an automatic version suffix in the package’s name. How does it work? $(Auto) will be automatically substituted by Delphi with compiler’s version number: “270” for Delphi 10.4 “280” for Delphi 11 Etc. When used in the Lib Suffix field, Delphi will automatically add the compiler version number at the end of the BPL name. For example, if my Light Saber package is named LightSaber.DPK, without this automatic suffix, the binary files will be called LightSaber.BPL (and DCP). The name will be static no matter where I compile the library (Delphi Sydney or Alex). So, if I have two Delphi versions installed in parallel, the resulted BPLs will have the same name and we would not know which is for which Delphi version. But with the auto suffix the output file will be called LightSaber270.BPL under Delphi Sydney and LightSaber280.BPL under Delphi Alex. Without $(Auto), we would have to manually update the right version suffix with each new Delphi release, or we would need packages with different names (LightSaber270.DPK, LightSaber280.DPK, LightSaber290.DPK, etc). Note that when we use the LightSaber library in the requires section of another package, we specify it under its standard (non-suffixed) name. Delphi Sydney will correctly look for a file named LightSaber270.bpl and Delphi Alex for LightSaber280.bpl. Requires VclSmp, Vclwinx, LightSaber; // not LightSaber270 ! Using a library with multiple Delphi versions There are multiple reasons for installing and using multiple Delphi versions in parallel: Testing a new Delphi release to see if it is worth purchasing it. Testing a new Delphi release to see if your code still compiles without issues. For library developers, testing if your library compiles with all (new and old) Delphi versions where you want to deliver/sell your library. Hint: if you purchase a license for a specific Delphi version, you have automatic access to all versions below that. With the four environment variables described above, we can have fully automatic naming for the output files. Each DCU file will go to the correct output folder and each BPL/DCP file will be correctly suffixed. Now we can truly have multiple Delphi versions installed and functioning in parallel. Source: https://gabrielmoraru.com/auto-one-package-to-rule-them-all/ Edited November 4 by FreeDelphiPascal Share this post Link to post