Recent

Author Topic: Lazarus, Subversion, "third party codeline" and lazbuild  (Read 418 times)

devEric69

  • Full Member
  • ***
  • Posts: 139
Lazarus, Subversion, "third party codeline" and lazbuild
« on: September 21, 2019, 10:21:14 am »
Hello,

I call upon those, who have advanced knowledge with lazbuild (https://wiki.freepascal.org/lazbuild), and "Distributing an IDE with preinstalled packages" (see https://wiki.freepascal.org/Install_IDE_packages_without_the_IDE).

I use the classic organizational pattern named "third party codeline" with Subversion. Basically, I have external repositories for used third-party components, which are injected into a subdirectory of /home/.../.../Libs of the working copy of my Lazarus projects,  through svn:externals properties placed on /Libs.

My problem is therefore to be able to recreate - at best - the build environment of an old tag\branch, to recompile, and debug it.

The problem comes mainly from the "Design" components that are installed in the pallet. If I come back to an old tag\branch, I can find a version of a component package that is no longer the one currently installed in the pallet. So I see two solutions (if some people have better, I'm open to any idea ^^ ):
● 1°) I saw that lazbuild (https://wiki.freepascal.org/lazbuild) would be able to recompile a list of *.lpk (if given their constant location in the working directory, containing versioned "Design lpk" to re-install, so that it could recompile, put in its historical and contextual build environment), and then lazbuild could recompile Lazarus itself by including the recompiled *.lpk-"Design".

● 2°) the solution of last resort: to program everything "manually", i. e. not to use the RAD features (deposit WYSIWYG of controls on TForm and TDatamodules, relying on streaming in *.lfm) by creating and configuring all components in the *.pas file. That's what I'd like to avoid, especially for the simplicity of RAD with db-aware controls :( .

➔ To summarize, is it possible to write a batch or shell script around lazbuild, to recreate a contextual build-environment stored in Subversion, with the right *.lpk-"Design" versioned versions reinstalled in their pallets (if so, any brief examples, tips,..., are welcome)?

ps: my question is very similar to the one already asked here.... https://forum.lazarus.freepascal.org/index.php?topic=44009.0 ...but for which I finally didn't understand in the end, if lazbuild and its switches are able to do that, because @dbannon had switched towards another solution.

Regards.
« Last Edit: September 21, 2019, 02:42:20 pm by devEric69 »
use: Ubuntu 18.04 + Laz. 1.8.5 + FPC 3.0.5 (64 bits).

devEric69

  • Full Member
  • ***
  • Posts: 139
Re: Lazarus, Subversion, "third party codeline" and lazbuild
« Reply #1 on: September 23, 2019, 09:41:49 am »
↑ Above: so, nobody has any feedback of experience, to reify an old "build environment" identically (i.e. put in its historical context, thanks to SVN for exemple, in which we saved everything including the same versions of run-time and design-time packages, ..., everything that has been used when we compiled an old branch o release-tag, that we want to recreate similarly now to fix a bug in a "ceretis paribus" way?
:'(
use: Ubuntu 18.04 + Laz. 1.8.5 + FPC 3.0.5 (64 bits).

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7459
Re: Lazarus, Subversion, "third party codeline" and lazbuild
« Reply #2 on: September 23, 2019, 11:53:29 am »
I don't fully understand your problem, but my gut tells me  you need to add the relevant lazarus package configuration to SVN too. So that you restore it, version data inclusive.

devEric69

  • Full Member
  • ***
  • Posts: 139
Re: Lazarus, Subversion, "third party codeline" and lazbuild
« Reply #3 on: September 23, 2019, 02:07:43 pm »
Quote
I don't fully understand your problem

Ok, I'm probably too vague.
I'm talking about restoring a "build environment", with old versions of packages, used for in an old release-tag compilation.

nb: I limit myself to the problem of restoring third-party packages (which come from GitHub, SourceForge, ...), each of these third-party code sources, are stored in their local SVN repositories, on my computer. The versions of Lazarus and FCP being constant!

Quote
my gut tells me  you need to add the relevant lazarus package configuration to SVN too. > So that you restore it, version data inclusive.

Yes, I'm talking about that: let's say I saved, in the "release1.0.0" SVN-tag, everything I've used: all versioned third-party source codes (run-time and design-time *.lpk, configuration files, *.lpl files, packagefiles.xml, miscellaneousoption.xml, packegelinks.xml, etc).

Time is passing.

A bug is found in "release1.0.0", so I check-out "release1.0.0". Then, in my working copy, I have the source code of the "release1.0.0". I am happy.

==> Now, I wonder if it's theoretically possible, to write a *.sh or *.bat script around the tool Lazbuild (that seems to be made for that), which could allow me to *automate* in this way:
1°) the deletion from the Lazarus palette, of the components used too by "release1.0.0", but which are not necessarily in their correct version (it's probably a little paranoid);
2°) the recompilation of run-time *.lpk used by "release1.0.0";
3°) the recompilation of desig-time *.lpk used by "release1.0.0";
4°) the recompilation of Lazarus itself, in order to have the IDE with the correct versions of the visual components in their pallets, components recompiled in 3°)?
use: Ubuntu 18.04 + Laz. 1.8.5 + FPC 3.0.5 (64 bits).

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7459
Re: Lazarus, Subversion, "third party codeline" and lazbuild
« Reply #4 on: September 23, 2019, 02:17:11 pm »
1 is for the paranoid,  and not managed or known by Lazarus

4 implies 2 and 3 and afaik the base commandline for that would be something like

lazbuild -B  -pcp=release100/config --build-ide=

The only problem is that you first must make the whole thing compiling in that situation (with all your external pkgs in release100/ and the config there) and only than commit.

dbannon

  • Hero Member
  • *****
  • Posts: 702
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus, Subversion, "third party codeline" and lazbuild
« Reply #5 on: September 23, 2019, 02:41:21 pm »
devEric69, sorry for such a bland answer, but I rcannot re-read you post as someone is waiting for me. And I did find it a bit hard to understand what you want.

But just in case it helps, I did manage to make a bash script that does, perhaps, do a bit of what you want to do. See it at https://github.com/tomboy-notes/tomboy-ng/blob/master/tomboy-ng/buildit.bash

Its a command line driven way to build tomboy-ng including getting and building an external package (kcontrols). You could use this approach to get and build any combination of Lazarus/extPackages you like.

Sorry if I have misunderstood so much that this is an unwelcome distraction.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

devEric69

  • Full Member
  • ***
  • Posts: 139
Re: Lazarus, Subversion, "third party codeline" and lazbuild
« Reply #6 on: September 23, 2019, 03:16:44 pm »
@marcov: thank you for the clarifications regarding the order of dependencies between Lazbuid and Lazarus.

@dbannon: thank you for the link, leading to your script using Lazbuid. That's what I was looking for too: a rather concrete, and rather complete example of Lazbuild's possibilities.

==> I have to study Lazbuild now...  :)
« Last Edit: September 23, 2019, 03:20:51 pm by devEric69 »
use: Ubuntu 18.04 + Laz. 1.8.5 + FPC 3.0.5 (64 bits).