Prepend '//' to Address.spec when the spec_path is empty.

Review Request #3234 — Created Dec. 11, 2015 and submitted

patricklaw
pants
2693
pants-reviews
benjyw, jsirois, molsen, zundel

Also fix a bug in Address.reference that this revealed: namely
that spec_path-relative references at the root were actually
going through the code path for absolute references, but
because the result was identical it didn't matter.

An issue in https://rbcommons.com/s/twitter/r/3225/ uncovered a bug in the way we
handle addresses at the root of the repo (i.e. with an empty spec_path) in the
context of Target.traversable_dependency_specs. These specs are always with respect
to the target being loaded, meaning that relative spec paths are relative to
the target's spec_path. This means that specs with an empty spec_path must
be disambiguated by prepending //, otherwise they will be treated as a relative
spec.

Had to fix up lots of little assertions that rely on the spec formatting.

CI is green: https://travis-ci.org/pantsbuild/pants/builds/96364177

PA
MO
  1. Thanks for looking into this issue. It looks like this should solve the problem with https://rbcommons.com/s/twitter/r/3225/

  2. 
      
BE
  1. Ship It!
  2. 
      
ST
  1. Ship It!
  2. 
      
ZU
  1. Ship It!
  2. 
      
PA
PA
BE
  1. Ship It!
  2. 
      
PA
PA
PA
PA
Review request changed

Status: Closed (submitted)

Change Summary:

Upstream @ 17b0f291da37cc6443ade6c5e78359a7ef24d40f

Loading...