[ruby] buildpack followups - #17249
Conversation
…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.
|
| 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
📦 CLI Tarball ReadyThe Vercel CLI tarball for this PR is now available! Quick TestYou can test this PR's CLI directly by running: npx https://vercel-1ex90rjvz.vercel.sh/tarballs/vercel.tgz --helpUse in vercel.jsonTo use this CLI version in your project builds, add to your {
"build": {
"env": {
"VERCEL_CLI_VERSION": "vercel@https://vercel-1ex90rjvz.vercel.sh/tarballs/vercel.tgz"
}
}
}Python Runtime WheelA Python Workers WheelA This comment is automatically generated |
Signed-off-by: gscho <greg.c.schofield@gmail.com>
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.
723c745 to
dafa61e
Compare
…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).
No description provided.