Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

audit needs to provide path to dependency #10

Closed
spearce opened this issue Apr 30, 2013 · 3 comments
Closed

audit needs to provide path to dependency #10

spearce opened this issue Apr 30, 2013 · 3 comments

Comments

@spearce
Copy link
Contributor

spearce commented Apr 30, 2013

audit input, classpath and owner don't let me see the path between a java_binary() and why a particular prebuilt_jar() is appearing in the classpath. The path data is necessary to track down the intermediate offending library and fix its deps statement (which may also require fixing code there, but whatever, that isn't buck's problem).

The problem I have right now is two different incompatible versions of the servlet-api appearing in a java_binary()'s classpath. This fails to package because which javax.servlet.Filter do you include? The one from the 2.5 specification or the one from the 3.0 specification? The developer should fix the library usages to be consistent, but they need to know where in the path to start looking.

Since multiple paths may exist to the same dependency, audit should try to print any paths as it can find, but an iterative approach would also be OK, e.g. fix one edge, re-run audit, fix another, etc.

@bolinfest
Copy link
Contributor

As a quick fix, try running:

buck audit classpath --dot

I often write the stdout to a file and then do some textual searching in there to figure this out.

@spearce
Copy link
Contributor Author

spearce commented Apr 30, 2013

Didn't know about the --dot flag; this is indeed useful. Still would be nice to have a compact tree printed to standard out, but until someone has time to build and contribute that --dot and searching is an interim replacement.

@dreiss dreiss closed this as completed Jan 22, 2014
@dreiss dreiss reopened this Jan 22, 2014
@sdwilsh
Copy link
Contributor

sdwilsh commented Apr 3, 2015

buck audit dependencies will give you the information that you need. It wouldn't be hard to write a script to make it display some tree, but in practice, most trees would be massive.

https://facebook.github.io/buck/command/audit.html

@sdwilsh sdwilsh closed this as completed Apr 3, 2015
cwoodwar6 referenced this issue in cwoodwar6/buck Aug 9, 2017
* commit 'a36df7f27840a50c81a4417507ba80550d492dc0': (59 commits)
  Revert: Fix typo in WatchedFileHashCache
  Revert: Inverted order of FHC gets to assess impact of loading a file from memory.
  use regex for field_name in diag tool
  no compilation flags for sanitizing for VS toolchain
  Fix for duplicate log messages from ClientExecutor's scheduler thread.
  Added oncall and excludes for buck targets
  Remove MapDB and RocksDB
  Write cross-cell used classes paths pre-pended by cell name
  Add CellPathResolver as a second param to SuppportsDependencyFileRuleKey#getInputsAfterBuildingLocally()
  Make CompareAbis play nice with caching
  Verify SHA1 after materializing source files.
  Fix typo in WatchedFileHashCache
  Generate package-info class when needed
  fix build
  Teach InnerClassesTable to be able to examine PackageElements
  Detect inner class references in default values of annotation parameters
  Don't list inner classes of inner classes (unless they are referenced)
  Don't list inner classes more than once
  Include references to inner classes from type parameter annotations
  InnerClassesTable and tests
  ...
jiangty-addepar pushed a commit to liuyang-li/buck that referenced this issue Oct 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants