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 01:09:40
Message-ID: 20221001010940.jxxhnrfzejmmhroj@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-09-30 10:17:37 -0700, Andres Freund wrote:
> Agreed - I was just trying to give background. I'm inclined to just go for
> Junwang Zhao's patch for now.

That turns out to break tests on windows right now - but it's not the fault of
the patch. Paths on windows are just evil:

We do the installation for tmp_install with DESTDIR (no surprise) just as in
autoconf. To set PATH etc, we need a path to the bindir inside that. Trivial
on unixoid systems. Not so much on windows. The obvious problematic cases are
things like a prefix of c:/something: Can't just prepend tmp_install/.

I'd hacked that up for c:/ style paths. But that doesn't work for paths like
/usr/local, because they're neither absolute nor relative, but "drive
relative". And then there's like a gazillion other things. A prefix could be
'//computer/share/path/to/' and all other sorts of nastiness.

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

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-10-01 01:19:03 Re: [PATCH v1] [meson] add a default option prefix=/usr/local/pgsql
Previous Message Andres Freund 2022-10-01 00:20:44 Re: problems with making relfilenodes 56-bits