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

Feature/build compatibles #16871

Merged
merged 20 commits into from
Sep 24, 2024
Merged

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Aug 25, 2024

Changelog: Feature: Allow building a compatible package still of the current profile one.
Docs: Omit

Lets keep this not documented at the moment, as there is a gap in conan graph build-order

Close #16148
Close #14291

@memsharded
Copy link
Member Author

@czoido @franramirez688 @AbrilRBS

This PR contains both the feature + some necessary refactors to support the feature.

I have done the refactor in its own PR to simplify the review, please check it first before reviewing this one: #16919

@memsharded memsharded added this to the 2.8.0 milestone Sep 3, 2024
@memsharded memsharded marked this pull request as ready for review September 3, 2024 16:25
Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

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

This is awesome! Some comments about user feedback

conans/client/graph/graph_binaries.py Outdated Show resolved Hide resolved
conans/client/graph/graph_binaries.py Show resolved Hide resolved
Copy link
Member Author

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

What would be the behavior if some users define some compatibility.py for different compiler versions? Some might be ok and might work, like VS, but using a different gcc version for a dependency build might be challenging, Conan does not configure the environment different for different compiler versions, so it will use the compiler.version=<compatible-one> as setting, but it will still use the current environment configuration and fail?

@@ -79,6 +70,15 @@ def compute_package_id(node, new_config, config_version):

def run_validate_package_id(conanfile):
# IMPORTANT: This validation code must run before calling info.package_id(), to mark "invalid"
if hasattr(conanfile, "validate_build"):
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the main thing that could accidentally break something.
Previously, the validate_build() only ran for the main requested configuration. Now it is going to run for the compatible configurations, if there is some config that makes it fail other than ConanInvalidConfiguration, something might break. I think this is unlikely and we can go with this, but not impossible, but we can learn the reasons if it happens to break.

conans/client/graph/graph_binaries.py Show resolved Hide resolved
Copy link
Contributor

@franramirez688 franramirez688 left a comment

Choose a reason for hiding this comment

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

It looks great!

test/integration/package_id/compatible_test.py Outdated Show resolved Hide resolved
test/integration/package_id/compatible_test.py Outdated Show resolved Hide resolved
Co-authored-by: Francisco Ramírez <franchuti688@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants