Recent

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

TRon

  • Hero Member
  • *****
  • Posts: 3647
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #15 on: February 26, 2024, 08:02:18 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
afaik it is not a constant. It is documented here and is actually a number (to be able to compare versions). Or you can use include
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

rvk

  • Hero Member
  • *****
  • Posts: 6588
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #16 on: February 26, 2024, 08:07:18 pm »
How does writeln(FPC_FULLVERSION) work then?

Where does FPC_FULLVERSION come from if it's only a define.
(I can't use any other defines like that)


O, forget my question.
It's a macro.
What line only works if macros is on ( {$MACRO ON}  ).
« Last Edit: February 26, 2024, 08:10:30 pm by rvk »

Thaddy

  • Hero Member
  • *****
  • Posts: 16196
  • Censorship about opinions does not belong here.
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #17 on: February 26, 2024, 08:14:34 pm »
You do not need a macro, just a little compiler internals...
If I smell bad code it usually is bad code and that includes my own code.

qk

  • New Member
  • *
  • Posts: 33
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #18 on: February 26, 2024, 08:39:50 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

The issue has already been reported and resolved in the development branch in that manner.  :-[
« Last Edit: February 26, 2024, 08:42:15 pm by qk »

MarkMLl

  • Hero Member
  • *****
  • Posts: 8038
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #19 on: February 27, 2024, 08:32:05 am »
You do not need a macro, just a little compiler internals...

Does that expand FPC_FULLVERSION, which is what I asked?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
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: 16196
  • Censorship about opinions does not belong here.
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #20 on: February 27, 2024, 08:41:58 am »
My code expands much more precise than the version macro.
E.g. the FULL_VERSION omits version data related to GIT and it omits the compiler build date and platform.
These are essential information if you are working with - or on - trunk/main.
But the normal approach would be the macro approach. If that is enough for you, use the macro.
« Last Edit: February 27, 2024, 08:44:54 am by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8038
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #21 on: February 27, 2024, 08:54:07 am »
My code expands much more precise than the version macro.
E.g. the FULL_VERSION omits version data related to GIT and it omits the compiler build date and platform.
These are essential information if you are working with - or on - trunk/main.
But the normal approach would be the macro approach. If that is enough for you, use the macro.

Don't care about git etc., hence doesn't answer my question.

Sorry for generating noise.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
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: 6588
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #22 on: February 27, 2024, 09:59:11 am »
My code expands much more precise than the version macro.
E.g. the FULL_VERSION omits version data related to GIT and it omits the compiler build date and platform.
Mine (fresh from gitlab) doesn't show revision or git info (only compile date):

Result with fixes 3_0: FPC 3.2.3 [2024/02/26] for x86_64 - Win64
Result with trunk: FPC 3.3.1 [2024/02/27] for x86_64 - Win64

I'm not sure where your "FPC 3.3.1-15198-g71a46465c8-dirty [2024/02/19] for" comes from.

cdbc

  • Hero Member
  • *****
  • Posts: 1673
    • http://www.cdbc.dk
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #23 on: February 27, 2024, 10:22:38 am »
Hi
The 'dirty' is a giveaway for FpcUpDeluxe compiled
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

Thaddy

  • Hero Member
  • *****
  • Posts: 16196
  • Censorship about opinions does not belong here.
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #24 on: February 27, 2024, 10:23:35 am »
Mine shows today:
FPC 3.3.1-15286-g1966ce7c1c [2024/02/26] for x86_64 - Win64
Fresh from gitlab
and FPC 3.3.1-15286-g1966ce7c1c [2024/02/26] for x86_64 - Linux
If I smell bad code it usually is bad code and that includes my own code.

Thaddy

  • Hero Member
  • *****
  • Posts: 16196
  • Censorship about opinions does not belong here.
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #25 on: February 27, 2024, 10:25:10 am »
Hi
The 'dirty' is a giveaway for FpcUpDeluxe compiled
Regards Benny
No it indicates my local repository is not clean. IOW code is compiled with my local changes.

That does not say that fpcupdeluxe can not have the same result.
And it can very well be that fpcupdeluxe adds the git info.

An older box gives me:
FPC 3.2.2+dfsg-20 [2023/03/30] for x86_64 - Linux
Which is at least also more informative than the macro.

In the past I also had code that the svn revision added to my builds (as per this forum and feature requests.
« Last Edit: February 27, 2024, 10:34:55 am by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

rvk

  • Hero Member
  • *****
  • Posts: 6588
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #26 on: February 27, 2024, 10:43:19 am »
Mine shows today:
FPC 3.3.1-15286-g1966ce7c1c [2024/02/26] for x86_64 - Win64
Fresh from gitlab
and FPC 3.3.1-15286-g1966ce7c1c [2024/02/26] for x86_64 - Linux
Weird. Mine does not show the revision.
Even the freshly compiled fpc gives:
Quote
Free Pascal Compiler version 3.3.1 [2024/02/27] for x86_64
Copyright (c) 1993-2024 by Florian Klaempfl and others

How do you download from gitlab?? And where is this added?? (In which file)

I download with: "git clone https://gitlab.com/freepascal.org/fpc/source.git fpc"
Am I missing a step?

I also don't recognize the revision 15286 (which kinda looks like the old github numbering).
Gitlab uses numbers like "revision 8b400339".


rvk

  • Hero Member
  • *****
  • Posts: 6588
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #27 on: February 27, 2024, 10:46:56 am »
Ha, I already see it in version.pas

Code: Pascal  [Select][+][-]
  1. function full_version_string:string;
  2. begin
  3.   full_version_string := version_nr+'.'+release_nr+'.'+patch_nr+minorpatch
  4. {$ifdef REVINC}
  5.   +'-'+{$i revision.inc}
  6. {$endif REVINC}
  7.   ;
  8. end;
  9.  

So you have REVINC defined. I have not.
It's default seems to be off.
There also doesn't seem to be a revision.inc on gitlab.
« Last Edit: February 27, 2024, 10:49:50 am by rvk »

rvk

  • Hero Member
  • *****
  • Posts: 6588
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #28 on: February 27, 2024, 01:24:53 pm »
Mine shows today:
FPC 3.3.1-15286-g1966ce7c1c [2024/02/26] for x86_64 - Win64
Fresh from gitlab
and FPC 3.3.1-15286-g1966ce7c1c [2024/02/26] for x86_64 - Linux
So you need to add REVINC=1 (or force) and REVSTR=<revision number> yourself during compilation of FPC.

"git describe" will give the correct revision.
3.3.1-15293-g8b40033964

I'll add it to my script  8-)

Thaddy

  • Hero Member
  • *****
  • Posts: 16196
  • Censorship about opinions does not belong here.
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #29 on: February 27, 2024, 03:51:59 pm »
Indeed, that's how I do it. (with revinc=force)
« Last Edit: February 27, 2024, 03:55:56 pm by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018