Sign in Join

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

Mailing lists / fpc-pascal / 2021-11

Keeping current with FPC Source on gitlab

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

James Richters

I'm trying to set things up so I can stay up to date with the latest FPC sources on gitlab.
I'm following the instructions found here:
https://www.freepascal.org/develop.var - Connect to Source Repository with Git

So I have cloned the read only sources, and now I have the FPC directory described, and I can update my local copy.. but, now what? How do I go from having this source cloned directory to being able to compile my programs with the current sources?
Do I need to use the source to re-install FPC every time I want to update it? If so how is this accomplished?
Or is there a better way to just update everything when I update the repository without re-installing it?

James

Reply by email

Ryan Joseph
to James Richters
On Nov 6, 2021, at 7:09 AM, James Richters via fpc-pascal wrote: Do I need to use the source to re-install FPC every time I want to update it? If so how is this accomplished?

You need to rebuild the compiler every time it's updated. It can installed to a "trunk" location so that it doesn't overwrite existing stable compiler releases.

Regards,
Ryan Joseph

Reply by email

Christo Crause
to James Richters: I'm trying to set things up so I can stay up to date with the latest FPC sources on…

On Sat, 6 Nov 2021, 02:09 James Richters via fpc-pascal, <

Show quoted text 8 lines
wrote: Do I need to use the source to re-install FPC every time I want to update it? If so how is this accomplished? Or is there a better way to just update everything when I update the repository without re-installing it?

To build the compiler, rtl and packages from newly updated source, call make clean all

from the base folder of the source containing the compiler, rtl etc folders. This will produce a new compiler located in the compiler folder. It will be called something like ppcx64 (depends on your host architecture). Compiled units for rtl are located in rtl/units/$fpctarget and packages will sit under packages/*/units/$fpctarget.

a) You can use this as is without installing, but then your config file needs to be updated with the relevant locations to units and utilities. Either call ppcx64 (or your target compiler) directly, or build the fpc frontend located in compiler/utils, then copy the resulting fpc executable into the compiler folder from where it can call the target specific executables. Since this folder layout is most likely different from the installed layout, use a different fpc.cfg file with paths updated according to the source structure.

b) You can install the new compiler (make install), which would typically overwrite the existing installed version. Or you can install to a custom location by specifying INSTALL_PREFIX=path/to/install/folder. You need the previous stable compiler to start the build process, so do not overwrite the installed version. This also requires a custom fpc.cfg, since the base folder will be different to the installed path.

For either of the options, call the compiler with the option -n to not load the default config file (which would point to the installed version, leading to unit version conflicts) and @/path/to/new/fpc.cfg so that the compiler can load the new config.

Notes
1. I'm using Linux conventions above, translate path separators and .exe extensions as required for Windows.
2. If the stable compiler is not in the path, add
FPC=path/to/compiler/ppcx64 to the make commands.
3. There are many more permutations I'm sure, these are just the options I've managed to get working.

As Ryan mentioned, you have to frequently (if you want to stay up to date) update the source (git pull), then rebuild. So configuring your setup initially is key, after that it is relatively simple to stay up to date.

On a personal note, I got tangled up with config files and conflicts between old and new compiler versions in the past. When you run into strange compiler errors about not finding units, or invalid PPU versions or some such, take note of the paths used for the compiler, config file and the relevant units. My strategy was to never install fpc into the search path, always specify the path to the compiler executable and know when the compiler should ignore the default and load a specific config file for the particular compiler.

Alternatively use fpcupdeluxe, it has an option to checkout and build main. I haven't tested this much, since I'm comfortable with my workflow. There is an active thread on the Lazarus forum for fpcupdeluxe support.

Reply by email