Re: Build problem with square brackets in build path

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nikolay Shaplov <dhyan(at)nataraj(dot)su>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Build problem with square brackets in build path
Date: 2023-04-28 18:06:37
Message-ID: 1439278.1682705197@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nikolay Shaplov <dhyan(at)nataraj(dot)su> writes:
> If you do

> mkdir [source]
> git clone git://git.postgresql.org/git/postgresql.git [source]
> mkdir build; cd build
> ../\[source\]/configure
> make

> you will get

> make[1]: *** No rule to make target 'generated-headers'. Stop.

> If there are no "[]" in the path to the source, everything is OK.

It's generally quite unwise to use shell meta-characters in
file or directory names. I give you one example:

$ ls ../[source]
COPYRIGHT README.git contrib/
GNUmakefile.in aclocal.m4 doc/
HISTORY config/ meson.build
Makefile configure* meson_options.txt
README configure.ac src/
$ ls ../[source]/*.ac
ls: ../[source]/*.ac: No such file or directory

This is expected behavior (I leave it as an exercise for the
student to figure out why).

While it might be possible to make the Postgres build scripts
proof against funny characters in the build paths, the effort
required would be far out of proportion to the value. Not least
because manual operations in such a file tree would misbehave
often enough to convince you to change, even if the scripts were
all water-tight.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2023-04-28 18:08:18 Re: run pgindent on a regular basis / scripted manner
Previous Message Tom Lane 2023-04-28 16:38:20 Re: Postgres Version want to update from 9.2 to 9.5 version in CentOS 7.9