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

From Andres Freund
Subject Re: [PATCH v1] [meson] add a default option prefix=/usr/local/pgsql
Date
Msg-id 20221001010940.jxxhnrfzejmmhroj@awork3.anarazel.de
Whole thread Raw
In response to Re: [PATCH v1] [meson] add a default option prefix=/usr/local/pgsql  (Andres Freund <andres@anarazel.de>)
Responses Re: [PATCH v1] [meson] add a default option prefix=/usr/local/pgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: problems with making relfilenodes 56-bits
Next
From: Tom Lane
Date:
Subject: Re: [PATCH v1] [meson] add a default option prefix=/usr/local/pgsql