Re: [PATCH v1] [meson] add a default option prefix=/usr/local/pgsql

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Junwang Zhao <zhjwpku(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH v1] [meson] add a default option prefix=/usr/local/pgsql
Date: 2022-10-01 02:07:21
Message-ID: 20221001020721.rsvpd23jlkintmqp@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-09-30 21:19:03 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > I see two potential ways of dealing with this reliably on windows: - error out
> > if a prefix is not drive-local, that's easy enough to check, something like:
> > normalized_prefix.startswith('/') and not normalized_prefix.startswith('//')
> > as the installation on windows is relocatable, that's not too bad a
> > restriction - if on windows call a small python helper to compute the path of
> > tmp_install + prefix, using the code that meson uses for the purpose
>
> I'd be inclined to keep it simple for now. This seems like something
> that could be improved later in a pretty localized way, and it's not
> like there's not tons of other things that need work.

Just not sure which of the two are simpler, particularly taking docs into
account...

The attached 0001 calls into a meson helper command to do this. Not
particularly pretty, but less code than before, and likely more reliable.

Alternatively, the code meson uses for this is trivial, we could just stash it
in a windows_tempinstall_helper.py as well:

import sys
from pathlib import PureWindowsPath as PurePath

def destdir_join(d1: str, d2: str) -> str:
if not d1:
return d2
# c:\destdir + c:\prefix must produce c:\destdir\prefix
return str(PurePath(d1, *PurePath(d2).parts[1:]))

print(destdir_join(sys.argv[1], sys.argv[2]))

Greetings,

Andres Freund

Attachment Content-Type Size
v2-0001-meson-windows-Determine-path-to-tmp_install-prefi.patch text/x-diff 2.8 KB
v2-0002-meson-Add-prefix-usr-local-pgsql-to-default_optio.patch text/x-diff 1.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhihong Yu 2022-10-01 03:40:36 Re: Bloom filter Pushdown Optimization for Merge Join
Previous Message Peter Geoghegan 2022-10-01 01:44:52 Re: problems with making relfilenodes 56-bits