{"thread":{"id":"56341","subject":"[PATCH v2] make: add INSTALL_STRIP variable","startedAt":"2021-08-21T11:25:42Z","lastAt":"2021-08-22T14:37:47Z","messageCount":2,"participants":["Bagas Sanjaya","Đoàn Trần Công Danh"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"433310","messageId":"20210821112510.50468-1-bagasdotme@gmail.com","threadId":"56341","inReplyTo":null,"subject":"[PATCH v2] make: add INSTALL_STRIP variable","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-08-21T11:25:11Z","receivedAt":"2021-08-21T11:25:42Z","isPatch":true,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"In some environments (most notably embedded systems and small production\nservers), it is often desirable to have stripped Git binaries due to\ntight disk space constraint.\n\nUntil now stripped Git can be built wih `make strip install`. Add\nINSTALL_STRIP make variable so that they can install stripped Git\nbinaries with `make INSTALL_STRIP=yes install`.\n\nAlso document stripping and using INSTALL_STRIP in INSTALL.\n\nSigned-off-by: Bagas Sanjaya <bagasdotme@gmail.com>\n---\n Changes from v1 [1]:\n\n   - install target depends on strip when INSTALL_STRIP is defined\n     (sugested by Đoàn)\n\n [1]: https://lore.kernel.org/git/YSDW3nsG2iWPGakF@danh.dev/T/#t\n\n INSTALL  | 8 ++++++++\n Makefile | 5 +++++\n 2 files changed, 13 insertions(+)\n\ndiff --git a/INSTALL b/INSTALL\nindex 66389ce059..98e541ee4d 100644\n--- a/INSTALL\n+++ b/INSTALL\n@@ -58,6 +58,14 @@ suite has to be run using only a single CPU.  In addition, the profile\n feedback build stage currently generates a lot of additional compiler\n warnings.\n \n+You can also strip debug info from built binaries by:\n+\n+\t$ make strip\n+\n+or for stripping and installing together:\n+\n+\t$ make INSTALL_STRIP=yes install\n+\n Issues of note:\n \n  - Ancient versions of GNU Interactive Tools (pre-4.9.2) installed a\ndiff --git a/Makefile b/Makefile\nindex 9573190f1d..43c47f5560 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -8,6 +8,8 @@ all::\n # Define SANE_TOOL_PATH to a colon-separated list of paths to prepend\n # to PATH if your tools in /usr/bin are broken.\n #\n+# Define INSTALL_STRIP if you want to install with stripped binaries.\n+#\n # Define SOCKLEN_T to a suitable type (such as 'size_t') if your\n # system headers do not define a socklen_t type.\n #\n@@ -3004,6 +3006,9 @@ profile-install: profile\n profile-fast-install: profile-fast\n \t$(MAKE) install\n \n+ifdef INSTALL_STRIP\n+install: strip\n+endif\n install: all\n \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'\n \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n\nbase-commit: 225bc32a989d7a22fa6addafd4ce7dcd04675dbf\n-- \n2.25.1\n\n"},{"id":"433324","messageId":"YSJhM2x82c7ardUm@danh.dev","threadId":"56341","inReplyTo":"20210821112510.50468-1-bagasdotme@gmail.com","subject":"Re: [PATCH v2] make: add INSTALL_STRIP variable","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2021-08-22T14:37:39Z","receivedAt":"2021-08-22T14:37:47Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2021-08-21 18:25:11+0700, Bagas Sanjaya <bagasdotme@gmail.com> wrote:\n> In some environments (most notably embedded systems and small production\n> servers), it is often desirable to have stripped Git binaries due to\n> tight disk space constraint.\n> \n> Until now stripped Git can be built wih `make strip install`. Add\n> INSTALL_STRIP make variable so that they can install stripped Git\n> binaries with `make INSTALL_STRIP=yes install`.\n> \n> Also document stripping and using INSTALL_STRIP in INSTALL.\n> \n> Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>\n> ---\n>  Changes from v1 [1]:\n> \n>    - install target depends on strip when INSTALL_STRIP is defined\n>      (sugested by Đoàn)\n> \n>  [1]: https://lore.kernel.org/git/YSDW3nsG2iWPGakF@danh.dev/T/#t\n\nWe may want to see this discussion[2] settled first, I think.\n\n2: https://lore.kernel.org/git/YSBhPdK8jYIQUNhP@danh.dev/\n\n-- Danh\n\n> \n>  INSTALL  | 8 ++++++++\n>  Makefile | 5 +++++\n>  2 files changed, 13 insertions(+)\n> \n> diff --git a/INSTALL b/INSTALL\n> index 66389ce059..98e541ee4d 100644\n> --- a/INSTALL\n> +++ b/INSTALL\n> @@ -58,6 +58,14 @@ suite has to be run using only a single CPU.  In addition, the profile\n>  feedback build stage currently generates a lot of additional compiler\n>  warnings.\n>  \n> +You can also strip debug info from built binaries by:\n> +\n> +\t$ make strip\n> +\n> +or for stripping and installing together:\n> +\n> +\t$ make INSTALL_STRIP=yes install\n> +\n>  Issues of note:\n>  \n>   - Ancient versions of GNU Interactive Tools (pre-4.9.2) installed a\n> diff --git a/Makefile b/Makefile\n> index 9573190f1d..43c47f5560 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -8,6 +8,8 @@ all::\n>  # Define SANE_TOOL_PATH to a colon-separated list of paths to prepend\n>  # to PATH if your tools in /usr/bin are broken.\n>  #\n> +# Define INSTALL_STRIP if you want to install with stripped binaries.\n> +#\n>  # Define SOCKLEN_T to a suitable type (such as 'size_t') if your\n>  # system headers do not define a socklen_t type.\n>  #\n> @@ -3004,6 +3006,9 @@ profile-install: profile\n>  profile-fast-install: profile-fast\n>  \t$(MAKE) install\n>  \n> +ifdef INSTALL_STRIP\n> +install: strip\n> +endif\n>  install: all\n>  \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'\n>  \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'\n> \n> base-commit: 225bc32a989d7a22fa6addafd4ce7dcd04675dbf\n> -- \n> 2.25.1\n> \n\n-- \nDanh\n"}]}