code: func verifyPerkeepRoot() {
  	var err error
  	pkRoot, err = os.Getwd()
  	if err != nil {
  		log.Fatalf("Failed to get current directory: %v", err)
  	}
  	testFile := filepath.Join(pkRoot, "pkg", "blob", "ref.go")
  	if _, err := os.Stat(testFile); err != nil {
  		log.Fatalf("make.go must be run from the Perkeep src root directory (where make.go is). Current working directory is %s", pkRoot)
  	}
  
  	// we can't rely on perkeep.org/cmd/pk with modules on as we have no assurance
  	// the current dir is $GOPATH/src/perkeep.org, so we use ./cmd/pk instead.
  	cmd := exec.Command("go", "list", "-f", "{{.Target}}", "./cmd/pk")
  	if os.Getenv("GO111MODULE") == "off" || *buildWebUI {
  		// if we're building the webUI we need to be in "legacy" GOPATH mode, so in
  		// $GOPATH/src/perkeep.org
  		if err := validateDirInGOPATH(pkRoot); err != nil {
  			log.Fatalf("We're running in GO111MODULE=off mode, either because you set it, or because you want to build the Web UI, so we need to be in a GOPATH, but: %v", err)
  		}
  		cmd = exec.Command("go", "list", "-f", "{{.Target}}", "perkeep.org/cmd/pk")
  	}
  	cmd.Stderr = os.Stderr
  	out, err := cmd.Output()
  	if err != nil {
  		log.Fatalf("Could not run go list to find install dir: %v, %s", err, out)
  	}
  	binDir = filepath.Dir(strings.TrimSpace(string(out)))
  }
docs: // verifyPerkeepRoot sets pkRoot and crashes if dir isn't the Perkeep root directory.