/build/soong/cmd/sbox/ |
D | sbox.go | 95 filepath.Walk(root, func(path string, info os.FileInfo, err error) error { 97 relPath, err := filepath.Rel(root, path) 98 if err != nil { 100 panic(err) 122 manifest, err := readManifest(manifestFile) 123 if err != nil { 124 return err 132 err = os.MkdirAll(sandboxesRoot, 0777) 133 if err != nil { 134 return fmt.Errorf("failed to create %q: %w", sandboxesRoot, err) [all …]
|
/build/blueprint/ |
D | live_tracker.go | 47 ruleDef, err := l.innerAddRule(def.Rule) 48 if err != nil { 49 return err 53 err = l.innerAddNinjaStringListDeps(def.Outputs) 54 if err != nil { 55 return err 58 err = l.innerAddNinjaStringListDeps(def.Inputs) 59 if err != nil { 60 return err 63 err = l.innerAddNinjaStringListDeps(def.Implicits) [all …]
|
D | ninja_defs.go | 115 err := nw.Comment(p.Comment) 116 if err != nil { 117 return err 121 err := nw.Pool(name) 122 if err != nil { 123 return err 157 value, err := parseNinjaString(scope, params.Command) 158 if err != nil { 159 return nil, fmt.Errorf("error parsing Command param: %s", err) 164 value, err = parseNinjaString(scope, params.Depfile) [all …]
|
D | ninja_writer.go | 79 _, err := n.writer.WriteString(line) 80 if err != nil { 81 return err 89 _, err := n.writer.WriteString("# ") 90 if err != nil { 91 return err 93 _, err = n.writer.WriteString(line) 94 if err != nil { 95 return err 97 _, err = n.writer.WriteString("\n") [all …]
|
/build/soong/cmd/diff_target_files/ |
D | zip_artifact.go | 45 zr, err := zip.OpenReader(name) 46 if err != nil { 47 return nil, err 91 zr, err := zf.Open() 92 if err != nil { 93 d.err = err 102 d.err = fmt.Errorf("invalid filename %q", zf.Name) 107 err = os.MkdirAll(filepath.Dir(path), 0777) 108 if err != nil { 109 d.err = err [all …]
|
D | allow_list.go | 51 newAllowlists, err := parseAllowListFile(file) 52 if err != nil { 53 return nil, err 74 r, err := os.Open(file) 75 if err != nil { 76 return nil, err 87 if err := d.Decode(&jsonAllowLists); err != nil { 88 return nil, err 101 return allowLists, err 108 if match, err := Match(w.path, l[i][0].Name); err != nil { [all …]
|
/build/soong/bpfix/cmd_lib/ |
D | bpfix.go | 47 func report(err error) { 48 fmt.Fprintln(os.Stderr, err) 53 f, err := os.Open(filename) 54 if err != nil { 55 return err 64 src, err := ioutil.ReadAll(in) 65 if err != nil { 66 return err 71 for _, err := range errs { 72 fmt.Fprintln(os.Stderr, err) [all …]
|
/build/make/tools/metadata/testdata/ |
D | metadata_test.go | 16 stderr, err := cmd.CombinedOutput() 17 if err != nil { 18 t.Fatalf("Error running metadata command: %s. Error: %v", stderr, err) 22 expectedOutput, err := ioutil.ReadFile("./expectedOutputFile.txt") 23 if err != nil { 24 t.Fatalf("Error reading expected output file: %s", err) 28 generatedOutput, err := ioutil.ReadFile("./generatedOutputFile.txt") 29 if err != nil { 30 t.Fatalf("Error reading generated output file: %s", err) 46 stderr, err := cmd.CombinedOutput() [all …]
|
/build/soong/ui/build/ |
D | util_test.go | 29 defer logger.Recover(func(err error) { 30 t.Error(err) 33 tmpDir, err := ioutil.TempDir("", "") 34 if err != nil { 35 t.Fatal(err) 38 err := os.RemoveAll(tmpDir) 39 if err != nil { 40 t.Errorf("Error removing tmpDir: %v", err) 46 err = os.Chmod(filepath.Join(tmpDir, "a"), 0555) 47 if err != nil { [all …]
|
D | util.go | 27 ret, err := filepath.Abs(p) 28 if err != nil { 29 ctx.Fatalf("Failed to get absolute path: %v", err) 64 err := os.MkdirAll(dir, 0777) 65 if err != nil { 66 ctx.Fatalf("Error creating %s: %q\n", dir, err) 77 err := os.RemoveAll(dir) 78 if err == nil { 82 if pathErr, ok := err.(*os.PathError); !ok || 85 ctx.Fatalf("Error removing %s: %q\n", dir, err) [all …]
|
/build/make/tools/rbcrun/ |
D | host_test.go | 66 if err := os.Chdir(dataDir()); err != nil { 67 t.Fatal(err) 81 if err := os.Chdir(dataDir()); err != nil { 82 t.Fatal(err) 96 if _, err := starlark.ExecFile(thread, filename, nil, rbcBuiltins); err != nil { 97 if err, ok := err.(*starlark.EvalError); ok { 98 t.Fatal(err.Backtrace()) 100 t.Fatal(err) 107 if _, err := starlark.ExecFile(thread, "file_ops.star", nil, rbcBuiltins); err != nil { 108 if err, ok := err.(*starlark.EvalError); ok { [all …]
|
/build/soong/cmd/release_config/release_config/ |
D | main.go | 32 var err error 66 if err = os.Chdir(top); err != nil { 67 panic(err) 69 …configs, err = rc_lib.ReadReleaseConfigMaps(releaseConfigMapPaths, targetRelease, useBuildVar, all… 70 if err != nil { 71 panic(err) 73 config, err := configs.GetReleaseConfig(targetRelease) 74 if err != nil { 75 panic(err) 77 err = os.MkdirAll(outputDir, 0775) [all …]
|
/build/blueprint/bpfmt/ |
D | bpfmt.go | 35 func report(err error) { 36 fmt.Fprintln(os.Stderr, err) 52 f, err := os.Open(filename) 53 if err != nil { 54 return err 62 src, err := ioutil.ReadAll(in) 63 if err != nil { 64 return err 71 for _, err := range errs { 72 fmt.Fprintln(os.Stderr, err) [all …]
|
/build/soong/cmd/soong_build/ |
D | queryview.go | 32 res, err := bp2build.GenerateBazelTargets(ctx, generateFilegroups) 33 if err != nil { 34 panic(err) 44 if err := writeReadOnlyFile(outDir, f); err != nil { 45 return err 57 …err := filepath.WalkDir(filepath.Join(topDir, "build/bazel"), func(path string, info fs.DirEntry, … 59 contents, err := os.ReadFile(path) 60 if err != nil { 61 return err 63 path, err = filepath.Rel(topDir, path) [all …]
|
/build/soong/bazel/ |
D | aquery_test.go | 136 data, err := JsonToActionGraphContainer(inputString) 137 if err != nil { 138 t.Error(err) 195 data, err := JsonToActionGraphContainer(inputString) 196 if err != nil { 197 t.Error(err) 200 _, _, err = AqueryBuildStatements(data, &metrics.EventHandler{}) 201 assertError(t, err, "undefined outputId 3: [X] []") 230 data, err := JsonToActionGraphContainer(inputString) 231 if err != nil { [all …]
|
/build/blueprint/microfactory/ |
D | microfactory_test.go | 34 err := flags.Parse([]string{ 38 if err != nil { 39 t.Fatal(err) 54 got, ok, err := pkgMap.Path("android/soong/ui/test") 55 if err != nil { 56 t.Error("Unexpected error in pkgMap.Path(soong):", err) 63 got, ok, err = pkgMap.Path("github.com/google/blueprint") 64 if err != nil { 65 t.Error("Unexpected error in pkgMap.Path(blueprint):", err) 77 if _, _, err := pkgMap.Path("testing"); err == nil { [all …]
|
/build/soong/third_party/zip/ |
D | example_test.go | 33 f, err := w.Create(file.Name) 34 if err != nil { 35 log.Fatal(err) 37 _, err = f.Write([]byte(file.Body)) 38 if err != nil { 39 log.Fatal(err) 44 err := w.Close() 45 if err != nil { 46 log.Fatal(err) 52 r, err := zip.OpenReader("testdata/readme.zip") [all …]
|
/build/blueprint/pathtools/ |
D | glob.go | 59 buf, err := json.Marshal(multipleMatches) 60 if err != nil { 61 panic(fmt.Errorf("failed to marshal glob results to json: %w", err)) 97 matches, deps, err := glob(fs, pattern, false, follow) 99 if err != nil { 100 return GlobResult{}, err 103 matches, err = filterExcludes(matches, excludes) 104 if err != nil { 105 return GlobResult{}, err 124 info, err = fs.Lstat(match) [all …]
|
/build/soong/android/ |
D | expand_test.go | 42 err bool 133 err: true, 137 err: true, 141 err: true, 145 err: true, 149 err: true, 153 err: true, 157 err: true, 161 err: true, 167 got, err := Expand(test.in, func(s string) (string, error) { [all …]
|
/build/soong/finder/fs/ |
D | fs_test.go | 33 …assertStat := func(t *testing.T, stat os.FileInfo, err error, wantName string, wantMode os.FileMod… 35 if err != nil { 36 t.Error(err) 47 assertErr := func(t *testing.T, err error, wantErr string) { 48 if err == nil || err.Error() != wantErr { 49 t.Errorf("want error %q, got %q", wantErr, err) 53 stat, err := filesystem.Lstat("/tmp/links/dir") 54 assertStat(t, stat, err, "dir", os.ModeSymlink) 56 stat, err = filesystem.Stat("/tmp/links/dir") 57 assertStat(t, stat, err, "realdir", os.ModeDir) [all …]
|
/build/soong/shared/ |
D | proto.go | 26 func Save(pb proto.Message, filepath string) (err error) { 27 data, err := proto.Marshal(pb) 28 if err != nil { 29 return err 32 if err := ioutil.WriteFile(tempFilepath, []byte(data), 0644 /* rw-r--r-- */); err != nil { 33 return err 36 if err := os.Rename(tempFilepath, filepath); err != nil { 37 return err
|
/build/soong/elf/ |
D | elf.go | 32 f, err := os.Open(filename) 33 if err != nil { 34 return "", fmt.Errorf("failed to open %s: %w", filename, err) 44 f, err := elf.NewFile(r) 45 if err != nil { 47 if errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) { 50 if _, ok := err.(*elf.FormatError); ok { 55 return "", fmt.Errorf("failed to parse elf file %s: %w", filename, err) 67 buildIDs, err := readNote(buildIDNote.Open(), f.ByteOrder) 68 if err != nil { [all …]
|
/build/soong/cmd/fileslist/ |
D | fileslist.go | 69 f, err := os.Open(n.path) 70 if err != nil { 71 panic(err) 75 if _, err := io.Copy(h, f); err != nil { 76 panic(err) 80 s, err := os.Readlink(n.path) 81 if err != nil { 82 panic(err) 84 if _, err := io.WriteString(h, s); err != nil { 85 panic(err) [all …]
|
/build/soong/cmd/path_interposer/ |
D | main_test.go | 32 var err error 33 tmpDir, err = ioutil.TempDir("", "interposer_test") 34 if err != nil { 35 panic(err) 40 err = os.Setenv("PATH", "") 41 if err != nil { 42 panic(err) 50 f, err := ioutil.TempFile(tmpDir, "interposer") 51 if err != nil { 52 t.Fatal(err) [all …]
|
/build/soong/cmd/release_config/release_config_lib/ |
D | util.go | 62 func WriteMessage(path string, message proto.Message) (err error) { 85 func WriteFormattedMessage(path, format string, message proto.Message) (err error) { 87 if _, err := os.Stat(filepath.Dir(path)); err != nil { 88 if err = os.MkdirAll(filepath.Dir(path), 0775); err != nil { 89 return err 94 data, err = json.MarshalIndent(message, "", " ") 96 data, err = proto.Marshal(message) 98 data, err = prototext.MarshalOptions{Multiline: true}.Marshal(message) 102 if err != nil { 103 return err [all …]
|