Combining PREMIRRORS and downloadfilename with wget
Hi,
I'm experience some confusing behaviour when trying to add PREMIRRORS to use an internal proxy for source files fetched over HTTPS, and I'm wondering if this is the intended behaviour or if this is a bug.
If I set the SRC_URI to download a release archive for a tag from GitHub like so:
SRC_URI = "https://github.com/GROUP/PACKAGE/archive/refs/tags/${PV}.tar.gz"
Then I can successfully download it from the internal proxy using the following PREMIRRORS setting:
PREMIRRORS:prepend = "https://github.com/.* https://internal.proxy.url/github/PATH "
This maps the URL correctly and the source archive can be downloaded:
DEBUG: For url https://github.com/group/package/archive/refs/tags/TAG.tar.gz returning https://internal.proxy.url/github/GROUP/PACKAGE/archive/refs/tags/TAG.tar.gz
Everything works fine up until here. However, I want to change the name of the downloaded file to ${BPN}-${PV}.tar.gz to ensure its uniqueness in the download folder, and that's where I start to run into issues.
If I modify the SRC_URI to add downloadfilename like so:
SRC_URI = "https://github.com/GROUP/PACKAGE/archive/refs/tags/${PV}.tar.gz;downloadfilename=${BPN}-${PV}.tar.gz"
Then the URL returned by the PREMIRRORS mapping is wrong and uses the filename specified in downloadfilename in the URL, rather than the original name:
DEBUG: For url https://github.com/GROUP/PACKAGE/archive/refs/tags/TAG.tar.gz;downloadfilename=PACKAGE-TAG.tar.gz returning https://internal.proxy.url/github/GROUP/PACKAGE/archive/refs/tags/PACKAGE-TAG.tar.gz;downloadfilename=PACKAGE-TAG.tar.gz
Notice that the last component of the URL mapped with the PREMIRROR is now "PACKAGE-TAG.tar.gz", rather than just "TAG.tar.gz". This causes the download from the internal proxy to fail with a 404 error as the filename it is trying to download from GitHub is no longer correct.
Is this the intended behaviour when combining PREMIRRORS and downloadfilename? Should I be using some other mechanism to achieve this?
MIRRORS exhibits the same behaviour:
DEBUG: Trying MIRRORS
...
DEBUG: For url https://github.com/GROUP/PACKAGE/archive/refs/tags/TAG.tar.gz;downloadfilename=PACKAGE-TAG.tar.gz returning https://internal.proxy.url/github/GROUP/PACKAGE/archive/refs/tags/PACKAGE-TAG.tar.gz;downloadfilename=PACKAGE-TAG.tar.gz
This was tested using BitBake 2.8.0 and 2.8.1.
Cheers,
Signature · 9 lines
Isaac True emlix GmbH, https://www.emlix.com Fon +49 228 94 77 96 94 Bachstraße 6, 53115 Bonn, Germany Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160 Geschäftsfuehrung: Heike Jordan, Dr. Uwe Kracke Ust-IdNr.: DE 205 198 055 emlix - smart embedded open source
Quoted 3 lines · Isaac True via lists.openembedded.org
I'm experience some confusing behaviour when trying to add PREMIRRORS to use an internal proxy for source files fetched over HTTPS, and I'm wondering if this is the intended behaviour or if this is a bug.
It is a known bug. It was mentioned in the weekly status reports for a while.
Basically nobody has been able to find the time to dive in and unravel things to make everything work as it should.
There may be an open bug for it (I hope!) but if not we should have one open.
We may need to introduce a new parameter with different semantics and remove the current one to properly solve it, going from memory.
Cheers,
Richard
Quoted 6 lines · Richard Purdie via lists.openembedded.org
Quoted 3 lines · Isaac True via lists.openembedded.org
I'm experience some confusing behaviour when trying to add PREMIRRORS to use an internal proxy for source files fetched over HTTPS, and I'm wondering if this is the intended behaviour or if this is a bug.
Quoted 9 lines
It is a known bug. It was mentioned in the weekly status reports for a while.
Basically nobody has been able to find the time to dive in and unravel things to make everything work as it should.
There may be an open bug for it (I hope!) but if not we should have one open.
Sounds like
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15126
Quoted 18 lines
We may need to introduce a new parameter with different semantics and remove the current one to properly solve it, going from memory.
Cheers,
Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#18357):
https://lists.openembedded.org/g/bitbake-devel/message/18357
Mute This Topic: https://lists.openembedded.org/mt/116240177/4316185
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 2 lines
Yoann Congal Smile ECS