Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 729186 - net-misc/rsync-3.2.0-r1[zstd]: configure.sh: error: Failed to find ZSTD_minCLevel function in zstd lib.
Summary: net-misc/rsync-3.2.0-r1[zstd]: configure.sh: error: Failed to find ZSTD_minCL...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-22 15:20 UTC by Rolf Eike Beer
Modified: 2020-09-18 10:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build2.log,11.17 KB, text/plain)
2020-06-22 15:20 UTC, Rolf Eike Beer
Details
build.log (build.log,24.50 KB, text/plain)
2020-06-22 15:24 UTC, Rolf Eike Beer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Eike Beer archtester 2020-06-22 15:20:43 UTC
Created attachment 645744 [details]
build.log

All failed builds in this log have the same error:

USE='-acl -examples -iconv -ipv6 lz4 ssl -static -stunnel -system-zlib -xattr -xxhash -zstd' succeeded for =net-misc/rsync-3.2.0-r1
USE='-acl examples -iconv -ipv6 lz4 -ssl static -stunnel -system-zlib -xattr -xxhash zstd' failed for =net-misc/rsync-3.2.0-r1
    log has been saved as /root/tatt/logs/net-misc_rsync-3.2.0-r1_use_vZmMq
USE='-acl -examples iconv ipv6 lz4 -ssl static -stunnel system-zlib -xattr -xxhash zstd' failed for =net-misc/rsync-3.2.0-r1
    log has been saved as /root/tatt/logs/net-misc_rsync-3.2.0-r1_use_ARxyk
USE='-acl examples -iconv ipv6 -lz4 ssl -static stunnel system-zlib -xattr -xxhash zstd' succeeded for =net-misc/rsync-3.2.0-r1
USE='-acl examples iconv -ipv6 -lz4 -ssl static -stunnel -system-zlib xattr -xxhash zstd' failed for =net-misc/rsync-3.2.0-r1
    log has been saved as /root/tatt/logs/net-misc_rsync-3.2.0-r1_use_ptEwX
USE='acl examples -iconv -ipv6 -lz4 ssl -static -stunnel system-zlib xattr -xxhash zstd' succeeded for =net-misc/rsync-3.2.0-r1
USE='acl -examples iconv -ipv6 -lz4 ssl -static -stunnel system-zlib xattr -xxhash zstd' succeeded for =net-misc/rsync-3.2.0-r1
USE='-acl examples -iconv ipv6 lz4 ssl -static stunnel -system-zlib -xattr xxhash zstd' succeeded for =net-misc/rsync-3.2.0-r1
USE='acl examples -iconv -ipv6 lz4 -ssl -static -stunnel -system-zlib xattr xxhash zstd' succeeded for =net-misc/rsync-3.2.0-r1
USE='acl -examples -iconv -ipv6 -lz4 ssl -static stunnel system-zlib xattr xxhash zstd' succeeded for =net-misc/rsync-3.2.0-r1
Comment 1 Rolf Eike Beer archtester 2020-06-22 15:24:07 UTC
Created attachment 645746 [details]
build.log

There is a distinct, but probably related build error here:

token.c: In function ‘send_zstd_token’:
token.c:685:2: error: unknown type name ‘ZSTD_EndDirective’
  685 |  ZSTD_EndDirective flush = ZSTD_e_continue;
      |  ^~~~~~~~~~~~~~~~~
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-06-26 08:22:37 UTC
Does this really happen with USE="-zstd" as well?
Comment 3 Rolf Eike Beer archtester 2020-06-26 09:27:53 UTC
No, USE=-zstd builds were fine.
Comment 4 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-06-26 09:53:05 UTC
So to summarize this, we have two maybe unrelated issues with USE="zstd":


* On hppa, configure already fails with:

  checking whether to enable zstd compression... yes
  checking for library containing ZSTD_minCLevel... no
  configure.sh: error: Failed to find ZSTD_minCLevel function in zstd lib.
  Use --disable-zstd to continue without zstd compression.


* On sparc, configure succeeds but build later fails with:

  token.c: In function ‘send_zstd_token’:
  token.c:685:2: error: unknown type name ‘ZSTD_EndDirective’

and some more error messages (too many to post them here all. See second build.log attachment for more).


We should now figure out if these issues come from something being wrong in the app-arch/zstd package or in the net-misc/rsync package.
Comment 5 Rolf Eike Beer archtester 2020-06-26 10:28:20 UTC
Correct. Here is the state on sparc:

 * Found these USE flags for app-arch/zstd-1.4.4-r4:
 U I
 - - lz4         : Enable support for lz4 compression (as implemented in app-arch/lz4)
 - - static-libs : Build static versions of dynamic libraries as well
 + + threads     : Add threads support for various packages. Usually pthreads

And this is hppa:

 * Found these USE flags for app-arch/zstd-1.4.4-r4:
 U I
 - + lz4         : Enable support for lz4 compression (as implemented in app-arch/lz4)
 - + static-libs : Build static versions of dynamic libraries as well
 + + threads     : Add threads support for various packages. Usually pthreads

Then I went and used USE="lz4 static-libs" on sparc also, and:

checking for library containing ZSTD_minCLevel... no
configure.sh: error: Failed to find ZSTD_minCLevel function in zstd lib.
Use --disable-zstd to continue without zstd compression.

And config.log shows what's going wrong:

configure.sh:6322: sparc-unknown-linux-gnu-gcc -o conftest -O2 -mcpu=niagara2 -pipe -Wcast-align -DHAVE_CONFIG_H -Wall -W  -Wl,-O1 -Wl,--as-needed -static conftest.c -lzstd   >&5
/usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../sparc-unknown-linux-gnu/bin/ld: /usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../lib/libzstd.a(zstdmt_compress.o): in function `ZSTDMT_freeJobsTable':
(.text+0x12c): undefined reference to `pthread_mutex_destroy'
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2020-06-26 12:14:30 UTC
I think our current stable zstd[threads] is completely broken due to bug #713940 (shared library is underlinked against -lpthread).
Comment 7 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-06-26 13:04:09 UTC
Rolf, can you try with latest unstable app-arch/zstd and report back your results?
Comment 8 Rolf Eike Beer archtester 2020-06-26 18:18:48 UTC
The underlinking is still the same with 1.4.5.
Comment 9 Sergei Trofimovich (RETIRED) gentoo-dev 2020-06-26 21:52:22 UTC
(In reply to Rolf Eike Beer from comment #5)
> Correct. Here is the state on sparc:
> 
>  * Found these USE flags for app-arch/zstd-1.4.4-r4:
>  U I
>  - - lz4         : Enable support for lz4 compression (as implemented in
> app-arch/lz4)
>  - - static-libs : Build static versions of dynamic libraries as well
>  + + threads     : Add threads support for various packages. Usually pthreads
> 
> And this is hppa:
> 
>  * Found these USE flags for app-arch/zstd-1.4.4-r4:
>  U I
>  - + lz4         : Enable support for lz4 compression (as implemented in
> app-arch/lz4)
>  - + static-libs : Build static versions of dynamic libraries as well
>  + + threads     : Add threads support for various packages. Usually pthreads
> 
> Then I went and used USE="lz4 static-libs" on sparc also, and:
> 
> checking for library containing ZSTD_minCLevel... no
> configure.sh: error: Failed to find ZSTD_minCLevel function in zstd lib.
> Use --disable-zstd to continue without zstd compression.
> 
> And config.log shows what's going wrong:
> 
> configure.sh:6322: sparc-unknown-linux-gnu-gcc -o conftest -O2
> -mcpu=niagara2 -pipe -Wcast-align -DHAVE_CONFIG_H -Wall -W  -Wl,-O1
> -Wl,--as-needed -static conftest.c -lzstd   >&5
> /usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../sparc-unknown-linux-
> gnu/bin/ld:
> /usr/lib/gcc/sparc-unknown-linux-gnu/9.3.0/../../../../lib/libzstd.
> a(zstdmt_compress.o): in function `ZSTDMT_freeJobsTable':
> (.text+0x12c): undefined reference to `pthread_mutex_destroy'

That is with USE=static for rsync, right? I noticed /usr/lib64/pkgconfig/libzstd.pc also does not refer -pthread in any form in private libs (zstd bug). If rsync uses pkg-config that will explain link failures as well.
Comment 10 Francesco Riosa 2020-07-07 20:32:57 UTC
just a note that this is present in app-arch/zstd-1.4.5 on amd64 if these *FLAGS are used:
CFLAGS="-Os -pipe -march=ivybridge -mtune=skylake -frecord-gcc-switches -fdiagnostics-color=never -ffunction-sections -fdata-sections -flto"
CXXFLAGS="-Os -pipe -march=ivybridge -mtune=skylake -frecord-gcc-switches -fdiagnostics-color=never -ffunction-sections -fdata-sections -flto"
FCFLAGS="-Os -pipe -march=ivybridge -mtune=skylake"
FFLAGS="-Os -pipe -march=ivybridge -mtune=skylake"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -flto"
Comment 11 INODE64 Sistemas 2020-09-17 07:19:47 UTC
It fails with rsync 3.2.3 and zstd 1.3.xx

You see the doc INSTALL.md, rsync 3.2.x need at least version 1.4

-----------------------
## zstd                                                                                                                                                                                                            
                                                                                                                                                                                                                   
The [zstd library][2] compression algorithm that uses less CPU than                                                                                                                                                
the default zlib algorithm at the same compression level.  Note that you                                                                                                                                           
need at least version 1.4, so you might need to skip the zstd compression if                                                                                                                                       
you can only install a 1.3 release.  Installing this development library                                                                                                                                           
adds zstd compression as the default compression algorithm.                                                                                                                                                        
                                                                                                                                                                                                                   
[2]: http://facebook.github.io/zstd/                                                                                                                                                                               

-----------------------

path to solving the problem

-----------------------
--- rsync-3.2.3.ebuild.old      2020-09-07 11:09:38.000000000 +0200
+++ rsync-3.2.3.ebuild  2020-09-17 09:06:40.493533175 +0200
@@ -37,7 +37,7 @@
        system-zlib? ( sys-libs/zlib[static-libs(+)] )
        xattr? ( kernel_linux? ( sys-apps/attr[static-libs(+)] ) )
        xxhash? ( dev-libs/xxhash[static-libs(+)] )
-       zstd? ( app-arch/zstd[static-libs(+)] )
+       zstd? ( >=app-arch/zstd-1.4[static-libs(+)] )
        >=dev-libs/popt-1.5[static-libs(+)]"
 RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
        iconv? ( virtual/libiconv )"
-----------------------
Comment 12 Larry the Git Cow gentoo-dev 2020-09-18 10:39:40 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e754603cf2eb976b3d1c0975db1d79904df43b8

commit 6e754603cf2eb976b3d1c0975db1d79904df43b8
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2020-09-18 10:39:23 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2020-09-18 10:39:36 +0000

    net-misc/rsync: Adjusted dependency on app-arch/zstd
    
    Bug: https://bugs.gentoo.org/729186
    Package-Manager: Portage-3.0.7, Repoman-3.0.1
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 net-misc/rsync/rsync-3.2.3.ebuild | 2 +-
 net-misc/rsync/rsync-9999.ebuild  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)