Skip to content

Always set CNB_TARGET_* variables during detect, build, and generate#1317

Merged
natalieparellano merged 1 commit intorelease/0.17.5from
fix/target-env-0.17
Mar 12, 2024
Merged

Always set CNB_TARGET_* variables during detect, build, and generate#1317
natalieparellano merged 1 commit intorelease/0.17.5from
fix/target-env-0.17

Conversation

@natalieparellano
Copy link
Copy Markdown
Member

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

Summary

Backporting #1309 to 0.17.x

See #1309 (comment)

Release notes

The lifecycle will 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 <narellano@vmware.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 66.03%. Comparing base (e955b6a) to head (88dc987).

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##           release/0.17.5    #1317      +/-   ##
==================================================
+ Coverage           66.03%   66.03%   +0.01%     
==================================================
  Files                  95       95              
  Lines                7108     7118      +10     
==================================================
+ Hits                 4693     4700       +7     
- Misses               1996     1998       +2     
- Partials              419      420       +1     
Flag Coverage Δ
os_linux 65.53% <85.72%> (+0.01%) ⬆️
os_windows 58.61% <66.67%> (+0.02%) ⬆️
unit 65.53% <85.72%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@natalieparellano natalieparellano merged commit 4f3e744 into release/0.17.5 Mar 12, 2024
@natalieparellano natalieparellano deleted the fix/target-env-0.17 branch March 12, 2024 14:06
edmorley added a commit to heroku/cnb-builder-images that referenced this pull request Mar 15, 2024
To pick up this backported fix:
buildpacks/lifecycle#1317

...so that these images still work after the removal of the `CNB_TARGET_*`
env vars workaround in:
heroku/base-images#260

Release notes:
https://github.com/buildpacks/lifecycle/releases/tag/v0.17.5

Full changelog:
buildpacks/lifecycle@v0.17.4...v0.17.5

GUS-W-15225541.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants