Seeing errors with pngquant 3.0.3

未关闭
#278 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
docker, rust

调研方向

使用报告中的 Docker build 命令和 pngquant 标签 3.0.3 重现该失败。检查 rust/bin.rs 中第 206 行附近以及 lib/imagequant-sys/src/ffi.rs 中第 217 行附近,以了解 callback 类型不匹配;当 pngquant release build 成功完成时,工作即告完成。

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

描述

Seeing this error since the last update to the latest tag:

[rust-builder 4/4] RUN git clone --recursive https://github.com/kornelski/pngquant.git     && cd pngquant     && git checkout 3.0.3     && cargo build --release     && mkdir -p /output     && cp target/release/pngquant /output/
#14 10.74 error[E0308]: mismatched types
#14 10.74    --> rust/bin.rs:206:44
#14 10.74     |
#14 10.74 206 |         unsafe { liq_set_log_callback(liq, log_callback, Default::default()); }
#14 10.74     |                  --------------------      ^^^^^^^^^^^^ expected `Option<...>`, found fn item
#14 10.74     |                  |
#14 10.74     |                  arguments to this function are incorrect
#14 10.74     |
#14 10.74     = note: expected enum `Option<for<'a> unsafe extern "C" fn(&'a imagequant_sys::liq_attr, *const i8, imagequant_sys::AnySyncSendPtr)>`
#14 10.74             found fn item `for<'a> unsafe extern "C" fn(&'a imagequant_sys::liq_attr, *const i8, imagequant_sys::AnySyncSendPtr) {log_callback}`
#14 10.74 note: function defined here
#14 10.74    --> lib/imagequant-sys/src/ffi.rs:217:26
#14 10.74     |
#14 10.74 217 | pub unsafe extern "C" fn liq_set_log_callback(attr: &mut liq_attr, callback: Option<liq_log_callback_function>, user_info: AnySyncS...
#14 10.74     |                          ^^^^^^^^^^^^^^^^^^^^
#14 10.74 help: try wrapping the expression in `Some`
#14 10.74     |
#14 10.74 206 |         unsafe { liq_set_log_callback(liq, Some(log_callback), Default::default()); }
#14 10.74     |                                            +++++            +
#14 10.74 
#14 10.75 For more information about this error, try `rustc --explain E0308`.
#14 10.75 error: could not compile `pngquant` (bin "pngquant") due to 1 previous error
#14 ERROR: process "/bin/sh -c git clone --recursive https://github.com/kornelski/pngquant.git     && cd pngquant     && git checkout 3.0.3     && cargo build --release     && mkdir -p /output     && cp target/release/pngquant /output/" did not complete successfully: exit code: 101

This breaks our CI/CD pipeline. Can anyone support here with this?

主要语言
Dockerfile
星标
540
派生
110
平均合并
24 分钟
30 天内合并 PR
3

环境准备

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

从这里开始

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

rust-lang/docker-rust 的其他 Issue

查看 rust-lang/docker-rust 的全部 Issue

相似的 Issue

更多 Build System Issue

把新 issue 发到你的邮箱

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