Skip to contentSkip to conversation

fetch/git: Handle github dropping git:// support

PATCH Richard Purdie 4 participants 8 messages Nov 3, 2021 – Nov 11, 2021 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 13 lines · Richard Purdie via lists.openembedded.org

github is dropping support for git procotol iun git urls. Add code to remap this to https in a way that could be used in older bitbake versions.

---
 lib/bb/fetch2/git.py | 4 ++++
 1 file changed, 4 insertions(+)
lib/bb/fetch2/git.py +0 -0
index e974445fbe..f5be24d6ab 100644

lib/bb/fetch2/git.py class Git(FetchMethod): · line 151

Quoted 10 lines
lib/bb/fetch2/git.py +4 -0
@@ -142,6 +142,10 @@ class Git(FetchMethod):
             ud.proto = 'file'
         else:
             ud.proto = "git"
+        if ud.host == "github.com" and ud.proto == "git":
+            # github stopped supporting git protocol
+            # https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git
+            ud.proto = "https"
 
         if not ud.proto in ('git', 'file', 'ssh', 'http', 'https', 'rsync'):
             raise bb.fetch2.ParameterError("Invalid protocol type", ud.url)

To make things a bit easier for everyone, I did backport this to a number of the older bitbake branches back to 1.40.

Cheers,

Richard

#2 lore raw

Hi Richard,

Are there any plans to backport this fix to older versions of bitbake/poky? My company has a line of legacy embedded products that are only supported in older versions of our Yocto distribution (1.3 in the most extreme case), and although we can manually change the protocol from git to https in the recipes in our layer, we can't do the same for other third party layers our distribution depends on (meta-qt5, meta-freescale, poky...). Since backporting the fix to older bitbake versions is trivial, do you intend to incorporate it in older bibake/poky versions in the near future?

Otherwise, are there any alternative approaches we can take to ensure that users that depend on our legacy products can continue to build our Yocto distribution? Upgrading our entire legacy line to newer Yocto versions is not a viable solution for us.

Thanks and best regards,
Gabriel

#3 lore raw

If the versions are very old (anything older than dunfell really), I think the only viable path for you is to make private copies of respective yocto repositories, and patch them as needed.

Alex

Quoted 30 lines · gabriel.valcazar via lists.openembedded.org

Hi Richard,

Are there any plans to backport this fix to older versions of bitbake/poky? My company has a line of legacy embedded products that are only supported in older versions of our Yocto distribution (1.3 in the most extreme case), and although we can manually change the protocol from git to https in the recipes in our layer, we can't do the same for other third party layers our distribution depends on (meta-qt5, meta-freescale, poky...). Since backporting the fix to older bitbake versions is trivial, do you intend to incorporate it in older bibake/poky versions in the near future?

Otherwise, are there any alternative approaches we can take to ensure that users that depend on our legacy products can continue to build our Yocto distribution? Upgrading our entire legacy line to newer Yocto versions is not a viable solution for us.

Thanks and best regards,
Gabriel
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#12982):
https://lists.openembedded.org/g/bitbake-devel/message/12982
Mute This Topic: https://lists.openembedded.org/mt/86764631/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw
In reply to [email protected]

FWIW: It was already backported all the way to 1.40 version used in Yocto 2.6 Thud:
https://git.openembedded.org/bitbake/log/?h=1.40

All the way till 1.16 version used in Yocto 1.3 Danny, is still quite long. Maybe you can backport the bitbake patch on your end? I would be surprised if you don't have bunch of various other changes backported just to keep these ancient builds going _and_ reliable PREMIRROR to never access upstream repos from 2012.

Quoted 30 lines · gabriel.valcazar via lists.openembedded.org

Hi Richard,

Are there any plans to backport this fix to older versions of bitbake/poky? My company has a line of legacy embedded products that are only supported in older versions of our Yocto distribution (1.3 in the most extreme case), and although we can manually change the protocol from git to https in the recipes in our layer, we can't do the same for other third party layers our distribution depends on (meta-qt5, meta-freescale, poky...). Since backporting the fix to older bitbake versions is trivial, do you intend to incorporate it in older bibake/poky versions in the near future?

Otherwise, are there any alternative approaches we can take to ensure that users that depend on our legacy products can continue to build our Yocto distribution? Upgrading our entire legacy line to newer Yocto versions is not a viable solution for us.

Thanks and best regards,
Gabriel
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#12982):
https://lists.openembedded.org/g/bitbake-devel/message/12982
Mute This Topic: https://lists.openembedded.org/mt/86764631/3617156
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw

Thanks all for the suggestions. Indeed, creating a fork of poky and applying the fix ourselves seems like a reasonable solution if there is no official fix for old versions.

I've just tested applying the patch to *bitbake 1.18* , and I'm able to build my Yocto 1.4 distribution with no problem. Is it not possible to officially backport the patch all the way back to bitbake 1.18? I could provide the patches, but they're literally just clean cherry-picks of the bitbake 1.40 patch.

Regards,
Gabriel

#6 lore raw
Quoted 10 lines · gabriel.valcazar via lists.openembedded.org

Thanks all for the suggestions. Indeed, creating a fork of poky and applying the
fix ourselves seems like a reasonable solution if there is no official fix for old versions.

I've just tested applying the patch to bitbake 1.18, and I'm able to build my Yocto 1.4 distribution with no problem. Is it not possible to officially backport the patch all the way back to bitbake 1.18? I could provide the patches, but they're literally just clean cherry-picks of the bitbake 1.40 patch.

The trouble is there are a *lot* of fixes missing from 1.18. If we start backporting this one, which other ones should we backport? If I don't say "no" to this one, which other ones would I then need to take?

I appreciate this one is relatively safe and easy but it is also very easy to backport something which applies cleanly but causes all kinds of issues.

We can't really start giving the impression we support things as old as 1.18, much as I'd like to help. I can't imagine this is the only fix you need with 1.18?

Cheers,

Richard

#7 lore raw

Hi Richard,

Thanks for the explanation. I fully understand the reasoning behind your decision, but I really think this issue requires specific treatment due to its nature.

Ideally, customers using our legacy products (and thus, really old versions of our Yocto distribution) would migrate to newer products running newer software, and these situations would be avoided altogether. However, we're talking about products that are already in production, with several devices in the field that require periodic updates. Maintaining outdated software, while not recommendable from several standpoints, is oftentimes a more efficient approach than migrating to something newer, especially in these cases.

Older Yocto builds are still possible for us and our customers via docker containers or virtual machines, which provide "old" environments where the builds still work, despite all of the missing fixes in bitbake/poky. Basically, rather than patching the Yocto stack to fit our environment, we adapt our environment to fit the Yocto stack - again, because several legacy customers have made the decision to depend on old Yocto versions.

Having said this, I believe GitHub's deprecation of the git protocol is a special case because, regardless of the environment you're using or how many patches you've backported so far, builds will simply stop working altogether after the plug is pulled. No matter which environment we use, this is an external factor that's going to force changes in the Yocto stack, in areas that we have little to no control over. We're going to have to fix it either way, but it would be a much smoother transition if the fix were included by the community, and it's a unique enough case to warrant it being patched in older bitbake versions (in my opinion).

Forgive me for the insistence, but I truly believe this situation requires exceptional treatment.

Best regards,
Gabriel

#8 lore raw

Are your customers paying anyone in the ‘community’ for this work or any other work we do? Seriously, if you want anyone to pay attention to ancient yocto versions, you have to support that financially.

Alex

Quoted 48 lines · gabriel.valcazar via lists.openembedded.org

Hi Richard,

Thanks for the explanation. I fully understand the reasoning behind your decision, but I really think this issue requires specific treatment due to its nature.

Ideally, customers using our legacy products (and thus, really old versions of our Yocto distribution) would migrate to newer products running newer software, and these situations would be avoided altogether. However, we're talking about products that are already in production, with several devices in the field that require periodic updates. Maintaining outdated software, while not recommendable from several standpoints, is oftentimes a more efficient approach than migrating to something newer, especially in these cases.

Older Yocto builds are still possible for us and our customers via docker containers or virtual machines, which provide "old" environments where the builds still work, despite all of the missing fixes in bitbake/poky. Basically, rather than patching the Yocto stack to fit our environment, we adapt our environment to fit the Yocto stack - again, because several legacy customers have made the decision to depend on old Yocto versions.

Having said this, I believe GitHub's deprecation of the *git *protocol is a special case because, regardless of the environment you're using or how many patches you've backported so far, builds will simply stop working altogether after the plug is pulled. No matter which environment we use, this is an external factor that's going to force changes in the Yocto stack, in areas that we have little to no control over. We're going to have to fix it either way, but it would be a much smoother transition if the fix were included by the community, and it's a unique enough case to warrant it being patched in older bitbake versions (in my opinion).

Forgive me for the insistence, but I truly believe this situation requires exceptional treatment.

Best regards,
Gabriel
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#13015):
https://lists.openembedded.org/g/bitbake-devel/message/13015
Mute This Topic: https://lists.openembedded.org/mt/86764631/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-