Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.rc > #363819

Bug#1071363: snappy-tools: FTBFS: snappy.cpp:575:51: error: call of overloaded ‘Compress({anonymous}::fd_source*, {anonymous}::FILE_sink*)’ is ambiguous

From наб <nabijaczleweli@nabijaczleweli.xyz>
Newsgroups linux.debian.bugs.rc
Subject Bug#1071363: snappy-tools: FTBFS: snappy.cpp:575:51: error: call of overloaded ‘Compress({anonymous}::fd_source*, {anonymous}::FILE_sink*)’ is ambiguous
Date 2024-05-18 00:30 +0200
Message-ID <IFefn-e39L-7@gated-at.bofh.it> (permalink)
References <IFcGN-e26K-67@gated-at.bofh.it> <IFcGN-e26K-67@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Control: reassign -1 src:snappy 1.2.0-2
Control: merge 1070785 -1

On Fri, May 17, 2024 at 10:41:58PM +0200, Santiago Vila wrote:
> Package: src:snappy-tools
> Version: 1-1
> Severity: serious
> Tags: ftbfs
> 
> Dear maintainer:
> 
> During a rebuild of all packages in unstable, your package failed to build:
> 
> --------------------------------------------------------------------------------
> snappy.cpp: In function ‘int main(int, char* const*)’:
> snappy.cpp:575:51: error: call of overloaded ‘Compress({anonymous}::fd_source*, {anonymous}::FILE_sink*)’ is ambiguous
>   575 |                                 written = Compress(&source, &sink);
>       |                                           ~~~~~~~~^~~~~~~~~~~~~~~~
> In file included from snappy.cpp:14:
> /usr/include/snappy.h:81:10: note: candidate: ‘size_t snappy::Compress(Source*, Sink*)’
>    81 |   size_t Compress(Source* reader, Sink* writer);
>       |          ^~~~~~~~
> /usr/include/snappy.h:82:10: note: candidate: ‘size_t snappy::Compress(Source*, Sink*, CompressionOptions)’
>    82 |   size_t Compress(Source* reader, Sink* writer,
>       |          ^~~~~~~~

Not our bug:
this is #1070785, caused by a breaking fix to #1070217,
and now subject to a potential src:snappy transition in #1070977.

When tchet@ brought the latter to my attention I build-tested against
unbroken libsnappy-dev 1.2.0-3 from experimental and that worked,
so if that ever happens snappy-tools will work.

But a fixed patch, would be much easier to produce:
in restore-api.patch in 1.2.0-2 I see
	--- snappy-1.2.0.orig/snappy.h
	+++ snappy-1.2.0/snappy.h
	@@ -78,6 +78,7 @@ namespace snappy {
	
	   // Compress the bytes read from "*reader" and append to "*writer". Return the
	   // number of bytes written.
	+  size_t Compress(Source* reader, Sink* writer);
	   size_t Compress(Source* reader, Sink* writer,
	                   CompressionOptions options = {});
which will be trivially fixed by deleting the "= {}"
(thus, only the two-argument Compress will be considered when two
 arguments are given, like in snappy-tools and ceph;
 the signatures are not affected by this, since defaults are call-site-only).

I also see
	@@ -157,6 +158,8 @@ namespace snappy {
	   // `uncompressed_length` is the total number of bytes to be read from the
	   // elements of `iov` (_not_ the number of elements in `iov`).
	   void RawCompressFromIOVec(const struct iovec* iov, size_t uncompressed_length,
	+                            char* compressed, size_t* compressed_length);
	+  void RawCompressFromIOVec(const struct iovec* iov, size_t uncompressed_length,
	                             char* compressed, size_t* compressed_length,
	                             CompressionOptions options = {});
which should've gotten a similar treatment,
or actually no treatment at all, because RawCompressFromIOVec() is new in 1.2
(but AFAICT calling RawCompressFromIOVec() will fail on overload resolution like Compress()).

László: I'm attaching a replacement restore-api.patch for src:snappy (based on 1.2.0-1).
This provides the same symbols as 1.1.9-3 + the new API, seamlessly,
which I think is what you were indending with your original patch in 1.2.0-2:
	$ diff -U0 <(nm -D /lib/x86_64-linux-gnu/libsnappy.so.1 | cut -d\  -f2- | sort) <(nm -D sn/usr/lib/x86_64-linux-gnu/libsnappy.so.1 | cut -d\  -f2- | sort)
	--- /dev/fd/63  2024-05-18 00:17:19.586857117 +0200
	+++ /dev/fd/62  2024-05-18 00:17:19.590857295 +0200
	@@ -8,0 +9,3 @@
	+T _ZN6snappy11RawCompressEPKcmPcPmNS_18CompressionOptionsE
	+T _ZN6snappy12DeferMemCopyEPPKvPmS1_m
	+T _ZN6snappy13ClearDeferredEPPKvPmPh
	@@ -15,0 +19 @@
	+T _ZN6snappy17CompressFromIOVecEPK5iovecmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_18CompressionOptionsE
	@@ -18,0 +23,2 @@
	+T _ZN6snappy20RawCompressFromIOVecEPK5iovecmPcPm
	+T _ZN6snappy20RawCompressFromIOVecEPK5iovecmPcPmNS_18CompressionOptionsE
	@@ -42,4 +47,0 @@
	-T _ZN6snappy7MemCopyElPKhm
	-T _ZN6snappy7MemCopyEPcPKhm
	-T _ZN6snappy7MemMoveElPKvm
	-T _ZN6snappy7MemMoveEPcPKvm
	@@ -46,0 +49 @@
	+T _ZN6snappy8CompressEPKcmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_18CompressionOptionsE
	@@ -47,0 +51 @@
	+T _ZN6snappy8CompressEPNS_6SourceEPNS_4SinkENS_18CompressionOptionsE
	@@ -52,0 +57,3 @@
	+T _ZN6snappy8internal26CompressFragmentDoubleHashEPKcmPcPtiS4_i
	+T _ZN6snappy9MemCopy64ElPKvm
	+T _ZN6snappy9MemCopy64EPcPKvm
	@@ -62 +69 @@
	-                U _ZdlPv@GLIBCXX_3.4
	+                U _ZdlPvm@CXXABI_1.3.9
	@@ -68,0 +76 @@
	+                U _ZSt24__throw_out_of_range_fmtPKcz@GLIBCXX_3.4.20
	@@ -71,0 +80 @@
	+V _ZTIN6snappy17SnappyIOVecReaderE
	@@ -75,0 +85 @@
	+V _ZTSN6snappy17SnappyIOVecReaderE
	@@ -79,0 +90 @@
	+V _ZTVN6snappy17SnappyIOVecReaderE
	@@ -87,0 +99,5 @@
	+W _ZN6snappy17SnappyIOVecReader4PeekEPm
	+W _ZN6snappy17SnappyIOVecReader4SkipEm
	+W _ZN6snappy17SnappyIOVecReaderD0Ev
	+W _ZN6snappy17SnappyIOVecReaderD1Ev
	+W _ZN6snappy17SnappyIOVecReaderD2Ev
	@@ -96,0 +113 @@
	+W _ZNK6snappy17SnappyIOVecReader9AvailableEv

I have tested this briefly and it works with snappy-tools built for
snappy 1.1.9 (bookworm), and src:snappy-tools builds against it.
Maybe a migration is unnecessary?

Best,

Back to linux.debian.bugs.rc | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Bug#1071363: snappy-tools: FTBFS: snappy.cpp:575:51: error: call of overloaded ‘Compress({anonymous}::fd_source*, {anonymous}::FILE_sink*)’ is ambiguous Santiago Vila <sanvila@debian.org> - 2024-05-17 22:50 +0200
  Processed (with 1 error): Re: Bug#1071363: snappy-tools: FTBFS:  snappy.cpp:575:51: error: call of overloaded ‘Compress({anonymous}::fd_source*,  {anonymous}::FILE_sink*)’ is ambiguous "Debian Bug Tracking System" <owner@bugs.debian.org> - 2024-05-18 00:30 +0200
  Bug#1071363: snappy-tools: FTBFS: snappy.cpp:575:51: error: call of overloaded ‘Compress({anonymous}::fd_source*, {anonymous}::FILE_sink*)’ is ambiguous наб <nabijaczleweli@nabijaczleweli.xyz> - 2024-05-18 00:30 +0200

csiph-web