Ruby is built without libcrypt on Debian 14 (forky) because `libc6-dev` no longer depends on `libcrypt-dev`

未关闭 适合新手
#534 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
docker, ruby, shell
领域
build-system

调研方向

从 Debian 变体的 Dockerfile 开始,尤其是报告中提到的 4.0/trixie 和 4.0/slim-trixie 文件,并追踪它们的构建依赖项。使用报告中提到的 forky 基础镜像重现 configure 检查;构建成功的标准是能够找到 crypt,且生成的 Ruby 支持所示的 SHA-512 crypt 示例。确认运行时依赖项已作为 libcrypt1 存在,如 issue 所述。

由索引模型根据 Issue 内容生成。

描述

This is a heads-up for the time a Debian 14 (forky) variant is added. The current images (trixie, bookworm and alpine) are not affected.

Debian's glibc package dropped the libcrypt-dev dependency from libc6-dev in 2.42-7:

https://salsa.debian.org/glibc-team/glibc/-/commit/10c4a331fb977ae5ae7255e9ee1c9c133f9d9da9

The Dockerfiles do not install libcrypt-dev explicitly, and buildpack-deps:forky does not have it either. On Debian 14 (forky), Ruby's configure then does not find crypt, and the build still succeeds. As a result, String#crypt falls back to the DES-only missing/crypt.c, and libruby.so is not linked to libcrypt.so.1.

I built 4.0/trixie/Dockerfile and 4.0/slim-trixie/Dockerfile with only the FROM line changed to buildpack-deps:forky and debian:forky-slim. Both give the same result:

$ docker build -t local/dl-ruby:4.0-forky forky
... snip ...
checking for crypt in -lcrypt... no
... snip ...
checking for crypt_r... no
... snip ...
$ docker run --rm local/dl-ruby:4.0-forky ruby -e 'p "secret".crypt("$6$saltsalt$")'
"$6/iozuRTIzwY"
$ docker run --rm ruby:4.0 ruby -e 'p "secret".crypt("$6$saltsalt$")'
"$6$saltsalt$TVLlQcbpFVof5W3Yz4DTP6gRstiNuHwwTt6GLc1E5n0U0aDehy0S5knV8wiOQSpT0Y77vwPZN.Pq.H91p5hVO1"

The same thing happened to the rubylang/ruby images when they moved to Ubuntu 26.04, which has the same glibc change. It was fixed by installing libcrypt-dev in the build stage: https://github.com/ruby/docker-images/pull/195

Ubuntu also added libcrypt-dev to build-essential for Ubuntu 26.04 because of this: https://bugs.launchpad.net/bugs/2154780

A possible fix is to add libcrypt-dev to the build dependencies of the Debian variants. libcrypt1 is already in both base images, so nothing is needed at runtime.

主要语言
Shell
星标
627
派生
322
平均合并
23 小时 39 分钟
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

docker-library/ruby 的其他 Issue

查看 docker-library/ruby 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。