Recent

Author Topic: Is "FPC_FULLVERSION" not configured properly in some builds?  (Read 2802 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Is "FPC_FULLVERSION" not configured properly in some builds?
« on: February 26, 2024, 12:29:03 pm »
I build a new version of Lazarus yesterday with the version from the Help | About box

Lazarus 3.1 (rev lazarus_3_0-140-gd0fda80791) FPC 3.2.3 x86_64-linux-gtk2

and when I compile BGRABitmapPack I get the following errors from the subsequent code

Quote
Compile package BGRABitmapPack 11.5.8: Exit code 1, Errors: 3, Warnings: 4, Hints: 8
bgraunicode.pas(1143,19) Warning: function result variable of a managed type does not seem to be initialized
unibitmap.inc(121,5) Error: Duplicate identifier "FResolutionUnit"
unibitmap.inc(121,20) Hint: Identifier already defined in unit FPIMAGE: fpimage.pp at line 121
unibitmap.inc(122,5) Error: Duplicate identifier "FResolutionX"
unibitmap.inc(122,17) Hint: Identifier already defined in unit FPIMAGE: fpimage.pp at line 122
unibitmap.inc(123,5) Error: Duplicate identifier "FResolutionY"
unibitmap.inc(123,17) Hint: Identifier already defined in unit FPIMAGE: fpimage.pp at line 123
unibitmap.inc(127,14) Warning: An inherited method is hidden by "GetResolutionHeight:Single;"

Code: Pascal  [Select][+][-]
  1.     {$IF FPC_FULLVERSION<30301}
  2.     //Resolution
  3.     FResolutionUnit: TResolutionUnit;
  4.     FResolutionX,
  5.     FResolutionY: Single;
  6.  
  7.     procedure SetResolutionUnit(AResolutionUnit: TResolutionUnit);
  8.     function GetResolutionWidth: Single; virtual;
  9.     function GetResolutionHeight: Single; virtual;
  10.     {$ENDIF}
  11.  

It seems that although the FPC version is 3.2.3 it fails the check for {$IF FPC_FULLVERSION<30301}

Is that a problem or in the debug build or is some feature of the fpcdeluxe I used to build Lazarus?

Could it be that library developer used the wrong string for FPC_FULLVERSION?

Can I set FPC_FULLVERSION some where in the build settings to override this?
« Last Edit: February 26, 2024, 12:34:35 pm by vfclists »
Lazarus 3.0/FPC 3.2.2

cdbc

  • Hero Member
  • *****
  • Posts: 1157
    • http://www.cdbc.dk
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #1 on: February 26, 2024, 01:10:54 pm »
Hi
Well, Of course it fails the check for version >'30301' = 3.3.1 = /trunk/...
Because Its version is namely > '30203' = 3.2.3 = /3.2.2-Fixes/...
So the BGRA-stuff is compiled with trunk-compiler...
edit: Solution: get the trunk = 3.3.1 compiler with FpcUpDeluxe  :D
edit2: remember to check for gitlab-issues before compiler download!
Regards Benny
« Last Edit: February 26, 2024, 01:15:58 pm by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

paweld

  • Hero Member
  • *****
  • Posts: 1028
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #2 on: February 26, 2024, 01:34:33 pm »
get BGRABitmap from dev branch: https://github.com/bgrabitmap/bgrabitmap/tree/dev-bgrabitmap   
this is fixed
Best regards / Pozdrawiam
paweld

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11517
  • FPC developer.
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #3 on: February 26, 2024, 02:04:00 pm »
Probably it means that some trunk change was merged back to the fixes (3.2.x ) branch, probably during the big merges of december. The $if needs to be adapted for that.

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #4 on: February 26, 2024, 04:20:41 pm »
I think the change may be in Lazarus because the error is not present in Lazarus 3.0 - Lazarus 3.0 (rev lazarus_3_0) FPC 3.2.2 x86_64-linux-gtk2

Which indicates the change must be made in BGRABitmap.
Lazarus 3.0/FPC 3.2.2

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #5 on: February 26, 2024, 04:21:56 pm »
Hi
Well, Of course it fails the check for version >'30301' = 3.3.1 = /trunk/...
Because Its version is namely > '30203' = 3.2.3 = /3.2.2-Fixes/...
So the BGRA-stuff is compiled with trunk-compiler...
edit: Solution: get the trunk = 3.3.1 compiler with FpcUpDeluxe  :D
edit2: remember to check for gitlab-issues before compiler download!
Regards Benny

I think the change may be in Lazarus because the error is not present in Lazarus 3.0 - Lazarus 3.0 (rev lazarus_3_0) FPC 3.2.2 x86_64-linux-gtk2

Which indicates the change must be made in BGRABitmap.
Lazarus 3.0/FPC 3.2.2

cdbc

  • Hero Member
  • *****
  • Posts: 1157
    • http://www.cdbc.dk
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #6 on: February 26, 2024, 04:32:16 pm »
Hi
I think you're right:
Quote
Compile package BGRABitmapPack 11.5.8: Exit code 1, Errors: 3, Warnings: 4, Hints: 8
from your first post...
...and I remember f.ex. @lainz was making some changes recently, that's why I thought, it might be better with the trunk-compiler  8)
Ps.: At least on my lappy, the 3.3.1 compiler is an order of magnitude faster, than the 3.2.2 one.(read compiles to faster running code)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

MarkMLl

  • Hero Member
  • *****
  • Posts: 6747
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #7 on: February 26, 2024, 04:39:04 pm »
Can I set FPC_FULLVERSION some where in the build settings to override this?

The problem is likely to be in a library/package which was built outside the scope of your project's build settings.

I think that a more useful question is "how can I expand FPC_FULLVERSION in my code so that I can be absolutely certain what version compiler is being used?".

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

rvk

  • Hero Member
  • *****
  • Posts: 6191
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #8 on: February 26, 2024, 05:15:21 pm »
I think that a more useful question is "how can I expand FPC_FULLVERSION in my code so that I can be absolutely certain what version compiler is being used?".
Isn't FPC_FULLVERSION not just a constant in FPC ???

Also... you can use a macro to actually print it out.

Code: Pascal  [Select][+][-]
  1. program Project1;
  2. {$MACRO ON}
  3. begin
  4.  
  5. writeln(FPC_FULLVERSION);
  6.  
  7. {$DEFINE vs:=writeln(FPC_FULLVERSION)}
  8. vs;
  9.  
  10. readln;
  11.  
  12. end.

Quote
30301
30301

Lazarus 3.1 (rev lazarus_3_0-140-gd0fda80791) FPC 3.2.3 x86_64-linux-gtk2
Does 3.2.3 even exist???
I thought it would have been 3.3.1.
« Last Edit: February 26, 2024, 05:21:48 pm by rvk »

TRon

  • Hero Member
  • *****
  • Posts: 2660
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #9 on: February 26, 2024, 05:31:59 pm »
Does 3.2.3 even exist???
I thought it would have been 3.3.1.

To my knowledge:
3.2.2 -> even is release version
3.2.3 -> fixes on top of release version
3.3.1 -> trunk

And that should be it (*) ?

(*) not including new feature branches and perhaps upcoming release version that might be branched/tagged (already)
« Last Edit: February 26, 2024, 05:35:20 pm by TRon »

Thaddy

  • Hero Member
  • *****
  • Posts: 14583
  • Sensorship about opinions does not belong here.
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #10 on: February 26, 2024, 05:59:20 pm »
You can also retrieve the EXACT version of main trunk and including the revision.
This is like this for x86_64:
Code: ASM  [Select][+][-]
  1. .section .fpc.n_version,"aw"
  2.         .balign 32
  3. __fpc_ident:
  4.         .ascii  "FPC 3.3.1-15198-g71a46465c8-dirty [2024/02/19] for "
  5.         .ascii  "x86_64 - Win64"
This is not what you want in most cases, but I already posted how to retrieve this in pure Pascal.
Here is a slightly modified version I published a couple of years ago.

Code: Pascal  [Select][+][-]
  1. program testversion;
  2. type
  3.  TCharArray = array [0..1023] of char; //arbitrary
  4. var
  5.  __fpc_ident:TCharArray;external;
  6. begin
  7.   writeln(__fpc_ident);
  8. end.
These kind of tricks are not recommended!!!!
It shows the compiler version + the git + if I have modified it myself + compile date + platform.
It seems cross platform, works on Arm32 too.... and on Linux and Windows.
Do not use. A normal user does not need this.
« Last Edit: February 26, 2024, 06:39:04 pm by Thaddy »
bitrate is always calculated like this:sample rate * bitdepth * number of channels.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6747
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #11 on: February 26, 2024, 07:45:43 pm »
Isn't FPC_FULLVERSION not just a constant in FPC ???

Can't be, it's not documented.

https://www.freepascal.org/docs-html/current/rtl/index-8.html#SECTIONF

Quote
Also... you can use a macro to actually print it out.

Code: Pascal  [Select][+][-]
  1. program Project1;
  2. {$MACRO ON}
  3. begin
  4.  
  5. writeln(FPC_FULLVERSION);
  6.  
  7. {$DEFINE vs:=writeln(FPC_FULLVERSION)}
  8. vs;
  9.  
  10. readln;
  11.  
  12. end.

Ah yes, very nice... thanks for that :-)

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

Thaddy

  • Hero Member
  • *****
  • Posts: 14583
  • Sensorship about opinions does not belong here.
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #12 on: February 26, 2024, 07:51:08 pm »
Yes. But the true full version is différent as I demonstrated.
bitrate is always calculated like this:sample rate * bitdepth * number of channels.

Thaddy

  • Hero Member
  • *****
  • Posts: 14583
  • Sensorship about opinions does not belong here.
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #13 on: February 26, 2024, 07:53:54 pm »
Can't be, it's not documented.
My version is extremely not documented but FULL_VERSION is documented.
bitrate is always calculated like this:sample rate * bitdepth * number of channels.

qk

  • New Member
  • *
  • Posts: 33
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #14 on: February 26, 2024, 08:01:57 pm »
Probably it means that some trunk change was merged back to the fixes (3.2.x ) branch, probably during the big merges of december. The $if needs to be adapted for that.

+1

My two cents, it might be sufficient to replace all occurrences of

Code: Pascal  [Select][+][-]
  1. {$IF FPC_FULLVERSION<30301}

with

Code: Pascal  [Select][+][-]
  1. {$IF FPC_FULLVERSION<30203}

into BGRABitmap and BGRAControls packages.

It seems to work.
Regards

 

TinyPortal © 2005-2018