-
Notifications
You must be signed in to change notification settings - Fork 106
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
CNB_TARGET_
environment variables are not set when expected
#1308
Labels
Milestone
Comments
Related Slack conversation: https://cloud-native.slack.com/archives/C0333LG7C9J/p1709323194121239 We can fix this in 0.19 |
natalieparellano
added a commit
that referenced
this issue
Mar 4, 2024
when the Buildpack API version is at least 0.10. Previously, we only set these variables when the Platform API version was at least 0.12. But, newer Buildpack APIs expect these variables regardless of the Platform API version. If we are on an older platform, derive the target variables from the base image OS. Fixes #1308 Signed-off-by: Natalie Arellano <[email protected]>
natalieparellano
added a commit
that referenced
this issue
Mar 4, 2024
…1309) * Always set CNB_TARGET_* variables during detect, build, and generate when the Buildpack API version is at least 0.10. Previously, we only set these variables when the Platform API version was at least 0.12. But, newer Buildpack APIs expect these variables regardless of the Platform API version. If we are on an older platform, derive the target variables from the base image OS. Fixes #1308 Signed-off-by: Natalie Arellano <[email protected]> * Fix unit Signed-off-by: Natalie Arellano <[email protected]> * Fix unit again Signed-off-by: Natalie Arellano <[email protected]> --------- Signed-off-by: Natalie Arellano <[email protected]>
This was referenced Mar 4, 2024
edmorley
added a commit
to heroku/base-images
that referenced
this issue
Mar 11, 2024
These were added recently in #251 to work around this upstream `lifecycle` bug: buildpacks/lifecycle#1308 The fix for that has since been released in lifecycle 0.19.0: https://github.com/buildpacks/lifecycle/releases/tag/v0.19.0 Which our builder images are now using: heroku/cnb-builder-images#475 As such, we no longer need the workaround here (and in fact, setting these env vars now cannot have an effect, since `lifecycle` now ignores them).
edmorley
added a commit
to heroku/base-images
that referenced
this issue
Mar 11, 2024
These were added recently in #251 to work around this upstream `lifecycle` bug: buildpacks/lifecycle#1308 The fix for that has since been released in lifecycle 0.19.0: https://github.com/buildpacks/lifecycle/releases/tag/v0.19.0 Which our builder images are now using: heroku/cnb-builder-images#475 As such, we no longer need the workaround here (and in fact, setting these env vars now cannot have an effect, since `lifecycle` now ignores them). GUS-W-15225541.
natalieparellano
added a commit
that referenced
this issue
Mar 12, 2024
when the Buildpack API version is at least 0.10. Previously, we only set these variables when the Platform API version was at least 0.12. But, newer Buildpack APIs expect these variables regardless of the Platform API version. If we are on an older platform, derive the target variables from the base image OS. Fixes #1308 Signed-off-by: Natalie Arellano <[email protected]>
natalieparellano
added a commit
that referenced
this issue
Mar 12, 2024
…1317) when the Buildpack API version is at least 0.10. Previously, we only set these variables when the Platform API version was at least 0.12. But, newer Buildpack APIs expect these variables regardless of the Platform API version. If we are on an older platform, derive the target variables from the base image OS. Fixes #1308 Signed-off-by: Natalie Arellano <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
In Buildpack API 0.10, it says:
But
lifecycle
fails to provide theseCNB_TARGET_*
environment variables if the Platform API is less than0.12
:lifecycle/phase/analyzer.go
Lines 84 to 93 in be881f2
This means that a buildpack using Buildpack API 0.10 running on a platform using Platform API 0.9 won't have
CNB_TARGET_OS
andCNB_TARGET_ARCH
set, even though these should be set according to the Buildpack API.Reproduction
Steps
pack
, likev0.27.0
, that uses a Platform API version < 0.12pack build myapp --builder heroku/builder@sha256:5856c2e1f6c55ec5e289453b872f57f4ebe1a32a6da31f053cd27eddccbf21c5
CNB_TARGET_OS
, which is not present)pack
that uses Platform API version >= 0.12pack build myapp --builder heroku/builder@sha256:5856c2e1f6c55ec5e289453b872f57f4ebe1a32a6da31f053cd27eddccbf21c5
again.Current behavior
Buildpacks using Buildpack API 0.10 may not receive
CNB_TARGET_OS
/CNB_TARGET_PLATFORM
env vars when an older Platform API is in use.Expected behavior
Buildpacks using Buildpack API 0.10 always receive
CNB_TARGET_OS
/CNB_TARGET_PLATFORM
(regardless of Platform API version).Context
lifecycle version
0.18.5
in my testing, but I think older versions are affected as well.platform version(s)
Anything < 0.12.
anything else?
The text was updated successfully, but these errors were encountered: