Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pbok0-0006kY-Kj for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Mar 2023 20:25:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pbojz-0000OF-Ho for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Mar 2023 20:25:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pbojz-0000LC-3w for pgsql-hackers@lists.postgresql.org; Mon, 13 Mar 2023 20:25:55 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pboju-0003BJ-86 for pgsql-hackers@postgresql.org; Mon, 13 Mar 2023 20:25:54 +0000 Received: by mail-pl1-x62e.google.com with SMTP id i5so14329325pla.2 for ; Mon, 13 Mar 2023 13:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678739148; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=zPt2Iwh4+biIm2eF2olXSX9Tdn7/ZaNpFjdIZErOn3Q=; b=ZWs1k79laDv+TtsSNaz0UpZgMAOvX/8Ap3/0j1IrSEtbexoAwlKepfB7bBG51XiHcp qv8f2w7Fz98k2OUNq9Ezlx9cGNMcgtba2JxabODjf/9TpCGqBTqztgMK+qAXaTovFJXI rHr3L5os6dxUiB/PrD38lqfXGvJw7nmdrHdGgbCUmzpYj0t3X9dqbSNSZc3FNN0z+j4y E0qWZRmXK8HtJthIKm4tSCYk4+1Z83b6oSUwageIS0DTQp9voSfv07ttCIBJe6317bD4 Z4sf2hXrLd50SHjj/k7ahYRKHv4PlfEFHo2+4+B7XwtOjaIbfE01Eizqqeckds6cRFvA 1mvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678739148; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zPt2Iwh4+biIm2eF2olXSX9Tdn7/ZaNpFjdIZErOn3Q=; b=kQr8VxfDqJwILtHBRj/ZI3+hy3VIYMOwc51139oy1GvUO0FVgd5fmWmrc0Bg4DSci/ wu9BWBFNqchOfQ6RUjl2FhTGvu8fxr8BoMsTlkdn2hyGc1msmuhwsrXY3dzx27KuVw9e VBnwflknsLYWQgS+5r4zg9LkdXz6rUdFxw1FxsF0eZjXP77tT74OnL9z/Fd2LD/e/dTi uxEydg2XEWF9xTHGuVNBfpYvKedu03t7Jwd2FHSelpvabIfSnnbHE0i2rfsJhTNxV+CX KC6GkbThOQGlYcdKkXHRHkGPCPRfiBfMwZbentLqrFKt1nnACUWudH/amiXV6ZU8RpWB JgbQ== X-Gm-Message-State: AO0yUKU2qFM+cbs40VjtY5x66TQQEJCD3QqXkCkRmvipKfDiedm3el03 Mdl6/dFWjo1urOMIDu28ayA= X-Google-Smtp-Source: AK7set/IeXzUQCgb+NTD2KWmEtx4FBl/XbVJ/OR/HxX4i2c315FV4qyKW2Zv+TQEMqVR3KcwfSd1ZA== X-Received: by 2002:a17:902:c204:b0:19f:3e77:ab7 with SMTP id 4-20020a170902c20400b0019f3e770ab7mr5760263pll.57.1678739147853; Mon, 13 Mar 2023 13:25:47 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id kw6-20020a170902f90600b0019f53e0f136sm245368plb.232.2023.03.13.13.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 13:25:46 -0700 (PDT) Date: Mon, 13 Mar 2023 13:25:44 -0700 From: Nathan Bossart To: Andres Freund Cc: Peter Eisentraut , Daniel Gustafsson , Nazir Bilal Yavuz , PostgreSQL Hackers Subject: Re: meson: Non-feature feature options Message-ID: <20230313202544.GA373446@nathanxps13> References: <0fff0827-c1f5-d29c-2ee3-dc8c871176bf@enterprisedb.com> <9df9067d-5651-2d3e-e838-9e5d273f5524@enterprisedb.com> <5250E85B-4A97-4DA1-8900-7DCDE925441A@yesql.se> <6d3310fb-50e3-34d8-fe10-8dd8c4ffdf23@enterprisedb.com> <20230313180432.GA246741@nathanxps13> <20230313201331.xvbhzh5fufs6gxmn@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230313201331.xvbhzh5fufs6gxmn@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 13, 2023 at 01:13:31PM -0700, Andres Freund wrote: > On 2023-03-13 11:04:32 -0700, Nathan Bossart wrote: >> I noticed that after 6a30027, if you don't have the OpenSSL headers >> installed, 'meson setup' will fail: >> >> meson.build:1195:4: ERROR: C header 'openssl/ssl.h' not found >> >> Shouldn't "auto" cause Postgres to be built without OpenSSL if the required >> headers are not present? > > Yea. I found another thing: When dependency() found something, but the headers > weren't present, ssl_int wouldn't exist. > > Maybe something like the attached? > ssl_lib = cc.find_library('ssl', > dirs: test_lib_d, > header_include_directories: postgres_inc, > - has_headers: ['openssl/ssl.h', 'openssl/err.h']) > + has_headers: ['openssl/ssl.h', 'openssl/err.h'], > + required: openssl_required) > crypto_lib = cc.find_library('crypto', > dirs: test_lib_d, > - header_include_directories: postgres_inc) > - ssl_int = [ssl_lib, crypto_lib] > - > - ssl = declare_dependency(dependencies: ssl_int, > - include_directories: postgres_inc) > + required: openssl_required) > + if ssl_lib.found() and crypto_lib.found() > + ssl_int = [ssl_lib, crypto_lib] > + ssl = declare_dependency(dependencies: ssl_int, include_directories: postgres_inc) > + endif I was just about to post a patch to set "required" like you have for ssl_lib and crypto_lib. It seemed to work alright without the 'if ssl_lib.found() and crypto_lib.found()' line, but I haven't worked with these meson files very much, so what you have is probably better form. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com