Skip to content
This repository has been archived by the owner on Apr 7, 2023. It is now read-only.

Turtle not compatible with Yarn 3 #371

Open
5 tasks done
cm-nutrien opened this issue Dec 23, 2021 · 0 comments
Open
5 tasks done

Turtle not compatible with Yarn 3 #371

cm-nutrien opened this issue Dec 23, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@cm-nutrien
Copy link

New Issue Checklist

  • Updated turtle-cli to the latest version (yarn global add turtle-cli or npm install --global turtle-cli).
  • I read the Contribution Guidelines.
  • I read docs.expo.dev (Managed Workflow > Distributing Your App).
  • I searched for existing GitHub issues.
  • I enclosed the complete output when running turtle, including the stack trace and command used.

Issue Description

Building a standalone Android app fails due to an incompatibility with modern versions of Yarn (berry, or more specifically in this case, Yarn 3). On line 106 of src/bin/setup/android/index.ts the yarn/npm command is invoked with the following flags: 'install', '--ignore-scripts', '--production'. However, in Yarn 3, these are not valid flags and using them results in a failure to build the app.

Valid flags for yarn install in Yarn v3 are: --json, --immutable, --immutable-cache, --check-cache, --inline-builds, --mode #0

I'm not certain what the flags should be in order to replicate the yarn v1 behavior. The official Yarn docs on this page (towards the bottom of the page) describe how to achieve the same affect as yarn install --production but its using the workspaces focus command to do so instead of the install command. I'm unsure if that would work as a drop in replacement because I haven't used that particular feature in Yarn 3.

Ideally, using any version of Yarn would result in a successful build.

This problem did not happen when building a standalone iOS app.

Command executed
yarn exec turtle build:android \
--output "$BITRISE_DEPLOY_DIR/$androidAppFile" \
--mode release \
--type apk \
--release-channel $RELEASE_CHANNEL \
--keystore-path ../../keystore.jks \
--keystore-alias $EXPO_ANDROID_KEYSTORE_ALIAS
Complete output when running turtle, including the stack trace and command used
 
Dec 22 19:38:23 turtle[6381] INFO:  extracting shell app (this may take a while)...
  platform: "android"
  buildPhase: "setting up environment"
Dec 22 19:40:12 turtle[6381] INFO:  shell app extracted
  platform: "android"
  buildPhase: "setting up environment"
Dec 22 19:40:12 turtle[6381] INFO:  installing dependencies in /Users/vagrant/.turtle/workingdir/android/sdk41 directory...
  platform: "android"
  buildPhase: "setting up environment"
Dec 22 19:40:12 turtle[6381] INFO:  Unknown Syntax Error: Unsupported option name ("--ignore-scripts").
  platform: "android"
  buildPhase: "setting up environment"
  source: "stdout"
Dec 22 19:40:12 turtle[6381] INFO:  $ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]
  platform: "android"
  buildPhase: "setting up environment"
  source: "stdout"
Dec 22 19:40:12 turtle[6381] ERROR: Failed to build standalone app
  err: Error: yarn exited with non-zero code: 1
      at ChildProcess.completionListener (/Users/vagrant/git/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
      at Object.onceWrapper (events.js:421:26)
      at ChildProcess.emit (events.js:314:20)
      at ChildProcess.EventEmitter.emit (domain.js:483:12)
      at maybeClose (internal/child_process.js:1022:16)
      at Socket. (internal/child_process.js:444:11)
      at Socket.emit (events.js:314:20)
      at Socket.EventEmitter.emit (domain.js:483:12)
      at Pipe. (net.js:675:12)
      ...
      at spawnAsync (/Users/vagrant/git/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
      at Object.spawnAsyncThrowError (/@expo/[email protected]/src/detach/ExponentTools.ts:111:19)
      at _installNodeModules (/Users/vagrant/git/node_modules/turtle-cli/src/bin/setup/android/index.ts:106:23)
      at _shellAppPostDownloadAction (/Users/vagrant/git/node_modules/turtle-cli/src/bin/setup/android/index.ts:91:5)
      at Object.ensureShellAppIsPresent (/Users/vagrant/git/node_modules/turtle-cli/src/bin/setup/utils/common.ts:40:5)
      at Object.setup [as default] (/Users/vagrant/git/node_modules/turtle-cli/src/bin/setup/android/index.ts:60:5)
      at Object.setup [as default] (/Users/vagrant/git/node_modules/turtle-cli/src/bin/setup/setup.ts:15:12)
      at /Users/vagrant/git/node_modules/turtle-cli/src/bin/utils/builder.ts:79:7
      at Command. (/Users/vagrant/git/node_modules/turtle-cli/src/bin/index.ts:23:12)
  platform: "android"
 

Environment

 
Expo CLI 4.13.0 environment info:
    System:
      OS: macOS 11.6
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
      Yarn: 3.1.1 - ~/.nvm/versions/node/v14.17.0/bin/yarn
      npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm
      Watchman: 2021.09.06.00 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.11.2 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    IDEs:
      Android Studio: Arctic Fox 2020.3.1 Patch 4 Arctic Fox 2020.3.1 Patch 4
      Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
    npmGlobalPackages:
      expo-cli: 4.13.0
    Expo Workflow: managed
 
@cm-nutrien cm-nutrien added the bug Something isn't working label Dec 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant