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

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

Information
Patrick Lawson
pants
2693
Reviewers
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

Patrick Lawson
Matt Olsen
Benjy Weinberger
Stu Hood
Eric Ayers
Patrick Lawson
Benjy Weinberger
Patrick Lawson
Patrick Lawson
Patrick Lawson
Patrick Lawson
Review request changed

Status: Closed (submitted)

Change Summary:

Upstream @ 17b0f291da37cc6443ade6c5e78359a7ef24d40f

Loading...