'bazel version' not displaying the actual version

979 views
Skip to first unread message

James DeMichele

unread,
Sep 21, 2016, 12:22:15 PM9/21/16
to bazel-discuss
Hello, I have installed bazel a few different ways on linux (apt, installer script, and even the .deb). However, when I run bazel version......it does not print the version label. Does anyone know why that's the case and how I can get it to show up?

foo:/ $ bazel version
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Jan 01 00:00:00 1970 (0)
Build timestamp: Thu Jan 01 00:00:00 1970 (0)
Build timestamp as int: 0

Any help or guidance would be greatly appreciated. Thanks.

Austin Schuh

unread,
Sep 21, 2016, 12:25:47 PM9/21/16
to James DeMichele, bazel-discuss
How are you building it?

I see 2 things wrong with the bazel you built here.  It was built with -c fastbuild rather than -c opt, and it wasn't built with --stamp=yes.

If you enable stamping when the binary is built, you will get the date stamped in.  Otherwise, the date is set to 0 to get a reproducible build output.

Austin

--
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/20fdbb42-f180-4068-8cfd-d694cc18f7b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James DeMichele

unread,
Sep 21, 2016, 12:27:45 PM9/21/16
to Austin Schuh, bazel-discuss
Hey Austin, thanks for the quick reply!

No, I am not building it. I grabbed this .deb file most recently and installed via dpkg https://github.com/bazelbuild/bazel/releases/download/0.3.1/bazel_0.3.1-linux-x86_64.deb

So I don't think I'm doing anything special at all. 

-Jamie

On Wed, Sep 21, 2016 at 11:25 AM, Austin Schuh <austin...@gmail.com> wrote:
How are you building it?

I see 2 things wrong with the bazel you built here.  It was built with -c fastbuild rather than -c opt, and it wasn't built with --stamp=yes.

If you enable stamping when the binary is built, you will get the date stamped in.  Otherwise, the date is set to 0 to get a reproducible build output.

Austin

On Wed, Sep 21, 2016 at 9:22 AM James DeMichele <james.d...@redfin.com> wrote:
Hello, I have installed bazel a few different ways on linux (apt, installer script, and even the .deb). However, when I run bazel version......it does not print the version label. Does anyone know why that's the case and how I can get it to show up?

foo:/ $ bazel version
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Jan 01 00:00:00 1970 (0)
Build timestamp: Thu Jan 01 00:00:00 1970 (0)
Build timestamp as int: 0

Any help or guidance would be greatly appreciated. Thanks.

--
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-discuss+unsubscribe@googlegroups.com.

James DeMichele

unread,
Sep 21, 2016, 12:32:37 PM9/21/16
to Austin Schuh, bazel-discuss
Hmmm. Actually an update on this. I had installed it via .deb and it was working, and then I think I installed it via apt-get by accident after that. I actually think the problem lies in the installation via apt.

I'm going to remove the Bazel distribuition URI I have, and try a clean re-install from the .deb.

-Jamie

Austin Schuh

unread,
Sep 21, 2016, 12:32:54 PM9/21/16
to James DeMichele, bazel-discuss
Ok!  Sounds like the distributed packages aren't built with stamping enabled.  I would consider that a bug.

I dug in a bit more.  It looks like Bazel turned off stamping by default in their repo.  I'm guessing that they built the deploy binaries without any extra flags.

bazel build -c opt src:bazel
$ bazel version
Extracting Bazel installation...
.
Build target: bazel-out/local-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Jan 01 00:00:00 1970 (0)
Build timestamp: Thu Jan 01 00:00:00 1970 (0)
Build timestamp as int: 0


bazel build -c opt src:bazel --stamp=yes

$ bazel version
Extracting Bazel installation...
.
Build label: 
Build target: bazel-out/local-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Sep 21 16:27:25 2016 (1474475245)
Build timestamp: 1474475245
Build timestamp as int: 1474475245

Austin


On Wed, Sep 21, 2016 at 9:27 AM James DeMichele <james.d...@redfin.com> wrote:
Hey Austin, thanks for the quick reply!

No, I am not building it. I grabbed this .deb file most recently and installed via dpkg https://github.com/bazelbuild/bazel/releases/download/0.3.1/bazel_0.3.1-linux-x86_64.deb

So I don't think I'm doing anything special at all. 

-Jamie
On Wed, Sep 21, 2016 at 11:25 AM, Austin Schuh <austin...@gmail.com> wrote:
How are you building it?

I see 2 things wrong with the bazel you built here.  It was built with -c fastbuild rather than -c opt, and it wasn't built with --stamp=yes.

If you enable stamping when the binary is built, you will get the date stamped in.  Otherwise, the date is set to 0 to get a reproducible build output.

Austin

On Wed, Sep 21, 2016 at 9:22 AM James DeMichele <james.d...@redfin.com> wrote:
Hello, I have installed bazel a few different ways on linux (apt, installer script, and even the .deb). However, when I run bazel version......it does not print the version label. Does anyone know why that's the case and how I can get it to show up?

foo:/ $ bazel version
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Jan 01 00:00:00 1970 (0)
Build timestamp: Thu Jan 01 00:00:00 1970 (0)
Build timestamp as int: 0

Any help or guidance would be greatly appreciated. Thanks.

--
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.

--
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/CAOuAOxBEGnrSK64r62Gr8Qij%2B1wsvbvjZM8VpJL_8SC%3D-3caGg%40mail.gmail.com.

James DeMichele

unread,
Sep 21, 2016, 12:39:26 PM9/21/16
to Austin Schuh, bazel-discuss
Yep, looks like the version coming via apt is incorrect. Here's a clean re-install from deb

Build label: 0.3.1
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jul 29 09:09:52 2016 (1469783392)
Build timestamp: 1469783392
Build timestamp as int: 1469783392


Thanks, Austin!

To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.

--
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-discuss+unsubscribe@googlegroups.com.

Austin Schuh

unread,
Sep 21, 2016, 12:39:58 PM9/21/16
to James DeMichele, bazel-discuss
FYI, we build the bazel we release internally with

./compile.sh compile
./output/bazel build //scripts/packages:bazel-debian -c opt --embed_label="${VERSION}" --stamp=yes

If you are setting up something for Redfin, I'd recommend versioning your bazel with your repo by either checking bazel into //tools/bazel or putting a shell script in //tools/bazel which fetches the right version of bazel.

Austin

On Wed, Sep 21, 2016 at 9:32 AM James DeMichele <james.d...@redfin.com> wrote:
Hmmm. Actually an update on this. I had installed it via .deb and it was working, and then I think I installed it via apt-get by accident after that. I actually think the problem lies in the installation via apt.

I'm going to remove the Bazel distribuition URI I have, and try a clean re-install from the .deb.

-Jamie
On Wed, Sep 21, 2016 at 11:27 AM, James DeMichele <james.d...@redfin.com> wrote:
Hey Austin, thanks for the quick reply!

No, I am not building it. I grabbed this .deb file most recently and installed via dpkg https://github.com/bazelbuild/bazel/releases/download/0.3.1/bazel_0.3.1-linux-x86_64.deb

So I don't think I'm doing anything special at all. 

-Jamie
On Wed, Sep 21, 2016 at 11:25 AM, Austin Schuh <austin...@gmail.com> wrote:
How are you building it?

I see 2 things wrong with the bazel you built here.  It was built with -c fastbuild rather than -c opt, and it wasn't built with --stamp=yes.

If you enable stamping when the binary is built, you will get the date stamped in.  Otherwise, the date is set to 0 to get a reproducible build output.

Austin

On Wed, Sep 21, 2016 at 9:22 AM James DeMichele <james.d...@redfin.com> wrote:
Hello, I have installed bazel a few different ways on linux (apt, installer script, and even the .deb). However, when I run bazel version......it does not print the version label. Does anyone know why that's the case and how I can get it to show up?

foo:/ $ bazel version
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Jan 01 00:00:00 1970 (0)
Build timestamp: Thu Jan 01 00:00:00 1970 (0)
Build timestamp as int: 0

Any help or guidance would be greatly appreciated. Thanks.

--
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.

Kristina Chodorow

unread,
Sep 21, 2016, 12:42:29 PM9/21/16
to Austin Schuh, James DeMichele, bazel-discuss
Btw, this is a known bug with the debian package: https://github.com/bazelbuild/bazel/issues/1770.

Austin


To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.

--
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-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CABsbf%3DGP4CJALW%2BXwkkNjG3qiBOQP4imU%2BojPKECoqKq-QRR6g%40mail.gmail.com.

James DeMichele

unread,
Sep 21, 2016, 12:47:21 PM9/21/16
to Kristina Chodorow, Austin Schuh, bazel-discuss
Thanks. Note to self, search issues first........................
Reply all
Reply to author
Forward
0 new messages