When do Gazelle change "take effect"?

73 views
Skip to first unread message

Hilco Wijbenga

unread,
Feb 15, 2021, 10:58:04 PM2/15/21
to Bazel Discuss
Hi all,

I've been wondering whether Gazelle (or similar tools/scripts) are
intended to be run "out of band" or if they can actually be used as a
regular target/dependency?

In other words, when does Bazel notice a new or changed BUILD file?

Cheers,
Hilco

Jay Conrod

unread,
Feb 17, 2021, 10:15:10 AM2/17/21
to Hilco Wijbenga, Bazel Discuss
Changes to BUILD files apply to the next Bazel command that runs.

A command (like Gazelle) started with bazel run can modify BUILD files, but that won't apply to anything that's built as part of that command.

If you're looking for a way to avoid the extra step of running Gazelle, you might find autogazelle interesting: it's a tool that watches for file system changes, then runs Gazelle in modified directories via a script that's triggered by Bazel commands. Autogazelle isn't maintained, and there are a number of open issues, so unfortunately I can't really promise anything other than it might be interesting :)

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAE1pOi1jL0xty9dxRtiRshxqxKrETKFz100zSO18ob4wT2RzjA%40mail.gmail.com.

Hilco Wijbenga

unread,
Feb 17, 2021, 12:27:00 PM2/17/21
to Jay Conrod, Bazel Discuss
Interesting, I was not aware of Autogazelle.

Anyway, we can achieve what we want with a simple wrapper around
Bazel, I would think. I just wanted to make sure I wasn't
misunderstanding how Gazelle was supposed to work.
Reply all
Reply to author
Forward
0 new messages