title: Include file downloaded by Bazel http_file
body: <p>I'm using <a href="https://bazel.build" rel="nofollow noreferrer">Bazel</a> to build my project. I'd like to use the single-header test framework, <a href="https://github.com/catchorg/Catch2" rel="nofollow noreferrer">Catch v2</a>. I decided to use the <a href="https://github.com/bazelbuild/bazel/blob/master/tools/build_defs/repo/http.bzl#L254" rel="nofollow noreferrer">http_file</a> rule to make Bazel download the catch header. My <code>WORKSPACE</code> file looks like this:</p>
  
  <pre><code>load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
  
  http_file(
    name = "catch",
    downloaded_file_path = "catch.hpp",
    sha256 = "cc6cc272cf84d8e10fb28f66f52584dedbb80d1234aae69e6a1027af4f31ae6f",
    urls = ["https://github.com/catchorg/Catch2/releases/download/v2.4.2/catch.hpp"],
  )
  </code></pre>
  
  <p>According to the doc, the test depends on the generated package like this:</p>
  
  <pre><code>cc_test(
    name = "my_test",
    srcs = ["@catch//file", "my_test.cc"]
  )
  </code></pre>
  
  <p>The test file <code>my_test.cc</code> can't get any simpler:</p>
  
  <pre><code>#include "catch.hpp"
  </code></pre>
  
  <p>However, I get the following error:</p>
  
  <pre><code>$ bazel test --config=opt -s //...
  WARNING: [...]/BUILD:25:10: in srcs attribute of cc_test rule //test:my_test: please do not import '@catch//file:catch.hpp' directly. You should either move the file to this package or depend on an appropriate rule there
  SUBCOMMAND: # //test:my_test [action 'Compiling test/my_test.cc']
  (cd [...] &amp;&amp; \
    exec env - [...] \
    /usr/bin/gcc
   -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF [...].d '-frandom-seed=[...].o' -fPIC
   -iquote .
   -iquote bazel-out/k8-fastbuild/genfiles
   -iquote bazel-out/k8-fastbuild/bin
   -iquote external/bazel_tools
   -iquote bazel-out/k8-fastbuild/genfiles/external/bazel_tools
   -iquote bazel-out/k8-fastbuild/bin/external/bazel_tools
   -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c test/my_test.cc
   -o [...].o)
  ERROR: [...]/BUILD:23:1: C++ compilation of rule '//test:my_test' failed (Exit 1)
  test/my_test.cc:1:28: fatal error: catch.hpp: No such file or directory
  compilation terminated.
  [...]
  FAILED: Build did NOT complete successfully
  </code></pre>
  
  <p>Creating a <code>cc_library</code> wrapper, or including <code>catch/catch.hpp</code>, catch/file/catch.hpp produces the same error.</p>