Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Heroku-22 #160

Closed
edmorley opened this issue Jun 26, 2022 · 9 comments · Fixed by #161
Closed

Add Support for Heroku-22 #160

edmorley opened this issue Jun 26, 2022 · 9 comments · Fixed by #161

Comments

@edmorley
Copy link

edmorley commented Jun 26, 2022

The Heroku-22 stack was just released:
https://devcenter.heroku.com/changelog-items/2429

In Heroku-22, there is no longer a system install of Ruby:
https://devcenter.heroku.com/articles/heroku-22-stack#system-ruby-is-no-longer-installed

This buildpack uses Ruby here:

in_chroot /usr/bin/ruby /app/R/etc/copy_libs.rb "/app/R/site-library/**/*.so" 2>&1 > /dev/null

https://github.com/virtualstaticvoid/heroku-buildpack-r/blob/77319b361aee3473fb2a01ab8ea9ef3f18f4edf4/bin/copy_libs.rb

In order for this buildpack to work on Heroku-22, one of the following will be necessary:

  1. Have the buildpack vendor Ruby for use by this script (for an example of a buildpack doing this, see Vendor Ruby if an installation is not found heroku/heroku-buildpack-nginx#103).
  2. Convert the Ruby script to be a bash script instead.
  3. Have users of this buildpack add the heroku/ruby buildpack prior to this one (they will also need to add a minimal Gemfile to their app source, so the Ruby buildpack passes detection).
@virtualstaticvoid
Copy link
Owner

Luckily, the copy_libs.rb utility is executed within the chroot during slug compilation, which includes Ruby.

@kalorz
Copy link

kalorz commented Jun 30, 2022

@virtualstaticvoid I can see that the sources have already been updated with support for Heroku-22. But I'm not sure if it's something I do wrong, or the buildpack has not been deployed to AWS yet (or something... not sure how the process looks like 😬 ), but I get errors when I try to add the buildpack to Heroku-22 stack.

When the buildpack is added as https://github.com/virtualstaticvoid/heroku-buildpack-r.git, the build process fails with error:

-----> Downloading buildpack archives from AWS S3
       Downloading https://heroku-buildpack-r.s3.amazonaws.com/latest/heroku-buildpack-r-22-4.1.2-deploy.tar.gz
curl: (22) The requested URL returned error: 403
 !     Push rejected, failed to compile R app.
 !     Push failed

Then the buildpack is added as vsv/heroku-buildpack-r (which resolves to https://buildpack-registry.s3.amazonaws.com/buildpacks/vsv/heroku-buildpack-r.tgz), the build process fails with error:

 !     ERROR: This buildpack is NOT intended for use with the 'heroku-22' stack
       The supported stacks are 'heroku-18' and 'heroku-20'.
       Use the 'heroku stack:set' CLI command to set the appropriate stack.
       See https://devcenter.heroku.com/articles/stack
       Optionally, for greater control and flexibility consider using the Heroku
       container stack together with the heroku-docker-r implementation.
       See https://github.com/virtualstaticvoid/heroku-docker-r for more information.

@virtualstaticvoid
Copy link
Owner

Yeah, I haven't been able to publish the static assets yet due to test failures with virtualstaticvoid/heroku-buildpack-r-build2#11. I'll revert the update to the main branch in the meantime to avoid any confusion.

@virtualstaticvoid virtualstaticvoid changed the title Heroku-22 and no system Ruby Add Support for Heroku-22 Jun 30, 2022
@virtualstaticvoid
Copy link
Owner

@karolsarnacki FYI, the static assets have now been published for heroku-22 stack.

@kalorz
Copy link

kalorz commented Jul 3, 2022

@virtualstaticvoid Thank you for letting me know. I'm still getting 403 errors when I try to install the buildpack, though:

Buildpack https://github.com/virtualstaticvoid/heroku-buildpack-r.git:

remote: -----> R app detected
remote: -----> Installing R
remote:        Version 4.1.2 will be installed on heroku-22 stack.
remote: -----> Downloading buildpack archives from AWS S3
remote:        Downloading https://heroku-buildpack-r.s3.amazonaws.com/latest/heroku-buildpack-r-22-4.1.2-deploy.tar.gz
remote: curl: (22) The requested URL returned error: 403
remote:  !     Push rejected, failed to compile R app.
remote: 
remote:  !     Push failed

Buildpack vsv/heroku-buildpack-r:

remote: -----> R app detected
remote: -----> Installing R
remote:        Version 4.1.2 will be installed on heroku-22 stack.
remote: -----> Downloading buildpack archives from AWS S3
remote:        Downloading https://heroku-buildpack-r.s3.amazonaws.com/latest/heroku-buildpack-r-22-4.1.2-deploy.tar.gz
remote: curl: (22) The requested URL returned error: 403
remote:  !     Push rejected, failed to compile R app.
remote: 
remote:  !     Push failed

@virtualstaticvoid
Copy link
Owner

Ah okay, I didn't include 4.1.2 in the heroku-22 build originally (see virtualstaticvoid/heroku-buildpack-r-build2#11).
I set off another build today which included 4.1.2, so your test should now work.

@virtualstaticvoid
Copy link
Owner

I've also update the README to add a table listing the combination of R and Heroku stack versions.

@kalorz
Copy link

kalorz commented Jul 4, 2022

@virtualstaticvoid Thank you, that fixed my builds! :)

I think there's one place that's still not updated: https://elements.heroku.com/buildpacks/virtualstaticvoid/heroku-buildpack-r

Thank you for maintaining this buildpack!

@virtualstaticvoid
Copy link
Owner

Thanks @karolsarnacki

I've done another release on the Elements page, so should be up-to-date now. I need to figure out a GitHub Action to do this, so I don't forget again.

$ heroku buildpacks:versions vsv/heroku-buildpack-r
Version  Released At               Status
───────  ────────────────────────  ─────────
5        2022-07-04T20:44:15.802Z  published
4        2022-07-03T11:58:27.832Z  published
3        2022-06-30T14:47:59.537Z  published
2        2021-10-07T10:31:36.765Z  published
1        2021-10-07T09:55:22.869Z  published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants