Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Set environment variables for use in Termux #240

Merged
merged 1 commit into from Jul 10, 2018
Merged

Set environment variables for use in Termux #240

merged 1 commit into from Jul 10, 2018

Conversation

chromicant
Copy link
Contributor

Termux uses LD_PRELOAD and LD_LIBRARY_PATH to get around a few issues with the dynamic linker in Android. The issue with antibody is that in git.go, an environment variable is set before calling the git binary. This causes the environment of the git process to contain the GIT_TERMINAL_PROMPT=0 environment variable only, and git cannot find its shared libs on Termux in Android.

This patch checks to see if LD_LIBRARY_PATH and LD_PRELOAD is set, and if the variable is set, sets those variables.

@caarlos0
Copy link
Member

I think the best solution is to append the entire os.Environ(), something like:

cmd.Env = append(os.Environ(), "GIT_TERMINAL_PROMPT=0")

what do you think?

@chromicant
Copy link
Contributor Author

Made the recommended change. I also think it's a good idea.

@caarlos0
Copy link
Member

lint issues are on me.

thanks

@caarlos0 caarlos0 merged commit 83f36b9 into getantibody:master Jul 10, 2018
@schrej
Copy link

schrej commented Jul 11, 2018

This also allows running antibody behind a http proxy as git applies the proxy variables/the global git config properly when it has the os.Environ() variables.

@caarlos0
Copy link
Member

This also allows running antibody behind a http proxy as git applies the proxy variables/the global git config properly when it has the os.Environ() variables.

Awesome!@

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants