Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Avahi is not available but cups/dnssd.c tries to use it unconditional

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
85/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
c
领域
build-system

调研方向

从 cups/dnssd.c 开始:dnssdGetAddrInfo/backend 代码块落入一个 #else // HAVE_AVAHI 分支,该分支在 config.h 中未定义 HAVE_AVAHI 的情况下仍然包含 <avahi-client/client.h>。对比提交 23a183b63a4c94a 中对 cups/dest.c 里同等 HAVE_AVAHI 用法的保护方式,应用同样的保护,使非 Avahi 的 Linux 构建能够编译。完成标准 = 在没有 avahi-client 头文件的系统上 ./configure && gmake 成功,并且在定义了 HAVE_AVAHI 时没有任何功能性变更。

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

描述

.
Describe the bug

  • Version: CUPS 2.4.20 from today git clone
  • Platform: SLES 15 SP7, 64-bit
  • ./configure reports:
    checking for Avahi client... no
    
  • Generated config.h contains:
    /* #undef HAVE_AVAHI */
    
  • Nevertheless, cups/dnssd.c has:
    #ifdef HAVE_MDNSRESPONDER
    ...
    #elif _WIN32
    ...
    #else // HAVE_AVAHI
    #  include <avahi-client/client.h>
    
  • Consequently, on Linux without Avahi, the #else branch is taken and compilation fails with:
    fatal error: avahi-client/client.h: Datei oder Verzeichnis nicht gefunden
    
  • the preceding cups/dest.c problem was fixed by commit 23a183b63a4c94a.

That makes the problem reproducible and, importantly, demonstrates that installing avahi-devel would merely mask the inconsistency between configure and the source.

To Reproduce
Steps to reproduce the behavior:

  1. Go to cups
  2. Run ./configure && gmake
主要语言
C
星标
1.8k
派生
342
平均合并
3 天 20 小时
30 天内合并 PR
11

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

OpenPrinting/cups 的其他 Issue

查看 OpenPrinting/cups 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

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