Skip to content

Commit

Permalink
Update rcfile advice for force_pic and disable it by default
Browse files Browse the repository at this point in the history
While we're here, clean up some other non-functional irregularies:
- Remove irrelevant rules_python flag.
- Use the correct working directory during `bazel version`.
  • Loading branch information
jwnimmer-tri committed Sep 22, 2023
1 parent b5fc71e commit 5744d7f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
9 changes: 5 additions & 4 deletions drake_bazel_external/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# SPDX-License-Identifier: MIT-0

# Disable native Python rules in Bazel versions before 3.0.
build --incompatible_load_python_rules_from_bzl=yes

# Default to an optimized build.
build --compilation_mode=opt

# Default build options.
build --force_pic=yes
build --strip=never

# Default test options.
Expand All @@ -21,6 +17,11 @@ build --host_cxxopt=-std=c++17
# https://github.com/bazelbuild/bazel/issues/1164
build --action_env=CCACHE_DISABLE=1

# For Ubuntu builds, this flag can cut build times in half. For macOS builds,
# this flag might cause build errors. We suggest turning it on if and only if
# your project doesn't use macOS.
## build --force_pic=yes

# TODO(jwnimmer-tri) We should see if we can reuse more of Drake's
# customizations somehow.

Expand Down
10 changes: 5 additions & 5 deletions drake_bazel_installed/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# SPDX-License-Identifier: MIT-0

# Disable native Python rules in Bazel versions before 3.0.
# TODO(jamiesnape): Uncomment the below line when @drake uses @rules_python.
# build --incompatible_load_python_rules_from_bzl=yes

# Default to an optimized build.
build --compilation_mode=opt

# Default build options.
build --force_pic=yes
build --strip=never

# Default test options.
Expand All @@ -22,6 +17,11 @@ build --host_cxxopt=-std=c++17
# https://github.com/bazelbuild/bazel/issues/1164
build --action_env=CCACHE_DISABLE=1

# For Ubuntu builds, this flag can cut build times in half. For macOS builds,
# this flag might cause build errors. We suggest turning it on if and only if
# your project doesn't use macOS.
## build --force_pic=yes

# TODO(jwnimmer-tri) We should see if we can reuse more of Drake's
# customizations somehow.

Expand Down
3 changes: 1 addition & 2 deletions scripts/continuous_integration/common/drake_bazel_external
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

set -euxo pipefail

bazel version

pushd drake_bazel_external

bazel version
bazel test //...

popd
3 changes: 1 addition & 2 deletions scripts/continuous_integration/common/drake_bazel_installed
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

set -euxo pipefail

bazel version

pushd drake_bazel_installed

bazel version
bazel test //...

popd

0 comments on commit 5744d7f

Please sign in to comment.