Re: [bazel-discuss] Question about Bazel build output

105 views
Skip to first unread message
Message has been deleted

Filip Filmar

unread,
Mar 19, 2023, 2:34:28 PM3/19/23
to ujjain bana, bazel-discuss
Frankly, you might want to explain what you are trying to do that makes you need to know this.

I would think that in most cases you shouldn't care about where your artifacts come from.
If you do care, you must be trying to do something very special, so it might be useful to know what it is.

F


On Sun, Mar 19, 2023 at 11:28 AM ujjain bana <ujjainb...@gmail.com> wrote:

I am writing to ask a question about using Bazel 6.0.0 to build a monorepo.

Specifically, I am running the command bazel build //... to build all targets at once. While this command successfully builds all targets, I am having difficulty determining which targets were rebuilt and which were retrieved from the cache.

I have tried multiple options available in the output command, but I have not found a concrete solution. I know that Bazel must know which targets were affected and rebuilt during the build process. Is there a way to access this information in the output logs?

Any guidance you could provide on this issue would be greatly appreciated. Thank you for your time and assistance.

--
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/84976c4b-5184-4960-b49c-9bf7ab31c62fn%40googlegroups.com.

ujjain bana

unread,
Mar 19, 2023, 2:38:11 PM3/19/23
to Filip Filmar, bazel-discuss
Actually we will be creating docker images for each package and will be pushing it to some registry.

So, we wouldn’t want to push image which haven’t changed yet.

Cristian Falcas

unread,
Mar 19, 2023, 4:42:43 PM3/19/23
to ujjain bana, Filip Filmar, bazel-discuss
I wouldn't put too much effort into this, since docker doesn't push already existing layers again.
So if the image doesn't change, it will just be a check on upstream repo


ujjain bana

unread,
Mar 19, 2023, 5:09:09 PM3/19/23
to Cristian Falcas, Filip Filmar, bazel-discuss
Cristian - Is it not possible with bazel itself?

Cristian Falcas

unread,
Mar 19, 2023, 5:41:04 PM3/19/23
to ujjain bana, Filip Filmar, bazel-discuss
Bazel does the same thing, it will not push the same layer again.

So if nothing changes, a container_push target will return very fast. It will still need remote access, tho.

ujjain bana

unread,
Mar 19, 2023, 5:44:49 PM3/19/23
to Cristian Falcas, Filip Filmar, bazel-discuss
Thanks cristian,

One more thing, how this is handled for binary/tar targets? 
Lets say i want to push them to any remote location? 

Daniel Wagner-Hall

unread,
Mar 20, 2023, 6:27:00 AM3/20/23
to ujjain bana, bazel-discuss
There’s a tool called Target Determinator (https://github.com/bazel-contrib/target-determinator) and a few others (https://github.com/Tinder/bazel-diff and https://github.com/ewhauser/bazel-differ which aim to be faster but less accurate) which will tell you which targets may have changed (e.g. if you just change some Java code it’ll tell you that your Go tests didn’t change) through graph analysis. But they are based on which inputs changed, not which outputs, so if e.g. a comment changed and the output binaries are the same, they won’t identify that.
Reply all
Reply to author
Forward
0 new messages