Forum > General

FPCUp cleanup & minimal build

(1/1)

Warfley:
Hey, so I am using FPCUp to build FPC+Crosscompilers and Lazarus for a docker image. Now it works pretty well, but I run into another problem, the installation gets huge:


--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---root@4907722d13a2:/# du -hs root/development/*68K     root/development/config_lazarus827M    root/development/fpc3.2M    root/development/fpcbootstrap969M    root/development/lazarus4.0K    root/development/projectsThis is just after the base installation without any cross compilers and it already takes up 1.8 GB. With the cross compilers for Win32 and Win64, another 400mb is added, resulting in a stagaring 3GB Docker image.

There must be a way to reduce that size. When I download the OpenSuse RPM package for Lazarus and FPC they are in sum around 100 mb large, so I'm off by a factor of 18.
That said, I don't even need complete lazarus, I only need the LCL and lazbuild, but I am to stupid to find out how to tell fpcup this.

Another thing I thought is, after compiling there sure are compilation artifacts I don't need anymore, as well as the the (fpc) source, is also unessecary (as it is for docker, I don't need lazarus completion feature and stuff so I don't need these sources).

Does anyone of you know how I can clean up the Lazbuild installation, and/or minimize it?

This is the script that installs Lazarus and FPC, pretty naive and uses only very few arguments for FPCUp

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function build() {    fpcup --noconfirm --fpcURL=$FPC --lazURL=$LAZ $@}function buildCross() {    cpu="$1"    shift    os="$1"    shift    build --only=FPCBuildOnly --cputarget=$cpu --ostarget=$os $@} # Install fpc and lazars for linux x86_64build# Install cross-compiler for Win32buildCross i386 win32# Install cross-compiler for win64buildCross x86_64 win64

DonAlfredo:
Interesting question.
Part of your quest can already be done by fpcup, with the correct settings.
But not all. Will look into this.

marcov:
Deleting units/$fpctarget/googleapi  saves 100M per target.

These are auto generated headers for google apis.

Warfley:

--- Quote from: marcov on July 14, 2020, 11:04:01 pm ---Deleting units/$fpctarget/googleapi  saves 100M per target.

--- End quote ---
Not quite 100 MB, for 3 targets it saved around 200 mb. That said, 200M less :)


--- Quote from: DonAlfredo on July 14, 2020, 10:24:13 pm ---Interesting question.
Part of your quest can already be done by fpcup, with the correct settings.
But not all. Will look into this.

--- End quote ---
Any suggestions for the options to use? I am to stupid for fpcup. I tried --only=FPCBuildOnly,lazbuild but it then I get:

--- Quote ---fpclazup: info: FPCNativeInstaller (BuildModule: FPC): Building module FPC...
fpclazup: ERROR: FPCNativeInstaller (BuildModule: FPC): /root/development/fpc/Makefile not found. Severe error. Should not happen. Aborting.
--- End quote ---
So I am missing something and I don't know what. So I thought I go the other route with --skip=bigide but now I still have too much, as this doesnt save much (not even 100 m)

DonAlfredo:

--- Quote -----only=FPCBuildOnly,lazbuild
--- End quote ---
This should work. But does not work (not implemented yet). So, needs some fpcup-changes !

Summary.
You need to build FPC and Lazarus from sources (by running make) and let the Makefile install the result in some other directory.
However. Due to your question and me trying to solve, this was needed.
https://bugs.freepascal.org/view.php?id=37356
As the Lazarus devs are very very helpful, this was solved in mere moments !

More changes are needed. But, at the moment, I am trying to solve this through fpcup.

Navigation

[0] Message Index

Go to full version