Skip to content

possible fix to cmake.install() failing in test_package #8117

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

Merged

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Nov 26, 2020

Changelog: Fix: Define package_folder in the test_package folder (defaulting to "package"), so the test recipe can execute cmake.install() in its build() method.
Docs: Omit

Close #8080

@memsharded memsharded added this to the 1.33 milestone Dec 4, 2020
@memsharded memsharded self-assigned this Dec 4, 2020
@memsharded memsharded requested a review from uilianries December 4, 2020 14:17
@@ -36,7 +36,8 @@ def install_build_and_test(app, conanfile_abs_path, reference, graph_info,
manifest_interactive=manifest_interactive,
keep_build=keep_build,
recorder=recorder)
cmd_build(app, conanfile_abs_path, base_folder, test_build_folder, package_folder=None,
cmd_build(app, conanfile_abs_path, base_folder, test_build_folder,
package_folder=os.path.join(test_build_folder, "package"),
Copy link
Member

@uilianries uilianries Dec 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use conans.paths.PACKAGES_FOLDER instead:

from conans.paths import PACKAGES_FOLDER

...

cmd_build(app, conanfile_abs_path, base_folder, test_build_folder,
                  package_folder=os.path.join(test_build_folder, PACKAGES_FOLDER),

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to leave it explicit and independent, that is an internal path definition for the Conan cache. We might want to change it anytime, to something like "pkg", but we don't want to break what happens in user space.

@memsharded memsharded merged commit 8b13892 into conan-io:develop Dec 4, 2020
@memsharded memsharded deleted the fix/cmake_install_test_package branch December 4, 2020 18:59
@memsharded memsharded mentioned this pull request Dec 14, 2020
5 tasks
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.

[bug] Can't use cmake.install() in test_package/conanfile.py
2 participants