Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor garden cleanups #63

Merged
merged 10 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions bazel.rc
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ build --force_pic
build --strip=never
build --strict_system_includes
build --workspace_status_command=./bazel/workspace/workspace-status.bash
build --define enable_ifaddrs=true

build --fission=dbg
build --features=per_object_debug_info

test --define enable_ifaddrs=true

# -- Options for explicitly using GCC.
common:gcc --repo_env=CC=gcc
common:gcc --repo_env=CXX=g++
Expand Down
2 changes: 1 addition & 1 deletion example/bazel.repos
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repositories:
msgs:
type: git
url: https://github.com/gazebosim/gz-msgs
version: gz-msgs9
version: mjcarroll/garden_bazel
mjcarroll marked this conversation as resolved.
Show resolved Hide resolved
physics:
type: git
url: https://github.com/gazebosim/gz-physics
Expand Down
2 changes: 1 addition & 1 deletion skylark/cmake_configure_file.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ _cmake_configure_file_gen = rule(
"undefines": attr.string_list(),
"cmakelists": attr.label_list(allow_files = True),
"cmake_configure_file_py": attr.label(
cfg = "host",
cfg = "exec",
executable = True,
default = Label("@gz//bazel/skylark:cmake_configure_file"),
),
Expand Down
2 changes: 1 addition & 1 deletion skylark/gz_configure_file.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ _gz_configure_file_gen = rule(
"undefines": attr.string_list(),
"cmakelists": attr.label_list(allow_files = True),
"gz_configure_file_py": attr.label(
cfg = "host",
cfg = "exec",
executable = True,
default = Label("@gz//bazel/skylark:gz_configure_file"),
),
Expand Down
13 changes: 7 additions & 6 deletions skylark/gz_configure_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,19 @@ def _transform(line, definitions):
blank, maybe01, var, rest, newline = match.groups()
defined = definitions.get(var) is not None
if maybe01:
return blank + '#define ' + var + [' 0', ' 1'][defined] + newline
return blank + '#define ' + str(var) + [' 0', ' 1'][defined] + newline
elif defined:
line = blank + '#define ' + var + rest + newline
line = blank + '#define ' + str(var) + rest + newline
else:
return blank + '/* #undef ' + var + ' */' + newline
return blank + '/* #undef ' + str(var) + ' */' + newline

# Replace variable substitutions.
while True:
match = _varsubst.match(line)
if not match:
break
before, xvarx, after, newline = match.groups()
var = ''
if xvarx[0] == '$':
assert len(xvarx) >= 4
assert xvarx[1] == '{'
Expand All @@ -60,14 +61,15 @@ def _transform(line, definitions):
assert len(xvarx) >= 3
assert xvarx[-1] == '@'
var = xvarx[1:-1]
assert len(var) > 0
assert var

if var not in definitions:
raise KeyError('Missing definition for ' + var)
value = definitions.get(var)

if value is None:
value = ''
line = before + value + after + newline
line = before + str(value) + after + newline

return line

Expand Down Expand Up @@ -189,4 +191,3 @@ def main():

if __name__ == "__main__":
main()

260 changes: 0 additions & 260 deletions skylark/gz_py.bzl

This file was deleted.

14 changes: 0 additions & 14 deletions skylark/py.bzl

This file was deleted.

22 changes: 0 additions & 22 deletions skylark/python_env.bzl

This file was deleted.

5 changes: 4 additions & 1 deletion workspace/workspace-status.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ LIBS=(
plugin
rendering
sensors
sim
tools
transport
utils
sdformat)
sdformat
)

for LIB in "${LIBS[@]}"
do
Expand Down