Many of the plugins compile some files through make, that's why I'm opening the issue here, in the parent repository.
Should asdf detect if it can compile in parallel and set proper -jn flags for make? Is this a job for asdf, or should it assume user has proper MAKEFLAGS env variable set?
This can potentially significantly speed up compilation.
@michalmuskala If parallel is good, then let us make the asdf plugins use the parallel flag by default atleast for languages that are known to work well with it.
I see that each plug-in has entirely separate code from the core manager, so each one would need to solve this on it's own.
The really tricky part is deciding on the number of concurrent jobs. A good rule is the number of cores, but the issue is there's no easy cross-platform way of determining it.
In order of how easy to use they are:
nproc commandsysctl -n hw.ncpu/proc/cpuinfo: grep -c processor /proc/cpuinfoI think we could set ASDF_CONCURRENCY before delegating the build to the plugin,
so that plugin writers do not have to do this check on their own.
On Windows gnu make does not support concurrent jobs, so it doesn't matter.
Does that means that make -j2 would break, or simply be noop?
The GNU make documents it as being a noop on windows:
https://www.gnu.org/software/make/manual/html_node/Parallel.html
On MS-DOS, the ‘-j’ option has no effect, since that system doesn’t support multi-processing.
It talks about MS-DOS, so I'm not sure it applies to modern windowses as well.
It could probably detect it on a best effort basis and set to 1 otherwise. It will still be better than the current situation.
@michalmuskala
On MS-DOS, the ‘-j’ option has no effect, since that system doesn’t support multi-processing.
It talks about MS-DOS, so I'm not sure it applies to modern windowses as well.
Thanks.
I will try to check in a VM or something, but at least it should probably not emit any error.
It could probably detect it on a best effort basis and set to 1 otherwise. It will still be better than the current situation.
I agree. I will try to add this feature during the week.
Most helpful comment
I think we could set
ASDF_CONCURRENCYbefore delegating the build to the plugin,so that plugin writers do not have to do this check on their own.
Does that means that
make -j2would break, or simply be noop?