Closed Irvise closed 1 year ago
I propose that it is set to -j1 or be made an option.
But it is, precisely, an option, i.e. you can override it. E.g.:
GNATMAKEFLAGS=-j1 bootstrap.sh
will run it at -j1. Isn't this what you need?
Uhh... My shell-fu is not that great. I did not recognise it as an option. Yes, that is what I needed. Thank you for your time and I am sorry for the inconvenience.
No problem! Glad to hear this was indeed what you were looking for.
https://github.com/AdaCore/gprbuild/blob/1baa403991b49487a59ec44ff99b7a59cd200d83/bootstrap.sh#L18
The bootstrap script uses the
-j0
option, which tellsgnatmake
to use all cores/threads that are available in the system to build the bootstrap. This, in principle is okay and should not cause any issues. However,gnat
/gnatmake
can consume quite a bit of memory. If the system that is running the build does not have much free memory and it does have quite a few cores, this will overwhelm the machine. For example, my Raspberry Pi 3 cannot handle the bootstrapping procedure, as the 4 CPUs get used and each build consumes about 300MB at its peak. This requires more than the 900MB of free memory that my system has.I think a bootstrap script should not be trying to be performant, but have a simple and easy way of building the tool. Later down the line, more powerful options can be used if desired by the user. I propose that it is set to
-j1
or be made an option.Feedback is welcome. I did not submit a patch since I would like to get feedback first. Regards, Fer