Delivered-To: [email protected]
Received: by 2002:a05:6a20:394d:b0:15d:8365:d4b8 with SMTP id r13csp566012pzg;
        Fri, 29 Sep 2023 06:55:01 -0700 (PDT)
X-Google-Smtp-Source: 
 AGHT+IEjIqW/0ZI1pZCLiYXJp3fC5tcCj2CjvF8uOyRyR79By07pAwOhSUvHtEyRXtgGdUYe1ePk
X-Received: by 2002:a05:6402:14cb:b0:533:c55f:582a with SMTP id
 f11-20020a05640214cb00b00533c55f582amr3689992edx.27.1695995701593;
        Fri, 29 Sep 2023 06:55:01 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1695995701; cv=none;
        d=google.com; s=arc-20160816;
        b=L5tQbraZEuzofPt2zL9w2Ps4DACszJ36F32urDF1D77Yc7pljJoyhXmKQDHIx4UdOY
         RsmuvK5puNVtPhsCemJL+3Wua7Y89CRJy1e4xLZRTlLKyYRMpjYA/LRyxoHSL6tfBWrq
         SpVh3xE/3q902Oy1A0XykYo9KeOpjvv3QibjogafZLIOXO23mM9bM2nAiaxSQiYucdi0
         shdFVTlDRq6eGD1PDfM/P9Vhg3UbuD0O4NcUj5BY0l9VnKYkXEngFYk8JJxJZsGtkiZg
         FuHBKcQF3wIlRgUhjJfPiq1QAdY+p4IlSQ0wIPrbct7MvkWZVSPPKF0B0toyZVON5UEc
         XcRQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
 s=arc-20160816;
        h=sender:errors-to:content-transfer-encoding:cc:reply-to
         :list-subscribe:list-help:list-post:list-archive:list-unsubscribe
         :list-id:precedence:subject:mime-version:message-id:date:to:from
         :delivered-to;
        bh=5o+RZl/IRFrhV5X8DcofNrAicbdyCK6cAa4tGL3lX5Y=;
        fh=57n7dni/uTQepP1ITyrU+KebMFlKum1fMHsI5jg0NsE=;
        b=ClEqH/5ntKyVZbZaZ+/ue+sVJe4s8UUgEru8PLz5cZ82pgSG7rSJgoWwGYi1NYi179
         mkdsO3ke+j9Xpj3IE0Tk7JI0teDKU9htqNuRD+WZItRq6D2IRA/o74BdA5PPmu3Bh5Mp
         qeFOXIMxox5ri3LEKhOlufm/4c4ctV9QoUChjKq/DYNCKeiQedQ1yaGwBAqEJHhlGRBo
         XsvCyieZskLQzEOFnVtmJO5I1rJ8Ie3G2s58dVvAFrLTVxjmLX7ZktWoMBVEt6wX9n/9
         a0phnAonID6uVXCDGbjKn7jp7a9lgu//N8kFWxzG2FzRm/f/8TEdb9NLq+fXx0sHQale
         RYzQ==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of [email protected]
 designates 79.124.17.100 as permitted sender)
 [email protected]
Return-Path: <[email protected]>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100])
        by mx.google.com with ESMTP id
 r9-20020aa7d149000000b00534517a2c65si6682068edo.524.2023.09.29.06.54.59;
        Fri, 29 Sep 2023 06:55:01 -0700 (PDT)
Received-SPF: pass (google.com: domain of [email protected]
 designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100;
Authentication-Results: mx.google.com;
       spf=pass (google.com: domain of [email protected]
 designates 79.124.17.100 as permitted sender)
 [email protected]
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CA72668CC10;
	Fri, 29 Sep 2023 16:54:57 +0300 (EEST)
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com
 [209.85.219.50])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AD6E168CA80
 for <[email protected]>; Fri, 29 Sep 2023 16:54:50 +0300 (EEST)
Received: by mail-qv1-f50.google.com with SMTP id
 6a1803df08f44-65b10205207so2873746d6.0
 for <[email protected]>; Fri, 29 Sep 2023 06:54:50 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1695995688; x=1696600488;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=8yClTKCT6bfxrjP/P03T/pH4iVyjxEcsjbxiCFHph+g=;
 b=YBJe8uL45kUmSb4RVC5GkwuBkKhvAGvlvh7YgwYFEINVthJLW58JeuxftZHJXd2eZR
 fi9R26dj8/OsRtjIHmnuzh/gJQ2CYsF2vWkzREAf2AgUlJ+qXJZVeKzRJrB/1xjvMcU5
 HiNbuvEb9foE22oGknxPvtfzMRjj8ke+LZN0/TBU7phxsRpkEiwpqGS18y9+Wv5dte34
 4WSe/hf3knrel+4CScrvHnlPFYF39/7GV8Ish7EeyMb0MyCh4wEEcqAECwinkB0sxxXv
 6hbVcsGh+RezBCBLZWXM12qLgB2HswW9lyVHYVPStppVk/QmKr44DO0Kqb9q5l6fRswV
 kuZQ==
X-Gm-Message-State: AOJu0Yzwzgv28Je0gde7iuva9fkXU55gAjZHGO0y48kesaUoLwC6XjkJ
 uWRGRAHbr98Ic/L3Lb2vsNeBOl37tTKt/g==
X-Received: by 2002:a05:6214:21ad:b0:65b:c89:f44c with SMTP id
 t13-20020a05621421ad00b0065b0c89f44cmr4257534qvc.7.1695995688451;
 Fri, 29 Sep 2023 06:54:48 -0700 (PDT)
Received: from bellini.. ([107.159.3.182]) by smtp.gmail.com with ESMTPSA id
 qj19-20020a056214321300b0063d038df3f3sm5844036qvb.52.2023.09.29.06.54.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 29 Sep 2023 06:54:48 -0700 (PDT)
From: Tristan Matthews <[email protected]>
To: [email protected]
Date: Fri, 29 Sep 2023 09:52:54 -0400
Message-Id: <[email protected]>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Subject: [FFmpeg-devel] [PATCH] configure: disable vulkan if min version
 insufficient
X-BeenThere: [email protected]
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:[email protected]?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:[email protected]>
List-Help: <mailto:[email protected]?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:[email protected]?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <[email protected]>
Cc: Tristan Matthews <[email protected]>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: [email protected]
Sender: "ffmpeg-devel" <[email protected]>
X-TUID: srEHFMZ4PawJ
On 29.09.2023 15:52, Tristan Matthews wrote: > Fixes: https://trac.ffmpeg.org/ticket/10596 > configure | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > diff --git a/configure b/configure > index 20db1801ed..50ba6f772f 100755 > --- a/configure > +++ b/configure > @@ -7154,7 +7154,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if. > if enabled vulkan; then > check_pkg_config_header_only vulkan "vulkan >= 1.3.255" "vulkan/vulkan.h" "defined VK_VERSION_1_3" || > - check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" > + check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" || > + warn "Disabling vulkan" && disable vulkan Doesn't that just always disable vulkan if any of the previous checks succeed? The logic looks weird to me. Also, shouldn't all of those check_* calls disable vulkan already? That's what the first argument is for. On Fri, Sep 29, 2023 at 1:37 PM Timo Rothenpieler <[email protected]> wrote: > On 29.09.2023 15:52, Tristan Matthews wrote: > > Fixes: https://trac.ffmpeg.org/ticket/10596 > > configure | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/configure b/configure > > index 20db1801ed..50ba6f772f 100755 > > --- a/configure > > +++ b/configure > > @@ -7154,7 +7154,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if. > > if enabled vulkan; then > > check_pkg_config_header_only vulkan "vulkan >= 1.3.255" "vulkan/vulkan.h" "defined VK_VERSION_1_3" || > > - check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" > > + check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" || > > + warn "Disabling vulkan" && disable vulkan > Doesn't that just always disable vulkan if any of the previous checks > succeed? The logic looks weird to me. No, it will only disable vulkan if all the previous checks fail as this conditional shortcircuits (so to get to here it would have to be false || false || false || false || false || warn "Disable vulkan" && disable vulkan). If I hack the version number to match mine (changing it to 1.3.239), vulkan won't be disabled (that's why I added the warning message) and you'll hit the build breakage I and others are hitting currently. > Also, shouldn't all of those check_* calls disable vulkan already? > That's what the first argument is for. They don't, so my first thought was that since this is the only place where check_pkg_config_header_only is called, it seemed likely that there was a bug in that function. However, I couldn't spot anything obviously broken in it and it is returning the correct value (hence this patch behaving as expected). Best, Tristan > _______________________________________________ > ffmpeg-devel mailing list > [email protected] > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > To unsubscribe, visit link above, or email > [email protected] with subject "unsubscribe". On Fri, Sep 29, 2023 at 3:55 PM Tristan Matthews <[email protected]> wrote: > Fixes: https://trac.ffmpeg.org/ticket/10596 > configure | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > diff --git a/configure b/configure > index 20db1801ed..50ba6f772f 100755 > --- a/configure > +++ b/configure > @@ -7154,7 +7154,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if. > if enabled vulkan; then > check_pkg_config_header_only vulkan "vulkan >= 1.3.255" "vulkan/vulkan.h" "defined VK_VERSION_1_3" || > - check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" > + check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" || > + warn "Disabling vulkan" && disable vulkan This change doesn't seem right. If a feature is explicitly requested, we generally fail the build and don't just disable the feature (afterall the user wanted it to be on). If the feature is not explicitly requested, then it should not print a message. - Hendrik On Fri, Sep 29, 2023 at 2:32 PM Hendrik Leppkes <[email protected]> wrote: > On Fri, Sep 29, 2023 at 3:55 PM Tristan Matthews <[email protected]> wrote: > > Fixes: https://trac.ffmpeg.org/ticket/10596 > > configure | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/configure b/configure > > index 20db1801ed..50ba6f772f 100755 > > --- a/configure > > +++ b/configure > > @@ -7154,7 +7154,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if. > > if enabled vulkan; then > > check_pkg_config_header_only vulkan "vulkan >= 1.3.255" "vulkan/vulkan.h" "defined VK_VERSION_1_3" || > > - check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" > > + check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" || > > + warn "Disabling vulkan" && disable vulkan > This change doesn't seem right. If a feature is explicitly requested, > we generally fail the build and don't just disable the feature > (afterall the user wanted it to be on). That is the case here, with or without this patch, on my system --enable-vulkan will fail as expected on: > ERROR: vulkan requested but not found The bug I'm trying to address is the autodetect case. I'm happy to drop the warning, I just wanted it to be obvious what was happening (but one could infer it from the list of modules that will be built). > If the feature is not > explicitly requested, then it should not print a message. On 29.09.2023 20:10, Tristan Matthews wrote: > On Fri, Sep 29, 2023 at 1:37 PM Timo Rothenpieler <[email protected]> wrote: >> On 29.09.2023 15:52, Tristan Matthews wrote: >>> Fixes: https://trac.ffmpeg.org/ticket/10596 >>> configure | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> diff --git a/configure b/configure >>> index 20db1801ed..50ba6f772f 100755 >>> --- a/configure >>> +++ b/configure >>> @@ -7154,7 +7154,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if. >>> if enabled vulkan; then >>> check_pkg_config_header_only vulkan "vulkan >= 1.3.255" "vulkan/vulkan.h" "defined VK_VERSION_1_3" || >>> - check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" >>> + check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" || >>> + warn "Disabling vulkan" && disable vulkan >> Doesn't that just always disable vulkan if any of the previous checks >> succeed? The logic looks weird to me. > No, it will only disable vulkan if all the previous checks fail as > this conditional shortcircuits (so to get to here it would have to be > false || false || false || false || false || warn "Disable vulkan" && > disable vulkan). If I hack the version number to match mine (changing > it to 1.3.239), vulkan won't be disabled (that's why I added the > warning message) and you'll hit the build breakage I and others are > hitting currently. My shell disagrees: $ function warn() { echo $1; } $ true || false || warn "Disabling vulkan" && echo DISABLED DISABLED $ false || true || warn "Disabling vulkan" && echo DISABLED DISABLED $ false || false || warn "Disabling vulkan" && echo DISABLED Disabling vulkan DISABLED $ true || true || warn "Disabling vulkan" && echo DISABLED DISABLED No matter the results of the checks, this will always disable Vulkan, since the chain before it will always have a positive outcome, so && continues. On Fri, Sep 29, 2023 at 3:26 PM Timo Rothenpieler <[email protected]> wrote: > On 29.09.2023 20:10, Tristan Matthews wrote: > > On Fri, Sep 29, 2023 at 1:37 PM Timo Rothenpieler <[email protected]> wrote: > >> On 29.09.2023 15:52, Tristan Matthews wrote: > >>> Fixes: https://trac.ffmpeg.org/ticket/10596 > >>> configure | 3 ++- > >>> 1 file changed, 2 insertions(+), 1 deletion(-) > >>> diff --git a/configure b/configure > >>> index 20db1801ed..50ba6f772f 100755 > >>> --- a/configure > >>> +++ b/configure > >>> @@ -7154,7 +7154,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if. > >>> if enabled vulkan; then > >>> check_pkg_config_header_only vulkan "vulkan >= 1.3.255" "vulkan/vulkan.h" "defined VK_VERSION_1_3" || > >>> - check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" > >>> + check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" || > >>> + warn "Disabling vulkan" && disable vulkan > >> Doesn't that just always disable vulkan if any of the previous checks > >> succeed? The logic looks weird to me. > > No, it will only disable vulkan if all the previous checks fail as > > this conditional shortcircuits (so to get to here it would have to be > > false || false || false || false || false || warn "Disable vulkan" && > > disable vulkan). If I hack the version number to match mine (changing > > it to 1.3.239), vulkan won't be disabled (that's why I added the > > warning message) and you'll hit the build breakage I and others are > > hitting currently. > My shell disagrees: > $ function warn() { echo $1; } > $ true || false || warn "Disabling vulkan" && echo DISABLED > DISABLED > $ false || true || warn "Disabling vulkan" && echo DISABLED > DISABLED > $ false || false || warn "Disabling vulkan" && echo DISABLED > Disabling vulkan > DISABLED > $ true || true || warn "Disabling vulkan" && echo DISABLED > DISABLED > No matter the results of the checks, this will always disable Vulkan, > since the chain before it will always have a positive outcome, so && > continues. Oh I see, I should have parens around the last bit, e.g.: false || true || (warn "Disabling vulkan" && echo DISABLED) but as Hendrik mentioned, the warning can be dropped in which case this would become: check_pkg_config_header_only vulkan ... || check_cpp_condition || disable vulkan As mentioned earlier in the thread if someone has a better idea of how to avoid explicitly calling disable vulkan like this (i.e. why isn't this already working) that would of course be preferable. Best, --- a/configure +++ b/configure @@ -7154,7 +7154,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if. if enabled vulkan; then check_pkg_config_header_only vulkan "vulkan >= 1.3.255" "vulkan/vulkan.h" "defined VK_VERSION_1_3" || - check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" + check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" || + warn "Disabling vulkan" && disable vulkan if enabled x86; then