cloudfoundry / java-buildpack

Cloud Foundry buildpack for running Java applications
Apache License 2.0
435 stars 2.58k forks source link

Install ruby when custom stacks are used #1017

Closed dsabeti closed 1 year ago

dsabeti commented 1 year ago

If a user specifies a custom stack -- for example, a Paketo stack based on Ubuntu Jammy -- this check will fail and ruby will not be installed, causing the app to fail to stage.

This change skips installing ruby only when the specified stack is cflinuxfs3, which is known to include its own ruby.

I considered a few alternatives before landing on this one:

I'm open to these other solutions, but unsure of their repercussions. I went with the least drastic change.

anthonydahanne commented 1 year ago

hello @dsabeti ! Actually @pivotal-david-osullivan and I discussed that, and we'd prefer option 2: no check on the stack, but only on the presence of Ruby - so in case cflinuxfs5 brings Ruby back (who knows?!) it will be working fine.

robdimsdale commented 1 year ago

As a Paketo/CF stacks maintainer I can state with a high degree of certainty that we won't be bringing ruby back into the stack :)

Checking for the presence of ruby is even better than relying on the implicit knowledge of cflinuxfs3 having ruby, but is a bit more work that the existing solution in this PR.

dsabeti commented 1 year ago

Cool. I went ahead with option 2. I decided to move the call to util::environment::setup inside the same if-block -- the thinking being that, if ruby exists already, those environment variables are probably already set up.

pivotal-david-osullivan commented 1 year ago

Looks good, thanks all!