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

generate packages for different option values #457

Closed
boussaffawalid opened this issue Feb 13, 2020 · 6 comments · Fixed by #473
Closed

generate packages for different option values #457

boussaffawalid opened this issue Feb 13, 2020 · 6 comments · Fixed by #473

Comments

@boussaffawalid
Copy link
Contributor

Feature request

Right now if I set CONAN_BUILD_TYPES="Debug,Release" CPT will create two packages for Debug and Release build types.
However CONAN_OPTIONS does not work in the same way. I'm not sure if this is a feature or a bug.

For example, if I set CONAN_OPTIONS ="foobar:with_bar=True,foobar:with_bar=False" only one package is created.
It would be great if CPT allow creating permutations for options as well,

Environment Details

  • Conan Package Tools Version: 0.23.0
  • Operating System: Linux
  • Operation System Version: Ubuntu 16.04
  • Compiler+version: gcc-5.4
  • Docker image: conanio/gcc7
  • Conan version: conan 1.2.0
  • Python version: python 3.7.0
@boussaffawalid boussaffawalid changed the title generate builds for different option values generate packages for different option values Feb 13, 2020
@uilianries
Copy link
Member

Hi @boussaffawalid !

Do you have a log showing your explanation? Also, I would like which env vars you are using.

Regards

@boussaffawalid
Copy link
Contributor Author

@uilianries here is a minimal example to reproduce the issue
https://github.com/boussaffawalid/cpt_issue_457

@uilianries
Copy link
Member

@boussaffawalid Now I see your question. Unfortunately, CONAN_OPTIONS was not designed to do that, the current behavior is correct. What you want is swapping the option values, which is another case.

I recommend you customizing your ConanMultiPackager with the expected values:

from cpt.packager import ConanMultiPackager
import copy


if __name__ == "__main__":
    builder = ConanMultiPackager(options=["foo:qux=True", "foo:bar=True"])
    builder.add_common_builds()
    for item in copy.copy(builder.items):
        new_options = copy.copy(item.options)
        new_options["foo:qux"] = False
        new_options["foo:bar"] = False
        builder.add(settings=item.settings, options=new_options, env_vars=item.env_vars, build_requires=item.build_requires)
    builder.run()

@boussaffawalid
Copy link
Contributor Author

@uilianries thank you, that what we are doing currently. I just thought that CPT should support this out of the box.

@uilianries
Copy link
Member

uilianries commented Feb 13, 2020

@boussaffawalid Your request is not bad, but inserting option values which are not explicit, are not good IMO. For instance, fPIC is only distributed as True.

I think we could add new option like CONAN_BUILD_ALL_OPTIONS=foo:qux,foo:bar which do what you need.

@boussaffawalid
Copy link
Contributor Author

@uilianries I agree and think such new option will be very handy

@uilianries uilianries added this to the 0.32.0 milestone Feb 17, 2020
uilianries added a commit to uilianries/conan-package-tools that referenced this issue Feb 28, 2020
Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/conan-package-tools that referenced this issue Feb 28, 2020
Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/conan-package-tools that referenced this issue Feb 29, 2020
Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/conan-package-tools that referenced this issue Feb 29, 2020
Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/conan-package-tools that referenced this issue Feb 29, 2020
Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/conan-package-tools that referenced this issue Feb 29, 2020
Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/conan-package-tools that referenced this issue Feb 29, 2020
Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/conan-package-tools that referenced this issue Feb 29, 2020
Signed-off-by: Uilian Ries <uilianries@gmail.com>
uilianries added a commit to uilianries/conan-package-tools that referenced this issue Feb 29, 2020
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@uilianries uilianries mentioned this issue Mar 1, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants