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
SDK44: source-login-scripts.sh sourcing in the wrong shell #15723
Comments
This was also happening to me but I'm on a 2017 MacBook pro. My fix was to go into my bash_profile and comment out everything in it. It was able to build after that |
Had the same problem, had to migrate from bash to zsh and nuke everything in ~/.bash_profile |
hi there! please let me double confirm how did you build, by |
Hey @Kudo - thanks for dropping in! |
thanks @zaubara. the call flow is expected to have |
Well, that's exactly the issue. ~/.bash_profile gets sourced, due to this:
But this fails silently, if there's bash-specific code in any of those. I'm just suspecting them being run in zsh, because I can see an error when running it manually in zsh, and building works after removing the offending lines. |
yep, so i would like to know why it transit from bash to zsh. maybe you can verify with these serial commands and make sure the shell insist in bash: $ ps -cp "$$" -o comm="" | sed s/^-//
bash
$ if [ -f /etc/profile ]; then . /etc/profile; fi
$ ps -cp "$$" -o comm="" | sed s/^-//
bash
$ if [ -f ~/.bash_profile ]; then . ~/.bash_profile; fi
$ ps -cp "$$" -o comm="" | sed s/^-//
bash
$ if [ -f ~/.bash_login ]; then . ~/.bash_login; fi
$ ps -cp "$$" -o comm="" | sed s/^-//
bash
$ if [ -f ~/.profile ]; then . ~/.profile; fi
$ ps -cp "$$" -o comm="" | sed s/^-//
bash |
published |
Summary
source-login-scripts.sh will fail silently and break every iOS build, when there is bash-specific code in one of the scripts sourced profiles.
Building an app for iOS will fail with:
Command PhaseScriptExecution failed with a nonzero exit code
or rather
PhaseScriptExecution [CP-User]\ Generate\ app.config\ for\ prebuilt\ Constants.manifest ... (in target 'EXConstants' from project 'Pods')
As it turns out, get-app-config-ios.sh will run source-login-scripts.sh, which will fail silently.
$current_shell will result in "bash", so, for me, ". ~/.bash_profile" will be run. This is, however, not running in bash - it's probably zsh for me.
So, if I would source my ~/.bash_profile in zsh with the same command manually, it will fail (for me) with:
I suspect the same happening for the script. When removing the specific code from .bash_profile, everything works.
So the workaround for users will be removing the offending code (for me, that's commenting out homebrews bash completion), while the actual fix would have to be done in source-login-scripts.sh (see 8db2fac)
Managed or bare workflow? If you have
ios/
orandroid/
directories in your project, the answer is bare!bare
What platform(s) does this occur on?
iOS
SDK Version (managed workflow only)
No response
Environment
Expo CLI 5.0.3 environment info:
System:
OS: macOS 12.1
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.18.2 - ~/.nvm/versions/node/v14.18.2/bin/node
npm: 6.14.15 - ~/.nvm/versions/node/v14.18.2/bin/npm
Watchman: 2021.12.20.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK:
API Levels: 19, 21, 23, 25, 26, 27, 28, 29, 30
Build Tools: 23.0.1, 23.0.2, 25.0.2, 26.0.1, 26.0.2, 27.0.3, 28.0.2, 28.0.3, 29.0.2
System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7935034
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
npmPackages:
babel-preset-expo: 9.0.1 => 9.0.1
expo: ^44.0.2 => 44.0.2
react: 17.0.1 => 17.0.1
react-dom: 17.0.1 => 17.0.1
react-native: 0.64.3 => 0.64.3
react-native-web: 0.17.1 => 0.17.1
npmGlobalPackages:
eas-cli: 0.42.4
expo-cli: 5.0.3
Expo Workflow: bare
Reproducible demo
Have bash-specific code in ~/.bash_profile, like homebrews bash completion:
HOMEBREW_PREFIX=$(brew --prefix)
if type brew &>/dev/null; then
for COMPLETION in "$HOMEBREW_PREFIX"/etc/bash_completion.d/*
do
[[ -f $COMPLETION ]] && source "$COMPLETION"
done
if [[ -f ${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh ]];
then
source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh"
fi
fi
The text was updated successfully, but these errors were encountered: