lib: Change godepcop to an XML (rather than JSON) config file.

Most of the rest of our build-related config files use XML, so
this increases consistency.  It's also easier to add comments.

The XML file is called .godepcop (rather than GO.PACKAGE) to
match the naming of the .api config file, and also to hide it
from view since it's rarely edited.  Here's an example of the
v.io/x/lib/.godepcop file:

<godepcop>
<import allow="v.io/x/lib/..."/>
<import allow="github.com/cosnicolaou/llog"/>
<import deny="..."/>

<xtest allow="v.io/v23/..."/>
<xtest allow="v.io/x/ref/..."/>
</godepcop>

Note that the new file allows specification of rules for regular
imports, test imports and xtest imports.  Having rules for all
three groups of imports is useful, since we can now have strict
rules about the dependencies for all code (both test and
non-test) that is used to build each package.  E.g. we have very
strict rules for the vdl package and the v23 tool, since they're
so critical to our codebase.

I also discovered (and fixed) a bug that caused us to miss some
transitive dependencies during checking.  E.g. vlog imports
verror, which imports a bunch of other packages under v23, but
the bug caused us to only check the verror dependency and skip
the others.  The bug was in checkImports, where we were
incorrectly re-using the "deps" variable.

I've also created reasonable .godepcop files for our codebase, as
appropriate, and added comments describing the philosophy.

MultiPart: 3/3

Change-Id: Idd7b2694410aa6c3009139b26a547cdb0a411dd5
7 files changed
tree: e67e3db86596a8029eb9d3e5da05a034ec9b5b76
  1. buildinfo/
  2. cmdline/
  3. dbutil/
  4. envvar/
  5. host/
  6. metadata/
  7. netconfig/
  8. netstate/
  9. pubsub/
  10. textutil/
  11. toposort/
  12. vlog/
  13. .gitignore
  14. .godepcop
  15. AUTHORS
  16. CONTRIBUTORS
  17. LICENSE
  18. PATENTS
  19. README.md
  20. VERSION
README.md

This repository contains general purpose libraries used by the Vanadium project.