-
Notifications
You must be signed in to change notification settings - Fork 396
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
iox-#2370 Fix Bzlmod dev_dependency setup #2371
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2371 +/- ##
=======================================
Coverage 78.69% 78.70%
=======================================
Files 440 440
Lines 16981 16981
Branches 2361 2361
=======================================
+ Hits 13364 13365 +1
Misses 2736 2736
+ Partials 881 880 -1
Flags with carried forward coverage won't be shown. Click here to find out more. |
@lalten looks fine. The MinGW CI failure is a flaky test, which we can ignore, but the Ubuntu bazel target fails. I assigned @elBoberido since he may has some more insights here. |
@lalten the bzlmod code came from a community member and I'm not that familiar with the code. Can you specify which public targets are affected by the dev dependencies? |
Buildifier is unconditionally depended on in the root BUILD Line 18 in d628cb7
Lines 61 to 65 in d628cb7
Googletest is depended on in a regular cc_library with public visibility: iceoryx/iceoryx_hoofs/BUILD.bazel Line 107 in d628cb7
|
Okay, the Is there another way to mark this library as a dev dependency but still make it available to users? In the end, I guess it should not matter and as long as one does depend only on e.g. |
dev dependencies can not be depended on outside the root module, i.e. as soon as iceoryx is used as Bzlmod dependency of another project (which of course is the intended use case), dev dependencies are not there anymore. See https://bazel.build/rules/lib/globals/module#parameters_1
|
Looks like the buildifier usage is actually ok, here is another repo with the same setup: |
🤷 ❯ cat MODULE.bazel
module(name = "test")
bazel_dep(name = "org_eclipse_iceoryx")
git_override(
module_name = "org_eclipse_iceoryx",
commit = "d628cb7111051ae1cd27620d9a621a366d5cac82",
remote = "https://github.com/eclipse-iceoryx/iceoryx",
)
❯ bazel build @org_eclipse_iceoryx//:iceoryx_binding_c
WARNING: Target pattern parsing failed.
ERROR: Skipping '@org_eclipse_iceoryx//:iceoryx_binding_c': error loading package '@@org_eclipse_iceoryx~//': Unable to find package for @@[unknown repo 'buildifier_prebuilt' requested from @@org_eclipse_iceoryx~]//:rules.bzl: The repository '@@[unknown repo 'buildifier_prebuilt' requested from @@org_eclipse_iceoryx~]' could not be resolved: No repository visible as '@buildifier_prebuilt' from repository '@@org_eclipse_iceoryx~'.
ERROR: error loading package '@@org_eclipse_iceoryx~//': Unable to find package for @@[unknown repo 'buildifier_prebuilt' requested from @@org_eclipse_iceoryx~]//:rules.bzl: The repository '@@[unknown repo 'buildifier_prebuilt' requested from @@org_eclipse_iceoryx~]' could not be resolved: No repository visible as '@buildifier_prebuilt' from repository '@@org_eclipse_iceoryx~'.
INFO: Elapsed time: 1.897s
INFO: 0 processes.
ERROR: Build did NOT complete successfully |
Okay, this is weird. Why should the Do you have time to check it there is an obvious flaw in the bzlmod setup? |
Notes for Reviewer
Fix Bzlmod dev_dependency setup
Pre-Review Checklist for the PR Author
iox-123-this-is-a-branch
)iox-#123 commit text
)task-list-completed
)Checklist for the PR Reviewer
iceoryx_hoofs
have been added to./clang-tidy-diff-scans.txt
Post-review Checklist for the PR Author
References