U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/make_pip: Use virtualenv when invoking pip
@ 2025-04-09  7:46 Mattijs Korpershoek
  2025-04-11 19:06 ` Tom Rini
  2025-04-15 17:59 ` Tom Rini
  0 siblings, 2 replies; 6+ messages in thread
From: Mattijs Korpershoek @ 2025-04-09  7:46 UTC (permalink / raw)
  To: Tom Rini, Simon Glass; +Cc: u-boot, Mattijs Korpershoek

Recent Ubuntu versions (24.04+) disallow pip by default when
installing packages. The recommended approach is to use a virtualenv
instead.
Because of this, "make pip" is failing on such versions.

To prepare CI container migration to Ubuntu 24.04, use a virtualenv
in the make_pip script.

Note: This has been reported on [1]

[1] https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/37

Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
---
This has been tested in docker on ubuntu:24.04 after running:
$ apt install python3 python3-virtualenv

with:
$ ./scripts/make_pip.sh u_boot_pylib "-n"

And shows:
Successfully built u_boot_pylib-0.0.6.tar.gz and u_boot_pylib-0.0.6-py3-none-any.whl

Also tested with "$ make pip".
---
 scripts/make_pip.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/make_pip.sh b/scripts/make_pip.sh
index d2639ffd6e43..f7135938b13c 100755
--- a/scripts/make_pip.sh
+++ b/scripts/make_pip.sh
@@ -106,6 +106,10 @@ fi
 mkdir ${dir}/tests
 cd ${dir}
 
+# Use virtualenv
+virtualenv .venv
+source .venv/bin/activate
+
 # Make sure the tools are up to date
 python3 -m pip install --upgrade build
 python3 -m pip install --upgrade twine
@@ -122,6 +126,8 @@ if [ -n "${upload}" ]; then
 	echo "Completed upload of ${tool}"
 fi
 
+# Finish using virtualenv
+deactivate
 rm -rf "${dir}"
 
 echo -e "done\n\n"

---
base-commit: 34820924edbc4ec7803eb89d9852f4b870fa760a
change-id: 20250408-ubuntu-24-04-0dce32b95770

Best regards,
-- 
Mattijs Korpershoek <mkorpershoek@kernel.org>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools/make_pip: Use virtualenv when invoking pip
  2025-04-09  7:46 [PATCH] tools/make_pip: Use virtualenv when invoking pip Mattijs Korpershoek
@ 2025-04-11 19:06 ` Tom Rini
  2025-04-15 17:59 ` Tom Rini
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Rini @ 2025-04-11 19:06 UTC (permalink / raw)
  To: Mattijs Korpershoek; +Cc: Simon Glass, u-boot

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

On Wed, Apr 09, 2025 at 09:46:34AM +0200, Mattijs Korpershoek wrote:

> Recent Ubuntu versions (24.04+) disallow pip by default when
> installing packages. The recommended approach is to use a virtualenv
> instead.
> Because of this, "make pip" is failing on such versions.
> 
> To prepare CI container migration to Ubuntu 24.04, use a virtualenv
> in the make_pip script.
> 
> Note: This has been reported on [1]
> 
> [1] https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/37
> 
> Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools/make_pip: Use virtualenv when invoking pip
  2025-04-09  7:46 [PATCH] tools/make_pip: Use virtualenv when invoking pip Mattijs Korpershoek
  2025-04-11 19:06 ` Tom Rini
@ 2025-04-15 17:59 ` Tom Rini
  2025-04-16  8:25   ` Mattijs Korpershoek
  1 sibling, 1 reply; 6+ messages in thread
From: Tom Rini @ 2025-04-15 17:59 UTC (permalink / raw)
  To: Mattijs Korpershoek; +Cc: Simon Glass, u-boot

[-- Attachment #1: Type: text/plain, Size: 1385 bytes --]

On Wed, Apr 09, 2025 at 09:46:34AM +0200, Mattijs Korpershoek wrote:

> Recent Ubuntu versions (24.04+) disallow pip by default when
> installing packages. The recommended approach is to use a virtualenv
> instead.
> Because of this, "make pip" is failing on such versions.
> 
> To prepare CI container migration to Ubuntu 24.04, use a virtualenv
> in the make_pip script.
> 
> Note: This has been reported on [1]
> 
> [1] https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/37
> 
> Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> ---
> This has been tested in docker on ubuntu:24.04 after running:
> $ apt install python3 python3-virtualenv
> 
> with:
> $ ./scripts/make_pip.sh u_boot_pylib "-n"
> 
> And shows:
> Successfully built u_boot_pylib-0.0.6.tar.gz and u_boot_pylib-0.0.6-py3-none-any.whl
> 
> Also tested with "$ make pip".
> ---
>  scripts/make_pip.sh | 6 ++++++
>  1 file changed, 6 insertions(+)

So, this ends up failing with Ubuntu 22.04 thusly:
https://source.denx.de/u-boot/u-boot/-/jobs/1103567

And in short, I think your original plan to use venv not virtualenv is
correct, sorry for the noise. I'll post something to install
python3-venv to our container shortly and switch to venv not virtualenv
as that seems to be the long term best answer.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools/make_pip: Use virtualenv when invoking pip
  2025-04-15 17:59 ` Tom Rini
@ 2025-04-16  8:25   ` Mattijs Korpershoek
  2025-04-16 12:38     ` Mattijs Korpershoek
  0 siblings, 1 reply; 6+ messages in thread
From: Mattijs Korpershoek @ 2025-04-16  8:25 UTC (permalink / raw)
  To: Tom Rini, Mattijs Korpershoek; +Cc: Simon Glass, u-boot

Hi Tom,

On mar., avril 15, 2025 at 11:59, Tom Rini <trini@konsulko.com> wrote:

> On Wed, Apr 09, 2025 at 09:46:34AM +0200, Mattijs Korpershoek wrote:
>
>> Recent Ubuntu versions (24.04+) disallow pip by default when
>> installing packages. The recommended approach is to use a virtualenv
>> instead.
>> Because of this, "make pip" is failing on such versions.
>> 
>> To prepare CI container migration to Ubuntu 24.04, use a virtualenv
>> in the make_pip script.
>> 
>> Note: This has been reported on [1]
>> 
>> [1] https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/37
>> 
>> Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
>> Reviewed-by: Tom Rini <trini@konsulko.com>
>> ---
>> This has been tested in docker on ubuntu:24.04 after running:
>> $ apt install python3 python3-virtualenv
>> 
>> with:
>> $ ./scripts/make_pip.sh u_boot_pylib "-n"
>> 
>> And shows:
>> Successfully built u_boot_pylib-0.0.6.tar.gz and u_boot_pylib-0.0.6-py3-none-any.whl
>> 
>> Also tested with "$ make pip".
>> ---
>>  scripts/make_pip.sh | 6 ++++++
>>  1 file changed, 6 insertions(+)
>
> So, this ends up failing with Ubuntu 22.04 thusly:
> https://source.denx.de/u-boot/u-boot/-/jobs/1103567

Argh, sorry I did not test that.

>
> And in short, I think your original plan to use venv not virtualenv is
> correct, sorry for the noise. I'll post something to install
> python3-venv to our container shortly and switch to venv not virtualenv
> as that seems to be the long term best answer.

Ok, will send a v2 to use venv instead.

>
> -- 
> Tom

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools/make_pip: Use virtualenv when invoking pip
  2025-04-16  8:25   ` Mattijs Korpershoek
@ 2025-04-16 12:38     ` Mattijs Korpershoek
  2025-04-16 13:58       ` Tom Rini
  0 siblings, 1 reply; 6+ messages in thread
From: Mattijs Korpershoek @ 2025-04-16 12:38 UTC (permalink / raw)
  To: Mattijs Korpershoek, Tom Rini, Mattijs Korpershoek; +Cc: Simon Glass, u-boot

On mer., avril 16, 2025 at 10:25, Mattijs Korpershoek <mkorpershoek@kernel.org> wrote:

> Hi Tom,
>
> On mar., avril 15, 2025 at 11:59, Tom Rini <trini@konsulko.com> wrote:
>
>> On Wed, Apr 09, 2025 at 09:46:34AM +0200, Mattijs Korpershoek wrote:
>>
>>> Recent Ubuntu versions (24.04+) disallow pip by default when
>>> installing packages. The recommended approach is to use a virtualenv
>>> instead.
>>> Because of this, "make pip" is failing on such versions.
>>> 
>>> To prepare CI container migration to Ubuntu 24.04, use a virtualenv
>>> in the make_pip script.
>>> 
>>> Note: This has been reported on [1]
>>> 
>>> [1] https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/37
>>> 
>>> Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
>>> Reviewed-by: Tom Rini <trini@konsulko.com>
>>> ---
>>> This has been tested in docker on ubuntu:24.04 after running:
>>> $ apt install python3 python3-virtualenv
>>> 
>>> with:
>>> $ ./scripts/make_pip.sh u_boot_pylib "-n"
>>> 
>>> And shows:
>>> Successfully built u_boot_pylib-0.0.6.tar.gz and u_boot_pylib-0.0.6-py3-none-any.whl
>>> 
>>> Also tested with "$ make pip".
>>> ---
>>>  scripts/make_pip.sh | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>
>> So, this ends up failing with Ubuntu 22.04 thusly:
>> https://source.denx.de/u-boot/u-boot/-/jobs/1103567
>
> Argh, sorry I did not test that.
>
>>
>> And in short, I think your original plan to use venv not virtualenv is
>> correct, sorry for the noise. I'll post something to install
>> python3-venv to our container shortly and switch to venv not virtualenv
>> as that seems to be the long term best answer.
>
> Ok, will send a v2 to use venv instead.

Posted here:
https://lore.kernel.org/all/87ikn44io3.fsf@kernel.org/

As mentioned in the cover letter, this requires python3-venv to be added
in the container and I've assumed you will be doing that, Tom.

Thanks!

>
>>
>> -- 
>> Tom

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools/make_pip: Use virtualenv when invoking pip
  2025-04-16 12:38     ` Mattijs Korpershoek
@ 2025-04-16 13:58       ` Tom Rini
  0 siblings, 0 replies; 6+ messages in thread
From: Tom Rini @ 2025-04-16 13:58 UTC (permalink / raw)
  To: Mattijs Korpershoek; +Cc: Simon Glass, u-boot

[-- Attachment #1: Type: text/plain, Size: 2151 bytes --]

On Wed, Apr 16, 2025 at 02:38:00PM +0200, Mattijs Korpershoek wrote:
> On mer., avril 16, 2025 at 10:25, Mattijs Korpershoek <mkorpershoek@kernel.org> wrote:
> 
> > Hi Tom,
> >
> > On mar., avril 15, 2025 at 11:59, Tom Rini <trini@konsulko.com> wrote:
> >
> >> On Wed, Apr 09, 2025 at 09:46:34AM +0200, Mattijs Korpershoek wrote:
> >>
> >>> Recent Ubuntu versions (24.04+) disallow pip by default when
> >>> installing packages. The recommended approach is to use a virtualenv
> >>> instead.
> >>> Because of this, "make pip" is failing on such versions.
> >>> 
> >>> To prepare CI container migration to Ubuntu 24.04, use a virtualenv
> >>> in the make_pip script.
> >>> 
> >>> Note: This has been reported on [1]
> >>> 
> >>> [1] https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/37
> >>> 
> >>> Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> >>> Reviewed-by: Tom Rini <trini@konsulko.com>
> >>> ---
> >>> This has been tested in docker on ubuntu:24.04 after running:
> >>> $ apt install python3 python3-virtualenv
> >>> 
> >>> with:
> >>> $ ./scripts/make_pip.sh u_boot_pylib "-n"
> >>> 
> >>> And shows:
> >>> Successfully built u_boot_pylib-0.0.6.tar.gz and u_boot_pylib-0.0.6-py3-none-any.whl
> >>> 
> >>> Also tested with "$ make pip".
> >>> ---
> >>>  scripts/make_pip.sh | 6 ++++++
> >>>  1 file changed, 6 insertions(+)
> >>
> >> So, this ends up failing with Ubuntu 22.04 thusly:
> >> https://source.denx.de/u-boot/u-boot/-/jobs/1103567
> >
> > Argh, sorry I did not test that.
> >
> >>
> >> And in short, I think your original plan to use venv not virtualenv is
> >> correct, sorry for the noise. I'll post something to install
> >> python3-venv to our container shortly and switch to venv not virtualenv
> >> as that seems to be the long term best answer.
> >
> > Ok, will send a v2 to use venv instead.
> 
> Posted here:
> https://lore.kernel.org/all/87ikn44io3.fsf@kernel.org/
> 
> As mentioned in the cover letter, this requires python3-venv to be added
> in the container and I've assumed you will be doing that, Tom.

Yup, thanks again!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-04-16 13:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-09  7:46 [PATCH] tools/make_pip: Use virtualenv when invoking pip Mattijs Korpershoek
2025-04-11 19:06 ` Tom Rini
2025-04-15 17:59 ` Tom Rini
2025-04-16  8:25   ` Mattijs Korpershoek
2025-04-16 12:38     ` Mattijs Korpershoek
2025-04-16 13:58       ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox