All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: git@vger.kernel.org, felipe.contreras@gmail.com,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Emily Shaffer" <emilyshaffer@google.com>,
	"Đoàn Trần Công Danh" <congdanhqx@gmail.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH 1/2] make: add install-stripped target
Date: Thu, 26 Aug 2021 13:08:06 -0700	[thread overview]
Message-ID: <xmqq8s0odl5l.fsf@gitster.g> (raw)
In-Reply-To: <20210826113824.50078-2-bagasdotme@gmail.com> (Bagas Sanjaya's message of "Thu, 26 Aug 2021 18:38:23 +0700")

Bagas Sanjaya <bagasdotme@gmail.com> writes:

> +install-stripped: install
> +	for f in $(PROGRAMS) git$X; do \
> +		find $$prefix -type f -name $$f -exec $(STRIP) $(STRIP_OPTS) {} \; ; \
> +	done
> +

This sounds awfully wasteful.

The recipe for the install target knows exactly each of these
programs are installed, but yet the above is running around inside
$prefix to find them after the fact.

It also looks incorrect, too.

It is not guaranteed that $prefix does not contain any $IFS
whitespace in it, and worse yet, $prefix may not contain $bindir or
$libexecdir in it, so find may never reach these binaries.

It also depends on "strip" not to break handlinks to the same
binary.  "git" is linked to many built-in command binary like
"git-cat-file" and "git-remote-$curl" for various protocols are
installed by creating links to "git-remote-http".  It seems that the
"strip" command from GNU binutils package strips such a binary
in-place, but I do not think there is no fundamental reason to
believe that everybody else's "strip" would behave that way.

I would have expected that 'install-stripped' and 'install' targets
would run the same recipe, and when $(install_bindir_programs) are
installed in $(bindir) using $(INSTALL), we would optionally pass
the '--strip' option to the $(INSTALL) program when the recipe is
run for the install-stripped target.  All the tricky symlinking,
hardlinking and copying happens only on the result of that step, and
the strip step should happen before that, I would think.

> +.PHONY: install-gitweb install-doc install-man install-man-perl install-html install-info install-pdf install-stripped

Split the overly long line like this into two or more.

>  .PHONY: quick-install-doc quick-install-man quick-install-html
>  install-gitweb:
>  	$(MAKE) -C gitweb install

  reply	other threads:[~2021-08-26 20:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 11:38 [PATCH 0/2] make: install stripped Git Bagas Sanjaya
2021-08-26 11:38 ` [PATCH 1/2] make: add install-stripped target Bagas Sanjaya
2021-08-26 20:08   ` Junio C Hamano [this message]
2021-08-27  7:57     ` Bagas Sanjaya
2021-08-27 12:41       ` Đoàn Trần Công Danh
2021-08-26 11:38 ` [PATCH 2/2] make: delete strip target Bagas Sanjaya
2021-08-26 19:36   ` Ævar Arnfjörð Bjarmason
2021-08-26 20:10   ` Junio C Hamano

Reply instructions:

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

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

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq8s0odl5l.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=congdanhqx@gmail.com \
    --cc=emilyshaffer@google.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.