rust-lang / rust-lang/docker-rust

Seeing errors with pngquant 3.0.3

Open
#278 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dockerfile
Stars
537
Forks
111
Avg merge
1d 38m
Merged PRs (30d)
4

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using the Docker build command in the report with pngquant tag 3.0.3. Inspect rust/bin.rs around line 206 and lib/imagequant-sys/src/ffi.rs around line 217 to understand the callback type mismatch; the work is done when the pngquant release build completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, rust
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.