-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support heroku-24 #280
Closed
Closed
Support heroku-24 #280
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
39026cd
Add arch in heroku-24 download url
runesoerensen 46fc05c
Add changelog entry
runesoerensen c626c59
Get ruby arch identifier from host arch
runesoerensen fd0e254
Map aarch64 to arm64
runesoerensen 6c14d0f
Verify ruby arch behavior
runesoerensen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great starting point. The only thing I would change is to use the architecture of the current machine. We're doing this in classic via shelling out https://github.com/heroku/heroku-buildpack-ruby/blob/fd6585411cbf86d363ad0824f53d8edba1d7afed/lib/language_pack/base.rb#L45-L57.
I'm hoping on a plane in a few hours and then out tomorrow, if you're available to take a stab at adding that extra logic that would be amazing 🙏🏻. If not, I can take this commit and add that on top.
I was working towards upgrading libcnb first, but seeing how compact this PR is, I think I like the idea of merging this in now and cutting a builder so people can play with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@runesoerensen @schneems The multi-arch CNB release automation relies upon the buildpack having declared
[[targets]]
in order to know to create the OCI images and.cnb
files (attached to the GitHub release) as multi-arch. As such, adding support for Heroku-24 via[[stacks]]
will mean the releases will continue to be single arch and so cannot be added to theheroku/builder:24
builder, since CNBs in there need to support ARM64 too. As such, the priority is to upgrade to newer libcnb.rs and[[targets]]
.We shouldn't shell out for this in our CNBs. We should either:
context.target.arch
(once the CNB has upgraded libcnb and switched to targets)See also:
https://salesforce-internal.slack.com/archives/C02GZCPPV38/p1712568024934129?thread_ts=1712073915.519419&cid=C02GZCPPV38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep shelling out is definitely not the best approach here.. This is somewhat related to heroku/buildpacks-nodejs#814 (comment) -- e.g. whether to use the CNB targets, or the compile-time conditional (or
std::env::consts::ARCH
as in the node.js sample).I alluded to a conversation I had with @Malax on this (re env provided target arch vs compile-time conditionals) in the other PR. What do you think about this @Malax (and did I remember the conversation correctly :-))?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Python I used
context.target.arch
during the build since I have to use other fields fromcontent.target
anyway, such as the distro name/version, so it seemed to make sense to use all metadata from the same place:https://github.com/heroku/buildpacks-python/blob/de378063c83e1eec6302e79f93f189162b5bbbbf/src/python_version.rs#L39-L47
(Though for the tests, I have to use conditional compilation: https://github.com/heroku/buildpacks-python/blob/de378063c83e1eec6302e79f93f189162b5bbbbf/tests/mod.rs#L29-L35)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure, seems like it'd make a lot of sense to also use
context.target
in this buildpack when the buildpack is updated to newerlibcnb.rs
andtargets
.I've updated this implementation to also factor in the current arch -- should be fairly straightforward to adapt this to use the
Target
instead.