What are the (non-developers) use cases for --upload-tools

Gustavo Niemeyer gustavo.niemeyer at canonical.com
Mon Mar 25 22:14:42 UTC 2013


On Mon, Mar 25, 2013 at 6:50 PM, Tim Penhey <tim.penhey at canonical.com> wrote:
> On 26/03/13 10:14, Gustavo Niemeyer wrote:
>> On Mon, Mar 25, 2013 at 6:04 PM, Tim Penhey <tim.penhey at canonical.com> wrote:
>>>> Imagine you have the whole file #ifdef'd. That's how Go handles it via
>>>> the //build flags.
>>>
>>> Sorry, but this still doesn't answer my question.
>>
>> I can't do better if you give no hints of why this isn't answering
>> your question.
>
> My question was (stated differently):
>
> In go, how do you restrictively build something with tags?
>
> i.e. If we have --tags release, how would a file be included or excluded
> from the build / installed files?

It's automatically done by the go tool. It looks up the //build
comment and excludes/includes the whole file depending on how the
flags provided within the comment match the current build environment.

> How does that impact testing?  As in, how do you test builds both with
> and without the files?

Normal builds and testing both use exactly the same mechanism.

Here is some additional information that may be useful:

http://golang.org/pkg/go/build/#hdr-Build_Constraints
http://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies


gustavo @ http://niemeyer.net



More information about the Juju-dev mailing list