Skip to content

Commit

Permalink
Possible fix for stat error during globbing
Browse files Browse the repository at this point in the history
Globs can fail when a directory is replaced with a file:
Error checking globs: stat foo: not a directory

Manually check for syscall.ENOTDIR, which is not covered by
fs.ErrNotExist.


Ignore-AOSP-First: "Landing internal first for critical ap4a move"
Bug: 369548825
Test: manual
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c3cd8e3f3c93773f0051608b94a0358554a95c98)
Merged-In: I35f65725b70fc0abb22aff46298d053d98d03b00
Change-Id: I35f65725b70fc0abb22aff46298d053d98d03b00
  • Loading branch information
colincross authored and Android Build Coastguard Worker committed Sep 25, 2024
1 parent cf886f9 commit de7d7bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/build/soong.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"strings"
"sync"
"sync/atomic"
"syscall"
"time"

"android/soong/ui/tracer"
Expand Down Expand Up @@ -780,7 +781,7 @@ func checkGlobs(ctx Context, finalOutFile string) error {
hasNewDep := false
for _, dep := range cachedGlob.Deps {
info, err := os.Stat(dep)
if errors.Is(err, fs.ErrNotExist) {
if errors.Is(err, fs.ErrNotExist) || errors.Is(err, syscall.ENOTDIR) {
hasNewDep = true
break
} else if err != nil {
Expand Down

0 comments on commit de7d7bc

Please sign in to comment.