tilt-dev / tilt.build

Tilt landing page
https://tilt.dev/
Apache License 2.0
22 stars 61 forks source link

Doc: Integrating Bazel with Tilt: `custom_build` never watch for source deps #236

Closed kavirajk closed 5 years ago

kavirajk commented 5 years ago

In the Image Dependencies section here https://docs.tilt.dev/integrating_bazel_with_tilt.html

custom_build supposed to be watching for actual files, but in the example its just labels. Probably typo or am I missing something?

Currently its is

def bazel_build(image, target):
  build_deps = str(local(BAZEL_BUILDFILES_CMD % target)).splitlines()
  watch_labels(build_deps)

  source_deps = str(local(BAZEL_SOURCES_CMD % target)).splitlines()
  source_deps_files = bazel_labels_to_files(source_deps)

  custom_build(
    image,
    BAZEL_RUN_CMD % target,
    source_deps,
    tag="image",
  )

It supposed to be

def bazel_build(image, target):
  build_deps = str(local(BAZEL_BUILDFILES_CMD % target)).splitlines()
  watch_labels(build_deps)

  source_deps = str(local(BAZEL_SOURCES_CMD % target)).splitlines()
  source_deps_files = bazel_labels_to_files(source_deps)

  custom_build(
    image,
    BAZEL_RUN_CMD % target,
    source_deps_files,
    tag="image",
  )

source_deps -> source_deps_files in custom_build

nicks commented 5 years ago

This sounds right to me, but I haven't touched the Bazel integration code. @jazzdan what do you think?

jazzdan commented 5 years ago

Yup agreed. @kavirajk do you want to submit a PR for that? If not I am happy to do that, just let me know!

kavirajk commented 5 years ago

@jazzdan sure. I will do that :)