#1135277 sass-grass: FTBFS: error[E0053]: method `debug` has an incompatible type for trait

#1135277#5
Date:
2026-04-30 12:44:56 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202604/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:sass-grass, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
warning: `grass_compiler` (lib) generated 9 warnings (9 duplicates)
     Running `CARGO=/usr/bin/cargo CARGO_CRATE_NAME=grass CA [too-long-redacted] o/registry/include_sass-0.13.4`
warning: `grass` (lib) generated 1 warning (1 duplicate)
     Running `CARGO=/usr/bin/cargo CARGO_BIN_EXE_sass-grass= [too-long-redacted] o/registry/include_sass-0.13.4`
error[E0053]: method `debug` has an incompatible type for trait
   --> crates/lib/tests/macros.rs:189:32
    |
189 |     fn debug(&self, _location: SpanLoc, message: &str) {
    |                                ^^^^^^^ expected `codemap::SpanLoc`, found `SpanLoc`
    |
    = note: expected signature `fn(&TestLogger, codemap::SpanLoc, &_)`
               found signature `fn(&TestLogger, SpanLoc, &_)`
help: change the parameter type to match the trait
    |
189 |     fn debug(&self, _location: codemap::SpanLoc, message: &str) {
    |                                +++++++++

error[E0053]: method `warn` has an incompatible type for trait
   --> crates/lib/tests/macros.rs:193:31
    |
193 |     fn warn(&self, _location: SpanLoc, message: &str) {
    |                               ^^^^^^^ expected `codemap::SpanLoc`, found `SpanLoc`
    |
    = note: expected signature `fn(&TestLogger, codemap::SpanLoc, &_)`
               found signature `fn(&TestLogger, SpanLoc, &_)`
help: change the parameter type to match the trait
    |
193 |     fn warn(&self, _location: codemap::SpanLoc, message: &str) {
    |                               +++++++++

For more information about this error, try `rustc --explain E0053`.
error: could not compile `grass` (test "each") due to 2 previous errors

Caused by:
  process didn't exit successfully: `CARGO=/usr/bin/cargo CA [too-long-redacted] e_sass-0.13.4` (exit status: 1)
warning: build failed, waiting for other jobs to finish...
dh_auto_test: error: /usr/share/dh-rust/bin/cargo test returned exit code 101
make: *** [debian/rules:34: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------

#1135277#10
Date:
2026-05-02 08:38:31 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
sass-grass, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1135277@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jonas Smedegaard <dr@jones.dk> (supplier of updated sass-grass package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sat, 02 May 2026 09:36:56 +0200
Source: sass-grass
Architecture: source
Version: 0.13.4-3
Distribution: unstable
Urgency: medium
Maintainer: Jonas Smedegaard <dr@jones.dk>
Changed-By: Jonas Smedegaard <dr@jones.dk>
Closes: 1135277
Changes:
 sass-grass (0.13.4-3) unstable; urgency=medium
 .
   * add patch to fix incompatible type for trait in test;
     closes: bug#1135277, thanks to Santiago Vila
Checksums-Sha1:
 a6c7c810174b70d201ced8ad1937fa15c515d0d2 2487 sass-grass_0.13.4-3.dsc
 f816405d2c2d3aa8e0da2fbde1bf5cd5e056897b 6168 sass-grass_0.13.4-3.debian.tar.xz
 2f3c76b22fadd1c82333a37794e143bb1384498a 25787 sass-grass_0.13.4-3_amd64.buildinfo
Checksums-Sha256:
 59d9048464bf0ce43ac124af9282f4af9d610bf74d73ab12aba39aa70313e921 2487 sass-grass_0.13.4-3.dsc
 fba195ad35a15f86e4e2a83568e20ac3ec0a648ecc596e45e356d319da2f71ef 6168 sass-grass_0.13.4-3.debian.tar.xz
 8ab6c3db1920a9aef57f35a964a9bcd1b14458fe432584d1c2b5463d3b6e0b38 25787 sass-grass_0.13.4-3_amd64.buildinfo
Files:
 e3dfd3e4008e3fff22e2a0bc23f9ff72 2487 rust optional sass-grass_0.13.4-3.dsc
 636fc411679c82d8fd8e80dc0e38ffdb 6168 rust optional sass-grass_0.13.4-3.debian.tar.xz
 0e9c59a04ea59ec8945592697914d3a2 25787 rust optional sass-grass_0.13.4-3_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJABAEBCgAqFiEEn+Ppw2aRpp/1PMaELHwxRsGgASEFAmn1qkQMHGRyQGpvbmVz
LmRrAAoJECx8MUbBoAEhZewP/R4ScXD+5AU2zMhb1bISMfnhWArxgXRgRlWBoBVT
iBRGlG0N2ODYitUZ5ws/ezRx+dn4sRzYEE9fvmcLXlJav40sNoBow0DsjrDMv9uM
t9+gq0LbvrTquaMw7W/oA7yvRcm4ft91WvVczKsMrK00zHLCh2kzYk3IowPZrOad
ftZnn9dT9vRskKzRdVWOvf178o3BWyCWRzP2HcvBEKCViDiDiTicxETS4rWOviPa
wgRX6HFoNni2EBf9Wgovoh30UyfXCrXCiUwDIzRTwXiJ/bbl9JbX/HYAKetGrNGq
n/fJrrTW9ewzH6NWOWc8+5N9OJgpUnaVaDr9JpuwnbbaH+paPllNK6DCCIaJHEoy
fAW4RTIhaxu6ogrWhqyJ6xsKtWzC01yk+gjUgPjgd3BwKYdPh7WdccwZU+0kAvux
87NXtMN4VkdUSorpoco2I++ME+e+9c1yameIw8vr4SNk8JnihPloYGAIpPJFBO6M
sHO31zNPWhUiBJIK1yZv9Vo1mzfyb0A/8gLUr3gvJGL9hju1YLCYvUnGwncw+74T
tiC0qnz0FrCQTUWFSI3prw9SGCzcFd8jN6jVqxGKERge9WekKM5BGfL+/hfOwzKF
RvrxEEVU3nCRH39kQ2ImyanuvWUKhoBRmRnzRW4PBOoTww/XtdDZS0h2ztub1lLi
fwCo
=xXdU
-----END PGP SIGNATURE-----

#1135277#19
Date:
2026-05-09 14:30:04 UTC
From:
To:
Hi.

I see that 1001_test_trait_type.patch does this:

-    fn debug(&self, _location: SpanLoc, message: &str) {
+    fn debug(&self, _location: codemap::SpanLoc, message: &str) {


Could it be that this needs to be done a few more times?
When I do this:

rgrep "_location: SpanLoc"

on the source code (after applying all patches), I still see this:

crates/compiler/src/logger.rs:    fn debug(&self, _location: SpanLoc, _message: &str) {}
crates/compiler/src/logger.rs:    fn warn(&self, _location: SpanLoc, _message: &str) {}

Are those ok that way or maybe they should also be changed to codemap::SpanLoc?
(Just a wild idea, I know nothing about rust).

Thanks.

#1135277#24
Date:
2026-06-22 12:10:26 UTC
From:
To:
Quoting Santiago Vila (2026-05-09 15:22:16)

It seems fishy to me for a random error to persistently fail at your
setup and (with only few samples, but still) consistently succeed on
Debian buildds.

I asked a gAI to reason on this bugreport, and after first reaching for
your suggestion that the patch was sensible, it agreed with my own
understanding that it was in fact not changing anything, and it then
pointed to caching issues in the build infrastructure as a possible
cause and Debian packaging system being another. Since there seems to
be a clear difference in build environments and no difference in Debian
tooling, I lean towards the issue here being some caching stuff in your
system different from both mine and those of Debian build daemons.

Fixed now with release packaging release 0.13.4-5. Thanks!

 - Jonas

#1135277#29
Date:
2026-06-22 12:13:59 UTC
From:
To:
Quoting Santiago Vila (2026-05-09 16:30:04)

That is indeed a reasonable suggestion. I doubted it, however. And a
conversation with a generative AI today supported my own reasoning.

That conversation is attached this email, in case you appreciate the
input of hallucinatory machinery.

 - Jonas

#1135277#34
Date:
2026-06-22 13:46:54 UTC
From:
To:
Please note that it does not consistently succeed on Debian buildds.

On s390x, it fails in the exact same way it fails for me:

https://buildd.debian.org/status/fetch.php?pkg=sass-grass&arch=s390x&ver=0.13.4-5&stamp=1782135004&raw=0

error[E0053]: method `debug` has an incompatible type for trait
   --> crates/lib/tests/macros.rs:189:32
    |
189 |     fn debug(&self, _location: SpanLoc, message: &str) {
    |                                ^^^^^^^ expected `codemap::SpanLoc`, found `SpanLoc`
    |
    = note: expected signature `fn(&TestLogger, codemap::SpanLoc, &_)`
               found signature `fn(&TestLogger, SpanLoc, &_)`
help: change the parameter type to match the trait
    |
189 |     fn debug(&self, _location: codemap::SpanLoc, message: &str) {
    |                                +++++++++


I infer from this failure that the bug is not architecture-specific
and it may happen to anybody, probably a race condition of some kind.

( My offer for a VM to reproduce still holds. Please contact me privately for details )

Thanks.

#1135277#39
Date:
2026-06-22 14:19:58 UTC
From:
To:
You are right to be skeptical because I've just tried that and it
didn't work...

This looks to me like an upstream bug in the package. I suggest that
you forward the bug upstream. You can extend my VM offer to any of the
upstream authors if they think it would help.

Thanks.

#1135277#44
Date:
2026-06-22 16:49:04 UTC
From:
To:
Quoting Santiago Vila (2026-06-22 16:19:58)

What did you try that didn't work?

Thanks for the offer.

 - Jonas

#1135277#49
Date:
2026-06-22 17:42:09 UTC
From:
To:
The "reasonable suggestion", i.e. doing to macros.rs the same type of changes
that you did in 1001_test_trait_type.patch (and later reverted).

If this is not a bug in rust, it could also be a bug in the scripts
controlling the build, which take for granted that some things are
done in a certain order. Or maybe the package is taking for granted some
behaviour from the compiler which is in fact undefined behaviour.

Thanks.

#1135277#54
Date:
2026-06-22 19:49:52 UTC
From:
To:
Quoting Santiago Vila (2026-06-22 19:42:09)

As I wrote above, and in my other reply as well: What my gAI at first
considered "reasonable" was later rejected again by that same gAI:
First it analyzes what is in the bugreport (until line 60), but when I
ask to elaborate (until line 201) and then point out that it ends up
recommending to effectively *not* apply the patch (which is the same
round-about reasoning that lead me to first apply the patch but then
revert it), it acknowledges (from line 212 onwards).

 - Jonas

#1135277#59
Date:
2026-06-23 00:33:36 UTC
From:
To:
Explanation from my asistant:
------------------------------------------------------------------------------- The Logger trait at crates/compiler/src/logger.rs:5-12 exposes codemap::SpanLoc (a type from a third-party crate) in its public API. This means anyone who wants to implement Logger must link against the exact same crate instance of codemap that grass_compiler used, otherwise Rust's type system sees them as different types even at the same version. In normal cargo this works because Cargo unifies all dependencies into a single instance. In Debian's separate-package build system (where each crate is an independent package), the codemap that grass_compiler linked against and the codemap that the test binary links against can end up as different compilation instances, hence the E0053. The simple fix without refactoring the Logger trait: Avoid implementing Logger in the tests at all. Only two test files (warn.rs and debug.rs) actually use TestLogger. Instead of a custom logger implementation that runs into the type identity issue: 1. Move TestLogger and impl Logger for TestLogger out of macros.rs into its own module. 2. In the two tests that need it, replace the custom logger with StdLogger and capture stderr to verify the output. Or even simpler: just test that @warn and @debug compile without error, and skip verifying the exact message content, or use options.quiet(true) / NullLogger to test the silent path. The Sass parsing/output tests are already covered by the 80+ other test files; the logging tests are a nice-to-have. The deeper lesson for the author is: avoid third-party crate types in trait method signatures, prefer &str, usize, and other primitives, or define a local type. This keeps the trait implementable without cargo-dependency version gymnastics. ------------------------------------------------------------------------------- I asked it to implement the "simple fix" and the result is attached. Of course, this should be taken with a grain of salt, but the fact is that now I can rebuild the package, while previously I could not. So, we can reverse the famous quote from Donald Knuth: Beware with the attached patch, I have only verified that it solves the build error, not that the fix is correct... I would still be delighted to see a better fix if there is any. Thanks.
#1135277#64
Date:
2026-06-23 09:50:32 UTC
From:
To:
Quoting Santiago Vila (2026-06-23 02:33:36)

That was very helpful, and I think I now found an even better patch.

Can I ask you to test the attached patch?

(I am aware that you have offered me access, but it is much slower for
me to figure that out than pass a patch to you, so I hope that is ok)

I sure hope that my alternative and more compact patch addresses the
issue, since that also means it is likely that I actually understood
what is really going on here.

 - Jonas

#1135277#69
Date:
2026-06-23 10:54:53 UTC
From:
To:
Hi.

The last patch does not work. Tried several times and it fails all the time.
I've put an unmodified build of -5, and the modified attempt (versioned -6) here:

https://people.debian.org/~sanvila/build-logs/sass-grass/

in case a diff may give some hint. For example, I see a very small difference
in the error message:

 error[E0053]: method `debug` has an incompatible type for trait
    --> crates/lib/tests/macros.rs:189:32
     |
@@ -7988,22 +7982,22 @@
     |                               +++++++++

 For more information about this error, try `rustc --explain E0053`.
-error: could not compile `grass` (test "selector-replace") due to 2 previous errors
+error: could not compile `grass` (test "and") due to 2 previous errors


Thanks.

#1135277#74
Date:
2026-06-23 14:05:49 UTC
From:
To:
[replying to bugreport againg, since this now seems a bug in dh-rust]

Quoting Jonas Smedegaard (2026-06-23 11:50:32)
[...]
[...]
[...]

That patch turned out (as discussed privately) to not work, and my
further examination revealed that the likely deeper cause is that
dh-rust passes the custom option -Zavoid-dev-deps when building tests.
That option was carried over when dh-rust was forked from dh-cargo, and
there it makes sense, since **dh-cargo ignores tests during build**.
dh-rust was extended to check tests and used same arguments, where that
one argument is likely causing trouble for this very scenario of
reusing an object compiled during build when compiling tests, where a
hint about build-dependency guides the compiler to conclude that it is
the same object that is needed, not wrongly a recompilation of it.

dh-rust 0.1.2 continues to pass option -Zavoid-dev-deps during build
but no longer passes that option during test.

What is slower for me is not the speed of compilation nor the speed of
execution, but the speed of me adapting to the format of execution: I
am familiar with pbuilder and have not yet wrapped my mind around
sbuild. I know that sbuild is supposed to be a piece of cake, and it
simply happens to be a cake that is alien for me just yet.

 - Jonas

#1135277#85
Date:
2026-06-24 11:20:23 UTC
From:
To:
Quoting Jonas Smedegaard (2026-06-23 16:05:49)

Whoops - dh-rust cannot drop option -Zavoid-dev-deps during test for
different reasons (removing it triggers refreshing dependency graph
stored in Cargo.lock, which requires network access).

Also, further testing reveals that even with option -Zavoid-dev-deps
dropped, this issue still persists: A quick test with -j4 seemed to
show -Zavoid-dev-deps having an effect, but with option -j1 or -j2
-Zavoid-dev-deps has not affect. Either -Zavoid-dev-deps is a red
herring or or it only amplifies the likelyhood of this issue.

 - Jonas

#1135277#96
Date:
2026-06-24 13:48:58 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
sass-grass, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1135277@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jonas Smedegaard <dr@jones.dk> (supplier of updated sass-grass package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 24 Jun 2026 13:39:21 +0200
Source: sass-grass
Architecture: source
Version: 0.13.4-6
Distribution: unstable
Urgency: medium
Maintainer: Jonas Smedegaard <dr@jones.dk>
Changed-By: Jonas Smedegaard <dr@jones.dk>
Closes: 1135277
Changes:
 sass-grass (0.13.4-6) unstable; urgency=medium
 .
   * really fix Vcs-* fields, thanks to Santiago Vila
   * add patch 1001
     to not fail building tests with no or limited parallism;
     closes: bug#1135277, thanks (a lot) to Santiago Vila
Checksums-Sha1:
 8d0d8e0964a4d10e0217a0a8e2e9e7633e41f67b 2491 sass-grass_0.13.4-6.dsc
 903acc2d09f2b41177ab1563926f083a2406a5ed 7124 sass-grass_0.13.4-6.debian.tar.xz
 25d5afbce74464a892dbdf47f99b84ba899c1190 26248 sass-grass_0.13.4-6_amd64.buildinfo
Checksums-Sha256:
 72d461a8c224cc28e42c99402bf4a14fe0b964a627918861da1775d1c6a5eb37 2491 sass-grass_0.13.4-6.dsc
 175152488cbd29774c22419d7c04ecad0d4111c72dd25d4c18dba647d44110a4 7124 sass-grass_0.13.4-6.debian.tar.xz
 f4b805bcbc84112f01a52e7fcbdc8c89413e0d5a12c8f401b16f00ccbf6384cf 26248 sass-grass_0.13.4-6_amd64.buildinfo
Files:
 ac526b1f5ed9c7ac09d861308f25e778 2491 rust optional sass-grass_0.13.4-6.dsc
 85cbeab71994d3cd9c853bfd0027ec23 7124 rust optional sass-grass_0.13.4-6.debian.tar.xz
 8a1f2b6050a4fb3e44aee1bb251773cc 26248 rust optional sass-grass_0.13.4-6_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJABAEBCgAqFiEEn+Ppw2aRpp/1PMaELHwxRsGgASEFAmo73VwMHGRyQGpvbmVz
LmRrAAoJECx8MUbBoAEhHKYP/1Fq9PAg/SdQI/b9O+98B3vFwZXFv5eCj+0V4eJM
YDz/ldRD7sUxTL7ocZvpilajhBkV1pm944n/tMMxsdGEhaK45j3xNQFcPNHbb/Ot
L8thcapIrdZkmSkQatv1/MAG05L5tC3FDoNy0Zb8BndmMcjNpK5Ws1p4jALOfpUa
3zwZzyMtoeNTUxA8q1Q2UoEYxlXeXZI6ucKC5lO0rx/B68tb9JlmfugaiFbKPnUh
VqNotL+xDppYRSZn51GRSq3Y+mQ/vf0lFvWDa9WfhuglsVQatC6uo3uyxR8NGHJz
wgr6+/+bVb1zuUpm04JhOjAZywOZpVMVSvjjY0qWp1IhdSeleG5nux8WF9S3NOES
25v1IZ5R4YUwgKcVrKu3rMFIlxZkVJ5dIJSk7oS/kmPSOBWPKaBPJqX9IEgMNjy7
sJJ/OUIBPrib/HgX1onBmfMprSShcRtKw6IehdF1MediLaWi1MmDP46GRilRAEyU
PYysv8AQLSSJkddzlbEjsk/m4b7BXUprBUSMiNCIVElE6bNOA3L9+1Ct0s8aq8Yh
9onV410J75pTPJXPqnSGGyinBWaNP0fx5K1YCRVxdNcn4cDxrwX0owZYsPfQS6YP
zdcn6ddtsk2f8o54gohlnutQX3/Q8wlky2JWWxXG6TR7/9fJRkXhbK3sYpDbv5Lq
CgYH
=W7m0
-----END PGP SIGNATURE-----