expo / expo/eas-cli

build:inspect archive on Windows does not respect nested .gitignore entries

Open
#3,733 0 comments 0 reactions 0 assignees View on GitHub
needs review
Dominant language
TypeScript
Stars
1.4k
Forks
236
Avg merge
3d 1h
Merged PRs (30d)
91

Description

### Build/Submit details page URL

_No response_

### Summary

On Windows, `eas build:inspect --stage archive` does not respect `.gitignore` files in subdirectories of a monorepo. Root `.gitignore` entries are respected, but nested package `.gitignore` entries are not.

This looks like a Windows path separator bug in the local archive copy logic.

In `packages/eas-cli/src/vcs/local.ts`, nested `.gitignore` prefixes are stored with `/`, for example:

```ts
packages/app/
```
but `path.relative(...)` returns Windows paths with `\`, for example:
```ts
packages\app\android
```
Then `Ignore.ignores()` checks:
```ts
relativePath.startsWith(prefix)
```
which fails for nested prefixes on Windows. Root ignore rules still work because their prefix is `''`.

There also appears to be a related directory-rule edge case: rules like `.expo/` and `dist/` should ignore the directory itself during `fs.cp` filtering, but the path passed to `ignore.ignores(...)` may not have a trailing slash.

### Managed or bare?

managed

### Environment

```
> npx expo-env-info

expo-env-info 2.0.12 environment info:
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 24.15.0 - ~\AppData\Local\mise\installs\node\24.15.0\node.EXE
npm: 11.12.1 - ~\AppData\Local\mise\installs\node\24.15.0\npm.CMD
SDKs:
Android SDK:
API Levels: 28, 29, 31, 33, 34, 35, 36
Build Tools: 30.0.3, 33.0.1, 34.0.0, 35.0.0, 35.0.1, 36.0.0
System Images: android-26 | Google APIs Intel x86_64 Atom, android-26 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86_64 Atom, android-34 | Google Play Intel x86_64 Atom, android-35 | Google Play Intel x86_64 Atom, android-36 | Pre-Release 16 KB Page Size Google Play Intel x86_64 Atom, android-37.0 | Pre-Release 16 KB Page Size Google Play Intel x86_64 Atom
npmPackages:
expo: ~54.0.33 => 54.0.34
expo-router: ~6.0.23 => 6.0.23
react: 19.1.0 => 19.1.0
react-dom: 19.1.0 => 19.1.0
react-native: 0.81.5 => 0.81.5
react-native-web: ~0.21.0 => 0.21.2
Expo Workflow: managed
```

```
> npx expo-doctor
17/17 checks passed. No issues detected!
```

```
> eas --version
eas-cli/18.12.3 win32-x64 node-v24.15.0
```

### Error output

_No response_

### Reproducible demo or steps to reproduce from a blank project

```
npx create-expo-app@latest eas-ignore-repro
cd eas-ignore-repro
git init

mkdir nested
echo "ignored.txt" > nested\.gitignore
echo "should not be archived" > nested\ignored.txt

eas build:inspect --platform android --stage archive --output ~/archive
```
Notice that file `nested/ignored.txt` is in archive although it should not be.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.