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

[Bug] conan export-pkg has seemingly all values from profile propagated with the exception of CONAN_CMAKE_GENERATOR #4832

Closed
trondhe opened this issue Mar 26, 2019 · 5 comments

Comments

@trondhe
Copy link

trondhe commented Mar 26, 2019

When I want to export to local cache from a local source dir, I first run the setup commands and build my project

conan install . -if=build -pr=myprofile
conan build . -sf=. -bf=build

then when I run either of these commands the wrong generator is used

conan export-pkg . user/channel -sf=. -bf=build -f
conan export-pkg . user/channel -sf=. -bf=build -pr=myprofile -f

Looking at the command variable at line 195 in the cmake.py cmake helper class, the command given to cmake is exactly the same for both versions of export-pkg above. The cmake command value is how I expect it to be with the exception of that the generator given in the profile is not respected, but uses the default given in conan.conf. If no default in conan.conf is given it defaults back to MinGW Makefiles.

A workaround is to set the correct generator as default in conan.conf. But this can only be temporary as projects sometimes includes C# so a mix of generators is to be used.

@trondhe trondhe changed the title conan export-pkg has seemingly all values from profile propagated with the exception of CONAN_CMAKE_GENERATOR [Bug] conan export-pkg has seemingly all values from profile propagated with the exception of CONAN_CMAKE_GENERATOR Mar 27, 2019
@danimtb danimtb self-assigned this Mar 27, 2019
@danimtb
Copy link
Member

danimtb commented Mar 27, 2019

hi @trondhe,

Could you please share here the code in the package() method of your recipe?

I do not understand why the export-pkg is conditional to CONAN_CMAKE_GENERATOR. Probably you are missing the cmake.configure() before a cmake.install() or something similar.

Thanks!

@trondhe
Copy link
Author

trondhe commented Mar 27, 2019

The setup is identical with another issue I had, and this error appeared when I solved it, as you said by having cmake.configure() in the package method: #4710

It was maybe a bit badly explained, but the issue appears when executing conan export-pkg... which then runs the package method. Then it will run the given cmake.configure() method which sets the variable command which is used to run cmake. This line is set at line 195 in cmake.py. This variable contains the default generator as -G <generator, and not the one specified in the profile given by the conan install... It has also no regard for if the conan export-pkg... command is given a profile argument or not.

@danimtb
Copy link
Member

danimtb commented Mar 27, 2019

Will try to reproduce the error. Thanks for the details!

@ghost ghost assigned memsharded Mar 27, 2019
@ghost ghost added stage: review and removed stage: triaging labels Mar 27, 2019
@memsharded memsharded added this to the 1.14 milestone Mar 27, 2019
@memsharded
Copy link
Member

memsharded commented Mar 27, 2019

I have submitted a PR in #4852 trying to solve this issue.

@memsharded
Copy link
Member

Merged, will be released in next Conan 1.14, please try then and report. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants