-
The query language parses
deps(//foo)
asdeps(WORD)
-
review of
WORD
: https://bazel.build/query/language#expressions -
deps(//label with spaces)
doesn't parse because//label with spaces
isn't aWORD
-
Quotes can solve this. From https://bazel.build/query/language#kind :
Quotation of the pattern argument is often required because without it, many regular expressions, such as source file and .*_test, are not considered words by the parser.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@bazel_skylib//rules:common_settings.bzl", "string_flag") | |
string_flag( | |
name = "my_flag", | |
build_setting_default = "", | |
) | |
config_setting( | |
name = "apple", | |
flag_values = {":my_flag": "apple"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Tests stripping config prefixes from output paths for better caching. | |
# | |
# What is this? | |
# ------------------- | |
# Output paths are the paths of files created in a build. For example: | |
# "blaze-out/k8-fastbuild/bin/myproj/my.output". | |
# | |
# The config prefix is the "/k8-fastbuild/" part. That includes the CPU and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@bazel_skylib/rules:common_settings.bzl", "string_flag") | |
load("test.bzl", "test_rule") | |
string_flag( | |
name = "myflag", | |
build_setting_default = "a", | |
) | |
test_rule(name = "test") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@bazel_skylib//rules:common_settings.bzl", "string_list_flag") | |
load("test.bzl", "test_rule") | |
string_list_flag( | |
name = "string_list_flag", | |
build_setting_default = ["default_orig"], | |
) | |
test_rule( | |
name = "test", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load(":defs.bzl", "my_rule", "my_toolchain") | |
# Declare a constraint value and an alias to it. | |
constraint_setting(name = "test_setting") | |
constraint_value( | |
name = "actual_constraint", | |
constraint_setting = ":test_setting", | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat flagtest/defs.bzl | |
def _transition_impl(settings, attr): | |
return {"//flagtest:other": "b"} | |
_transition = transition( | |
implementation = _transition_impl, | |
inputs = [], | |
outputs = ["//flagtest:other"], | |
) |