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] --build missing does not always build missing packages #14324

Closed
DoDoENT opened this issue Jul 18, 2023 · 2 comments
Closed

[bug] --build missing does not always build missing packages #14324

DoDoENT opened this issue Jul 18, 2023 · 2 comments
Assignees

Comments

@DoDoENT
Copy link
Contributor

DoDoENT commented Jul 18, 2023

Environment details

  • Operating System+version: MacOS 13.4.1
  • Compiler+version: Apple-clang 14.0.3
  • Conan version: 2.0.8
  • Python version: 3.11.4

Steps to reproduce

  1. Create a package that has some option, which is disabled by default.
  2. Create a test_package that requires the original package both as requires and tool_requires, but the tool_requires version should enable the option.
  3. execute conan create . --build missing

The package gets built, and then during the package test phase you get the error that binary is missing for the package with the option enabled (which is true, as we conan created only the version with option=False.

I'd expect that --build missing would also build the original package with option=True and not complain about missing binary.

An example that should reproduce the issue:

package:

class PkgConan(ConanFile):

    options = {
        'some_option': [True, False]
    }
    default_options = {
        'some_option': False
    }

test_package:

class PkgTestConan(ConanFile):

    def requirements(self):
        self.requires(self.tested_reference_str)

    def build_requirements(self):
        self.tool_requires(self.tested_reference_str, options={'some_option': True})

Logs

ERROR: Missing prebuilt package for 'mypkg/1.0.0@nenad/testing'
Check the available packages using 'conan list mypkg/1.0.0@nenad/testing:* -r=remote'
'conan test' tested packages must exist, and '--build' argument is used only for the 'test_package' dependencies, not for the tested dependencies

More Info at 'https://docs.conan.io/2/knowledge/faq.html#error-missing-prebuilt-package'
@DoDoENT
Copy link
Contributor Author

DoDoENT commented Jul 18, 2023

Interestingly, this does not work even if running conan test ./test_package mypkg/1.0.0@nenad/testing --build missing afterward.

@memsharded memsharded self-assigned this Jul 18, 2023
@memsharded
Copy link
Member

Hi @DoDoENT

Thanks for the feedback.

I think this might be a duplicate of #14314

We are checking it, but initially it doesn't seem a bug, but by design. conan create is intended to create 1 package_id, no more. If the test_package is expected to have 2 different binaries for the "tested" package it will not work.

Please, lets follow in #14314, closing this one.

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

2 participants