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

Prefer targets over stacks #790

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pack buildpack new examples/node-js \
--api 0.10 \
--path node-js-buildpack \
--version 0.0.1 \
--stacks io.buildpacks.samples.stacks.noble
--targets "linux/amd64"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: While you are here, maybe

diff --git a/content/docs/for-buildpack-authors/tutorials/basic-buildpack/02_building-blocks-cnb.md b/content/docs/for-buildpack-authors/tutorials/basic-buildpack/02_building-blocks-cnb.md
index 55c72761..6ddb7977 100644
--- a/content/docs/for-buildpack-authors/tutorials/basic-buildpack/02_building-blocks-cnb.md
+++ b/content/docs/for-buildpack-authors/tutorials/basic-buildpack/02_building-blocks-cnb.md
@@ -34,7 +34,7 @@ This command will create `node-js-buildpack` directory which contains `buildpack
 - `-a, --api` Buildpack API compatibility of the generated buildpack
 - `-h, --help` Help for 'new'
 - `--path` the location on the filesystem to generate the artifacts
-- `--stacks` Stacks (deprecated) the buildpack will work with
+- `--targets` OS and arch the buildpack will target
 - `-V, --version` the version of the buildpack in buildpack.toml

or similar makes sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've bumped this in #793. We will update the text when your changes to pack --targets lands. buildpacks/pack#2296

```
<!--+- "{{execute}}"+-->
This command will create `node-js-buildpack` directory which contains `buildpack.toml`, `bin/build`, `bin/detect` files.
Expand All @@ -46,6 +46,11 @@ You will have `node-js-buildpack/buildpack.toml`<!--+"{{open}}"+--> in your buil
```toml
# Buildpack API version
api = "0.10"
# Enable to allow the buildpack to build on a Windows target
WithWindowsBuild = false
# Enable to force the buildpack to build only on supported Linux targets
# "false" by default, which allows the buildpack to build on *all* Linux targets
WithLinuxBuild = false

# Buildpack ID and metadata
[buildpack]
Expand All @@ -54,12 +59,8 @@ api = "0.10"

# Targets the buildpack will work with
[[targets]]
os = "linux"

# Stacks (deprecated) the buildpack will work with
[[stacks]]
id = "io.buildpacks.samples.stacks.noble"

os = "linux"
arch = "amd64"
```

The buildpack ID is the way you will reference the buildpack when you create buildpack groups, builders, etc.
Expand Down
Loading