Skip to content

[ruby] buildpack followups - #17249

Draft
gscho wants to merge 14 commits into
ricardo/ruby-buildpackfrom
gscho/ruby-buildpack-followups
Draft

[ruby] buildpack followups#17249
gscho wants to merge 14 commits into
ricardo/ruby-buildpackfrom
gscho/ruby-buildpack-followups

Conversation

@gscho

@gscho gscho commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

No description provided.

gscho added 7 commits July 27, 2026 13:47
…PACKS

Ruby keeps its legacy @vercel/ruby Lambda routing (services and the
framework preset) unless the flag is set; buildpack container routing is
substituted at detection time so existing projects are unaffected until
the migration is rolled out.
A conventional Dockerfile/Containerfile no longer overrides a selected
buildpack; only the .vercel-suffixed markers do, matching the platform's
container opt-in convention.
Buildpack-backed services build the whole service root, so entrypoint has
no effect. Surface a BUILDPACK_ENTRYPOINT_IGNORED warning through the
services warning channel instead of silently dropping it.
commandShell means a single shell command line; a multi-element array
would silently drop everything after the first element when baked into
the Procfile or passed to the CNB launcher.
- Each descriptor declares a buildpackGroup written to an explicit
  order.toml and passed to the creator via -order, so a mixed-language
  root cannot out-detect the requested language.
- Deploy command Procfiles are written into a staged app copy; the
  source tree is never mutated.
- When only the builder image is overridden and its run image cannot be
  resolved from metadata, fail instead of pairing it with the pinned
  default run image.
@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f2f9201

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 18 packages
Name Type
@vercel/container Minor
@vercel/fs-detectors Minor
@vercel/frameworks Patch
@vercel/build-utils Patch
vercel Major
@vercel/static-build Patch
@vercel/backends Patch
@vercel/client Patch
@vercel/elysia Patch
@vercel/express Patch
@vercel/fastify Patch
@vercel/gatsby-plugin-vercel-builder Patch
@vercel/h3 Patch
@vercel/hono Patch
@vercel/koa Patch
@vercel/nestjs Patch
@vercel/node Patch
@vercel/cervel Patch

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-1ex90rjvz.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-1ex90rjvz.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

Python Runtime Wheel

A vercel-runtime wheel was also built for this PR.
To use in your Python project builds, also set this environment variable:

VERCEL_RUNTIME_PYTHON="vercel-runtime @ https://vercel-1ex90rjvz.vercel.sh/tarballs/vercel_runtime-0.17.0.dev1785270916+f2f9201-py3-none-any.whl"

Python Workers Wheel

A vercel-workers wheel was also built for this PR.
To use in your Python project builds, also set this environment variable:

VERCEL_WORKERS_PYTHON="vercel-workers @ https://vercel-1ex90rjvz.vercel.sh/tarballs/vercel_workers-0.1.0.dev1785270916+f2f9201-py3-none-any.whl"

This comment is automatically generated

Signed-off-by: gscho <greg.c.schofield@gmail.com>
gscho added 3 commits July 28, 2026 10:35
The gate is Ruby-specific: it migrates Ruby from the @vercel/ruby Lambda
builder to CNB container builds. Rename the env var and the build-utils
helper (isBuildpacksEnabled -> isRubyBuildpacksEnabled) accordingly;
future buildpack languages will get their own flags.
Buildpack-backed runtime frameworks are now kept by the experimental
framework filter when their own flag is on, so
VERCEL_EXPERIMENTAL_RUBY_BUILDPACKS=1 alone enables zero-config Ruby
detection. Services framework detection drops its DETECTION_FRAMEWORKS
special case and relies on the same central filter.
Paketo's bundle-install hard-fails without a Gemfile, so config.ru or
Gemfile.lock alone is not buildable. The framework preset now detects a
Gemfile plus a config.ru or a supported server gem
(puma/thin/unicorn/passenger/rack) in Gemfile.lock, and the registry's
project markers shrink to ['Gemfile']. Falcon/pitchfork apps are covered
transitively: both depend on rack, and rack appears as a resolved spec
in their lockfiles.

Also fixes VirtualFilesystem.hasPath prefix matching so Gemfile.lock no
longer satisfies hasPath('Gemfile') in tests.
The creator's exit code encodes which phase failed (per
buildpacks/lifecycle platform/exit.go: 20-29 detect, 50-59 build, 60-69
export, ...). Surface that in both the deploy and dev failure messages
so e.g. a bundle install failure reads 'exit code 51: a buildpack
failed while building the app — its error is in the build output above'
instead of a bare number. run() now attaches the exit code to its
rejection to make this possible.
Bind-mounting the workspace left it owned by the host uid, so buildpacks
that write to the app dir failed — bundler couldn't update Gemfile.lock
(exit 23 → creator exit 51), and rails-assets/npm/composer would hit the
same wall. pack's contract is that /workspace is owned by
CNB_USER_ID:CNB_GROUP_ID; match it on deploy with buildah copy --chown
(uid:gid read from the builder image's own env), which also lets the
readability-staging hack drop out of the deploy path entirely. A command
Procfile is now written to a temp dir and copied on top of the app.

Dev keeps the bind mount (macOS Docker Desktop mounts are permissive);
the Linux dev fix is a TODO pointing at pack's named-volume flow.
…ages

Heroku parity: both heroku-buildpack-ruby and heroku/buildpacks-ruby set
RAILS_ENV/RACK_ENV=production, RAILS_LOG_TO_STDOUT and
RAILS_SERVE_STATIC_FILES as user-overridable defaults; without them Rails
boots in development mode where host authorization 403s deployment
hostnames. Descriptors declare defaultBuildEnv, delivered as
BPE_DEFAULT_* launch defaults through Paketo's environment-variables
buildpack — the CNB launcher only applies them to unset variables, so
project env vars always win. User build env suppresses a default at
build time and every applied default is logged.

SECRET_KEY_BASE is intentionally not defaulted yet (TODO in the
registry): the plan is a per-deployment fallback plus a CLI prompt that
persists a generated value as a project env var, instead of storing the
secret in the build cache like Heroku (where cache loss rotates it and
resets sessions).
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.

1 participant