-
Notifications
You must be signed in to change notification settings - Fork 314
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
feat(package-manager): Add initial support for Bazel #8409
Conversation
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Fixed
Show fixed
Hide fixed
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Fixed
Show fixed
Hide fixed
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Fixed
Show fixed
Hide fixed
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Fixed
Show fixed
Hide fixed
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Fixed
Show fixed
Hide fixed
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Fixed
Show fixed
Hide fixed
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Fixed
Show fixed
Hide fixed
clients/bazel-module-registry/src/funTest/kotlin/BazelModuleRegistryServiceFunTest.kt
Fixed
Show fixed
Hide fixed
clients/bazel-module-registry/src/funTest/kotlin/BazelModuleRegistryServiceFunTest.kt
Fixed
Show fixed
Hide fixed
clients/bazel-module-registry/src/funTest/kotlin/BazelModuleRegistryServiceFunTest.kt
Fixed
Show resolved
Hide resolved
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Outdated
Show resolved
Hide resolved
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Outdated
Show resolved
Hide resolved
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Outdated
Show resolved
Hide resolved
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Outdated
Show resolved
Hide resolved
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Outdated
Show resolved
Hide resolved
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryService.kt
Outdated
Show resolved
Hide resolved
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.
I haven't looked at the code, but please also add an entry to the package manager list in website/docs/tools/advisor.md
and mention the limitations / mark it as experimental.
...agers/bazel/src/funTest/assets/projects/synthetic/bzlmod-cc-has-lockfile-expected-output.yml
Outdated
Show resolved
Hide resolved
@haikoschol that should say |
626067b
to
cb5d40d
Compare
clients/bazel-module-registry/src/funTest/kotlin/BazelModuleRegistryClientFunTest.kt
Outdated
Show resolved
Hide resolved
...nagers/bazel/src/funTest/assets/projects/synthetic/bzlmod-cc-no-lockfile-expected-output.yml
Outdated
Show resolved
Hide resolved
plugins/package-managers/bazel/src/funTest/kotlin/BazelFunTest.kt
Outdated
Show resolved
Hide resolved
plugins/package-managers/bazel/src/funTest/kotlin/BazelFunTest.kt
Outdated
Show resolved
Hide resolved
plugins/package-managers/bazel/src/funTest/kotlin/BazelFunTest.kt
Outdated
Show resolved
Hide resolved
I realized that I added a quick & dirty way to install Bazel in the Dockerfile for testing purposes. I removed that from the latest commit on this branch and am currently working on adding it "properly" in a subsequent commit. edit: Since the PR is not ready to merge from my side until Bazel is added in Docker, I converted it to a draft. |
46ee3fa
to
f81c719
Compare
I have no idea why this markdown-links check thinks https://bazel.build/ is a dead link. |
6c0275f
to
e6d6150
Compare
I made the egregious mistake of assuming the "update branch" button would do the right thing. Instead it introduced a merge commit, which AFAIK is extremely verboten in ORT. How do I fix this? |
Exactly! 👮🏻♂️ 😆
Well, your local branch should still have your latest changes, so just force-push that to the remote branch for this PR. Afterwards, you can either click on "Update with rebase" from the drop-down, or just rebase locally and force-push once more. |
583359a
to
4686f39
Compare
e991237
to
09039c1
Compare
clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryClient.kt
Show resolved
Hide resolved
I could probably find a couple of more nits, but I propose to draw a line here and merge it, once my last remaining open comments are addressed. (Some nits can still be fixed in future iterations) Is this ok with you as well @sschuberth @mnonnenmacher ? |
@@ -403,6 +403,25 @@ RUN mkdir -p $DOTNET_HOME/bin \ | |||
FROM scratch AS dotnet | |||
COPY --from=dotnetbuild /opt/dotnet /opt/dotnet | |||
|
|||
#------------------------------------------------------------------------ |
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.
@sschuberth @mnonnenmacher do we still use the "legacy" Docker? (Should we update that one as well)
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's e.g. used as part of the Jenkinsfile
.
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.
So, Dockerfile-legacy
should be updated in this PR / commit as well ?!
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.
Ideally, yes. But going forward I'd like to avoid the need to maintain Dockerfile-legacy
in addition to Dockerfile
, and I hope @mnonnenmacher's Docker experiments to be the basis for such a change.
That said, I'm not sure whether it's worth to put effort into maintaining Dockerfile-legacy
just now, as part of this initial implementation. I'd also be fine either adding Bazel support to Dockerfile-legacy
later, or replacing the whole Docker stuff with a more streamlined solution, whatever comes first.
# BAZEL | ||
FROM base as bazelbuild | ||
|
||
ARG BAZEL_VERSION=7.0.1 |
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.
We have that .versions
file. I believe that BAZEL_VERSION
needs to go there as well, but not sure if this should be done in this commit, or in the following one.
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.
@heliocastro would you review the docker related bits as well, I guess you know this .versions
mechanism ;-)
909d3b9
to
85794f3
Compare
I first wanted the discussion between you and @haikoschol to settle down, but now that it comes to an end, I'd like to do a brief review myself, too. But please approve nonetheless if you're happy. As auto-merge is not on, we can have more reviews after that. |
Kotlin wise, it LGTM I agree with merge. Not approving now as there are open comments regarding the Docker bits. You may however start yourself already reviewing the Kotlin bits (I won't request further change on Kotlin side here). |
@haikoschol, |
Regarding the failing |
Apparently |
@fviernau suggested to move the Docker changes to a separate PR that gets merged before. Should I give that a go? |
If I can verify that funTest pass locally for me, I'd be fine with keeping things as-is. But I did not yet find the time to test, nor for a code review. I'll try today. |
The PR for fixing the race condition on funtest Docker is almost done, but the tests need be done in my private repo to avoid polute ort registry, since it involves upload docker images and version matching |
A Bazel module registry, such as https://bcr.bazel.build, is used to store metadata of dependencies managed by bzlmod. Signed-off-by: Haiko Schol <[email protected]>
This starts the work on issue oss-review-toolkit#264. Signed-off-by: Haiko Schol <[email protected]>
Signed-off-by: Haiko Schol <[email protected]>
Signed-off-by: Haiko Schol <[email protected]>
This PR introduces a very limited Analyzer plugin for the Bazel build system. It only covers projects that use bzlmod for managing dependencies. Therefore it expects Bazel 7.0 or later, where bzlmod is the default.
So far the implementation has only been tested with a small toy example project.
A few things that are not covered, which very likely need to be added in subsequent iterations are: