git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] make: add install-stripped target

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 26, 2021, 20:08 UTC
Message-ID
<xmqq8s0odl5l.fsf@gitster.g>
In-Reply-To
<20210826113824.50078-2-bagasdotme@gmail.com>
Bagas Sanjaya <bagasdotme@gmail.com> writes:
Show 5 quoted lines
> +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
Previous: Bagas SanjayaNext: Bagas Sanjaya
Message 3 of 8 in “make: install stripped Git”
  1. 0/2 make: install stripped GitBagas Sanjaya, Aug 26, 2021
  2. 1/2 make: add install-stripped targetBagas Sanjaya, Aug 26, 2021
  3. Junio C HamanoAug 26, 2021
  4. Bagas SanjayaAug 27, 2021
  5. Đoàn Trần Công DanhAug 27, 2021
  6. 2/2 make: delete strip targetBagas Sanjaya, Aug 26, 2021
  7. Ævar Arnfjörð BjarmasonAug 26, 2021
  8. Junio C HamanoAug 26, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.