asdf-vm / asdf-ruby

Ruby plugin for asdf version manager
https://github.com/asdf-vm/asdf
MIT License
650 stars 133 forks source link

Observe ASDF_CONCURRENCY #369

Open topalovic opened 10 months ago

topalovic commented 10 months ago

First of all, thank you for all the hard work so far.

I would like to inquire about support for ASDF_CONCURRENCY. Unless I'm missing something, it looks it was added in https://github.com/asdf-vm/asdf-ruby/commit/77df296, but then got lost during the transition to ruby-build.

Do you think we could reintroduce it by passing the value to ruby-build as MAKE_OPTS? I'm hoping it is as simple as exporting before the build command:

+export MAKE_OPTS="-j $ASDF_CONCURRENCY"
echo "$patches" | "$(ruby_build_path)" ${opts} "$version" "$install_path"
glyh commented 5 months ago

Hello, I run into this today, does this accept PR or maintained or whatever?

Stratus3D commented 5 months ago

I'm not sure I'm a fan of asdf managing the concurrency settings. What if a user wants to use different settings Ruby and another setting for another asdf plugin?

In any case a user has to set something, either:

export MAKE_OPTS="-j <cores>"
export ASDF_CONCURENCY="<cores>"

Thoughts?

topalovic commented 5 months ago

Hey @Stratus3D.

I'm not sure I'm a fan of asdf managing the concurrency settings

The official docs suggest that it should be supported:

https://asdf-vm.com/manage/configuration.html#concurrency

Note: the environment variable ASDF_CONCURRENCY take precedence if set.

If the plugins don't observe it, then there is no point in its existence, I suppose.

What if a user wants to use different settings Ruby and another setting for another asdf plugin?

It should be as simple as you suggest, no?

$ export ASDF_CONCURRENCY=<cores>
$ asdf install ruby

To clarify why I'm asking about this setting. The default options set MAKE_OPTS="-j $(num_cpu_cores)" which makes the recent i9 i13900 CPUs unstable and prone to segfaults. Only after reducing concurrency to -j 16 was I able to compile Ruby using asdf and rbenv.

If major plugins such as asdf-ruby do not intend to support ASDF_CONCURRENCY, perhaps it should be removed from the official docs.