Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2013-02

PPU version checking

23 messages · 10 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

silvioprog

Hello,

I generates some PPUs in a version of FPC. I try to use it in other version of FPC, but it not compiles.

So, can I disable the PPU version checking to I use my PPUs in any versions of FPC?

Thank you!

Silvio Clécio My public projects - github.com/silvioprog

Reply by email

Sven Barth
to silvioprog
silvioprog wrote 7 lines
Hello, I generates some PPUs in a version of FPC. I try to use it in other version of FPC, but it not compiles. So, can I disable the PPU version checking to I use my PPUs in any versions of FPC?

No you can't. The PPU version is there for a purpose. We increase it if we did incompatible changes in the PPU file format and thus older compiler versions would error out with cryptical errors. That's one of the reasons why it might be more reasonable to use releases, because there the PPU version is fixed.

Regards,
Sven

Reply by email

silvioprog
to Sven Barth: No you can't. The PPU version is there for a purpose. We increase it if we did…

2013/2/21 Sven Barth

Show quoted text 19 lines
On 21.02.2013 19:43, silvioprog wrote: > Hello, > > I generates some PPUs in a version of FPC. I try to use it in other > version of FPC, but it not compiles. > > So, can I disable the PPU version checking to I use my PPUs in any > versions of FPC? > No you can't. The PPU version is there for a purpose. We increase it if we did incompatible changes in the PPU file format and thus older compiler versions would error out with cryptical errors. That's one of the reasons why it might be more reasonable to use releases, because there the PPU version is fixed. Regards, Sven

Hum... I imagined that. Delphi also works in this way.

Thanks.

Silvio Clécio My public projects - github.com/silvioprog

Reply by email

silvioprog
to Florian Klämpfl: It won't help, we don't change the ppu version for fun but when the format changes.

2013/2/21 Florian Klämpfl

Show quoted text 11 lines
Am 21.02.2013 19:43, schrieb silvioprog: > Hello, > > I generates some PPUs in a version of FPC. I try to use it in other > version of FPC, but it not compiles. > > So, can I disable the PPU version checking to I use my PPUs in any > versions of FPC? It won't help, we don't change the ppu version for fun but when the format changes.

So the only way that I see for using protected code and keep compatibility with any version of FPC, is implementing it in libraries.

Thanks Florian and guys! :)

Silvio Clécio My public projects - github.com/silvioprog

Reply by email

Sven Barth
to silvioprog
"silvioprog" wrote 17 lines
2013/2/21 Florian Klämpfl > > Am 21.02.2013 19:43, schrieb silvioprog: > > Hello, > > > > I generates some PPUs in a version of FPC. I try to use it in other > > version of FPC, but it not compiles. > > > > So, can I disable the PPU version checking to I use my PPUs in any > > versions of FPC? > > It won't help, we don't change the ppu version for fun but when the > format changes. So the only way that I see for using protected code and keep

compatibility with any version of FPC, is implementing it in libraries.

Thanks Florian and guys! :)

Or you provide units only for released versions (e.g. 2.6.0, 2.6.2, etc).

Regards,
Sven

Reply by email

silvioprog
to Sven Barth

2013/2/25 Sven Barth

Show quoted text 27 lines
Am 25.02.2013 08:27 schrieb "silvioprog" : > > 2013/2/21 Florian Klämpfl >> >> Am 21.02.2013 19:43, schrieb silvioprog: >> > Hello, >> > >> > I generates some PPUs in a version of FPC. I try to use it in other >> > version of FPC, but it not compiles. >> > >> > So, can I disable the PPU version checking to I use my PPUs in any >> > versions of FPC? >> >> It won't help, we don't change the ppu version for fun but when the >> format changes. > > > So the only way that I see for using protected code and keep compatibility with any version of FPC, is implementing it in libraries. > > Thanks Florian and guys! :) Or you provide units only for released versions (e.g. 2.6.0, 2.6.2, etc). Regards, Sven

Yes. Very nice. Thank you very much! :)

Silvio Clécio My public projects - github.com/silvioprog

Reply by email

John Lee
to silvioprog

This is a major pain to quite a few users - I have some units for which source is lost from v2.4. Surely some of the reasons for the changes in ppu version would _not_ cause a problem with later versions if one isn't using this particular feature?

Maybe someone could generate a (binary?) patch to disable the check (at user's risk)?

John

Show quoted text 15 lines
> >> > I generates some PPUs in a version of FPC. I try to use it in other > >> > version of FPC, but it not compiles. > >> > > >> > So, can I disable the PPU version checking to I use my PPUs in any > >> > versions of FPC? > >> > >> It won't help, we don't change the ppu version for fun but when the > >> format changes. > > > > > > So the only way that I see for using protected code and keep > compatibility with any version of FPC, is implementing it in libraries. > > >

Reply by email

Sven Barth
to John Lee
John Lee wrote
This is a major pain to quite a few users - I have some units for which source is lost from v2.4. Surely some of the reasons for the changes in ppu version would _not_ cause a problem with later versions if one isn't using this particular feature?

This is the same problem one has with Delphi.

Maybe someone could generate a (binary?) patch to disable the check (at user's risk)?

If you'd disable the check you would not be able to use e.g. a 2.4 unit with 2.6, because the PPU format is different and thus you'd definitely (not just perhaps!) get errors when the compiler reads the PPU file.

Regards,
Sven

Reply by email

Tomas Hajny
to Sven Barth
Sven Barth wrote 14 lines
On 25.02.2013 13:08, John Lee wrote: > This is a major pain to quite a few users - I have some units for which > source is lost from v2.4. Surely some of the reasons for the changes in > ppu version would _not_ cause a problem with later versions if one isn't > using this particular feature? This is the same problem one has with Delphi. > Maybe someone could generate a (binary?) patch to disable the check (at > user's risk)? If you'd disable the check you would not be able to use e.g. a 2.4 unit with 2.6, because the PPU format is different and thus you'd definitely (not just perhaps!) get errors when the compiler reads the PPU file.

In other words: _If_ someone is motivated enough for such a task, it would be possible to create a convertor from one PPU version to another (and I don't mean a "convertor" only changing the version number but something that really loads the original format of the particular original version and stores the data in the new format with new version). I don't think any of the core developers would be interested in such a task (at least not just for fun because it would not be much fun most likely), but I don't want to talk for others.

Moreover, note that in addition to PPU version number you also have dependencies related changes in RTL and packages. In other words, you would need to convert the originally used compiled RTL+packages units this way together with your own (compiled) units in order to be able to use those units with the new compiler.

Tomas

Reply by email

silvioprog
to DaWorm

2013/2/25 DaWorm

Show quoted text 5 lines
Is the project one that can use shared libraries? Or does the code require inheritance from the code you want to hide the implementation of? Jeff.

Is the code for a component that will be commercial. It will use classes and inheritance.

Silvio Clécio My public projects - github.com/silvioprog

Reply by email

Sven Barth
to silvioprog
silvioprog wrote 11 lines
2013/2/25 DaWorm < > Is the project one that can use shared libraries? Or does the code require inheritance from the code you want to hide the implementation of? Jeff. Is the code for a component that will be commercial. It will use classes and inheritance.

Just state that your binary packages will only support selected releases. Most developers who buy components (and thus likely work for some company) are more likely to use stable versions anyway. E.g. altough I know about the many nice improvements in 2.7.1 I only use 2.6.0 (and in the future 2.6.2) for development of the Free Pascal based programs in our company.

Regards,
Sven

Reply by email

John Lee
to Tomas Hajny: In other words: _If_ someone is motivated enough for such a task, it would be possible to…

I'm guessing that you'd need to be pretty au fait with fpc internals & the code to do this eg because there's no spec, and no tools to help? J

Show quoted text 20 lines
In other words: _If_ someone is motivated enough for such a task, it would be possible to create a convertor from one PPU version to another (and I don't mean a "convertor" only changing the version number but something that really loads the original format of the particular original version and stores the data in the new format with new version). I don't think any of the core developers would be interested in such a task (at least not just for fun because it would not be much fun most likely), but I don't want to talk for others. Moreover, note that in addition to PPU version number you also have dependencies related changes in RTL and packages. In other words, you would need to convert the originally used compiled RTL+packages units this way together with your own (compiled) units in order to be able to use those units with the new compiler. Tomas

Reply by email

silvioprog
to Sven Barth: Just state that your binary packages will only support selected releases. Most developers…

2013/2/25 Sven Barth

Show quoted text 23 lines
On 25.02.2013 15:19, silvioprog wrote: > 2013/2/25 DaWorm < > > > Is the project one that can use shared libraries? Or does the code > require inheritance from the code you want to hide the > implementation of? > > Jeff. > > > Is the code for a component that will be commercial. It will use classes > and inheritance. > Just state that your binary packages will only support selected releases. Most developers who buy components (and thus likely work for some company) are more likely to use stable versions anyway. E.g. altough I know about the many nice improvements in 2.7.1 I only use 2.6.0 (and in the future 2.6.2) for development of the Free Pascal based programs in our company. Regards, Sven

Now, with the arrival of FPC 2.6.2 I believe that I'll use PPUs. Is very annoying maintain DLLs/SOs. :S

Thank very much friend! :)

Silvio Clécio My public projects - github.com/silvioprog

Reply by email

Tomas Hajny
to John Lee: I'm guessing that you'd need to be pretty au fait with fpc internals & the code to do…
John Lee wrote
I'm guessing that you'd need to be pretty au fait with fpc internals & the code to do this eg because there's no spec, and no tools to help? J

One would need to combine the original version of the PPU loader (as included within the compiler source of the respective FPC version) with the PPU writer of the latest version. I don't say that it would be easy though (that's why I talked about sufficient motivation - it is probably easier to rewrite certain stuff to which you lost your sources unless it is a fairly big project).

Tomas

Show quoted text 20 lines
> > In other words: _If_ someone is motivated enough for such a task, it > would > be possible to create a convertor from one PPU version to another (and I > don't mean a "convertor" only changing the version number but something > that really loads the original format of the particular original version > and stores the data in the new format with new version). I don't think > any > of the core developers would be interested in such a task (at least not > just for fun because it would not be much fun most likely), but I don't > want to talk for others. > > Moreover, note that in addition to PPU version number you also have > dependencies related changes in RTL and packages. In other words, you > would need to convert the originally used compiled RTL+packages units > this > way together with your own (compiled) units in order to be able to use > those units with the new compiler. > > Tomas

Reply by email

waldo kitty
to silvioprog: 2013/2/21 Florian Klämpfl So the only way that I see for using protected code and keep…
silvioprog wrote 17 lines
2013/2/21 Florian Klämpfl < > Am 21.02.2013 19:43, schrieb silvioprog: > Hello, > > I generates some PPUs in a version of FPC. I try to use it in other > version of FPC, but it not compiles. > > So, can I disable the PPU version checking to I use my PPUs in any > versions of FPC? It won't help, we don't change the ppu version for fun but when the format changes. So the only way that I see for using protected code and keep compatibility with any version of FPC, is implementing it in libraries.

what are you calling a library? you could also use OBJ files which get linked in... i used to do this with TP5 (at least that far back)... i suppose an OBJ file can be called a "library" in the general sense of the word ;)

Reply by email

Hans-Peter Diettrich
to Tomas Hajny: In other words: _If_ someone is motivated enough for such a task, it would be possible to…
Show quoted text 18 lines
> If you'd disable the check you would not be able to use e.g. a 2.4 unit > with 2.6, because the PPU format is different and thus you'd definitely > (not just perhaps!) get errors when the compiler reads the PPU file. In other words: _If_ someone is motivated enough for such a task, it would be possible to create a convertor from one PPU version to another (and I don't mean a "convertor" only changing the version number but something that really loads the original format of the particular original version and stores the data in the new format with new version). I don't think any of the core developers would be interested in such a task (at least not just for fun because it would not be much fun most likely), but I don't want to talk for others. Moreover, note that in addition to PPU version number you also have dependencies related changes in RTL and packages. In other words, you would need to convert the originally used compiled RTL+packages units this way together with your own (compiled) units in order to be able to use those units with the new compiler.

This is where a decompiler could help. It reconstructs the source code from the old PPU, which then can be adoptede and compiled with a newer version.

A PPU decompiler is somewhat easy to create, as is for object files of other OO languages, in contrast to an decompiler for executables of an unknown (or multiple) compilers. I wrote decompilers for many compilers, but never for Pascal because I wanted to protect the work of the users of this language.

DoDi

Reply by email

Sven Barth
to Hans-Peter Diettrich
"Hans-Peter Diettrich" wrote 9 lines
Tomas Hajny schrieb: >> If you'd disable the check you would not be able to use e.g. a 2.4 unit >> with 2.6, because the PPU format is different and thus you'd definitely >> (not just perhaps!) get errors when the compiler reads the PPU file. > > > In other words: _If_ someone is motivated enough for such a task, it

would

> be possible to create a convertor from one PPU version to another (and I > don't mean a "convertor" only changing the version number but something > that really loads the original format of the particular original version > and stores the data in the new format with new version). I don't think

any

Show quoted text 7 lines
> of the core developers would be interested in such a task (at least not > just for fun because it would not be much fun most likely), but I don't > want to talk for others. > > Moreover, note that in addition to PPU version number you also have > dependencies related changes in RTL and packages. In other words, you > would need to convert the originally used compiled RTL+packages units

this

Show quoted text 5 lines
> way together with your own (compiled) units in order to be able to use > those units with the new compiler. This is where a decompiler could help. It reconstructs the source code

from the old PPU, which then can be adoptede and compiled with a newer version.

A PPU decompiler is somewhat easy to create, as is for object files of

other OO languages, in contrast to an decompiler for executables of an unknown (or multiple) compilers. I wrote decompilers for many compilers, but never for Pascal because I wanted to protect the work of the users of this language.

You need to differentiate here. The compiled code is located in the .o files while the .ppu files contain the information for the compiler to use a compiled unit again (symbol information, definitions, generic token stream, inline node information).

Regards,
Sven

Reply by email

John Lee
to Florian Klämpfl: ppudump. If I'd lost the source of a unit I need (if the unit isn't too big), I'd just…

This sounds like the best plan if one has several .ppus - as some ppl seem to have & no source code, that should - but not sure what's involved with writing the wrapper. Could the whole thing be written in fpc pascal?

Would it be easy to reuse the wrapper for different .ppus? If so this'd be useful fpc tool.

What do others with this problem think?

J

Florian Klämpfl wrote 9 lines
ppudump. If I'd lost the source of a unit I need (if the unit isn't too big), I'd just ppudump the .ppu and write a new wrapper unit linked via externals with the original .o.

Reply by email

Marco van de Voort
to John Lee

In our previous episode, John Lee said:

Show quoted text 8 lines
This sounds like the best plan if one has several .ppus - as some ppl seem to have & no source code, that should - but not sure what's involved with writing the wrapper. Could the whole thing be written in fpc pascal? Would it be easy to reuse the wrapper for different .ppus? If so this'd be useful fpc tool. What do others with this problem think?

I would not bother recovering the ppu's.

Since RTL and codegeration changes might cause other trouble for non trivial cases (specially between major versions), I would say it is not very practical.

IOW the possibilities are mostly theoretical, and if you are really in a hurry, stop wasting time recovering and start rewriting the missing source.

... and make sure you back up source next time.

Reply by email

Michael Van Canneyt
to Marco van de Voort
Marco van de Voort wrote 20 lines
In our previous episode, John Lee said: > This sounds like the best plan if one has several .ppus - as some ppl seem > to have & no source code, that should - but not sure what's involved with > writing the wrapper. Could the whole thing be written in fpc pascal? > > Would it be easy to reuse the wrapper for different .ppus? If so this'd be > useful fpc tool. > > What do others with this problem think? I would not bother recovering the ppu's. Since RTL and codegeration changes might cause other trouble for non trivial cases (specially between major versions), I would say it is not very practical. IOW the possibilities are mostly theoretical, and if you are really in a hurry, stop wasting time recovering and start rewriting the missing source. ... and make sure you back up source next time.

+1

There are so many 'if's and "maybe"s that the end result is highly unlikely to produce a working binary. Even if you manage to get it working, there is no guarantee that the next FPC version will work.

The cartoon on http://developdaly.com/general/how-i-backup-everything/ says it all.

Michael.

Reply by email