Обсуждение: make install-world fails sometimes in Mac M1

Поиск
Список
Период
Сортировка

make install-world fails sometimes in Mac M1

От
Gaddam Sai Ram
Дата:
Hi team, 

      We are using a script to install Postgres from source, the script works fine in ubuntu and Mac(intel) but mostly fails(works sometimes) in Mac M1. 

Configure and make world works fine. But fails during make install-world.

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ./src/backend generated-headers

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C catalog distprep generated-header-symlinks

make[2]: Nothing to be done for `distprep'.

make[2]: Nothing to be done for `generated-header-symlinks'.

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C utils distprep generated-header-symlinks

make[2]: Nothing to be done for `distprep'.

make[2]: Nothing to be done for `generated-header-symlinks'.

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C doc install

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src install

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C sgml install

/bin/sh ../../../config/install-sh -c -d '/Users/sairam/work/postgresql-11.14/share/doc/'/html '/Users/sairam/work/postgresql-11.14/share/man'/man1 '/Users/sairam/work/postgresql-11.14/share/man'/man3 '/Users/sairam/work/postgresql-11.14/share/man'/man7

cp -R `for f in ./html; do test -r $f && echo $f && break; done` '/Users/sairam/work/postgresql-11.14/share/doc/'

cp -R `for f in ./man1; do test -r $f && echo $f && break; done` `for f in ./man3; do test -r $f && echo $f && break; done` `for f in ./man7; do test -r $f && echo $f && break; done` '/Users/sairam/work/postgresql-11.14/share/man'

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src install

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C common install

/bin/sh ../../config/install-sh -c -d '/Users/sairam/work/postgresql-11.14/lib'

/usr/bin/install -c -m 644  libpgcommon.a '/Users/sairam/work/postgresql-11.14/lib/libpgcommon.a'

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C port install

/bin/sh ../../config/install-sh -c -d '/Users/sairam/work/postgresql-11.14/lib'

/usr/bin/install -c -m 644  libpgport.a '/Users/sairam/work/postgresql-11.14/lib/libpgport.a'

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C timezone install

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../../src/port all

make[3]: Nothing to be done for `all'.

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../../src/common all

make[3]: Nothing to be done for `all'.

/bin/sh ../../config/install-sh -c -d '/Users/sairam/work/postgresql-11.14/share'

./zic -d '/Users/sairam/work/postgresql-11.14/share/timezone' -p 'US/Eastern' -b fat  ./data/tzdata.zi

make[2]: *** [install] Killed: 9

make[1]: *** [install-timezone-recurse] Error 2

make: *** [install-world-src-recurse] Error 2

2



It's not like it fails every time, sometimes the same script works just fine. Sometimes after few retries it works.

I have also noticed that, if it works without issue, binaries generated does't work immediately. i.e when I tried to query pg_config, the command waits for sometime and gets killed. After a few retries, it works there onwards.

I'm wondering what could be the issue. I'm attaching the script to the same, kindly go through it and help me understand the issue.

Postgres Version: 11.14
Machine details: MacBook Pro (13-inch, M1, 2020), Version 12.4

Regards
G. Sai Ram


Вложения

Re: make install-world fails sometimes in Mac M1

От
Tom Lane
Дата:
Gaddam Sai Ram <gaddamsairam.n@zohocorp.com> writes:
>       We are using a script to install Postgres from source, the script works fine in ubuntu and Mac(intel) but
mostlyfails(works sometimes) in Mac M1.  

We have developers (including me) and buildfarm machines using M1 Macs,
and nobody else is reporting any big problem with them, so I don't believe
that this is specifically due to that.

> make[2]: *** [install] Killed: 9

kill -9 is not something that would happen internally to the install
process.  My guess is that that is interference from some external agent.
Perhaps you have some resource-consumption-limiting daemon installed on
that machine, and it's deciding that the command ran too long?

            regards, tom lane



Re: make install-world fails sometimes in Mac M1

От
Gaddam Sai Ram
Дата:
Tom Lane <tgl@sss.pgh.pa.us> wrote ---
 > We have developers (including me) and buildfarm machines using M1 Macs ,
 > and nobody else is reporting any big problem with them, so I don't believe
 > that this is specifically due to that.

      Even we don't have any problem when we run commands via terminal. Problem occurs only when we run as a part of script.
      We have tried this script in 5 Mac m1 machines and it is the same issue everywhere.

 > kill -9 is not something that would happen internally to the install
 > process. My guess is that that is interference from some external agent.
 > Perhaps you have some resource-consumption-limiting daemon installed on
 > that machine, and it's deciding that the command ran too long?

      I don't think of any other external agent other than the anti-virus software running at that moment. And I also don't think that it will cause this issue.

      If possible, please do try this script(attached as screenshot as well as pastebin link)
      
      Steps:
      chmod +x install_pg.sh
      ./install_pg.sh -i <install_dir>

         
Thank you,
G. Sai Ram


Вложения

Re: make install-world fails sometimes in Mac M1

От
Alvaro Herrera
Дата:
On 2022-Jul-11, Gaddam Sai Ram wrote:

>       Even we don't have any problem when we run commands via
> terminal. Problem occurs only when we run as a part of script.

It must be a problem induced by the shell used to run the script, then.
What is it?  The script itself doesn't say.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"¿Cómo puedes confiar en algo que pagas y que no ves,
y no confiar en algo que te dan y te lo muestran?" (Germán Poo)



Re: make install-world fails sometimes in Mac M1

От
Gaddam Sai Ram
Дата:
> It must be a problem induced by the shell used to run the script, then.
> What is it? The script itself doesn't say.

Tried with,
1. Bash shell
2. zsh shell
3. Started terminal via rosetta(Again with both bash and zsh)

Same issue in all 3 cases.

Regards
G. Sai Ram



---- On Wed, 13 Jul 2022 20:26:14 +0530 Alvaro Herrera <alvherre@alvh.no-ip.org> wrote ---

On 2022-Jul-11, Gaddam Sai Ram wrote:

>       Even we don't have any problem when we run commands via
> terminal. Problem occurs only when we run as a part of script.

It must be a problem induced by the shell used to run the script, then.
What is it? The script itself doesn't say.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"¿Cómo puedes confiar en algo que pagas y que no ves,
y no confiar en algo que te dan y te lo muestran?" (Germán Poo)