expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
793 stars 82 forks source link

Env vars empty value #2051

Open moas opened 1 year ago

moas commented 1 year ago

Build/Submit details page URL

No response

Summary

Why does eas not accept empty values for keys declared in its 'env' section. And how can this limitation be bypassed?

Managed or bare?

Managed

Environment

expo-env-info 1.0.5 environment info: System: OS: macOS 13.5.2 Binaries: Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node Yarn: 1.22.19 - ~/.yarn/bin/yarn npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm Watchman: 2023.07.03.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.12.1 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 Android SDK: API Levels: 25, 26, 27, 28, 29, 30, 31 Build Tools: 28.0.3, 30.0.3, 31.0.0, 31.0.0, 31.0.0 System Images: android-29 | Google Play Intel x86 Atom_64, android-30 | Google APIs ARM 64 v8a, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-31 | Google Play ARM 64 v8a, android-S | Google APIs ARM 64 v8a, android-S | Google Play ARM 64 v8a IDEs: Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild npmPackages: expo: ~49.0.8 => 49.0.9 react: 18.2.0 => 18.2.0 react-native: 0.72.4 => 0.72.4 react-native-web: ~0.19.6 => 0.19.8 Expo Workflow: bare

Error output

eas.json is not valid.

Reproducible demo or steps to reproduce from a blank project

In the env section of eas.json file declare empty value for the environnement key and try to run a build.

szdziedzic commented 10 months ago

Hi,

What do you need empty string env vars for?

jmatsushita commented 7 months ago

Personally I need it for eas local builds, because I'm running in a nix environment which has the following bug https://github.com/google/glog/issues/940#issuecomment-1776120110 and therefore requires setting MACOSX_DEPLOYMENT_TARGET to an empty value.

NOTE: using pre-install hooks with unset MACOS_DEPLOYMENT_TARGET when [[ "$EAS_BUILD_RUNNER" == "local-build-plugin" ]]; doesn't work around the problem for me. And the doc's recommendation to use set-env doesn't work with an empty value.

jmatsushita commented 7 months ago

Bit of a hack, but I looked at what set-env did, and this did the trick:

if [[ "$EAS_BUILD_RUNNER" == "local-build-plugin" ]]; then
  echo "Unset MACOSX_DEPLOYMENT_TARGET to avoid nix issue"
  touch $__EAS_BUILD_ENVS_DIR/MACOSX_DEPLOYMENT_TARGET
fi