Skip to content

Commit

Permalink
Remove almost all special casing for ccache
Browse files Browse the repository at this point in the history
Apparently we don't need this anymore?  Perhaps because of our CROSSTOOL
specifying absolute paths, perhaps because action_env=PATH is the default
now.  For unsupported_crosstool, we can use an action_env setting to nerf
ccache entirely.
  • Loading branch information
jwnimmer-tri committed Aug 28, 2017
1 parent 4242eaf commit a5c48a7
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 186 deletions.
12 changes: 0 additions & 12 deletions drake/doc/bazel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ The one-time platform setup is the same as for a CMake build:
- Continue with the *"Mandatory platform specific instructions"* on the same
page.

When using Bazel, be sure that **ccache is not on your default $PATH**, e.g.,
``env | grep ccache`` is empty.

.. _using_bazel:

Developing Drake using Bazel
Expand Down Expand Up @@ -230,12 +227,3 @@ view it, browse to ``drake-distro/bazel-kcov/index.html``.
:hidden:

building_kcov

FAQ
===

Q: What does ``ccache: error: Could not find compiler "gcc" in PATH`` mean?

A: Your ``$PATH`` still has the magic ``ccache`` directory on it somewhere.
Update your dotfiles so that something like ``/usr/lib/ccache`` is not on
your ``$PATH``.
5 changes: 1 addition & 4 deletions drake/doc/clion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ with the environment you actually want!

**Ubuntu users** will generally get good behavior by default, because ``apt``
installs binaries in reasonable, standard paths, and because most CLion launch
mechanisms will have already sourced the ``.bashrc``. Do be careful that
``ccache`` is not on your ``PATH``, though. If you launch CLion with ``ccache``
on your ``PATH``, and then CLion launches a Bazel server, you'll need to quit
CLion, kill the Bazel server, and run ``bazel clean`` to recover.
mechanisms will have already sourced the ``.bashrc``.

**OS X users** will get broken behavior by default. When you run an OS X app
graphically, the parent process is `launchd` (PID 1), which provides its own
Expand Down
48 changes: 0 additions & 48 deletions setup/ubuntu/16.04/ccache-bazel-wrapper-mkdeb.sh

This file was deleted.

39 changes: 0 additions & 39 deletions setup/ubuntu/16.04/ccache-bazel-wrapper.sh

This file was deleted.

10 changes: 4 additions & 6 deletions setup/ubuntu/16.04/install_prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ fi
apt update -y
apt install --no-install-recommends $(tr '\n' ' ' <<EOF
alien
bash-completion
binutils
doxygen
fakeroot
g++
g++-5
g++-5-multilib
Expand Down Expand Up @@ -121,10 +119,10 @@ fi

rm /tmp/bazel_0.5.2-linux-x86_64.deb

# Repair a bad Bazel/ccache interaction.
# See https://github.com/RobotLocomotion/drake/issues/4464.
# See https://github.com/bazelbuild/bazel/issues/1322.
$(dirname $0)/ccache-bazel-wrapper-mkdeb.sh --install
# Remove deb that we used to generate and install, but no longer need.
if [ -L /usr/lib/ccache/bazel ]; then
apt purge ccache-bazel-wrapper
fi

# TODO(david-german-tri): Do we need to munge the MATLAB C++ libraries?
# http://drake.mit.edu/ubuntu.html#matlab
Expand Down
18 changes: 2 additions & 16 deletions tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -207,20 +207,6 @@ cc_toolchain_suite(
},
)

sh_binary(
name = "complain_about_ccache",
srcs = ["complain_about_ccache.sh"],
visibility = ["//visibility:private"],
)

load("//tools:ccache.bzl", "ccache_is_bad")

# This rule will fail loudly if ccache is on the path.
ccache_is_bad(
name = "ccache_is_bad",
visibility = ["//visibility:private"],
)

filegroup(
name = "empty",
srcs = [],
Expand All @@ -229,10 +215,10 @@ filegroup(

# This filegroup contains the files on which every toolchain component should
# always depend, regardless of platform. It is a useful place for the outputs
# of rules that check preconditions for the entire build.
# of rules that check preconditions for the entire build. (At the moment, we
# do not have any such files, although we once did.)
filegroup(
name = "universal_toolchain_deps",
srcs = ["ccache.txt"], # ccache.txt is an output of :ccache_is_bad
visibility = ["//visibility:private"],
)

Expand Down
1 change: 1 addition & 0 deletions tools/bazel.rc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ build:everything --define=WITH_SNOPT=ON
# Use the default Bazel-generated CROSSTOOL.
# This may be useful for developers with unsupported workstation configurations.
build:unsupported_crosstool --crosstool_top=//external:cc_toolchain
build:unsupported_crosstool --action_env=CCACHE_DISABLE=1

### git submodules
# If a CMake build is performed from the same source tree, it will checkout git
Expand Down
26 changes: 0 additions & 26 deletions tools/ccache.bzl

This file was deleted.

35 changes: 0 additions & 35 deletions tools/complain_about_ccache.sh

This file was deleted.

5 changes: 5 additions & 0 deletions tools/ipopt_build_with_autotools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ configure="$PWD"/external/ipopt/configure
# totally bog down the machine, while still achieving some parallelism.
half_the_cores="$[($(getconf _NPROCESSORS_ONLN)+1)/2]"

# Within the Bazel sandbox, ccache does not work, so we should turn it off.
# (The IPOPT build sniffs the path to find a compiler; it neither knows about
# nor obeys the Bazel --compiler flag.)
export CCACHE_DISABLE=1

# Set these to match --with-pic below.
export ADD_CFLAGS=-fPIC
export ADD_CXXFLAGS=-fPIC
Expand Down

0 comments on commit a5c48a7

Please sign in to comment.