Lines Matching refs:p

191 func (p *GoPackage) FindDeps(config *Config, path string) error {
195 err := p.findDeps(config, path, depSet)
199 p.allDeps = depSet.packageList
262 func (p *GoPackage) findDeps(config *Config, path string, allPackages *linkedDepSet) error {
308 p.files = append(p.files, filename)
351 sort.Strings(p.files)
354 fmt.Fprintf(os.Stderr, "Package %q depends on %v\n", p.Name, deps)
359 p.directDeps = append(p.directDeps, allPackages.getByName(dep))
365 func (p *GoPackage) Compile(config *Config, outDir string) error {
366 p.mutex.Lock()
367 defer p.mutex.Unlock()
368 if p.compiled {
369 return p.failed
371 p.compiled = true
375 for _, dep := range p.directDeps {
383 for _, dep := range p.directDeps {
385 p.failed = dep.failed
386 return p.failed
390 endTrace := config.trace("check compile %s", p.Name)
392 p.pkgDir = filepath.Join(outDir, strings.Replace(p.Name, "/", "-", -1))
393 p.output = filepath.Join(p.pkgDir, p.Name) + ".a"
394 shaFile := p.output + ".hash"
401 "-o", p.output,
402 "-p", p.Name,
415 for _, dep := range p.directDeps {
419 for _, filename := range p.files {
428 p.failed = err
435 p.failed = err
440 p.hashResult = hash.Sum(nil)
443 if _, err := os.Stat(p.output); err != nil {
448 rebuild = !bytes.Equal(oldSha, p.hashResult)
458 defer un(config.trace("compile %s", p.Name))
460 err := os.RemoveAll(p.pkgDir)
462 err = fmt.Errorf("%s: %v", p.Name, err)
463 p.failed = err
467 err = os.MkdirAll(filepath.Dir(p.output), 0777)
469 err = fmt.Errorf("%s: %v", p.Name, err)
470 p.failed = err
484 p.failed = err
488 err = ioutil.WriteFile(shaFile, p.hashResult, 0666)
490 err = fmt.Errorf("%s: %v", p.Name, err)
491 p.failed = err
495 p.rebuilt = true
500 func (p *GoPackage) Link(config *Config, out string) error {
501 if p.Name != "main" {
504 endTrace := config.trace("check link %s", p.Name)
508 if !p.rebuilt {
510 p.rebuilt = true
512 p.rebuilt = true
514 p.rebuilt = !bytes.Equal(oldSha, p.hashResult)
518 if !p.rebuilt {
521 defer un(config.trace("link %s", p.Name))
536 for _, dep := range p.allDeps {
539 cmd.Args = append(cmd.Args, p.output)
551 return ioutil.WriteFile(shaFile, p.hashResult, 0666)
555 p := &GoPackage{
584 if err := p.FindDeps(config, path); err != nil {
587 if err := p.Compile(config, intermediates); err != nil {
590 if err := p.Link(config, out); err != nil {
593 return p, nil
678 func (p *pkgPathMappingVar) Set(value string) error {
681 return fmt.Errorf("Argument must be in the form of: %q", p.String())
687 return p.Map(pkgPrefix, pathPrefix)