Lines Matching refs:p

208 func (p *GoPackage) FindDeps(config *Config, path string) error {
212 err := p.findDeps(config, path, depSet)
216 p.allDeps = depSet.packageList
279 func (p *GoPackage) findDeps(config *Config, path string, allPackages *linkedDepSet) error {
325 p.files = append(p.files, filename)
368 sort.Strings(p.files)
371 fmt.Fprintf(os.Stderr, "Package %q depends on %v\n", p.Name, deps)
376 p.directDeps = append(p.directDeps, allPackages.getByName(dep))
382 func (p *GoPackage) Compile(config *Config, outDir string) error {
383 p.mutex.Lock()
384 defer p.mutex.Unlock()
385 if p.compiled {
386 return p.failed
388 p.compiled = true
392 for _, dep := range p.directDeps {
400 for _, dep := range p.directDeps {
402 p.failed = dep.failed
403 return p.failed
407 endTrace := config.trace("check compile %s", p.Name)
409 p.pkgDir = filepath.Join(outDir, strings.Replace(p.Name, "/", "-", -1))
410 p.output = filepath.Join(p.pkgDir, p.Name) + ".a"
411 shaFile := p.output + ".hash"
418 "-o", p.output,
419 "-p", p.Name,
435 for _, dep := range p.directDeps {
439 for _, filename := range p.files {
448 p.failed = err
455 p.failed = err
460 p.hashResult = hash.Sum(nil)
463 if _, err := os.Stat(p.output); err != nil {
468 rebuild = !bytes.Equal(oldSha, p.hashResult)
478 defer un(config.trace("compile %s", p.Name))
480 err := os.RemoveAll(p.pkgDir)
482 err = fmt.Errorf("%s: %v", p.Name, err)
483 p.failed = err
487 err = os.MkdirAll(filepath.Dir(p.output), 0777)
489 err = fmt.Errorf("%s: %v", p.Name, err)
490 p.failed = err
504 p.failed = err
508 err = ioutil.WriteFile(shaFile, p.hashResult, 0666)
510 err = fmt.Errorf("%s: %v", p.Name, err)
511 p.failed = err
515 p.rebuilt = true
520 func (p *GoPackage) Link(config *Config, out string) error {
521 if p.Name != "main" {
524 endTrace := config.trace("check link %s", p.Name)
528 if !p.rebuilt {
530 p.rebuilt = true
532 p.rebuilt = true
534 p.rebuilt = !bytes.Equal(oldSha, p.hashResult)
538 if !p.rebuilt {
541 defer un(config.trace("link %s", p.Name))
556 for _, dep := range p.allDeps {
559 cmd.Args = append(cmd.Args, p.output)
574 return ioutil.WriteFile(shaFile, p.hashResult, 0666)
578 p := &GoPackage{
607 if err := p.FindDeps(config, path); err != nil {
610 if err := p.Compile(config, intermediates); err != nil {
613 if err := p.Link(config, out); err != nil {
616 return p, nil
702 func (p *pkgPathMappingVar) Set(value string) error {
705 return fmt.Errorf("Argument must be in the form of: %q", p.String())
711 return p.Map(pkgPrefix, pathPrefix)