setup-ruby icon indicating copy to clipboard operation
setup-ruby copied to clipboard

Support bundler-only runs

Open Bo98 opened this issue 2 years ago • 4 comments

#489

Seems to work across all macOS and Ubuntu runners.

Cache key has an extra RUBY_PLATFORM when using system Ruby as that can vary depending on how Ruby is compiled. For example, on macOS you could have a Ruby compiled for an older Darwin version than the one you are currently running on.

Bo98 avatar Dec 05 '23 17:12 Bo98

Could you clarify what's the use-case?

It does look like a lot of changes and complications, so it would need a really good use case (without good workarounds) to be worth it.

eregon avatar Dec 06 '23 12:12 eregon

Could you clarify what's the use-case?

It does look like a lot of changes and complications, so it would need a really good use case (without good workarounds) to be worth it.

#489 lists some, but for me specifically I need to conditionally use a custom-compiled Ruby while keeping the standard bundler install. Workaround would be to just copy the bundler caching logic here into a personal local action for my own use.

I suppose it in part comes from ruby/setup-ruby being more of a ruby/setup-ruby-and-bundler.

If this is too much then that's fine - I'll figure something else out.

Bo98 avatar Dec 06 '23 14:12 Bo98

#489 lists some,

I only see Docker there and I wonder if actions even work at all within Docker images.

but for me specifically I need to conditionally use a custom-compiled Ruby while keeping the standard bundler install.

I think one way would be to install your custom-compiled Ruby under the toolcache. Then it would be found by this action and no changes should be needed. See the end of https://github.com/ruby/setup-ruby/blob/master/README.md#using-self-hosted-runners, notably that self-hosted: true mode.

eregon avatar Dec 06 '23 18:12 eregon

I think one way would be to install your custom-compiled Ruby under the toolcache.

I can't move the install but maybe could maybe nuke the toolcache and symlink? Seems very hacky but I can give it a try.

Bo98 avatar Dec 06 '23 19:12 Bo98