Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress CMake external project 'update' phase #7

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

cottsay
Copy link
Contributor

@cottsay cottsay commented Nov 8, 2022

Bug fix

Fixed bug

When the 'install' target is invoked during the Debian and RPM package builds, the external project target is re-evaluated to determine if it is stale. By default, CMake performs an 'update' command on the source repository, which invalidates the target and causes the external project to be re-built.

This is a problem because when the 'install' target is invoked by the Debian/RPM build, the 'DESTDIR' variable is passed, which makes its way into the external project as well. This interferes with the sub-project's installation into the build directory, and results in unexpected files getting installed into the platform package staging directory.

This is a problem for both Debian and RPM builds, but it is only a fatal error in RPM builds at the moment.

Fix applied

Using a ref which can never change and suppressing the 'update' phase of the external project is enough to ensure that the external project is not deemed 'stale' during the install target invocation, and avoids the problem.

@cottsay cottsay self-assigned this Nov 8, 2022
When the 'install' target is invoked during the Debian and RPM package
builds, the external project target is re-evaluated to determine if it
is stale. By default, CMake performs an 'update' command on the source
repository, which invalidates the target and causes the external project
to be re-built.

This is a problem because when the 'install' target is invoked by the
Debian/RPM build, the 'DESTDIR' variable is passed, which makes its way
into the external project as well. This interferes with the
sub-project's installation into the build directory, and results in
unexpected files getting installed into the platform package staging
directory.

This is a problem for both Debian and RPM builds, but it is only a fatal
error in RPM builds at the moment.

Using a ref which can never change and suppressing the 'update' phase of
the external project is enough to ensure that the external project is
not deemed 'stale' during the install target invocation, and avoids the
problem.

Signed-off-by: Scott K Logan <logans@cottsay.net>
@orensbruli
Copy link
Contributor

LGTM

@orensbruli orensbruli merged commit c9e37ad into main Nov 9, 2022
@orensbruli orensbruli deleted the cottsay/extra_rebuild branch November 10, 2022 07:26
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.

None yet

2 participants