eas-cli icon indicating copy to clipboard operation
eas-cli copied to clipboard

Builds breaking between expo-cli v0.58 and v0.59

Open RWOverdijk opened this issue 1 year ago • 22 comments

Appologies for using a blank issue. I just wanted to stop bumping in discord. Also hoping this attracts other people with the same issue.

When running a build (local and remote) I get:

Error: [ios.infoPlist]: withIosInfoPlistBaseMod: ENOENT: no such file or directory, open '/Users/spiderclam/projects/mobile/projectname/GoogleService-Info.plist' Code: ENOENT

This makes sense, because the file doesn't exist until after eas-build-pre-install (That's where I place the correct GoogleService files based on the profile used).

So, for some reason it's running a config plugin before it should be running a plugin.

I've narrowed it down to somewhere between v0.58 and v0.59, since v0.59 (and later releases, too) is where the issue starts popping up.

Additional remarks:

  • I've tried removing all plugins from app.json and it's still giving me the same error.
  • It's looking for the GoogleService file in my project root instead of the build root (which is usually some tmp dir). That's weird, because so far I've noticed eas-build-pre-install is run relative to the build root and not the project root.
  • I noticed Expo-config was bumped a major version between v0.58 and v0.59. Probably not related but who knows.

RWOverdijk avatar Aug 25 '22 15:08 RWOverdijk

Can you share a link to the failing build?

dsokal avatar Aug 26 '22 07:08 dsokal

@dsokal No, because it never gets uploaded. This error shows up locally.

This runs before eas-build-pre-install, which itself shouldn't run until the build starts afaik. This error shows up immediately after running build. I'll add the full output below (so you can see the order of things which might be helpful?):

Preparation:

$ npm i -g [email protected]
// Boring output

Note: Anything above v0.59 (tested up to v1.1.1 has the exact same behaviour._

Local:

$ eas build --profile production --local
★ [email protected] is now available.
To upgrade, run npm install -g eas-cli.
Proceeding with outdated version.

✔ Select platform › iOS
✔ Linked to project @myorg/MyProject
    Error: [ios.infoPlist]: withIosInfoPlistBaseMod: ENOENT: no such file or directory, open '/Users/spiderclam/projects/mobile/projectname/GoogleService-Info.plist'
    Code: ENOENT

EAS:

$ eas build --profile production
★ [email protected] is now available.
To upgrade, run npm install -g eas-cli.
Proceeding with outdated version.

✔ Select platform › iOS
✔ Linked to project @myorg/MyProject
    Error: [ios.infoPlist]: withIosInfoPlistBaseMod: ENOENT: no such file or directory, open '/Users/spiderclam/projects/mobile/projectname/GoogleService-Info.plist'
    Code: ENOENT

RWOverdijk avatar Aug 26 '22 08:08 RWOverdijk

When running a non-local build, the eas-build-pre-install script is only executed in the cloud. See the docs https://docs.expo.dev/build-reference/ios-builds/#remote-steps

  • The problem is, as it seems, that you don't have GoogleService-Info.plist locally.
  • You most probably have a reference to the file in app.json/app.config.js.
  • When starting a build, EAS CLI tries to read the app configuration (locally).

Probable solution:

  • Keep GoogleService-Info.plist in the project dir locally.
  • If you don't want to have this file uploaded to EAS Build, add it to .gitignore.

dsokal avatar Aug 26 '22 08:08 dsokal

@dsokal

  1. This is a breaking change.
  2. eas-build-pre-install is being called locally (on 0.58 at least) so what you're saying isn't true.
  3. The issue isn't just with local. With the risk of sounding rude (not meant rude), I don't feel like you've read everything I wrote.

Proof of point 2 (output when running using --local):

[PRE_INSTALL_HOOK] Script 'eas-build-pre-install' is present in package.json, running it...

But I want to repeat, this isn't just about --local. This is about any eas build

RWOverdijk avatar Aug 26 '22 08:08 RWOverdijk

This is a breaking change.

What is a breaking change?

eas-build-pre-install is being called locally (on 0.58 at least) so what you're saying isn't true.

It's called locally only if you run local builds.

I don't feel like you've read everything I wrote.

Vice versa. Please read my comment again https://github.com/expo/eas-cli/issues/1317#issuecomment-1228204303

dsokal avatar Aug 26 '22 08:08 dsokal

What is a breaking change?

It works on 0.58. It doesn't on 0.59. Something broke for me that's why I call it a breaking change. I don't know the change is that broke things for me though, that's what I want to find out 😄

It's called locally only if you run local builds. Vice versa. Please read my comment again

My bad, I read your comment and you're right, I missed the "non-" part. But that's still not the actual issue.

The problem is not eas-build-pre-install. The problem is that it's looking for a file (from a config plugin I think?) before even starting the build.

So like you said:

When running a non-local build, the eas-build-pre-install script is only executed in the cloud.

This sounds perfectly logical to me. But before it gets to running a build, something is already looking for a file. It shouldn't do that and before v0.59 it didn't.

RWOverdijk avatar Aug 26 '22 09:08 RWOverdijk

I see, I can see we upgraded a bunch of packages in 0.59. You could be right. Can you share your app.json/app.config.js?

dsokal avatar Aug 26 '22 09:08 dsokal

Also, I'm aware this could be a breaking change but what do you think about the solution I propose above?

Keep GoogleService-Info.plist in the project dir locally. If you don't want to have this file uploaded to EAS Build, add it to .gitignore.

It's not the "fix" but it should unblock you.

dsokal avatar Aug 26 '22 09:08 dsokal

@dsokal Sure thing.

I do want to note that I already tried removing the entire "plugins" key from the config with the same result. The reason I mention this is because I have a custom plugin in that list, so that's the first thing I tried.

{
  "expo": {
    "backgroundColor": "#ffffff",
    "owner": "ltodev",
    "name": "LTO Dichtbij",
    "slug": "LTO",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/app-icons/icon.png",
    "splash": {
      "image": "./assets/app-icons/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "enabled": false,
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "config": {
        "usesNonExemptEncryption": false
      },
      "associatedDomains": [
        "applinks:ltodichtbij.nl",
        "applinks:landing.test.ltodichtbij.nl"
      ],
      "bundleIdentifier": "nl.ltodichtbij.app",
      "googleServicesFile": "./GoogleService-Info.plist",
      "supportsTablet": false,
      "buildNumber": "57"
    },
    "android": {
      "intentFilters": [
        {
          "action": "VIEW",
          "data": [
            {
              "scheme": "https",
              "host": "*.ltodichtbij.nl",
              "pathPrefix": "/link"
            }
          ],
          "category": [
            "BROWSABLE",
            "DEFAULT"
          ]
        }
      ],
      "package": "nl.ltodichtbij.app",
      "googleServicesFile": "./google-services.json",
      "adaptiveIcon": {
        "foregroundImage": "./assets/app-icons/adaptive-icon.png",
        "backgroundColor": "#FFFFFF"
      },
      "versionCode": 23
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "plugins": [
      "@react-native-firebase/app",
      "@react-native-firebase/crashlytics",
      "./plugins/analytics/disable-ad-id.js"
    ],
    "extra": {
      "eas": {
        "projectId": "b6b896b3-0cd2-47cd-b64a-b4aaa8a33f4c"
      }
    }
  }
}

RWOverdijk avatar Aug 26 '22 09:08 RWOverdijk

It's not the "fix" but it should unblock you.

I've thought about that, but I use eas.json to pick the right file based on the profile. I could move the copy to a bunch of npm scripts instead as a workaround for now?

Or do you mean, even if it's empty I could have the file there for now to shut up the error?

RWOverdijk avatar Aug 26 '22 09:08 RWOverdijk

Or do you mean, even if it's empty I could have the file there for now to shut up the error?

It's definitely worth trying.

dsokal avatar Aug 26 '22 09:08 dsokal

I'll try that. Any way I can find the source of this as well?

RWOverdijk avatar Aug 26 '22 09:08 RWOverdijk

What do you mean?

dsokal avatar Aug 26 '22 09:08 dsokal

I mean, the source of what is trying to find that file. Which package has the withIosInfoPlistBaseMod that is doing this.

I want to help find the source of the issue so I can be a good open source citizen 😄

RWOverdijk avatar Aug 26 '22 09:08 RWOverdijk

I have a similar problem.

I am running a local build on GitHub Actions. I had to use eas-build-pre-install to run a script to get GoogleService-Info.plist etc from GCP Secret Manager (setup.sh).

In Android's eas build, setup.sh is executed in ease-build-pre-install after fetching JKS and other files.

Android build log
Found eas-cli in your project dependencies.
It's recommended to use the "cli.version" field in eas.json to enforce the eas-cli version for your project.
Learn more: https://github.com/expo/eas-cli#enforcing-eas-cli-version-for-your-project

It looks like that you are using a custom metro.config.js that does not extend @expo/metro-config.
This can result in unexpected and hard to debug issues, like missing assets in the production bundle.
Learn more on customizing Metro: https://docs.expo.dev/guides/customizing-metro/
You've run EAS CLI in non-interactive mode, proceeding...
✔ Using remote Android credentials (Expo server)
✔ Using Keystore from configuration: Build Credentials 4e9yuk3Moc (default)
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected].[31](https://github.com/BonBon/aiseki_native/runs/8292228235?check_suite_focus=true#step:8:32): Deprecated due to CVE-2021-21[36](https://github.com/BonBon/aiseki_native/runs/8292228235?check_suite_focus=true#step:8:37)6 resolved in 0.5.0
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws    For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as @graphql-tools/schema, @graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead
[SETUP_WORKINGDIR] Preparing workingdir /tmp/runner/eas-build-local-nodejs/562b107a-06bc-4fef-9998-[38](https://github.com/BonBon/aiseki_native/runs/8292228235?check_suite_focus=true#step:8:39)f7faea58a1
[START_BUILD] Starting build
...

However, in the iOS eas build, the GoogleService-Info.plist check is performed first, and I get Error: [ios.infoPlist]: withIosInfoPlistBaseMod: ENOENT: no such file or directory.

iOS build log
Found eas-cli in your project dependencies.
It's recommended to use the "cli.version" field in eas.json to enforce the eas-cli version for your project.
Learn more: https://github.com/expo/eas-cli#enforcing-eas-cli-version-for-your-project

    Error: [ios.infoPlist]: withIosInfoPlistBaseMod: ENOENT: no such file or 
    directory, open 
    '/Users/runner/work/aiseki_native/aiseki_native/GoogleService-Info.plist'
    Code: ENOENT
Error: Process completed with exit code 1.

Tool versions

  • expo-version: "5.4.3"
  • eas-version: "2.1.0"

However, I have found workaround. It seems to work if I put GoogleService-Info.plist in the directory before running npx eas build --platform ios--local --profile preview --non-interactive.

In my case.

  • Run setup.sh
  • Run npx eas build ...

When I did this workaround, eas-build-pre-install was also executed when building iOS. For Android, it seems that eas-build-pre-install is executed without this workaround.

I have not investigated the code to the bug, but I hope this helps. 🙏

mrtry avatar Sep 11 '22 14:09 mrtry