-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
added support for chruby #6301
added support for chruby #6301
Conversation
Thanks for your pull request @tcurdt. I don't have a lot of knowledge around this. @nafu Would that solve the issue for you? (via #6277 (comment)) |
It did solve a big issue for me - if that counts :) |
|
@dflems I am not sure I am getting your point. This is how one includes
Because it's function it is I also don't see a good reason why one should use a custom way of unsetting the |
chruby is added by sourcing a few scripts in your shell and it becomes available as a function in your shell. We shouldn't make the expectation that that function will be available anywhere that For instance, this doesn't work for me because I use zsh and source the chruby scripts into my Unsetting the ruby-specific environment variables will cover the general use-case for chruby and rbenv across-the-board (and maybe RVM too). We might be able go go even further by just obliterating anything set in the user shell and starting fresh: #!/usr/bin/env -i sh
# ^ starts a fresh shell with no environment
# source system-wide profile
source /etc/profile
# xcode should not be polluted :D
xcodebuild "$@" EDIT: The above solution is actually no good because it strips ALL environment variables. There are some that we might want to make it through to |
I am using a Right now the assumption is that if there is a I don't understand your scenario yet though. If you use Resetting the full env sounds like an easy approach on the first glance - but users might expect env variables to be there that suddenly aren't. I am not convinced this will turn out to be the best approach in real life. |
@tcurdt: Even if the shebang specifies that it should run the bash login shell, the script will still inherit the environment from its parent process (in this case fastlane which itself inherits from the shell that's executing it). It won't have a pristine environment, so Functions are not inherited, especially across shells, so in my case, |
After looking at the code and the discussion, I agree with @dflems that this is a very specific solution that probably wouldn't work for most users. I'm closing this for now, as the underlying issues have been resolved (see 5240#issuecomment-253082825) - that should affect most users. If there is still an issue, let us know and we can reopen the discussion! 🚀 |
Thanks for contributing to fastlane! Before you submit your pull request, please make sure to check the following boxes:
rspec
for all tools you modifiedrubocop -a
to ensure the code style is validBefore submitting a pull request, we appreciate if you create an issue first to discuss the change 👍 ... This is related to
#5240
#6277
and various other issues potential "device not found" issues.
Anyway - this is what finally fixed many issues for me. Would be great to get this merged.
(Who would have thought that the
xcodebuild
has a dependency to system ruby?!)