Sign in Join

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

Mailing lists / lazarus / 2010-05

Package management questions

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Helmut Hartl

While working on a larger project I am contiously switching my work between 3-5 (feature) branches with the same files and the same 5 packages. (I am integrating and reviewing patches from 3 developers)

This works in principle very well, because of the good releative path management of lazarus IDE.
But I have some minor issues with the package system.

Considering 2 branches /physics and /network with packages packa,packb ,packc i have the following workflow:

Preconditions:
1) "Package Requirement Directory" in Project "Engine" is stored with option "Store dependecy filename"
(Project Inspector Context Menu)

Now I want to switch from feature branch "physics" to "network".

1) I have the project "Engine" open in Lazarus in branch "physics" (packa,packb,packc are now know to the ide from the physics branch directory)
2) I open the project "Engine" in branch "network" (because lazarus reloads my project on next open)
3) I close lazarus (because all my packages known to the IDE are now from the wrong branch)
4) I remove the file ide packagelink file : "rm
~/.lazarus/packagefiles.xml"
5) I reopen lazarus, the project opens and the switch is done.

Is there a smarter way to do this ?

Nice would be when lazarus drops my known packages simply on project open from the
other branch dir, and uses the "right" ones automagically ...

helmut

Reply by email

Mattias Gaertner
to Helmut Hartl
Show quoted text 34 lines
While working on a larger project I am contiously switching my work between 3-5 (feature) branches with the same files and the same 5 packages. (I am integrating and reviewing patches from 3 developers) This works in principle very well, because of the good releative path management of lazarus IDE. But I have some minor issues with the package system. Considering 2 branches /physics and /network with packages packa,packb ,packc i have the following workflow: Preconditions: 1) "Package Requirement Directory" in Project "Engine" is stored with option "Store dependecy filename" (Project Inspector Context Menu) Now I want to switch from feature branch "physics" to "network". 1) I have the project "Engine" open in Lazarus in branch "physics" (packa,packb,packc are now know to the ide from the physics branch directory) 2) I open the project "Engine" in branch "network" (because lazarus reloads my project on next open) 3) I close lazarus (because all my packages known to the IDE are now from the wrong branch) 4) I remove the file ide packagelink file : "rm ~/.lazarus/packagefiles.xml" 5) I reopen lazarus, the project opens and the switch is done. Is there a smarter way to do this ? Nice would be when lazarus drops my known packages simply on project open from the other branch dir, and uses the "right" ones automagically ...

Hmm. Good point.
The stored package files work as a fallback, if the user has not yet opened the package file himself. To select the right package you can set the min/max version.
But for branches you have the same package with the same version number. In this case the stored package file should be loaded. I can add a flag and a new menu item to create this.

Mattias

Reply by email

Mattias Gaertner
to Mattias Gaertner
Show quoted text 22 lines
On Fri, 14 May 2010 16:39:06 +0200 Helmut Hartl wrote: [...] > Now I want to switch from feature branch "physics" to "network". > > 1) I have the project "Engine" open in Lazarus in branch "physics" > (packa,packb,packc are now know to the ide from the physics branch > directory) > 2) I open the project "Engine" in branch "network" (because lazarus > reloads my project on next open) > 3) I close lazarus (because all my packages known to the IDE are now > from the wrong branch) > 4) I remove the file ide packagelink file : "rm > ~/.lazarus/packagefiles.xml" > 5) I reopen lazarus, the project opens and the switch is done. > > Is there a smarter way to do this ? > > Nice would be when lazarus drops my known packages simply on project > open from the > other branch dir, and uses the "right" ones automagically ...

I implemented it. See here:
http://wiki.lazarus.freepascal.org/Lazarus_Packages#Different_versions_of_a_package

Mattias

Reply by email

Helmut Hartl
to Mattias Gaertner
Mattias Gaertner wrote 20 lines
On Fri, 14 May 2010 17:25:46 +0200 Mattias Gaertner wrote: > On Fri, 14 May 2010 16:39:06 +0200 > Helmut Hartl wrote: > > [...] > >> [...] >> Nice would be when lazarus drops my known packages simply on project >> open from the >> other branch dir, and uses the "right" ones automagically ... >> I implemented it. See here: http://wiki.lazarus.freepascal.org/Lazarus_Packages#Different_versions_of_a_package Mattias

Thanks for implementing, I tested it and want to provide feedback: My package layout:
FRE.lpk (Metapackage)
-FRE_CORE.lpk (Subpackage)
-FRE_AGGPAS.lpk (Subpackage)
-FRE_AUDIO.lpk (Subpackage)
-FRE_APS.lpk (Subpackage)
-FRE_FCOM-lps (Subpackage)

The project has only the metapackage as dependency. I stored the metapackage with "preferred" option,
that works, but it only switches the metapackage not the subpackages. The workaround is to include all packages as requirement in the project - This works. The feature itself is really nice, as it now allows branch switching in zero time!

Helmut

Reply by email

Mattias Gaertner
to Helmut Hartl
Show quoted text 33 lines
Am 15.05.10 18:14, schrieb Mattias Gaertner: > On Fri, 14 May 2010 17:25:46 +0200 > Mattias Gaertner wrote: > > >> On Fri, 14 May 2010 16:39:06 +0200 >> Helmut Hartl wrote: >> >> [...] >> >>> [...] >>> Nice would be when lazarus drops my known packages simply on project >>> open from the >>> other branch dir, and uses the "right" ones automagically ... >>> > I implemented it. See here: > http://wiki.lazarus.freepascal.org/Lazarus_Packages#Different_versions_of_a_package > > > Mattias > Thanks for implementing, I tested it and want to provide feedback: My package layout: FRE.lpk (Metapackage) -FRE_CORE.lpk (Subpackage) -FRE_AGGPAS.lpk (Subpackage) -FRE_AUDIO.lpk (Subpackage) -FRE_APS.lpk (Subpackage) -FRE_FCOM-lps (Subpackage) The project has only the metapackage as dependency. I stored the metapackage with "preferred" option, that works, but it only switches the metapackage not the subpackages.

Have you set the preferred file names in the dependencies of the meta package?

The workaround is to include all packages as requirement in the project - This works.

Yes, and I think this is the better solution. Preferences should be stored in the project. Packages should be shared.

The feature itself is really nice, as it now allows branch switching in zero time!

:)

I will add it to changes list.

Mattias

Reply by email