How is stamp implemented by bazel?

761 views
Skip to first unread message

Ming Zhao

unread,
Apr 2, 2015, 3:49:21 PM4/2/15
to bazel-...@googlegroups.com
--[no]stamp (a boolean; default: "true")
Stamp binaries with the date, username, hostname, workspace information,
etc.

What's implication for the binary? If there any document describing
any placeholder the binary should leave so bazel can inject the right
information?

Thiago Farina

unread,
Apr 2, 2015, 6:09:01 PM4/2/15
to Ming Zhao, bazel-...@googlegroups.com


On Thursday, April 2, 2015, Ming Zhao <ming...@gmail.com> wrote:
  --[no]stamp (a boolean; default: "true")
    Stamp binaries with the date, username, hostname, workspace information,
    etc.

Well, I don't know if that feature is implemented in Bazel, but I read on Mike Bland's port something that might be related. Since that post is public, search for Sponge in your favorite search engine and you will see the relationship.


--
Thiago Farina

Ming Zhao

unread,
Apr 2, 2015, 9:52:25 PM4/2/15
to Thiago Farina, bazel-...@googlegroups.com
I thought this feature was about adding client and changelist related
information so it can be output as part of --version or /statusz.

I don't think this is about streaming build/test results to sponge.
But I might be wrong.

Ulf Adams

unread,
Apr 3, 2015, 8:52:34 AM4/3/15
to Ming Zhao, Thiago Farina, bazel-...@googlegroups.com
Each rule can observe the stamp flag and add stamp information to its output. I think we don't currently have a way to get stamp information from the client, but everything else should be wired up, at least for java_binary and cc_binary. (It will be much easier to do when we finally have the tests out.)

--
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 post to this group, send email to bazel-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAN0GiO0p9nNrRJEQFgh79uYP%3Ddo54xGeH2Rho-c7i73%2BEYi%3DQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ming Zhao

unread,
Apr 3, 2015, 9:14:38 PM4/3/15
to Ulf Adams, Thiago Farina, bazel-...@googlegroups.com
So I dig the code a little bit, after reading CcLibrary.java's code, I
guess "linkstamp" is the option to specify some genrule target to
create some ephemeral file to create link stamp, but then I got this
exception:

Unhandled exception thrown during build; message: Unrecoverable error
while evaluating node 'CONFIGURED_TARGET://examples:hello
local_linux-fastbuild-5a18746e823ad64d88efb5add1d017bc' (requested by
nodes )
INFO: Elapsed time: 0.441s
java.lang.RuntimeException: Unrecoverable error while evaluating node
'CONFIGURED_TARGET://examples:hello
local_linux-fastbuild-5a18746e823ad64d88efb5add1d017bc' (requested by
nodes )
at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:918)
at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$1.run(AbstractQueueVisitor.java:346)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.google.devtools.build.lib.analysis.CachingAnalysisEnvironment.getBuildInfo(CachingAnalysisEnvironment.java:293)
at com.google.devtools.build.lib.rules.cpp.CppLinkAction$Builder.build(CppLinkAction.java:619)
at com.google.devtools.build.lib.rules.cpp.CcBinary.init(CcBinary.java:228)
at com.google.devtools.build.lib.rules.cpp.CcBinary.create(CcBinary.java:151)
at com.google.devtools.build.lib.rules.cpp.CcBinary.create(CcBinary.java:66)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:236)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:163)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:400)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:482)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:173)
at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:879)
... 4 more

Ulf Adams

unread,
Apr 7, 2015, 7:34:52 AM4/7/15
to Ming Zhao, Thiago Farina, bazel-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages