Skip to contentSkip to conversation

pypi: set SRC_URI with =, not with +=

PATCH Superseded Alexander Kanavin 4 participants 7 messages Jun 22, 2021 – Jun 24, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pypi: set SRC_URI with =, not with +=

This did not cause problems in builds, but broke some devtool workflows such as version upgrades or checking the latest version from upstream. Tarballs should come first, not the patches.

---
 meta/classes/pypi.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/pypi.bbclass +1 -1
index 87b4c85fc0..899126e9e8 100644
@@ -19,7 +19,7 @@ PYPI_SRC_URI ?= "${@pypi_src_uri(d)}"
 
 HOMEPAGE ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/"
 SECTION = "devel/python"
-SRC_URI += "${PYPI_SRC_URI}"
+SRC_URI = "${PYPI_SRC_URI}"
 S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}"
 
 UPSTREAM_CHECK_URI ?= "https://pypi.org/project/${PYPI_PACKAGE}/"
Signature · 1 line
2.31.1
#1 lore raw

That doesn't look completely right to me.

You're absolutely right about devtool expecting the tarball in as the 1st item, but this patch here breaks existing recipes like

SRC_URI += "file://some.patch"

inherit pypi

as the patch will now be dropped.

I would suggest to go for SRC_URI_prepend = "${PYPI_SRC_URI} " which fixes the issue *and* doesn't break exisiting setups

#2 lore raw

Right, I sent an updated patch.

Alex

Quoted 19 lines · Konrad Weihmann

That doesn't look completely right to me.

You're absolutely right about devtool expecting the tarball in as the 1st item, but this patch here breaks existing recipes like

SRC_URI += "file://some.patch"

inherit pypi

as the patch will now be dropped.

I would suggest to go for SRC_URI_prepend = "${PYPI_SRC_URI} " which fixes the issue *and* doesn't break exisiting setups

#3 lore raw

I suggest you use =+ instead of _prepend to maintain expansion order. I.e., if someone does:

inherit pypi

SRC_URI = "http://some_url ${PYPI_SRC_URI}"

However, any way you change it, you risk breaking someone’s use case, but I believe using =+ instead of += should be the least invasive change compared to the current version.

//Peter

From: [email protected] <[email protected]> On Behalf Of Alexander Kanavin
Sent: den 23 juni 2021 10:34
To: Konrad Weihmann <[email protected]>
Cc: OE-core <[email protected]>
Subject: Re: [OE-core] [PATCH] pypi: set SRC_URI with =, not with +=

Right, I sent an updated patch.

Alex

On Wed, 23 Jun 2021 at 09:01, Konrad Weihmann <[email protected]<mailto:[email protected]>> wrote:

That doesn't look completely right to me.

You're absolutely right about devtool expecting the tarball in as the 1st item, but this patch here breaks existing recipes like

SRC_URI += "file://some.patch"

inherit pypi

as the patch will now be dropped.

I would suggest to go for SRC_URI_prepend = "${PYPI_SRC_URI} " which fixes the issue *and* doesn't break exisiting setups

#4 lore raw

Frankly guys, I think maybe we should just break stuff in this case, and have it fixed up properly, then try to guess what workaround might work.

From that perspective the original patch is the most clear.

Alex

Quoted 62 lines · Peter Kjellerstedt

I suggest you use =+ instead of _prepend to maintain expansion order. I.e., if someone does:

inherit pypi

SRC_URI = "http://some_url ${PYPI_SRC_URI}"

However, any way you change it, you risk breaking someone’s use case, but I believe using =+ instead of += should be the least invasive change compared to the current version.

//Peter

*From:* [email protected] < [email protected]> *On Behalf Of *Alexander Kanavin *Sent:* den 23 juni 2021 10:34
*To:* Konrad Weihmann <[email protected]>
*Cc:* OE-core <[email protected]> *Subject:* Re: [OE-core] [PATCH] pypi: set SRC_URI with =, not with +=

Right, I sent an updated patch.

Alex

On Wed, 23 Jun 2021 at 09:01, Konrad Weihmann <[email protected]> wrote:

That doesn't look completely right to me.

You're absolutely right about devtool expecting the tarball in as the 1st item, but this patch here breaks existing recipes like

SRC_URI += "file://some.patch"

inherit pypi

as the patch will now be dropped.

I would suggest to go for SRC_URI_prepend = "${PYPI_SRC_URI} " which fixes the issue *and* doesn't break exisiting setups

#5 lore raw
Quoted 4 lines · Alexander Kanavin

Frankly guys, I think maybe we should just break stuff in this case, and have it fixed up properly, then try to guess what workaround might work.

From that perspective the original patch is the most clear.

The typical ordering of variables etc in recipes is to put SRC_URI before inherit.

From the perspective of trying to get recipes to stick to a standard ordering of variables etc, _prepend seems to be the best solution.

#6 lore raw
Quoted 6 lines · Andre McCurdy
Quoted 2 lines · Alexander Kanavin

Frankly guys, I think maybe we should just break stuff in this case, and

have it fixed up properly, then try to guess what workaround might work.

Quoted 1 line
Quoted 8 lines
Quoted 1 line

From that perspective the original patch is the most clear.

The typical ordering of variables etc in recipes is to put SRC_URI before inherit.

From the perspective of trying to get recipes to stick to a standard ordering of variables etc, _prepend seems to be the best solution.

That's fine with me, we should probably fix up gnomebase.bbclass as well, as using = there adds friction to how SRC_URI must be set in the recipes.

Alex