Skip to content

ulysses4ever/bazel-user-settings-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is to show a bug in Bazel's (recently added) ability to employ user-defined build flags.

The minimal working setup

If you do:

bazel clean && bazel build //:my_drink

it will print:

DEBUG: .../rules.bzl:7:9: Get the default (False)

In contrast, if you do

bazel clean && bazel build //:my_drink --//:favorite_flavor=True

it will print:

DEBUG: .../rules.bzl:5:9: Get the opposite of default (True)

The bug (branch: bug)

Same code, except using workspace prefix for referencing the build-sertting target. Both commands listed above yield the same result:

DEBUG: .../rules.bzl:7:9: Get the default (False)

That is, the flag set in the command-line has no effect. It might make sense to modify the command to use the workspace prefix too:

bazel clean && bazel build //:my_drink --@bsws//:favorite_flavor=True

Unfortunately (and surpriingly) this yields:

ERROR: Unrecognized option: --@bsws//:favorite_flavor=True

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages