Recent

Author Topic: Lazarus file format conversion utility  (Read 1251 times)

wp

  • Hero Member
  • *****
  • Posts: 11856
Lazarus file format conversion utility
« on: August 14, 2020, 04:46:00 pm »
It has been mentioned here in the forum several times that the Lazarus xml file format was changed some times ago in Laz trunk -- see also https://wiki.freepascal.org/Lazarus_2.2.0_release_notes#IDE_incompatibilities. It is a side-effect of this change that project and package files written by trunk cannot be read successfully by older versions (not even by the latest release 2.0.10) resulting in hard-to-understand error messages during compilation. While users of Laz trunk can simply load the project and set the "Maximize compatibility" checkbox in the project/package options users of older version have no way to fix the file format, so far.

For this reason I uploaded a simple command line utility, fixlp, to ccr (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/applications/fixlp/) which can be run with the names of the lpi, lps or lpk files to be fixed. It reads the files and replaces the non-numbered xml nodes of the new structure by the numbered nodes of the old structure.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Lazarus file format conversion utility
« Reply #1 on: August 14, 2020, 05:25:21 pm »
Thank you.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Lazarus file format conversion utility
« Reply #2 on: August 14, 2020, 06:26:33 pm »
... resulting in hard-to-understand error messages during compilation. ...

For this reason I uploaded a simple command line utility, fixlp, to ccr (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/applications/fixlp/) which can be run with the names of the lpi, lps or lpk files to be fixed. It reads the files and replaces the non-numbered xml nodes of the new structure by the numbered nodes of the old structure.

Or even in projects which silently fail to load in older versions of the IDE.

Thanks for the upload.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Lazarus file format conversion utility
« Reply #3 on: August 14, 2020, 08:10:13 pm »
It has been mentioned here in the forum several times that the Lazarus xml file format was changed some times ago in Laz trunk -- see also https://wiki.freepascal.org/Lazarus_2.2.0_release_notes#IDE_incompatibilities. It is a side-effect of this change that project and package files written by trunk cannot be read successfully by older versions (not even by the latest release 2.0.10) resulting in hard-to-understand error messages during compilation. While users of Laz trunk can simply load the project and set the "Maximize compatibility" checkbox in the project/package options users of older version have no way to fix the file format, so far.

For this reason I uploaded a simple command line utility, fixlp, to ccr (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/applications/fixlp/) which can be run with the names of the lpi, lps or lpk files to be fixed. It reads the files and replaces the non-numbered xml nodes of the new structure by the numbered nodes of the old structure.


Awesome, @wp.

Thanks
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: Lazarus file format conversion utility
« Reply #4 on: August 14, 2020, 08:41:44 pm »
Thanks.

In which final release version will the format change be implemented? If there is an interim version to be released before Lazarus 2.2.0 it may be a good idea to bundle your tool with this last pre-2.2.0 version (and to include the information on the changed XML file format in the documentation – and to provide a sensible error message).
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

wp

  • Hero Member
  • *****
  • Posts: 11856
Re: Lazarus file format conversion utility
« Reply #5 on: August 14, 2020, 10:18:59 pm »
I think there will be no more interim release before 2.2.

 

TinyPortal © 2005-2018