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

Cleanup init verbose output #604

Merged
merged 1 commit into from
May 22, 2017

Conversation

darkowlzz
Copy link
Collaborator

  • Remove "dep:" prefix logs.
  • Remove logging gps solution lock constraints, instead enumerate not on disk
    projects.

@darkowlzz darkowlzz force-pushed the 512-followup-clean-init-verbose branch from 8233f79 to 7925d3f Compare May 18, 2017 17:08
@darkowlzz
Copy link
Collaborator Author

With this, as discussed in #512, dep init feedback would contain the hints/inputs of the init mode. When a local search is performed (GOPATH), the data obtained from the search is logged as feedback. Dependencies that require network to resolve are enumerated separately. No constraint details are logged. Only the direct dependencies are enumerated, no transitive dependencies.

$ dep init -no-examples -v
Searching GOPATH for projects...
  Using master as constraint for direct dep github.com/fsnotify/fsnotify
  Locking in master (fd9ec7d) for direct dep github.com/fsnotify/fsnotify
  Locking in master (ca83bd2) for transitive dep golang.org/x/sys
Following dependencies were not found in GOPATH. Dep will use the most recent versions of these projects.
  github.com/darkowlzz/openurl
  github.com/sdboyer/deptestdos
Root project is "github.com/darkowlzz/foo"
 2 transitively valid internal packages
 3 external packages imported from 3 projects
(0)   ✓ select (root)
(1)	? attempt github.com/fsnotify/fsnotify with 1 pkgs; at least 1 versions to try
(1)	    try github.com/fsnotify/fsnotify@master
(1)	✓ select github.com/fsnotify/fsnotify@master w/1 pkgs
(2)	? attempt golang.org/x/sys with 1 pkgs; at least 1 versions to try
(2)	    try golang.org/x/sys@master
(2)	✓ select golang.org/x/sys@master w/1 pkgs
(3)	? attempt github.com/sdboyer/deptestdos with 1 pkgs; 2 versions to try
(3)	    try github.com/sdboyer/[email protected]
(3)	✓ select github.com/sdboyer/[email protected] w/1 pkgs
(4)	? attempt github.com/darkowlzz/openurl with 1 pkgs; 1 versions to try
(4)	    try github.com/darkowlzz/openurl@master
(4)	✓ select github.com/darkowlzz/openurl@master w/1 pkgs
(5)	? attempt github.com/sdboyer/deptest with 1 pkgs; 4 versions to try
(5)	    try github.com/sdboyer/[email protected]
(5)	✓ select github.com/sdboyer/[email protected] w/1 pkgs
  ✓ found solution with 5 packages from 5 projects

Solver wall times by segment:
         b-list-pkgs: 1.496227916s
              b-gmal: 1.230926255s
     b-list-versions: 1.089999703s
     b-source-exists: 623.603828ms
         select-atom:    576.384µs
             satisfy:    458.083µs
            new-atom:    298.751µs
         select-root:    176.841µs
  b-deduce-proj-root:     58.781µs
               other:     36.995µs

  TOTAL: 4.442363537s

cmd/dep/init.go Outdated
// be added to manifest.
if _, ok := pd.notondisk[pr]; ok {
// If it's in notondisk, add to manifest, these are direct dependencies.
if contains(notondisk, string(pr)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this from a constant time map lookup into a O(N) slice scan?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops! right 😅
Thanks

@darkowlzz darkowlzz force-pushed the 512-followup-clean-init-verbose branch from 7925d3f to e6fb86d Compare May 18, 2017 20:52
Copy link
Collaborator

@jmank88 jmank88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one super-small nit! 😄

if _, ok := pd.notondisk[pr]; ok {
m.Dependencies[pr] = getProjectPropertiesFromVersion(x.Version())
feedback(x.Version(), pr, fb.DepTypeDirect, ctx)
Copy link
Collaborator

@carolynvs carolynvs May 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we don't log feedback for new projects found by the solver, let's update the comment on the for loop to remove log feedback for all the new projects on line 184.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow! thanks for noticing that 😊

- Remove "dep:" prefix logs.
- Remove logging gps solution lock constraints, instead enumerate not on disk
projects.
@darkowlzz darkowlzz force-pushed the 512-followup-clean-init-verbose branch from e6fb86d to 2ae37d6 Compare May 22, 2017 18:59
@carolynvs carolynvs merged commit f6be53c into golang:master May 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants