make install fails when INSTALL_DIR is defined #911

Closed
opened 2024-01-19 06:17:20 -06:00 by hgy59 · 2 comments
hgy59 commented 2024-01-19 06:17:20 -06:00 (Migrated from github.com)

Since v0.8.2 the build fails, when INSTALL_DIR env variable is defined

The build is broken by 836f4e7

The following line in Makefile must be omitted

INSTALL_DIR     ?= $(INSTALL) -d -m 755

and to create target directories, the use of $(Q)$(INSTALL_DIR) must be replaced by $(Q)$(INSTALL) -d -m 755 as before.

Notes:
INSTALL_DIR is a common variable for make, similar to DESTDIR and may not be used by Makefile for any other purpose.

Since v0.8.2 the build fails, when `INSTALL_DIR` env variable is defined The build is broken by 836f4e7 The following line in Makefile must be omitted ``` INSTALL_DIR ?= $(INSTALL) -d -m 755 ``` and to create target directories, the use of `$(Q)$(INSTALL_DIR) ` must be replaced by `$(Q)$(INSTALL) -d -m 755 ` as before. Notes: `INSTALL_DIR` is a common variable for make, similar to `DESTDIR` and may not be used by Makefile for any other purpose.
Cyan4973 commented 2024-01-19 11:07:17 -06:00 (Migrated from github.com)

It may very well be true, but It's a pity I can't find any information on this INSTALL_DIR variable.
In contrast, DESTDIR is very well documented.
Is there a reference place where these variables are listed ?

It may very well be true, but It's a pity I can't [find any information](https://www.gnu.org/prep/standards/html_node/Directory-Variables.html#Directory-Variables) on this `INSTALL_DIR` variable. In contrast, [`DESTDIR`](https://www.gnu.org/prep/standards/html_node/DESTDIR.html#DESTDIR) is very well documented. Is there a reference place where these variables are listed ?
hgy59 commented 2024-01-19 13:04:00 -06:00 (Migrated from github.com)

@Cyan4973 sorry, INSTALL_DIR is not related to make, but it is common for cmake for external projects (for example https://cmake.org/cmake/help/latest/module/ExternalProject.html)

I faced this issue in the spksrc project, where we build native packages for synology diskstation devices.
We have one environment to build packages with make, cmake, rust, go, meson, etc.
In this environment INSTALL_DIR is always defined.

To build rsync that depends on xxhash I added a patch for the Makefile to use the former version to create target folders (see cross/xxhash/patches/001-fix_Makefile.patch in https://github.com/SynoCommunity/spksrc/pull/5985/commits/6e2b9b6021081310ec1d515be85130224c7c0a2e)

Since INSTALL_DIR was introduced in xxHash Makefile without documenting a reason what this is for, I think it could be reverted to the former version - or you could use a different variable name like INSTALL_DIRECTORY or CREATE_DIRECTORY to avoid such side effects.

@Cyan4973 sorry, `INSTALL_DIR` is not related to make, but it is common for cmake for external projects (for example https://cmake.org/cmake/help/latest/module/ExternalProject.html) I faced this issue in the [spksrc](https://github.com/SynoCommunity/spksrc) project, where we build native packages for synology diskstation devices. We have one environment to build packages with make, cmake, rust, go, meson, etc. In this environment `INSTALL_DIR` is always defined. To build `rsync` that depends on `xxhash` I added a patch for the Makefile to use the former version to create target folders (see `cross/xxhash/patches/001-fix_Makefile.patch` in https://github.com/SynoCommunity/spksrc/pull/5985/commits/6e2b9b6021081310ec1d515be85130224c7c0a2e) Since `INSTALL_DIR` was introduced in xxHash Makefile without documenting a reason what this is for, I think it could be reverted to the former version - or you could use a different variable name like `INSTALL_DIRECTORY` or `CREATE_DIRECTORY` to avoid such side effects.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Cyan4973/xxHash#911
No description provided.