Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Fixes #907 Warn when an importer cannot preserve a constraint #1086

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/dep/glide_importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ func (g *glideImporter) buildProjectConstraint(pkg glidePackage) (pc gps.Project
}
pc.Constraint, err = g.sm.InferConstraint(pkg.Reference, pc.Ident)
if err != nil {
return
g.logger.Printf("Unable to interpret constraint '%s' for package %s: %s, (using the 'any' constraint instead)\n", pkg.Reference, pc.Ident, err.Error())
pc.Constraint = gps.Any()
}

if g.verbose {
Expand Down
3 changes: 2 additions & 1 deletion cmd/dep/godep_importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ func (g *godepImporter) buildProjectConstraint(pkg godepPackage) (pc gps.Project
pc.Ident = gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot(pkg.ImportPath)}
pc.Constraint, err = g.sm.InferConstraint(pkg.Comment, pc.Ident)
if err != nil {
return
g.logger.Printf("Unable to interpret constraint '%s' for package %s: %s, (using the 'any' constraint instead)\n", pkg.Comment, pc.Ident, err.Error())
pc.Constraint = gps.Any()
}

f := fb.NewConstraintFeedback(pc, fb.DepTypeImported)
Expand Down