-
Notifications
You must be signed in to change notification settings - Fork 1k
Chase improvements to input hashing in gps #97
Changes from all commits
0f5f78a
b108df4
8e836c0
7f6452c
f10f4a1
1fbd8df
72df2c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright 2017 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package main | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file is missing the license header There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i fixed |
||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
|
||
"github.com/pkg/errors" | ||
"github.com/sdboyer/gps" | ||
) | ||
|
||
func (cmd *hashinCommand) Name() string { return "hash-inputs" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wait why do we need this command? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. exclusively for debugging. i'm totally fine to pull it out if it seems like overkill to add it |
||
func (cmd *hashinCommand) Args() string { return "" } | ||
func (cmd *hashinCommand) ShortHelp() string { return "" } | ||
func (cmd *hashinCommand) LongHelp() string { return "" } | ||
func (cmd *hashinCommand) Hidden() bool { return true } | ||
|
||
func (cmd *hashinCommand) Register(fs *flag.FlagSet) { | ||
} | ||
|
||
type hashinCommand struct{} | ||
|
||
func (_ hashinCommand) Run(args []string) error { | ||
p, err := nestContext.loadProject("") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
sm, err := nestContext.sourceManager() | ||
if err != nil { | ||
return err | ||
} | ||
sm.UseDefaultSignalHandling() | ||
defer sm.Release() | ||
|
||
params := p.makeParams() | ||
cpr, err := nestContext.splitAbsoluteProjectRoot(p.absroot) | ||
if err != nil { | ||
return errors.Wrap(err, "determineProjectRoot") | ||
} | ||
|
||
params.RootPackageTree, err = gps.ListPackages(p.absroot, cpr) | ||
if err != nil { | ||
return errors.Wrap(err, "gps.ListPackages") | ||
} | ||
|
||
s, err := gps.Prepare(params, sm) | ||
if err != nil { | ||
return errors.Wrap(err, "prepare solver") | ||
} | ||
|
||
fmt.Println(gps.HashingInputsAsString(s)) | ||
return nil | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nest