Include HOME in build environment #1
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Many of the tools run by p4a store intermediate files in the user's home
directory. Passing the HOME environment variable to the build
environment has 2 positive effects:
To completely encapsulate the build, HOME can be set to an alternate
directory than the user's actual home directory. Many tools such as
p4a have options to override these paths, but that must be done on a
case by case basis and it would require that p4a pass through these
options or environment variables.
In containerized environments the user may not be registered in the
accounts database. If the user's home directory can't be found from
the HOME environment variable or the accounts database, many tools
will fail. An example of this is python2.7 when run by
ndk-build
.I sent this upstream in kivy#2582, but I have no idea when it will be merged. The ultimate goal I have here is to allow building as an unprivileged user in docker without defining a user in the container. Then you don't need to copy things in and out of the container. That only works if p4a doesn't filter out the
HOME
environment variable.