Skip to content
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

ensurepip uses cache directory #84628

Closed
kkonopko mannequin opened this issue Apr 30, 2020 · 7 comments
Closed

ensurepip uses cache directory #84628

kkonopko mannequin opened this issue Apr 30, 2020 · 7 comments
Labels
3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes build The build process and cross-build topic-installation type-bug An unexpected behavior, bug, or error

Comments

@kkonopko
Copy link
Mannequin

kkonopko mannequin commented Apr 30, 2020

BPO 40448
Nosy @pfmoore, @ncoghlan, @ned-deily, @dstufft, @pradyunsg, @miss-islington, @kkonopko
PRs
  • bpo-40448: ensurepip: Do not use cache #19812
  • [3.9] bpo-40448: ensurepip: Do not use cache (GH-19812) #20893
  • [3.8] bpo-40448: ensurepip: Do not use cache (GH-19812) #20894
  • [3.7] bpo-40448: ensurepip: Do not use cache (GH-19812) #20895
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-06-15.19:24:55.289>
    created_at = <Date 2020-04-30.09:39:11.935>
    labels = ['type-bug', 'expert-installation', '3.9', '3.10', '3.8', 'build', '3.7']
    title = 'ensurepip uses cache directory'
    updated_at = <Date 2020-06-15.19:24:55.281>
    user = 'https://github.com/kkonopko'

    bugs.python.org fields:

    activity = <Date 2020-06-15.19:24:55.281>
    actor = 'ned.deily'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-06-15.19:24:55.289>
    closer = 'ned.deily'
    components = ['Build', 'Installation']
    creation = <Date 2020-04-30.09:39:11.935>
    creator = 'kkonopko'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40448
    keywords = ['patch']
    message_count = 7.0
    messages = ['367751', '369436', '369437', '371579', '371580', '371581', '371582']
    nosy_count = 8.0
    nosy_names = ['paul.moore', 'ncoghlan', 'ned.deily', 'dstufft', 'pradyunsg', 'Marcus.Smith', 'miss-islington', 'kkonopko']
    pr_nums = ['19812', '20893', '20894', '20895']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40448'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10']

    @kkonopko
    Copy link
    Mannequin Author

    kkonopko mannequin commented Apr 30, 2020

    ensurepip optionally installs or upgrades 'pip' and 'setuptools' using the version of those modules bundled with Python. The internal PIP
    installation routine by default temporarily uses its cache, if it
    exists. This is undesirable as Python builds and installations may be
    independent of the user running the build, whilst PIP cache location
    is dependent on the user's environment and outside of the build
    environment.

    At the same time, there's no value in using the cache while installing
    bundled modules. By design ensurepip does not access network so there's no point in checking or in any way accessing the cache.

    This causes a problem in somewhat less usual build environments where Python is built into a designated DESTDIR with --prefix specified etc. If it does not have write permission to the cache directory (eg. $HOME/.cache/pip on Linux), it issues a warning but it installs bundled 'pip' and 'setuptools' fine. But if it does not have execute access (to read directories), it fails hard.

    strace also shows a lot of checks and even temporary use of the cache directory while processing whl files.

    @kkonopko kkonopko mannequin added 3.9 only security fixes build The build process and cross-build topic-installation type-bug An unexpected behavior, bug, or error labels Apr 30, 2020
    @ned-deily
    Copy link
    Member

    Thanks for the PR. We should get a review from at least one of the pip developers. @oradyunsg, @dstufft, @paul.moore, opinions?

    @ned-deily ned-deily added 3.10 only security fixes labels May 20, 2020
    @pfmoore
    Copy link
    Member

    pfmoore commented May 20, 2020

    PR looks good to me. There's a test failure that needs fixing and the PR needs a news entry, but otherwise looks fine.

    @ned-deily
    Copy link
    Member

    New changeset 4a3a682 by Krzysztof Konopko in branch 'master':
    bpo-40448: ensurepip: Do not use cache (GH-19812)
    4a3a682

    @miss-islington
    Copy link
    Contributor

    New changeset b46beb2 by Miss Islington (bot) in branch '3.7':
    bpo-40448: ensurepip: Do not use cache (GH-19812)
    b46beb2

    @miss-islington
    Copy link
    Contributor

    New changeset a1d3be4 by Miss Islington (bot) in branch '3.8':
    bpo-40448: ensurepip: Do not use cache (GH-19812)
    a1d3be4

    @miss-islington
    Copy link
    Contributor

    New changeset 9a0624a by Miss Islington (bot) in branch '3.9':
    bpo-40448: ensurepip: Do not use cache (GH-19812)
    9a0624a

    @ned-deily ned-deily added 3.7 (EOL) end of life 3.8 (EOL) end of life labels Jun 15, 2020
    @ned-deily ned-deily added 3.7 (EOL) end of life 3.8 (EOL) end of life labels Jun 15, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes build The build process and cross-build topic-installation type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants