Bug 79478 - libva requires wayland-scanner even with --disable-wayland
Summary: libva requires wayland-scanner even with --disable-wayland
Status: RESOLVED FIXED
Alias: None
Product: libva
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: ykzhao
QA Contact: Sean V Kelley
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-31 09:15 UTC by Heinz Wiesinger
Modified: 2015-12-04 02:30 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Bug fix. (777 bytes, patch)
2015-04-17 03:52 UTC, Cecil Curry
Details | Splinter Review
Patch for libva-1.5.1 (768 bytes, patch)
2015-06-24 19:49 UTC, Pacho Ramos
Details | Splinter Review
Patch for libva-intel-driver-1.5.1 (812 bytes, patch)
2015-06-24 19:49 UTC, Pacho Ramos
Details | Splinter Review
Properly working patch (1.23 KB, patch)
2015-07-24 15:08 UTC, Michał Górny
Details | Splinter Review
that little patch that could … build libva-1.6.0 without wayland (914 bytes, patch)
2015-08-18 22:54 UTC, Thomas Orgis
Details | Splinter Review
skip the check related with wayland if wayland is not used or found (2.28 KB, patch)
2015-11-30 01:07 UTC, ykzhao
Details | Splinter Review

Description Heinz Wiesinger 2014-05-31 09:15:09 UTC
When configuring libva 1.3.1 with "--disable-wayland", it still checks for wayland-scanner and fails if it is not present.
Comment 1 ykzhao 2014-07-22 02:29:26 UTC
There is no option of "disable-wayland".

In fact you can use the option of "--enable-wayland=0" to disable the support of wayland.

Will you please check it and see whether it work for you?

Thanks.
Comment 2 Heinz Wiesinger 2014-07-26 10:55:14 UTC
I tried "--enable-wayland=0" as well as "--enable-wayland=no". Both fail with 

-------------------
checking for WAYLAND_SCANNER... no
configure: error: Package requirements (wayland-scanner) were not met:

No package 'wayland-scanner' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables WAYLAND_SCANNER_CFLAGS
and WAYLAND_SCANNER_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
-------------------
Comment 3 Heinz Wiesinger 2014-07-26 14:20:54 UTC
FWIW, libva-intel-driver has exactly the same issue
Comment 4 ykzhao 2014-07-28 00:47:40 UTC
Hi, Heinz
    Will you please double check it again? 
    After the option of "enable-wayland=0" is added, it will bypass the check related with wayland. 

Thanks
    Yakui
Comment 5 Heinz Wiesinger 2014-07-28 08:44:55 UTC
It does, that's working fine, also by default without passing any parameters. The problem is that the check for wayland-scanner is later, outside of the other wayland checks block and not surrounded by any kind of "if wayland" conditions.
Comment 6 higuita 2014-10-11 17:56:49 UTC
This problem still exists and blocks the build.

The only workaround is to install the package, or at least fake it (in /usr/lib/pkconfig/wayland-scanner.pc):

$ cat /usr/lib64/pkgconfig/wayland-scanner.pc  
prefix=/usr
libdir=${prefix}/lib
includedir=${prefix}/include

Name: wayland-scanner
Description: fake wayland-scanner
Version: 1.6.0
Requires:
Conflicts:
Libs: 
Cflags:
Comment 7 Cecil Curry 2015-04-17 03:52:08 UTC
Created attachment 115144 [details] [review]
Bug fix.

Patch "configure.ac" to perform "wayland-scanner" logic only if also performing Wayland logic.
Comment 8 Cecil Curry 2015-04-17 03:55:33 UTC
Heinz nailed it: "The problem is that the check for wayland-scanner is later, outside of the other wayland checks block and not surrounded by any kind of "if wayland" conditions." Thanks, Heinz!

The attached patch fixes this is in the obvious way. This issue is severe enough to warrant a version bump to 1.3.2, as evidenced by this Gentoo thread: https://bugs.gentoo.org/show_bug.cgi?id=529388
Comment 9 Pacho Ramos 2015-06-24 19:49:33 UTC
Created attachment 116697 [details] [review]
Patch for libva-1.5.1
Comment 10 Pacho Ramos 2015-06-24 19:49:55 UTC
Created attachment 116698 [details] [review]
Patch for libva-intel-driver-1.5.1
Comment 11 Timo Gurr 2015-07-17 10:40:19 UTC
Still an issue for libva-1.6.0:
https://galileo.mailstation.de/jenkins/job/x11/1044/console
The fix mentioned in the previous comments worked for me as well, would be nice if this could be applied upstream.
Comment 12 Michał Górny 2015-07-24 14:35:32 UTC
I've obsoleted all the patches submitted so far because they were causing issues either with wayland enabled or disabled. I'm going to write a new patch that works on all systems with wayland enabled and disabled, installed and non-installed :).
Comment 13 Michał Górny 2015-07-24 15:08:57 UTC
Created attachment 117345 [details] [review]
Properly working patch

Here's a patch that really works for me. Two major changes from the previous patches;

1. I used $USE_WAYLAND rather than $enable_wayland, which means the patches addresses both the cases when wayland is explicitly disabled and implicitly via configure check,

2. I used AC_SUBST_FILE as that's what the wayland macros do. Mixing AC_SUBST and AC_SUBST_FILE is only going to result in broken output in one of the cases.

For AC_SUBST_FILE in wayland-disabled branch, I used /dev/null. I think it should work fine throughout all systems supporting the intel driver. If it does not, I can rewrite the patch to create a temporary empty file to insert.
Comment 14 Vittorio 2015-07-30 17:29:52 UTC
Hello,

I am working on trying to build libva (any version) on Gentoo.

Unfortunately, the latest patches by Michal Gorny do not work over the latest sources. Maybe I am applying them incorrectly, however Michal did not specify what version they should be applied to. They appear to not be compatible with 1.5.1 or 1.6.0.

I went back and used Pacho patches, and they appear to work correctly on 1.5.1. They however do not fix the issue in 1.6.0, as libva does not pass the ./configure step even with arguments such as --disable-wayland or --enable-wayland=0 on 1.6.0

I would say that Michal should fix his patch, or Pacho should update his to work on the latest libva sources.

Anyway here are my test results, I hope they help:
myPC tmp # tar xf libva-1.5.1.tar.bz2
myPC tmp # tar xf libva-1.6.0.tar.bz2
myPC tmp # cp 0001-Do-not-require-wayland-scanner-if-wayland-is-disable.patch libva-1.5.1/
myPC tmp # cp 0001-Do-not-require-wayland-scanner-if-wayland-is-disable.patch libva-1.6.0/
myPC tmp # cp libva-1.5.1-wayland-automagic.patch libva-1.5.1/
myPC tmp # cp libva-1.5.1-wayland-automagic.patch libva-1.6.0/

## Michal patch over 1.5.1 - PATCH FAILS
myPC tmp # cd libva-1.5.1
myPC libva-1.5.1 # patch --dry-run -p1 < 0001-Do-not-require-wayland-scanner-if-wayland-is-disable.patch
patching file configure.ac
Hunk #1 FAILED at 168.
1 out of 1 hunk FAILED -- saving rejects to file configure.ac.rej

## Pacho patch over 1.5.1 - PATCHES AND BUILDS
myPC libva-1.5.1 # patch --dry-run -p1 < libva-1.5.1-wayland-automagic.patch
patching file configure.ac
myPC libva-1.5.1 # cd ..

## Michal patch over 1.6.0 - PATCH FAILS
myPC tmp # cd libva-1.6.0
myPC libva-1.6.0 # patch --dry-run -p1 < 0001-Do-not-require-wayland-scanner-if-wayland-is-disable.patch
patching file configure.ac
Hunk #1 FAILED at 168.
1 out of 1 hunk FAILED -- saving rejects to file configure.ac.rej

## Pacho patch over 1.6.0 - PATCHES, BUT WAYLAND MISSING ERROR IS STILL PRESENT UPON EXECUTION OF ./configure
myPC libva-1.6.0 # patch --dry-run -p1 < libva-1.5.1-wayland-automagic.patch
patching file configure.ac


Thanks,
Vittorio
Comment 15 Thomas Orgis 2015-08-18 22:54:47 UTC
Created attachment 117777 [details] [review]
that little patch that could … build libva-1.6.0 without wayland

Are we serious about not being able to fix that ridiculous build system
issue for over a year now? Sometimes I need to dig deep, very deep, to
find my faith in humanity.

Here is my current iteration of a build fix for libva-1.6.0 without wayland.
Feel free to yell and insult me if I managed to screw it up. I tested it only
without wayland. If I am lucky and it actually does the right thing also with
wayland, please consider shipping that change upstream.
Comment 16 ykzhao 2015-11-26 04:25:46 UTC
Hi, Thomas

     Will you please help to send your patch to libva@lists.freedesktop.org and then we can help to push it?

Thanks.
Comment 17 Thomas Orgis 2015-11-27 00:09:51 UTC
Hi ykzhao,

do you mean that posting the patch to this bug report is not the right
thing to make it noticed and I should subscribe and push the patch to
the libva mailing list?
Comment 18 ykzhao 2015-11-27 00:20:42 UTC
right. It will be better that you can subscribe it and then send the patch to libva mailing list. (libva@lists.freedesktop.org)

Thanks
    Yakui
Comment 19 Thomas Orgis 2015-11-27 08:39:50 UTC
> right. It will be better that you can subscribe it and then send the patch to
> libva mailing list. (libva@lists.freedesktop.org)

Strange. So I guess we should ignore the bug tracker, then. But more
importantly: I just tested libva-1.6.1 and the configure does not fail
without wayland. I do not see any real difference in the configure.ac.

What I see: When I regenerate configure using `autoreconf -iv` in the
libva-1.6.0 directory without the patch, it works, too?!

Can you confirm that? So, perhaps it's only an autotools problem on the
system of whoever does the packaging?
Comment 20 Thomas Orgis 2015-11-27 13:12:43 UTC
> Can you confirm that? So, perhaps it's only an autotools problem on the
> system of whoever does the packaging?  

Ah, I guess it means that the system packaging 1.6.1 didn't have
Wayland, as opposed to the one packaging 1.6.0. I presume the

m4_ifdef([WAYLAND_SCANNER_RULES], ...)

won't result in configure script output if you don't have that macro
around.
Comment 21 ykzhao 2015-11-30 01:06:33 UTC
I think that we can skip some checks related with wayland if the wayland is not used or found.
    >skip the wayland_scan_rules check
    >doesn't output the Makefile related with wayland

I will post one updated patch.

Thanks
   Yakui
Comment 22 ykzhao 2015-11-30 01:07:46 UTC
Created attachment 120201 [details] [review]
skip the check related with wayland if wayland is not used or found
Comment 23 ykzhao 2015-12-04 02:30:59 UTC
Now the patch is already pushed to the corresponding libva repo.

So this bug will be marked as resolved and closed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.