Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-02

Changing package versions

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Werner Pamler

My development system for fpspreadsheet is Lazarus 1.2.6 and, of course, the trunk version of fpspreadsheet (version 1.5). Sometimes, however, I have to switch to the released versions, e.g. 1.4.1, and this appears to be very confusing to me.

Here is what I am doing
- Initially, fpspreadsheet v1.5 is installed.
- "Packages" / "Install/Uninstall packages" --> select "laz_fpspreadsheet_visual" and "laz_fpspreadsheetexport_visual", "Uninstall selection", "Save and rebuild IDE"
- "Packages" / "Open package file": navigate to folder with fpspreadsheet v1.4.1. Open each package file and install. At the end, recompile IDE.
- When Lazarus comes back after building and I open the "Install/Uninstall packages" again, I'd expect to see versions 1.4.1, but I see version 1.5 again.
- I tried several "recompile clean" etc. No effect, still version 1.5.

Looking at the packagefiles.xml in my user profile I see that both versions are listed. After deleting the entries of version 1.5 and rebuilding, I finally see version 1.4.1 in the "Install/Uninstall packages" list.

Is it really so complicated? Or am I doing something wrong?

Reply by email

Mattias Gaertner
to Werner Pamler
Show quoted text 17 lines
My development system for fpspreadsheet is Lazarus 1.2.6 and, of course, the trunk version of fpspreadsheet (version 1.5). Sometimes, however, I have to switch to the released versions, e.g. 1.4.1, and this appears to be very confusing to me. Here is what I am doing - Initially, fpspreadsheet v1.5 is installed. - "Packages" / "Install/Uninstall packages" --> select "laz_fpspreadsheet_visual" and "laz_fpspreadsheetexport_visual", "Uninstall selection", "Save and rebuild IDE" - "Packages" / "Open package file": navigate to folder with fpspreadsheet v1.4.1. Open each package file and install. At the end, recompile IDE. - When Lazarus comes back after building and I open the "Install/Uninstall packages" again, I'd expect to see versions 1.4.1, but I see version 1.5 again. - I tried several "recompile clean" etc. No effect, still version 1.5.

Sounds like a bug.
This should work:
- Initially, fpspreadsheet v1.5 is installed.
- Open packages (.lpk) of fpspreadsheets 1.4.
- Rebuild the IDE. This should compile with fpspreadsheets 1.4.
- Restart IDE. It should load fpspreadsheets 1.4.
- If you open a project with a dependency for 1.5, 1.5 will be loaded.

Looking at the packagefiles.xml in my user profile I see that both versions are listed. After deleting the entries of version 1.5 and rebuilding, I finally see version 1.4.1 in the "Install/Uninstall packages" list.

You can clean up the package list via Package / Package Links.

Mattias

Reply by email

Werner Pamler
Show quoted text 7 lines
This should work: - Initially, fpspreadsheet v1.5 is installed. - Open packages (.lpk) of fpspreadsheets 1.4. - Rebuild the IDE. This should compile with fpspreadsheets 1.4. - Restart IDE. It should load fpspreadsheets 1.4. - If you open a project with a dependency for 1.5, 1.5 will be loaded.

No, it comes up with 1.5 in the Install/Uninstall packages list, and if I add one of the visual components to a new project, the project options tell me that it is version 1.5 as well. If I open a demo file of the version 1.4 the used package is reported to be 1.5 again.

Do you want me to file a bug report?

You can clean up the package list via Package / Package Links.

Great tool which makes my workaround much easier! I wonder how many gems are within Lazarus that I've never seen...

Reply by email

Michael Van Canneyt
to Werner Pamler
Werner Pamler wrote 19 lines
> This should work: > - Initially, fpspreadsheet v1.5 is installed. > - Open packages (.lpk) of fpspreadsheets 1.4. > - Rebuild the IDE. This should compile with fpspreadsheets 1.4. > - Restart IDE. It should load fpspreadsheets 1.4. > - If you open a project with a dependency for 1.5, 1.5 will be > loaded. No, it comes up with 1.5 in the Install/Uninstall packages list, and if I add one of the visual components to a new project, the project options tell me that it is version 1.5 as well. If I open a demo file of the version 1.4 the used package is reported to be 1.5 again. Do you want me to file a bug report? > You can clean up the package list via Package / Package Links. Great tool which makes my workaround much easier! I wonder how many gems are within Lazarus that I've never seen...

Idem here, I was pleasantly surprised by this dialog.

Michael.

Reply by email

Mattias Gaertner
to Mattias Gaertner: On Fri, 06 Feb 2015 23:44:42 +0100 Sounds like a bug. This should work: - Initially,…
Show quoted text 8 lines
[...] This should work: - Initially, fpspreadsheet v1.5 is installed. - Open packages (.lpk) of fpspreadsheets 1.4. - Rebuild the IDE. This should compile with fpspreadsheets 1.4. - Restart IDE. It should load fpspreadsheets 1.4. - If you open a project with a dependency for 1.5, 1.5 will be loaded.

Note:
By default the IDE creates project dependencies only with a name, *without* any version or file preference. That means the project will take any package that fits the name, which usually is the last opened lpk with that name, which could be 1.4 or 1.5 or whatever.

An example for 1.5 fpspreadsheets in a sub directory of the fpspreadsheets repository, should set the "preferred" file name (right click on the dependency) to enforce loading the 1.5 version.

Mattias

Reply by email

Mattias Gaertner
to Werner Pamler: No, it comes up with 1.5 in the Install/Uninstall packages list, and if I add one of the…
Show quoted text 15 lines
> This should work: > - Initially, fpspreadsheet v1.5 is installed. > - Open packages (.lpk) of fpspreadsheets 1.4. > - Rebuild the IDE. This should compile with fpspreadsheets 1.4. > - Restart IDE. It should load fpspreadsheets 1.4. > - If you open a project with a dependency for 1.5, 1.5 will be > loaded. No, it comes up with 1.5 in the Install/Uninstall packages list, and if I add one of the visual components to a new project, the project options tell me that it is version 1.5 as well. If I open a demo file of the version 1.4 the used package is reported to be 1.5 again. Do you want me to file a bug report?

No. I fixed it. Please test.

Mattias

Reply by email

Werner Pamler
No. I fixed it. Please test.

Yes, after I "store the filename as preferred" in the V1.5 and V1.4 demo package dependencies I can load, compile and run both demos without having to recompile the IDE. Nice!

Reply by email

Werner Pamler

Grrr - sent too early! Things get more complicated...

Currently both package versions are known to the IDE, but I think there is a bug in the project inspector which tells the wrong package version:

On the component palette I see TsWorkbookChartSource which did not exist before 1.5. Therefore the active package version must be 1.5. But if I create a new project and add a visual spreadsheet control to create the dependency the project inspector tells me that the package is version 1.4. The same, if the dependency is added manually to an empty project.

The same if I open another demo of v1.5
("examples\fpschart\workbookchartsource\fpschartsource.lpi") in which the package filename has not yet been marked as "preferred". This demo uses a TsWorkbookChartSource which is not yet available in v1.4. The form opens without any issues, therefore, the IDE seems to work with v1.5. But the project inspector says again that the package is version 1.4.

Reply by email

Mattias Gaertner
to Werner Pamler
Show quoted text 17 lines
Grrr - sent too early! Things get more complicated... Currently both package versions are known to the IDE, but I think there is a bug in the project inspector which tells the wrong package version: On the component palette I see TsWorkbookChartSource which did not exist before 1.5. Therefore the active package version must be 1.5. But if I create a new project and add a visual spreadsheet control to create the dependency the project inspector tells me that the package is version 1.4. The same, if the dependency is added manually to an empty project. The same if I open another demo of v1.5 ("examples\fpschart\workbookchartsource\fpschartsource.lpi") in which the package filename has not yet been marked as "preferred". This demo uses a TsWorkbookChartSource which is not yet available in v1.4. The form opens without any issues, therefore, the IDE seems to work with v1.5. But the project inspector says again that the package is version 1.4.

There are two versions - the binary and the source code. When the IDE is built, the current package is compiled and linked in. But you have to restart to load the new code.
You can now alter the package source, for example add or remove a component, change the version, save the package at another place, or load another lpk with the same name.
The loaded binary code is still the old - the component palette is still the same. You have to rebuild and restart the IDE to get the binary changes.

You can quickly switch the fpspreadsheet version by using Package / Open Recent Package ...
Or by loading a project which has "preferred" package version.

You cannot load two lpk with the same name at the same time.

Mattias

Reply by email