Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Env vars empty value #2051

Open
moas opened this issue Sep 12, 2023 · 3 comments
Open

Env vars empty value #2051

moas opened this issue Sep 12, 2023 · 3 comments
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@moas
Copy link

moas commented Sep 12, 2023

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.

  • "build.base.env.EXPO_PUBLIC_XXX" is not allowed to be empty
  • "build.base.env.EXPO_PUBLIC_YYY" is not allowed to be empty
  • "build.development.env.EXPO_PUBLIC_ZZZ" is not allowed to be empty
    Error: build command failed.

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.

@moas moas added the needs review Issue is ready to be reviewed by a maintainer label Sep 12, 2023
@szdziedzic
Copy link
Member

Hi,

What do you need empty string env vars for?

@jmatsushita
Copy link

jmatsushita commented Feb 29, 2024

Personally I need it for eas local builds, because I'm running in a nix environment which has the following bug google/glog#940 (comment) 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
Copy link

jmatsushita commented Feb 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants