From 97c41120ae72c8ab30b4a4b2aa8632ffc57e8afa Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Tue, 25 Jun 2019 04:03:33 -0700 Subject: [PATCH] [buck/java2] eliminate project root config flag Summary: Passing an absolute project path as buck config flag makes buck caching almost impossible for infer artefacts, since on every host/run that directory can be different. Eliminate that and rely on shell commands to find the project root, executed within the genrule. Reviewed By: jvillard Differential Revision: D15963807 fbshipit-source-id: b6e590029 --- infer/src/integration/Buck.ml | 4 +--- infer/tests/build_systems/genrulecapture/DEFS | 7 +------ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/infer/src/integration/Buck.ml b/infer/src/integration/Buck.ml index dcfb15deb..31fa6ccd3 100644 --- a/infer/src/integration/Buck.ml +++ b/infer/src/integration/Buck.ml @@ -160,9 +160,7 @@ let die_if_empty f = function [] -> f L.(die UserError) | l -> l let buck_config = lazy ( if Config.genrule_master_mode then - [ "infer.project_root=" ^ Utils.realpath Config.project_root - ; "infer.infer_out=" ^ Utils.realpath Config.results_dir - ; "infer.version=" ^ Version.versionString + [ "infer.version=" ^ Version.versionString ; "infer.infer_bin=" ^ Config.bin_dir ^/ Config.exe_basename ; "infer.mode=capture" ] |> List.fold ~init:[] ~f:(fun acc f -> "--config" :: f :: acc) diff --git a/infer/tests/build_systems/genrulecapture/DEFS b/infer/tests/build_systems/genrulecapture/DEFS index c59d9afd2..c0f01232e 100644 --- a/infer/tests/build_systems/genrulecapture/DEFS +++ b/infer/tests/build_systems/genrulecapture/DEFS @@ -7,12 +7,7 @@ def _get_infer_bin(): return read_config("infer", "infer_bin") def _get_project_root(): - return read_config("infer", "project_root") - -def _get_infer_deps(): - infer_out = read_config("infer", "infer_out") - infer_deps = "{}/infer-deps.txt".format(infer_out) - return infer_deps + return "\$(git rev-parse --show-toplevel)/infer/tests/build_systems/genrulecapture" def _infer_capture_genrule( name,