-
Notifications
You must be signed in to change notification settings - Fork 991
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
[bugfix] BazelDeps in the build context #16025
[bugfix] BazelDeps in the build context #16025
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it seems that BazelDeps is already doing the right thing:
for require, dep in list(host_req.items()) + list(build_req.items()) + list(test_req.items()):
# Require is not used at the moment, but its information could be used,
# and will be used in Conan 2.0
# Filter the build_requires not activated with self.build_context_activated
if require.build and dep.ref.name not in build_context_activated:
continue
yield require, dep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ErniGH Tests looks great 👏 I'd like to clarify doubts before merging this.
tc.build_context_activated = ["wayland", "dep"] | ||
tc.generate() | ||
def build(self): | ||
context = "build-" if self.context == "build" else "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@memsharded The context is always build
(just checked putting an assert in this build step). Is that expected? I guess YES because the graph calculated looks like this:
======== Computing dependency graph ========
Graph root
conanfile.py: /private/var/folders/s8/zgn806y90xq7bdh64hhfw9th0000gr/T/tmpy1s2giudconans/path with spaces/app/conanfile.py
Build requirements
dep/1.0#3a30dfa1bc966c78af6678a6375744ac - Cache
tool/1.0#3e589dc662831acefe3409d0cada984a - Cache
wayland/1.0#7d0d2121157a6bacdeb022a5f85214dc - Cache
======== Computing necessary packages ========
Build requirements
dep/1.0#3a30dfa1bc966c78af6678a6375744ac:da39a3ee5e6b4b0d3255bfef95601890afd80709 - Build
tool/1.0#3e589dc662831acefe3409d0cada984a:6e8233b34cdad3c0e85d07cf9e18ae9291726bd1 - Build
wayland/1.0#7d0d2121157a6bacdeb022a5f85214dc:abfcc78fa8242cabcd1e3d92896aa24808c789a3 - Build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might be a copy&paste from other test in which it is also a host requirement
* feat add test to bazeldeps * Fixed several bugs. Improved tests coverage * Reverted * Better name --------- Co-authored-by: Francisco Ramirez de Anton <franchuti688@gmail.com>
* wip * wip * wip * Test for BazelDeps in the build context (#16025) * feat add test to bazeldeps * Fixed several bugs. Improved tests coverage * Reverted * Better name --------- Co-authored-by: Francisco Ramirez de Anton <franchuti688@gmail.com> * copy only if different (#16031) * allow conf in exports-sources and export (#16034) * refactor apple_min_version_flag() (#16017) * refactor apple_min_version_flag() * Refactored all the apple module and where it was being used (AutotoolsToolchain and MesonToolchain for now) * Fixed bad return * Fixing tests * Keeping legacy behavior in apple_min_version_flag function * Preventing possible breaking change --------- Co-authored-by: Francisco Ramirez de Anton <franchuti688@gmail.com> * Allow to unhide git url (#16038) * Add hide_url tests for git scm tool * Add hide_url flag to clone and fetch_commit. Resolves #15684 * Update conans/test/functional/tools/scm/test_git.py * Update conans/test/functional/tools/scm/test_git.py --------- Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es> * wip * wip * wip * fix * Update conan/tools/build/cstd.py Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es> * Update conan/tools/build/cstd.py Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es> * Update conan/tools/build/cstd.py Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es> --------- Co-authored-by: Ernesto de Gracia Herranz <vivalaburocracia@hotmail.com> Co-authored-by: Francisco Ramirez de Anton <franchuti688@gmail.com> Co-authored-by: Sebastian Höffner <info@sebastian-hoeffner.de> Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
Changelog: Bugfix:
BazelDeps
now uses therequirement.build
property instead ofdependency.context
one.Docs: Omit
Closes: #15764
Based on the tests that were done in the issue: #15763