Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 666548 - net-fs/samba-4.9.1 causes build failure in media-video/ffmpeg: ERROR: smbclient not found
Summary: net-fs/samba-4.9.1 causes build failure in media-video/ffmpeg: ERROR: smbclie...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords: PATCH, PullRequest
: 668016 668336 669738 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-09-19 11:13 UTC by Samuel Bernardo
Modified: 2018-11-16 07:46 UTC (History)
30 users (show)

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


Attachments
emerge build log (build.log,5.17 KB, text/x-log)
2018-09-19 11:13 UTC, Samuel Bernardo
Details
config.log (config.log,395.78 KB, text/plain)
2018-09-19 14:10 UTC, Ben Kohler
Details
4.9.2-r1 ebuild patch (4.9.2-r1.patch,1.15 KB, patch)
2018-11-15 21:07 UTC, Craig Andrews
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Bernardo 2018-09-19 11:13:25 UTC
Created attachment 547290 [details]
emerge build log

Compile phase fails with error:
ERROR: smbclient not found
Comment 1 Samuel Bernardo 2018-09-19 11:52:45 UTC
I found a reference for a similar error in the past (2015) that was solved with the upgrade of samba:
https://lists.slackbuilds.org/pipermail/slackbuilds-users/2015-June/014443.html

Reviewing ffmpeg "configure --help" I found that the cause of this samba dependency is because of --enable-libsmbclient option, that is activated by samba use flag.
Emerge ffmpeg with USE=-samba allows to install ffmpeg. This bug seems to be an upstream problem from ffmpeg source with samba expected version. I've installed samba-4.9.0.
Comment 2 Samuel Bernardo 2018-09-19 11:55:31 UTC
Completing my last comment, ffmpeg-3.3.8 compiled before with previous version of samba. With samba-4.9.0 the mentioned smbclient error appeared.
Comment 3 Ben Kohler gentoo-dev 2018-09-19 14:10:58 UTC
Created attachment 547300 [details]
config.log

FWIW this also affects 3.4.4 (latest unmasked ~amd64) as well as 4.0.2 (p.masked ~amd64)



x86_64-pc-linux-gnu-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -O2 -pipe -march=native -march=ivybridge -std=c11 -fomit-frame-pointer -fPIC -pthread -I/usr/include/opus -I/usr/include/opus -I/usr/include/samba-4.0 -c -o /var/tmp/portage/media-video/ffmpeg-3.4.4/temp/ffconf.Qk5voFJX/test.o /var/tmp/portage/media-video/ffmpeg-3.4.4/temp/ffconf.Qk5voFJX/test.c
In file included from /var/tmp/portage/media-video/ffmpeg-3.4.4/temp/ffconf.Qk5voFJX/test.c:1:
/usr/include/samba-4.0/libsmbclient.h:158:18: error: field 'btime_ts' has incomplete type
  struct timespec btime_ts;
                  ^~~~~~~~
/usr/include/samba-4.0/libsmbclient.h:162:18: error: field 'mtime_ts' has incomplete type
  struct timespec mtime_ts;
                  ^~~~~~~~
/usr/include/samba-4.0/libsmbclient.h:166:18: error: field 'atime_ts' has incomplete type
  struct timespec atime_ts;
                  ^~~~~~~~
/usr/include/samba-4.0/libsmbclient.h:170:18: error: field 'ctime_ts' has incomplete type
  struct timespec ctime_ts;
                  ^~~~~~~~
/usr/include/samba-4.0/libsmbclient.h:1107:38: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
                               struct timeval *tbuf);
                                      ^~~~~~~
/usr/include/samba-4.0/libsmbclient.h:1926:41: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
 int smbc_utimes(const char *url, struct timeval *tbuf);
                                         ^~~~~~~
Comment 4 sango 2018-09-20 05:25:24 UTC
Seems builds ok after header editing

--- /usr/include/samba-4.0/libsmbclient.h       2018-09-20 08:17:24.755000000 +0300
+++ /tmp/libsmbclient.h 2018-09-20 08:17:09.567000000 +0300
@@ -78,7 +78,7 @@
 #include <sys/statvfs.h>
 #include <stdint.h>
 #include <fcntl.h>
-#include <utime.h>
+#include <time.h>
 
 #define SMBC_BASE_FD        10000 /* smallest file descriptor returned */
Comment 5 Dennis Schridde 2018-09-25 06:10:19 UTC
(In reply to sango from comment #4)
> Seems builds ok after header editing
> 
> --- /usr/include/samba-4.0/libsmbclient.h       2018-09-20
> 08:17:24.755000000 +0300
> +++ /tmp/libsmbclient.h 2018-09-20 08:17:09.567000000 +0300
> @@ -78,7 +78,7 @@
>  #include <sys/statvfs.h>
>  #include <stdint.h>
>  #include <fcntl.h>
> -#include <utime.h>
> +#include <time.h>
>  
>  #define SMBC_BASE_FD        10000 /* smallest file descriptor returned */

Can this patch be added to net-fs/samba?
Comment 6 Dennis Schridde 2018-09-25 07:03:05 UTC
(In reply to sango from comment #4)
> Seems builds ok after header editing
> 
> --- /usr/include/samba-4.0/libsmbclient.h       2018-09-20
> 08:17:24.755000000 +0300
> +++ /tmp/libsmbclient.h 2018-09-20 08:17:09.567000000 +0300
> @@ -78,7 +78,7 @@
>  #include <sys/statvfs.h>
>  #include <stdint.h>
>  #include <fcntl.h>
> -#include <utime.h>
> +#include <time.h>
>  
>  #define SMBC_BASE_FD        10000 /* smallest file descriptor returned */

This patch breaks the build of net-fs/samba-4.9.0: Samba uses `struct utimbuf` internally.  This patch keeps both net-fs/samba-4.9.0 and media-video/ffmpeg-3.4.4 happy: https://github.com/devurandom/gentoo-patches/commit/6575c4dfdc1185b565f9f4c99f4b7d7ce87941d1
Comment 7 Samuel Bernardo 2018-09-26 10:12:49 UTC
I installed samba-4.9.1 and ffmpeg-3.3.8 error remains for smbclient.

After reviewing samba-4.9.1 and creating new patch with the correction suggested by Dennis Schridde it compiled ffmpeg.

I leave the url for ebuild I created with the patch included, available from my overlay:
https://github.com/samuelbernardo/ssnb-overlay/tree/master/net-fs/samba

Thanks for your help.
Comment 8 Jonas Stein gentoo-dev 2018-10-09 19:28:44 UTC
*** Bug 668016 has been marked as a duplicate of this bug. ***
Comment 9 Ben Kohler gentoo-dev 2018-10-11 17:40:42 UTC
*** Bug 668336 has been marked as a duplicate of this bug. ***
Comment 10 Markus Rathgeb 2018-10-16 08:32:25 UTC
I can confirm that adding the additional include to /usr/include/samba-4.0/libsmbclient.h allows the compilation of ffmpeg again.
Comment 11 Attila Tóth 2018-10-17 18:08:08 UTC
Works for me for the combination of net-fs/samba-4.9.1 and media-video/ffmpeg-3.4.4.
Comment 12 Martin Wegner 2018-10-19 08:41:00 UTC
(In reply to Samuel Bernardo from comment #7)
> [...]
> I leave the url for ebuild I created with the patch included, available from
> my overlay:
> https://github.com/samuelbernardo/ssnb-overlay/tree/master/net-fs/samba

To pinpoint this a bit further as diff: The only patch needed for net-fs/samba-4.9.1 to get it working with media-video/ffmpeg-3.4.4 is this one:

https://github.com/samuelbernardo/ssnb-overlay/blob/master/net-fs/samba/files/samba-4.9.1-fix_libsmbclient_h.patch

Adding it for epatch_user and recompiling samba made this issue go away for me.
Comment 13 Lee Trager 2018-10-27 02:57:29 UTC
(In reply to Martin Wegner from comment #12)
> (In reply to Samuel Bernardo from comment #7)
> > [...]
> > I leave the url for ebuild I created with the patch included, available from
> > my overlay:
> > https://github.com/samuelbernardo/ssnb-overlay/tree/master/net-fs/samba
> 
> To pinpoint this a bit further as diff: The only patch needed for
> net-fs/samba-4.9.1 to get it working with media-video/ffmpeg-3.4.4 is this
> one:
> 
> https://github.com/samuelbernardo/ssnb-overlay/blob/master/net-fs/samba/
> files/samba-4.9.1-fix_libsmbclient_h.patch
> 
> Adding it for epatch_user and recompiling samba made this issue go away for
> me.

This worked for me as well.
Comment 14 Nebojsa Trpkovic 2018-10-28 20:37:12 UTC
anyone carrying to fix this in the official tree?
Comment 15 Craig Andrews gentoo-dev 2018-11-12 03:31:37 UTC
*** Bug 669738 has been marked as a duplicate of this bug. ***
Comment 16 Craig Andrews gentoo-dev 2018-11-12 03:37:00 UTC
This issue is in media-video/samba so I've reassigned this issue accordingly.

There's a PR in samba upstream at: https://github.com/samba-team/samba/pull/212/
And a mailing list discussion at: https://lists.samba.org/archive/samba-technical/2018-October/130668.html
Comment 17 Craig Andrews gentoo-dev 2018-11-15 21:07:38 UTC
Created attachment 555286 [details, diff]
4.9.2-r1 ebuild patch

Here's the unified diff of the changes to the build and the addition of the patch. These are the same changes in the PR at https://github.com/gentoo/gentoo/pull/10396
Comment 18 Larry the Git Cow gentoo-dev 2018-11-16 07:46:38 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b72a744702238e2aedb7cad6f57ee95096a1fed

commit 3b72a744702238e2aedb7cad6f57ee95096a1fed
Author:     Craig Andrews <candrews@gentoo.org>
AuthorDate: 2018-11-12 03:32:28 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2018-11-16 07:46:31 +0000

    net-fs/samba: Fix compatibility issues with the timespec struct
    
    Closes: https://bugs.gentoo.org/666548
    Package-Manager: Portage-2.3.51, Repoman-2.3.12
    Signed-off-by: Craig Andrews <candrews@gentoo.org>
    Closes: https://github.com/gentoo/gentoo/pull/10396
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 net-fs/samba/files/samba-4.9.2-timespec.patch       | 21 +++++++++++++++++++++
 .../{samba-4.9.2.ebuild => samba-4.9.2-r1.ebuild}   |  1 +
 2 files changed, 22 insertions(+)