Recent

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

wp

  • Hero Member
  • *****
  • Posts: 7519
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.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

Handoko

  • Hero Member
  • *****
  • Posts: 3752
  • 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: 1217
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
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

ASBzone

  • Sr. Member
  • ****
  • Posts: 459
  • Automation leads to relaxation...
    • Free BrainWaveCC Console Utilities
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.0.11 r63516 / FPC v3.2.1-r46879 (via FpcUpDeluxe) -- Windows 64-bit install w/32-bit cross-compile
Primary System: Windows 10 Pro x64, Version 2004 (Build 19041.388)
Other Systems: Windows 10 Pro x64, Version 2004 or greater

jwdietrich

  • Hero Member
  • *****
  • Posts: 1131
    • 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.0.10 | FPC 3.2.0 | PPC, Intel, ARM | macOS, Windows, Linux

wp

  • Hero Member
  • *****
  • Posts: 7519
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.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

 

TinyPortal © 2005-2018