pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sergey Shinderuk <s.shinderuk@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: James Hilliard <james.hilliard1@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, Thomas Munro <thomas.munro@gmail.com>
Subject: Re: [PATCH 1/1] Fix detection of pwritev support for OSX.
Date: Sat, 23 Jan 2021 08:02:01 +0300
Message-ID: <49989a13-49d2-935a-c651-74719ec565e6@postgrespro.ru> (raw)
In-Reply-To: <1166796.1611335531@sss.pgh.pa.us>
References: <20210119111625.20435-1-james.hilliard1@gmail.com>
	<479372.1611070041@sss.pgh.pa.us>
	<CADvTj4riiHN9Zhhk5qOVndevQMOxuduFbFVVJnCiQ4R7k5_eng@mail.gmail.com>
	<480660.1611071845@sss.pgh.pa.us>
	<CADvTj4o6LEGRJSRR4H8Rmn8r_vv4ZE_mS0MS5Z60NwDZRwdZHQ@mail.gmail.com>
	<483800.1611076636@sss.pgh.pa.us>
	<CADvTj4oD6NoTe78vLi+Ss1CFuPH26vrhUrVTd5DHAPX63vP9Ww@mail.gmail.com>
	<522433.1611089678@sss.pgh.pa.us>
	<CADvTj4qNyMM5vHo+uZ6Xfq5n5g++X_bUTX1-g3zmNXYDWAo8sQ@mail.gmail.com>
	<CADvTj4pucOvo6aWinatLgARs3mjPFSiAXZr2ErSG4ASJsKNxBw@mail.gmail.com>
	<559755.1611106628@sss.pgh.pa.us>
	<CADvTj4qcwzrti9qK8E_xnoPHHn13hWqOGQC-1r3a=Y=mmGvCfQ@mail.gmail.com>
	<791992.1611184078@sss.pgh.pa.us>
	<CADvTj4qJmUdvVw3ECGK_FXXjkTneo5gVJGSvtpDxGrrseQdXDw@mail.gmail.com>
	<915981.1611254324@sss.pgh.pa.us>
	<CADvTj4pzBHOa4PyzLKxZrnOiuwYTa2CDYU=4nUB3Dh8BoReQPg@mail.gmail.com>
	<6d43a157-e51a-6449-0b47-94d133829afc@postgrespro.ru>
	<1166796.1611335531@sss.pgh.pa.us>

On 22.01.2021 20:12, Tom Lane wrote:
> [ pokes more carefully... ]  Ah-hah, I see why I needed the CLT.
> I bet you'll find that you can't build from "git clean -dfx" state
> with only Xcode, because comparing the contents of
> /Applications/Xcode.app/Contents/Developer/usr/bin and
> /Library/Developer/CommandLineTools/usr/bin on my own Mac,
> I observe that only the CLT provides bison and flex.  I also see
> install_name_tool only in the CLT; we don't depend on that today,
> but may soon (see the latest thread about coping with SIP).
> 

I did git clone from scratch. Xcode really has all the tools.

configure:9519: checking for bison
configure:9537: found /usr/bin/bison
configure:9549: result: /usr/bin/bison
configure:9571: using bison (GNU Bison) 2.3
configure:9609: checking for flex
configure:9654: result: /usr/bin/flex
configure:9674: using flex 2.5.35 Apple(flex-32)

% xcrun --find bison
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bison

% xcrun --find install_name_tool
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool


> On the whole it looks like we should recommend installing the CLT
> and not bothering with Xcode, which is about 10X the size:
> 
> $ du -hs /Library/Developer/CommandLineTools
> 1.1G    /Library/Developer/CommandLineTools
> $ du -hs /Applications/Xcode.app
>   15G    /Applications/Xcode.app
> 

Fair.


> BTW, reading [1] I see
> 
>     You can install Xcode, the CLT, or both; Homebrew supports all three
>     configurations.
> 
> So I'm not sure why you got that prompt, unless you were using a formula
> that knew you were going to need bison.
> 
> [1] https://docs.brew.sh/Installation#3

Apparently, this documentation is wrong. I’m not installing any 
particular formula, just running the Homebrew installer script.

% /bin/bash -c "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)";
Password:
==> This script will install:
[...]
==> The following new directories will be created:
[...]
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort

==> Installing Command Line Tools for Xcode-12.3
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ for\ 
Xcode-12.3
Software Update Tool

Downloading Command Line Tools for Xcode
[...]

I checked the script [1], and it really requires the CLT. Here is the 
explanation [2] for this:

	There is actually no such requirement. However, there are
	formulae that will be forced to build from source if you do not
	have the CLT. They can still be built from source with Xcode
	only, but because the pre-built bottles are compiled in an
	environment that has both Xcode and the CLT installed, there are
	some cases where the bottles end up having a hard dependency on
	the CLT. A major example is gcc. So installing the CLT may help
	you avoid some lengthy source builds.

	We ensure that all Homebrew formulae can be built with Xcode.app
	alone. Most formulae can be built with just the CLT, and those
	that require the full Xcode.app have an explicit depends_on
	:xcode => :build. Some users would prefer to use only the CLT
	because it's a much smaller download and takes less time to
	install and upgrade than Xcode.


[1] https://github.com/Homebrew/install/blob/master/install.sh#L191
[2] https://github.com/Homebrew/brew/issues/1613


Regards.

-- 
Sergey Shinderuk
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company





view thread (30+ messages)  latest in thread

Message-ID: <49989a13-49d2-935a-c651-74719ec565e6@postgrespro.ru>
Permalink:  ../49989a13-49d2-935a-c651-74719ec565e6@postgrespro.ru/
Also on:    postgresql.org/message-id/49989a13-49d2-935a-c651-74719ec565e6@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: s.shinderuk@postgrespro.ru, tgl@sss.pgh.pa.us, james.hilliard1@gmail.com, thomas.munro@gmail.com
  Subject: Re: [PATCH 1/1] Fix detection of pwritev support for OSX.
  In-Reply-To: <49989a13-49d2-935a-c651-74719ec565e6@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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