pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
errcodes.h and others not generated when compiling 13.6 on M1 Mac
9+ messages / 3 participants
[nested] [flat]

* errcodes.h and others not generated when compiling 13.6 on M1 Mac
@ 2022-04-27 00:05 Sam Kidman <sam@fresho.com>
  2022-04-27 10:51 ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 9+ messages in thread

From: Sam Kidman @ 2022-04-27 00:05 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hello

I recently upgraded one of our applications to use postgres 13.6. When I
try to compile from a source checkout or by running asdf install (our
version manager which also compiles 13.6) I get the same error message:

../../src/include/utils/elog.h:71:10: fatal error: 'utils/errcodes.h' file
not found

After digging around in the source it looks like it's supposed to be
generated. I can't figure out why this isn't working on my machine though.
It seems to happen on any M1 mac (my colleagues can reproduce it)

Any help on how to fix or debug this further would be appreciated.

Regards, Sam
www.fresho.com

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac
  2022-04-27 00:05 errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
@ 2022-04-27 10:51 ` Laurenz Albe <laurenz.albe@cybertec.at>
  2022-04-27 13:38   ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 9+ messages in thread

From: Laurenz Albe @ 2022-04-27 10:51 UTC (permalink / raw)
  To: Sam Kidman <sam@fresho.com>; pgsql-general@lists.postgresql.org

On Wed, 2022-04-27 at 10:05 +1000, Sam Kidman wrote:
> I recently upgraded one of our applications to use postgres 13.6. When I try to compile
> from a source checkout or by running asdf install (our version manager which also compiles 13.6)
> I get the same error message:
> 
> ../../src/include/utils/elog.h:71:10: fatal error: 'utils/errcodes.h' file not found
> 
> After digging around in the source it looks like it's supposed to be generated. I can't
> figure out why this isn't working on my machine though. It seems to happen on any M1 mac
> (my colleagues can reproduce it)
> 
> Any help on how to fix or debug this further would be appreciated.

I'd say that you didn't ./configure the PostgreSQL source.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac
  2022-04-27 00:05 errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
  2022-04-27 10:51 ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Laurenz Albe <laurenz.albe@cybertec.at>
@ 2022-04-27 13:38   ` Tom Lane <tgl@sss.pgh.pa.us>
  2022-04-28 22:54     ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
  2022-04-29 00:11     ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
  0 siblings, 2 replies; 9+ messages in thread

From: Tom Lane @ 2022-04-27 13:38 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Sam Kidman <sam@fresho.com>; pgsql-general@lists.postgresql.org

Laurenz Albe <laurenz.albe@cybertec.at> writes:
> On Wed, 2022-04-27 at 10:05 +1000, Sam Kidman wrote:
>> I recently upgraded one of our applications to use postgres 13.6. When I try to compile
>> from a source checkout or by running asdf install (our version manager which also compiles 13.6)
>> I get the same error message:
>> 
>> ../../src/include/utils/elog.h:71:10: fatal error: 'utils/errcodes.h' file not found

> I'd say that you didn't ./configure the PostgreSQL source.

No, we dealt with that case long ago: you get

$ make
You need to run the 'configure' program first. See the file
'README.git' for installation instructions, or visit: 
<https://www.postgresql.org/docs/devel/installation.html;
make: *** [all] Error 1

Anyway, 13.6 certainly builds on my M1 laptop, as well as my
M1 buildfarm animal [1], so it's not a case of "it's completely
broken".  But you need the appropriate prerequisites, eg
an Xcode installation [2].  I wonder exactly what configure
options the OP is using, and what's installed on his Mac
beyond bare macOS.

			regards, tom lane

[1] https://buildfarm.postgresql.org/cgi-bin/show_history.pl?nm=sifaka&br=REL_13_STABLE
[2] https://www.postgresql.org/docs/devel/installation-platform-notes.html#INSTALLATION-NOTES-MACOS





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac
  2022-04-27 00:05 errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
  2022-04-27 10:51 ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Laurenz Albe <laurenz.albe@cybertec.at>
  2022-04-27 13:38   ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-04-28 22:54     ` Sam Kidman <sam@fresho.com>
  2022-04-28 23:51       ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 9+ messages in thread

From: Sam Kidman @ 2022-04-28 22:54 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-general@lists.postgresql.org

Ok, so apparently it's something wrong with our environments? Is it
possible something is failing silently? Any tips for how to troubleshoot?

BTW I'm not doing anything special when compiling, just git checkout
REL_13_6, ./configure, ./make (unless I am doing something wrong there?)

Also the README.md makes mention of an INSTALL file that contains
instructions about prerequisites for compilation but I couldn't find it in
the repository.

Regards, Sam

On Wed, Apr 27, 2022 at 11:38 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Laurenz Albe <laurenz.albe@cybertec.at> writes:
> > On Wed, 2022-04-27 at 10:05 +1000, Sam Kidman wrote:
> >> I recently upgraded one of our applications to use postgres 13.6. When
> I try to compile
> >> from a source checkout or by running asdf install (our version manager
> which also compiles 13.6)
> >> I get the same error message:
> >>
> >> ../../src/include/utils/elog.h:71:10: fatal error: 'utils/errcodes.h'
> file not found
>
> > I'd say that you didn't ./configure the PostgreSQL source.
>
> No, we dealt with that case long ago: you get
>
> $ make
> You need to run the 'configure' program first. See the file
> 'README.git' for installation instructions, or visit:
> <https://www.postgresql.org/docs/devel/installation.html;
> make: *** [all] Error 1
>
> Anyway, 13.6 certainly builds on my M1 laptop, as well as my
> M1 buildfarm animal [1], so it's not a case of "it's completely
> broken".  But you need the appropriate prerequisites, eg
> an Xcode installation [2].  I wonder exactly what configure
> options the OP is using, and what's installed on his Mac
> beyond bare macOS.
>
>                         regards, tom lane
>
> [1]
> https://buildfarm.postgresql.org/cgi-bin/show_history.pl?nm=sifaka&br=REL_13_STABLE
> [2]
> https://www.postgresql.org/docs/devel/installation-platform-notes.html#INSTALLATION-NOTES-MACOS
>

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac
  2022-04-27 00:05 errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
  2022-04-27 10:51 ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Laurenz Albe <laurenz.albe@cybertec.at>
  2022-04-27 13:38   ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Tom Lane <tgl@sss.pgh.pa.us>
  2022-04-28 22:54     ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
@ 2022-04-28 23:51       ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 9+ messages in thread

From: Tom Lane @ 2022-04-28 23:51 UTC (permalink / raw)
  To: Sam Kidman <sam@fresho.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-general@lists.postgresql.org

Sam Kidman <sam@fresho.com> writes:
> Ok, so apparently it's something wrong with our environments? Is it
> possible something is failing silently? Any tips for how to troubleshoot?

Apparently so, but it's not very clear what.  You didn't answer as to
what your build environment is, eg do you have any MacPorts or Homebrew
packages in play.  The missing files are supposed to be generated by
Perl scripts, so I'm wondering if you have a broken Perl installation.
Apple's standard Perl works fine for this, which is why I'm suspicious
that you've got some other Perl installed that for some reason is
less fine.

> BTW I'm not doing anything special when compiling, just git checkout
> REL_13_6, ./configure, ./make (unless I am doing something wrong there?)

That's about what you need, yes.

> Also the README.md makes mention of an INSTALL file that contains
> instructions about prerequisites for compilation but I couldn't find it in
> the repository.

?? There's no README.md in our git tree.  There's no INSTALL there
either, because it's a generated file.  But it's just a flat text
version of the same installation instructions I pointed you to before:

https://www.postgresql.org/docs/13/installation.html

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac
  2022-04-27 00:05 errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
  2022-04-27 10:51 ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Laurenz Albe <laurenz.albe@cybertec.at>
  2022-04-27 13:38   ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-04-29 00:11     ` Sam Kidman <sam@fresho.com>
  2022-04-29 00:16       ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 9+ messages in thread

From: Sam Kidman @ 2022-04-29 00:11 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general@lists.postgresql.org

Actually I made some progress with this. I found if I:

cd src/backend
make generated-headers
cd ../..
make

it works.

So for some reason that submake-generated-headers target isn't getting
called for us.

On Wed, Apr 27, 2022 at 11:38 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Laurenz Albe <laurenz.albe@cybertec.at> writes:
> > On Wed, 2022-04-27 at 10:05 +1000, Sam Kidman wrote:
> >> I recently upgraded one of our applications to use postgres 13.6. When
> I try to compile
> >> from a source checkout or by running asdf install (our version manager
> which also compiles 13.6)
> >> I get the same error message:
> >>
> >> ../../src/include/utils/elog.h:71:10: fatal error: 'utils/errcodes.h'
> file not found
>
> > I'd say that you didn't ./configure the PostgreSQL source.
>
> No, we dealt with that case long ago: you get
>
> $ make
> You need to run the 'configure' program first. See the file
> 'README.git' for installation instructions, or visit:
> <https://www.postgresql.org/docs/devel/installation.html;
> make: *** [all] Error 1
>
> Anyway, 13.6 certainly builds on my M1 laptop, as well as my
> M1 buildfarm animal [1], so it's not a case of "it's completely
> broken".  But you need the appropriate prerequisites, eg
> an Xcode installation [2].  I wonder exactly what configure
> options the OP is using, and what's installed on his Mac
> beyond bare macOS.
>
>                         regards, tom lane
>
> [1]
> https://buildfarm.postgresql.org/cgi-bin/show_history.pl?nm=sifaka&br=REL_13_STABLE
> [2]
> https://www.postgresql.org/docs/devel/installation-platform-notes.html#INSTALLATION-NOTES-MACOS
>

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac
  2022-04-27 00:05 errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
  2022-04-27 10:51 ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Laurenz Albe <laurenz.albe@cybertec.at>
  2022-04-27 13:38   ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Tom Lane <tgl@sss.pgh.pa.us>
  2022-04-29 00:11     ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
@ 2022-04-29 00:16       ` Tom Lane <tgl@sss.pgh.pa.us>
  2022-04-29 00:47         ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Tom Lane @ 2022-04-29 00:16 UTC (permalink / raw)
  To: Sam Kidman <sam@fresho.com>; +Cc: pgsql-general@lists.postgresql.org

Sam Kidman <sam@fresho.com> writes:
> So for some reason that submake-generated-headers target isn't getting
> called for us.

Hmph.  What "make" version are you using exactly?  Are you using
any nondefault make options?  Are you invoking our Makefile from
some make script of your own?  (There are some hacks involving
toplevel vs not-top-level Makefiles that you might be falling
foul of.)

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac
  2022-04-27 00:05 errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
  2022-04-27 10:51 ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Laurenz Albe <laurenz.albe@cybertec.at>
  2022-04-27 13:38   ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Tom Lane <tgl@sss.pgh.pa.us>
  2022-04-29 00:11     ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
  2022-04-29 00:16       ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-04-29 00:47         ` Sam Kidman <sam@fresho.com>
  2022-04-29 00:51           ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 9+ messages in thread

From: Sam Kidman @ 2022-04-29 00:47 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general@lists.postgresql.org

>Are you using any nondefault make options?  Are you invoking our Makefile
from some make script of your own?
This all came about because we use asdf as a version manager which compiles
the versions of various programs you want to use. There's potentially a
problem with the asdf plugin for postgres which I'd like to fix. I couldn't
make head nor tails of the problem with asdf, so I cloned the source and
started trying to compile it myself. The error I get when I compile it
myself and when asdf does it are the same (the problem with header files
not being generated)

When I compile it myself I'm not doing anything more complicated than:
git checkout REL_13_6
./configure
./make

modulo running git clean -f -d -X and make clean to get back to a clean
source checkout.

> You didn't answer as to what your build environment is, eg do you have
any MacPorts or Homebrew packages in play.
Sorry, it's difficult to answer as I'm not sure exactly what you're asking.
But I do use homebrew. I do NOT use MacPorts.
AFAIK, the version of perl that is used is the system version. I do have
the xcode dev tools installed. I can provide more information, but I'll
need more specific questions.

>What "make" version are you using exactly?
➜  postgres git:(d7db957207) make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

On Fri, Apr 29, 2022 at 10:16 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Sam Kidman <sam@fresho.com> writes:
> > So for some reason that submake-generated-headers target isn't getting
> > called for us.
>
> Hmph.  What "make" version are you using exactly?  Are you using
> any nondefault make options?  Are you invoking our Makefile from
> some make script of your own?  (There are some hacks involving
> toplevel vs not-top-level Makefiles that you might be falling
> foul of.)
>
>                         regards, tom lane
>

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac
  2022-04-27 00:05 errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
  2022-04-27 10:51 ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Laurenz Albe <laurenz.albe@cybertec.at>
  2022-04-27 13:38   ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Tom Lane <tgl@sss.pgh.pa.us>
  2022-04-29 00:11     ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
  2022-04-29 00:16       ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Tom Lane <tgl@sss.pgh.pa.us>
  2022-04-29 00:47         ` Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
@ 2022-04-29 00:51           ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 9+ messages in thread

From: Tom Lane @ 2022-04-29 00:51 UTC (permalink / raw)
  To: Sam Kidman <sam@fresho.com>; +Cc: pgsql-general@lists.postgresql.org

Sam Kidman <sam@fresho.com> writes:
>> Are you using any nondefault make options?  Are you invoking our Makefile
>> from some make script of your own?

> This all came about because we use asdf as a version manager which compiles
> the versions of various programs you want to use. There's potentially a
> problem with the asdf plugin for postgres which I'd like to fix. I couldn't
> make head nor tails of the problem with asdf, so I cloned the source and
> started trying to compile it myself. The error I get when I compile it
> myself and when asdf does it are the same (the problem with header files
> not being generated)

Our manual recommends doing it this way if you invoke PG's build from
an upper-level makefile:

build-postgresql:
        $(MAKE) -C postgresql MAKELEVEL=0 all

I don't know anything about asdf, but if it uses make scripts then a
likely explanation for the problem is lack of the "MAKELEVEL=0" bit.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2022-04-29 00:51 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27 00:05 errcodes.h and others not generated when compiling 13.6 on M1 Mac Sam Kidman <sam@fresho.com>
2022-04-27 10:51 ` Laurenz Albe <laurenz.albe@cybertec.at>
2022-04-27 13:38   ` Tom Lane <tgl@sss.pgh.pa.us>
2022-04-28 22:54     ` Sam Kidman <sam@fresho.com>
2022-04-28 23:51       ` Tom Lane <tgl@sss.pgh.pa.us>
2022-04-29 00:11     ` Sam Kidman <sam@fresho.com>
2022-04-29 00:16       ` Tom Lane <tgl@sss.pgh.pa.us>
2022-04-29 00:47         ` Sam Kidman <sam@fresho.com>
2022-04-29 00:51           ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox