You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.
Bazel is fantastic and I am very happy with the characteristics of our Build. I am writing quite complex rules for our build now as we have specific packaging and launch requirements.
The tooling in this repo works fine for well defined workspaces with a few top level entries. I started our port to Bazel using the tooling here and quickly gave up.
To give you some scope -- at the moment I have partially ported our Java codebase to Bazel. I have 250 ~ external jars. There are a lot of dependencies which have huge transitive chains and conflicting common dependencies -- For example: Jersey, Spring-Data-JPA. Soon I need to update some of these dependencies and I can't see how I would realistically do that with the rules here.
To port our repo I took the approach of writing a shell script for the tooling here and then adding the dependencies incrementally. Each new dependency increased the cycle time. It was unbearable by the 10th or so dependency.
The transitive rule / macro provided is a non starter for a large project as well.
A dedicated dependency resolver: the rules above use Gradle (which uses Ivy I think).
Something serving as a lock file: The rules above spit out the transitive closure of the dependencies which have to be pasted back into the rules.
The approach isn't perfect as I still need to clutter my workspace with boilerplate, and I need to manually paste the transitive block in.
The Kubernetes project -- a go project uses the two elements above as well. The vendored dependencies are managed by dep and thus a lock file. And dep serves as a fast resolver.
It would be great to have a tool like the go dep tool, something that calculates a transitive dependency block and locks it and a file format that Bazel core understands.
The text was updated successfully, but these errors were encountered:
@hsyed, thanks for your feedback. I'm not sure what you mean when you talk about a lock file - can you elaborate how that'd work? If it needs Bazel support, then we'll also need to file a feature request over in the Bazel issue tracker...
@ulfjack sorry for the delay I missed your comment.
I've created an issue on pubref/rules_maven to bridge them in.
Currently the pubref/rules_maven work as follows:
Express dependencies in a rule. Pubref then uses Gradle to Resolve all the transitive dependencies. It generates a list of the dependencies with SHA hashes in a external workspace (W1). The transitive block has to be pasted back into the rule.
W1 contains compile rules for the Gradle configurations. These need to be loaded back into the workspace.
The approach works well but it is still inconvenient to modularise the dependencies. One thing that would help is support for load in macros. I added my 2cp to this issue in bazel core.
A lock file in this case not only locks the dependency stack of a workspace but Bazel core should load the file and setup the external workspace targets. The means thats once we have a lock file setup we don't need any external tooling.
Bazel core does not handle dependency resolution and does not need to be involved in the generation of the lock file (separate tool). The pubref rules work great for now. Perhaps in the future an ivy resolver can be build into Bazel core.
Bazel core supports this file format it sets up a java_library for each configuration. For k8sclient it would generate the targets @k8sclient//:compile.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bazel is fantastic and I am very happy with the characteristics of our Build. I am writing quite complex rules for our build now as we have specific packaging and launch requirements.
The tooling in this repo works fine for well defined workspaces with a few top level entries. I started our port to Bazel using the tooling here and quickly gave up.
To give you some scope -- at the moment I have partially ported our Java codebase to Bazel. I have 250 ~ external jars. There are a lot of dependencies which have huge transitive chains and conflicting common dependencies -- For example: Jersey, Spring-Data-JPA. Soon I need to update some of these dependencies and I can't see how I would realistically do that with the rules here.
To port our repo I took the approach of writing a shell script for the tooling here and then adding the dependencies incrementally. Each new dependency increased the cycle time. It was unbearable by the 10th or so dependency.
The transitive rule / macro provided is a non starter for a large project as well.
I ended up usingthese rules.
The following elements are key I think:
The approach isn't perfect as I still need to clutter my workspace with boilerplate, and I need to manually paste the transitive block in.
The Kubernetes project -- a go project uses the two elements above as well. The vendored dependencies are managed by dep and thus a lock file. And dep serves as a fast resolver.
It would be great to have a tool like the go dep tool, something that calculates a transitive dependency block and locks it and a file format that Bazel core understands.
The text was updated successfully, but these errors were encountered: