salesforce / rules_spring

Bazel rule for building Spring Boot apps as a deployable jar
BSD 3-Clause "New" or "Revised" License
224 stars 48 forks source link

ibazel run doesn't work, beginning with v2.1.0 #143

Open drmercer-lucid opened 2 years ago

drmercer-lucid commented 2 years ago

Hi team,

We have a Spring server built using bazel, and we use ibazel for local development. ibazel run //atlassian-embed should run the Spring server and automatically restart when any of the source files change. This was working great on rules_spring 2.0.0, but after upgrading to 2.1.0 or higher, ibazel run fails with these errors:

[bazel-bin]/atlassian-embed/atlassian-embed_deploy: 8: Bad substitution
[bazel-bin]/atlassian-embed/atlassian-embed_deploy: 11: source: not found

(Where [bazel-bin] is the full path of the bazel-bin dir.) Looking at the release notes for 2.1.0, I see some changes were made around the run script; I'll look into those and see if I can find a fix, but figured it'd be worth opening this anyway in case anyone else runs into this issue.

plaird commented 2 years ago

As a workaround, it may be helpful to use the custom launcher script option: https://github.com/salesforce/rules_spring/blob/master/springboot/bazelrun.md#custom-launcher-script

until we resolve this (which appears to be a variant of #110 as you mentioned).

drmercer-lucid commented 2 years ago

As a workaround, it may be helpful to use the custom launcher script option:

Unfortunately, this failure seems to happen in the script that launches the (possibly custom) launcher script. This is the source of the script that's failing (the atlassian-embed_deploy script in the error above):

https://github.com/salesforce/rules_spring/blob/21aa5bc0f376d1703bd29becd11f83f166864b9e/springboot/springboot.bzl#L154-L172

I've worked around this by just downgrading to 2.0.0, so this isn't urgent. :slightly_smiling_face: Just something that ideally would be fixed so we can upgrade without losing ibazel. I'll take a stab at debugging it myself with a local clone of rules_spring, if I have time.