Skip to content

Makefile: remove build prerequisites from install targets (fixes #8971)#8976

Open
ThomsenDrake wants to merge 1 commit intoElementsProject:masterfrom
ThomsenDrake:fix/make-install-no-build
Open

Makefile: remove build prerequisites from install targets (fixes #8971)#8976
ThomsenDrake wants to merge 1 commit intoElementsProject:masterfrom
ThomsenDrake:fix/make-install-no-build

Conversation

@ThomsenDrake
Copy link

Fixes #8971

Problem

make install triggers builds (wiregen, rust compilation, python scripts) because both install-program and install-data list build outputs ($(BIN_PROGRAMS), $(PKGLIBEXEC_PROGRAMS), $(PLUGINS), $(PY_PLUGINS), $(MAN1PAGES), etc.) as Makefile prerequisites.

This means make install can fail if build dependencies are missing, even when all artifacts are already built. This is particularly problematic for:

  • Package managers that run make install in a clean environment
  • Users who built with uv run make but install with plain make install
  • CI pipelines that separate build and install steps

Fix

Remove build output prerequisites from both install-program and install-data targets so make install only copies pre-built files, as documented in the comment now added to the Makefile.

Building remains available via make or make all.

Changes

  • Makefile: 2-line change (remove $(BIN_PROGRAMS) $(PKGLIBEXEC_PROGRAMS) $(PLUGINS) $(PY_PLUGINS) from install-program, remove $(MAN1PAGES) $(MAN5PAGES) $(MAN7PAGES) $(MAN8PAGES) $(DOC_DATA) from install-data)
  • Added clarifying comment referencing make install should only ever copy files #8971

…entsProject#8971)

make install should only copy pre-built files, never trigger builds.
Previously, install-program listed $(BIN_PROGRAMS),
$(PKGLIBEXEC_PROGRAMS), $(PLUGINS), and $(PY_PLUGINS) as
prerequisites, causing make to rebuild binaries if they were
missing or stale. Similarly, install-data listed man page
prerequisites, triggering Python-based man page generation.

This is problematic when running `sudo make install` because
sudo has a different environment (missing per-user Rust, uv,
Python modules like mako, etc.).

After this change, `make install` only creates directories
(via installdirs) and copies files. If expected files are
missing, the install commands will fail with clear error
messages indicating which files need to be built first.

Fixes ElementsProject#8971
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make install should only ever copy files

1 participant