Skip to content

Include HOME in build environment #1

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

Merged

Conversation

dbnicholson
Copy link

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:

  1. 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.

  2. 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.

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:

1. 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.

2. 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`.
@rtibbles rtibbles merged commit 999271b into learningequality:multi_arch_webview_updates Apr 20, 2022
@dbnicholson dbnicholson deleted the le-home-env branch April 20, 2022 17:38
@coveralls
Copy link

coveralls commented Apr 20, 2022

Pull Request Test Coverage Report for Build 2195757321

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 1 of 2 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.005%) to 61.196%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pythonforandroid/archs.py 1 2 50.0%
Totals Coverage Status
Change from base Build 2192636186: -0.005%
Covered Lines: 4391
Relevant Lines: 6654

💛 - Coveralls

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

Successfully merging this pull request may close these issues.

3 participants