Recent

Author Topic: Minimal install  (Read 5938 times)

user name

  • Guest
Minimal install
« on: November 19, 2023, 03:14:35 pm »
Hello my friends I have a few questions and suggestions.

I just installed Lazarus 3.0RC2 on Windows and it contains 1.60 GB in 35,261 files.

Currently the installer only asks whether help files should be installed.

The compiler itself has the "Minimal Install" option, which, if selected, sources are not copied to our disks, which greatly reduces the amount of files.

Would it be possible to have that option from FPC in Lazarus Setup, so it installs the minimal version of FPC?

And would it be possible to somehow choose what components are installed with Lazarus? The components directory has 8,829 files, totaling 435 MB. Things like pas2js I will never use.

Are the things in the folder "tests" necessary for a normal user?
And all the source files, from tools and so on, could these be made optional?

And the images used by the IDE, the directory contains 4,711 files in total. These could somehow be placed inside some compressed format, which would also improve reading.

Sorry if I'm retarded.

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Minimal install
« Reply #1 on: November 19, 2023, 05:22:21 pm »
I do use Fpcupdeluxe for my installation, while watching how it installs, I have a big thinking that the setup download the source and compile it afterwards on your system. Those sources, at least in compiled format, are also needed whenever you add/remove a package to/from Lazarus since it need to rebuild itself.
You can get the source to Fpcupdeluxe, analyze it to find out why it download file xyz and what it does do with it, if you think its unnecessary, add that xyz into a batch file for deletion after installation.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

PascalDragon

  • Hero Member
  • *****
  • Posts: 5759
  • Compiler Developer
Re: Minimal install
« Reply #2 on: November 19, 2023, 05:29:00 pm »
The compiler itself has the "Minimal Install" option, which, if selected, sources are not copied to our disks, which greatly reduces the amount of files.

Would it be possible to have that option from FPC in Lazarus Setup, so it installs the minimal version of FPC?

Lazarus needs the sources to provide code completion.

user name

  • Guest
Re: Minimal install
« Reply #3 on: November 19, 2023, 08:58:47 pm »
I do use Fpcupdeluxe

Thanks I didn't know about that and I'm currently too retarded to understand what it does exactly but it seems to be useful if you want to have multiple Lazarus installations.

if you think its unnecessary, add that xyz into a batch file for deletion after installation.

Yeah I remove stuff like that but the point is to not get them in the first place.

Lazarus needs the sources to provide code completion.

Would it be possible then, to not need the sources? Maybe have that information compiled in some manner, like a database instead? Or is that a retarded idea?
« Last Edit: November 19, 2023, 09:03:35 pm by user name »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11944
  • FPC developer.
Re: Minimal install
« Reply #4 on: November 19, 2023, 09:24:47 pm »
What is the actual problem?

user name

  • Guest
Re: Minimal install
« Reply #5 on: November 19, 2023, 09:41:18 pm »
What is the actual problem?

Who said anything about problem there is no problem these are just suggestions to make Lazarus better, to give the user the option to not install everything like I mentioned FPC lets you choose minimal install and it won't copy everything most normal users I suppose don't need all the source code or all supported architectures or packages there is no problem here just suggesting improvements to make things even better more efficient faster smaller fewer reads and writes and so forth

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11944
  • FPC developer.
Re: Minimal install
« Reply #6 on: November 19, 2023, 09:53:41 pm »
Currently the Lazarus IDE is specified as needing the source to operate.

Besides being used for code tools, the source is of course also important for debugging (and generating e.g. Debugging versions of the LCL). Also for normal users.

If you merely want to save space, e.g. on some SBC or so, try to move the source dir to a compressed ISO and mount it then in the original location. That probably would save you about 60% of the source size. (though performance might suffer)

Installer sources are also open source, so there should be no impediment to start working on issues that you consider important.


dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Minimal install
« Reply #7 on: November 19, 2023, 11:55:02 pm »
I would expect the source is also needed if you rebuild the IDE, for example, during the install of a Package.

If you wanted to offer the user a checkbox list of what packages they want, it would need to be incredibly fine grained, its quite a long list if you really want to give the user a useful choice.

On the other hand, I wonder how useful the GTK/GTK2/GTK3/Qt/Qt5/Qt6/Carbon/Cocoa widget sets are to a Windows user ? (yes, I know its possible to make GTK2 apps for Windows but why would you ?).

On the other, other hand, its only two gig,  anyone with a reasonable degree of common sense can open their computer up and wack a newer, faster and bigger disk in for the cost of most mainstream computer games.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

wp

  • Hero Member
  • *****
  • Posts: 12464
Re: Minimal install
« Reply #8 on: November 20, 2023, 10:22:52 pm »
In my opinion, trying to create a "minimal" installation is not worth the effort. In the attached screenshot I am showing the size of the top-level folders of a fresh, unused Lazarus v3RC2 (32-bit) installation on Win-11 . As you can see, 610MB out of total of 1.5 GB are needed by FPC, another 390 MB by components, and 210 MB by compiled units. OK - many components are not needed; another look at the components folder, however, shows that already the top three folders, synedit, ideintf, codetools which are absolutely essential occupy about 150 MB out of the 390...

Some possible candidates for removal for a minimal installation are mentioned in the first post: pas2js (8MB), tests (2 MB), tools (7.5 MB), images (11 MB), in total about 30 MB, or 2% of the entire installation...

Surely there's more which could be removed, but I would estimate that a minimal installation would be smaller than the full installation by only a few hundred MB.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5759
  • Compiler Developer
Re: Minimal install
« Reply #9 on: November 22, 2023, 10:56:10 pm »
Lazarus needs the sources to provide code completion.

Would it be possible then, to not need the sources? Maybe have that information compiled in some manner, like a database instead? Or is that a retarded idea?

In the future once dynamic packages are supported Lazarus will need to be able to deal with that, but that point is still a long time (read: years) off, so for now you'll have to live with this.

user name

  • Guest
Re: Minimal install
« Reply #10 on: November 23, 2023, 06:29:06 pm »
Currently the Lazarus IDE is specified as needing the source to operate.

yeah that's a valid reason, it's done that way currently... that probably means it would require a lot of work to change
« Last Edit: November 28, 2023, 04:59:26 pm by Martin_fr »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11944
  • FPC developer.
Re: Minimal install
« Reply #11 on: November 23, 2023, 10:48:40 pm »
Currently the Lazarus IDE is specified as needing the source to operate.

yeah that's a valid reason, it's done that way currently... that probably means it would require a lot of work to change

Worse, the exact details are unknown. But it won't be just one-off work, there will be a very long term maintenance attached to it too.

what I argued about here is efficiency for all users as a whole
And that's something scarce these days, cf. the posts above, reasoning like "HDD space is cheap" and so forth.

But that is not it. Most users DON'T have a problem. So that is also why any change must not make the situation worse for them.

Many efficient programs have their resources, e.g. images, localization files, grouped together inside single files such as Zip files

But Lazarus is basically a dynamic system because it can recompile itself with changes. That complicate things immensely. It is not read-only but read-write.

Quote
That makes resource access faster and efficient disk usage; a contiguous file is stored on disk
I mentioned not only the size of files but the NUMBER of files
The aforementioned packages don't necessarily need to be be compressed to improve efficiency

Yes, that is basically the ISO loopback solution that I said. Or toggle the compression bit on windows (or *nix filesystem). And that is nice and fairly transparent

But yes, both Lazarus and FPC could do with a better separation between read-only and write directories. The fact that the buildprocess writes to source directories (instead of build specific directories). But somebody has to work on it, and take a very long view before results become visible.

Quote
Yes, one can delete the compiler's sources if he doesn't need them; but it's best to not have them copied in the first place. That makes hardware happy users happy

But they are needed a lot, so simply cutting is not a solution.

Quote
You guys have probably seen many HDD failures over the years and inefficient disk usage is a common cause
That is, thousands and thousands operations that can be greatly reduced if only the programmers do not have that pajeet mentality like "space is plentiful nowadays", "HDDs are cheap" et caetera, and instead have the slightest clue of how disks operate and strive to write efficient software

That is minimalism for minimalism's sake. It is never little enough. That is not a healthy view.

Oh and I have no idea what "pajeet" is supposed to mean.

Quote

No, SSDs do not solve that problem, as people of that mentality like to think. They wear out over time as well like everything in this world

But the wear down is not by simply containing data, but by writing it, and in your write-up above you don't really make that different. There is a reason why SSD endurance is measured in Terabytes written, of whole disk writes (TBW)

Quote
To have the compiler's installer behave as it does when installed on its own should be simple enough

Quote
Anyway, simple suggestions to improve things. 

Random cutting is not a solution, and balanced work is *very* hard and long term.

So basically you have two options:

  • install on a sufficient machine, cut it down, and reuse that on your more limited machines. If you find other people interested like you, maybe you can create a specialised distribution for them
  • start working on a long  term solution

You can post bugreports with patches and pull requests via both gitlab projects.
« Last Edit: November 24, 2023, 11:13:48 am by marcov »

MarkMLl

  • Hero Member
  • *****
  • Posts: 8035
Re: Minimal install
« Reply #12 on: November 23, 2023, 11:10:56 pm »
Marco, I'm one of the oldest members of this community, and sometimes I feel like I'm the oldest member who still has possession of most of his marbles.

I know we disagree at times, but I want to be on record as being behind you on this one.

/However/, I feel that the overall poor understanding of how Lazarus "as a whole" hangs together is a major issue.

It hurts me to say that, since I feel that to a very large extent it is the work of Martin et al. that keeps the underlying FPC+RTL usable.

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

440bx

  • Hero Member
  • *****
  • Posts: 4739
Re: Minimal install
« Reply #13 on: November 24, 2023, 05:39:12 am »
I want to add a bit of perspective to the "minimal install" request.  At first sight, it sounds perfectly reasonable and it probably is when a minimal install is (or would be) significantly smaller than the full install.

As @wp mentioned in his post, a "minimal install" would not be much smaller than the full install.

Here is some perspective on environment installs.  My Visual Studio 2017 installation is a little over 80GB (basically, about 50 times the size of the Lazarus installation.)  A minimal installation of VS2017 (or VS2022) is in the ballpark of 8GB (for something that is minimally useful.) 

In addition to that, having the option of multiple installation options requires a smart/capable install program that can manage dependencies (which is not as simple as it sounds.)  Also, that install program needs to be capable of incremental installations, i.e, what a user thinks won't be needed at the time of installation becomes needed at some point in time and the installer needs to figure out what's the _net_ additional files needed to have the additional feature installed.

In the case of Visual Studio, a full installation would probably run around 150GB (I don't really know, I've never needed a full install), which justifies creating an installer for it.

In Lazarus' case, it really seems absurd to incurr in all the effort needed to _maybe_ save about 20% of the full install size.

Depending on where in the world you live, you can purchase a used, with a 5 year warranty, 10 terabyte hard drive for about $79.00.  (9.3 "true/binary" terabytes) A drive that large accommodates over 5,500 Lazarus full installations (that should be enough for a while.)

HTH.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4541
  • I like bugs.
Re: Minimal install
« Reply #14 on: November 24, 2023, 11:12:44 am »
See also the many M$ Windows 10 services that frequently crank up CPU usage to 100%, and disk usage as well.
You just indicated yourself that Lazarus is not the resource hog.
A hint to improve the situation: Install a good Linux distro and your old Windows computer turns into a fast super-computer.

As 440bx mentioned, Lazarus is a tiny snappy IDE compared to other massive IDEs. I am happy it is.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018