All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v2 1/2] utils/scanpypi: ensure tmp_extract is cleaned up on exception
Date: Thu, 4 Aug 2022 09:59:07 +0200	[thread overview]
Message-ID: <20220804095907.4b22adc0@windsurf> (raw)
In-Reply-To: <CADvTj4r9D=kUa-N+HC2tVTt7Oxna=ZMSp-H5POaYzE2DsXCD-w@mail.gmail.com>

Hello,

On Wed, 3 Aug 2022 16:02:43 -0600
James Hilliard <james.hilliard1@gmail.com> wrote:

> > If I understand correctly self.tmp_extract is where the Python package
> > source code is extracted. So if you remove it at the end of
> > load_setup(), how will your new load_pyproject() added in PATCH 2/2 be
> > able to use the package source code?  
> 
> We're not deleting self.tmp_extract, we're just ensuring we current dir and
> sys.path states are cleaned up properly on failure, load_pyproject() does the
> same thing. Always restoring initial state at the end means load_pyproject()
> doesn't need to deal with current dir and sys.path global state changes induced
> by load_setup().
> 
> >
> > Also, why is this removal needed, as anyway the full tmp_path gets
> > removed at the end of the main() function?  
> 
> sys.path.remove(self.tmp_extract) is not the same as shutil.rmtree(tmp_path)
> 
> We're restoring the module search path at the end to avoid leaking global state
> changes when there's an exception.

Aaah, yes, my bad! I guess I shouldn't have reviewed this past midnight.

I'll go ahead and apply PATCH 1/2.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-08-04  7:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-13 17:13 [Buildroot] [PATCH v2 1/2] utils/scanpypi: ensure tmp_extract is cleaned up on exception James Hilliard
2022-03-13 17:13 ` [Buildroot] [PATCH v2 2/2] utils/scanpypi: add flit package support James Hilliard
2022-08-03 21:46   ` Thomas Petazzoni via buildroot
2022-08-03 22:19     ` James Hilliard
2022-08-17  0:48   ` Marcus Hoffmann
2022-08-17  5:56     ` James Hilliard
2022-08-17 14:24       ` Marcus Hoffmann
2022-08-18  8:32         ` James Hilliard
2022-08-03 21:38 ` [Buildroot] [PATCH v2 1/2] utils/scanpypi: ensure tmp_extract is cleaned up on exception Thomas Petazzoni via buildroot
2022-08-03 22:02   ` James Hilliard
2022-08-04  7:59     ` Thomas Petazzoni via buildroot [this message]
2022-08-17  5:57       ` James Hilliard
2022-08-17  6:16         ` James Hilliard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220804095907.4b22adc0@windsurf \
    --to=buildroot@buildroot.org \
    --cc=james.hilliard1@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.