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 1q72M9-00072L-74 for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Jun 2023 23:14:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q72M7-0006jp-Q3 for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Jun 2023 23:14:19 +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 1q72M7-0006fD-Fq for pgsql-hackers@lists.postgresql.org; Wed, 07 Jun 2023 23:14:19 +0000 Received: from mail-yw1-x1135.google.com ([2607:f8b0:4864:20::1135]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q72M0-000ueV-NW for pgsql-hackers@postgresql.org; Wed, 07 Jun 2023 23:14:18 +0000 Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-565ba53f434so88460607b3.3 for ; Wed, 07 Jun 2023 16:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1686179651; x=1688771651; h=user-agent:content-disposition:mime-version:message-id:subject:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=sUYoCLmxUBotbNd63VW/NVuEBDXb93q5WDwLRKgaXuQ=; b=Z5iSWumqNN13UIhD56HpkWeGX6ihjRQuEoBpMSIuPVOubC6YXQfSHofg9tsoz2wEI1 E6/ZPxs2twZHbIFyDQNH0DNxSwEbDUGyA5PN78u9oRBn/7n/G13mA97aQa/2ftop7CT2 75FFBCfYGw0E4cfBnhpd2P9cBMC2DoYBexFyI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686179651; x=1688771651; h=user-agent:content-disposition:mime-version:message-id:subject:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sUYoCLmxUBotbNd63VW/NVuEBDXb93q5WDwLRKgaXuQ=; b=NOB7lUkA2hDlE+mEy4pnGQak3BohOuXPSoqWTTpyZ//0WAzPNtoTa/FB8QB8e2ER91 OaBE1tyI1j9kirzkJt/uKnqWQlKHOkZABP6dFFpuefhAxn9CoCK3I/byw8TABVTOzptl 5gQ16BjmOSKv4eAlZaWSnnt1JNTE6T8redjOMXftbsazuClMFCtek7Fnm2psIekPWGnw eU+3foNjtLf0icfppGnG0l+1GoG5Iem03LTD1j6mbKC81514zMpRz2BBduIrUx0030dn sp2D3ViB/RVw/3h984WWpoqPCSY5ZEdkho/GVbyHLTJWIdENmkDmYRlAD3v6qrHrVC3W XKmg== X-Gm-Message-State: AC+VfDySNzNxMYk66mm/BgtH3Mb70Hvcmn/XSOU/vHQhTAdF0sojuG0S WH2a0xAMWPq4xVw68WMllE4oaB1uusFC+0D6gW0= X-Google-Smtp-Source: ACHHUZ4lmB1UVuA+D/2wW+fI6b6y1r2xpuDoWgaJdfShMg6oVHRIKXTrXf8VokgfLnXSyZm4zu+FMA== X-Received: by 2002:a0d:cb07:0:b0:55a:5ce4:aff2 with SMTP id n7-20020a0dcb07000000b0055a5ce4aff2mr7493939ywd.39.1686179651038; Wed, 07 Jun 2023 16:14:11 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::2e]) by smtp.gmail.com with ESMTPSA id z19-20020a81c213000000b0055d8768408dsm4955013ywc.105.2023.06.07.16.14.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2023 16:14:10 -0700 (PDT) Date: Wed, 7 Jun 2023 16:14:07 -0700 From: Noah Misch To: pgsql-hackers@postgresql.org Subject: win32ver data in meson-built postgres.exe Message-ID: <20230607231407.GC1334487@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="yEPQxsgoJgBvi8ip" Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline A postgres.exe built with meson, ninja, and MSVC lacks the version metadata that postgres.exe gets under non-meson build systems. Patch attached. --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="win32ver-backend-meson-v1.patch" Author: Noah Misch Commit: Noah Misch Add win32ver data to meson-built postgres.exe. This preserves two quirks of the older build systems. First, postgres.exe is icon-free. Second, the resources object is not an input to postgres.def. Reviewed by FIXME. Discussion: https://postgr.es/m/FIXME diff --git a/meson.build b/meson.build index 16b2e86..6d88836 100644 --- a/meson.build +++ b/meson.build @@ -2714,9 +2714,12 @@ if host_system == 'windows' rcgen_base_args += ['--depfile', '@DEPFILE@'] endif - rcgen_bin_args = rcgen_base_args + [ + rcgen_server_args = rcgen_base_args + [ '--VFT_TYPE', 'VFT_APP', - '--FILEENDING', 'exe', + '--FILEENDING', 'exe' + ] + + rcgen_bin_args = rcgen_server_args + [ '--ICO', pg_ico ] @@ -2731,6 +2734,12 @@ if host_system == 'windows' output: rcgen_outputs, ) + rc_server_gen = generator(rcgen, + depfile: '@BASENAME@.d', + arguments: rcgen_server_args, + output: rcgen_outputs, + ) + rc_lib_gen = generator(rcgen, depfile: '@BASENAME@.d', arguments: rcgen_lib_args, diff --git a/src/backend/meson.build b/src/backend/meson.build index ccfc382..0e56b7f 100644 --- a/src/backend/meson.build +++ b/src/backend/meson.build @@ -5,6 +5,7 @@ backend_sources = [] backend_link_with = [pgport_srv, common_srv] generated_backend_sources = [] +post_export_backend_sources = [] subdir('access') subdir('archive') @@ -133,8 +134,15 @@ if dtrace.found() and host_system != 'darwin' ) endif +if host_system == 'windows' + post_export_backend_sources += rc_server_gen.process(win32ver_rc, extra_args: [ + '--NAME', 'postgres', + '--FILEDESC', 'PostgreSQL Server',]) +endif + postgres = executable('postgres', backend_input, + sources: post_export_backend_sources, objects: backend_objs, link_args: backend_link_args, link_with: backend_link_with, --yEPQxsgoJgBvi8ip--