https://kotlinlang.org logo
Title
j

James Richardson

09/20/2019, 5:21 PM
Is anybody using bazel to compile kotlin in a real world production environment. I have tried a couple of times. It seems to basically not work, except for toy demos. Am I missing something? It would be great to hear of real life projects. Do you have to maintain your own rulesets?
c

changd

09/20/2019, 5:28 PM
There's a BazelBuild Slack and a #kotlin channel there it seems like @christiangruber's fork will be upstreamed to Google's rule set until they can open source it. I think Square and Lyft (besides G) are one of the few that companies that I know of that have Kotlin code bases and are migrating to Bazel I'm starting to evaluate Bazel for Dropbox starting Q4 (all of our new code is written in Kotin, but a majority of our code is still in Java)
t

tipsy

09/21/2019, 7:52 AM
my company is, sadly
we currently maintain our own ruleset, but very few people in the company are comfortable with bazel
one of my team members specifically mentioned bazel as something ruining his mood in our retrospective this sprint
it does "work" though, bazel itself is okay-ish, but the intellij plugin isn't very good
c

changd

09/21/2019, 11:12 PM
Do you happen to have a laundry list of what makes the plug-in not great? Or what about bazel is affecting your team members mood;
t

tipsy

09/22/2019, 8:26 AM
bazel is changing fast, so some of these complaints might be outdated (or they might be our own fault for not configuring bazel correctly), but here goes - the plugin usually doens't work with the latest version of intellij, so you have to stay a couple of versions behind - the plugin doesn't resolve dependencies properly, so when you do a full sync some external dependencies show up as missing. we currently solve this by commenting out the dependencies in our build file, syncing, and commenting them back in. we have no idea why it happens or why this "fix" works - there's no way to pass environment variables (neither from intellij nor command line) - projects don't run from the project root, they run from the bazel server, which makes some references to local files break (files used for local development) - it's hard to add dependencies. before they introduced maven_rules we had our own tool written in golang which would add all transitive dependencies (we've mostly gotten rid of that now though...) - need to manually write run configs in intellij - we haven't found any way to run single tests from intellij - restarting a project is very slow compared to maven - when navigating web projects, intellij includes the built copy as a source, so you have to choose the correct one (i actually remember fixing this by adding a exlusion manually, but it's currently bothering me in one project where i forgot to do that). we recently had one engineer quit, and bazel was mentioned as a contributing factor (a minor one, but that's still pretty bad). i've been using maven for ten years and i've never really had any issues with. sometimes you get a dependency conflict and you have to specify a version explicity, but that's really it. everything else just work. there's nothing really wrong or bad about bazel, it's sort of a death by a thousand cuts situation. it feels bad to have to fight your build tool all the time. i usually stay out of the monorepo at work, so other people probably have more complaints than this.
we've been using it for ~1.5 years now, i think