Skip to contentSkip to conversation

hg: Add python3-native to native paths

PATCH In review Khem Raj 2 participants 3 messages Nov 28, 2019

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 hg: Add python3-native to native paths

This helps fix an issue where python interpreter in hg script could overflow the BINPRM_BUF_SIZE which is 128 on most of systems, because interpreter is hardcoded and build paths can be deep.

This patch helps, because now the absolute python interp path in hg can be replaced with '/usr/bin/env python3' and it will ensure that python3 from native install is used instead of the one on host.

---
 lib/bb/fetch2/hg.py | 1 +
 1 file changed, 1 insertion(+)
lib/bb/fetch2/hg.py +1 -0
index e21115de..a640a80c 100644
@@ -65,6 +65,7 @@ class Hg(FetchMethod):
         ud.pkgdir = os.path.join(hgdir, hgsrcname)
         ud.moddir = os.path.join(ud.pkgdir, ud.module)
         ud.localfile = ud.moddir
+        d.appendVar("EXTRANATIVEPATH", " python3-native ")
         ud.basecmd = d.getVar("FETCHCMD_hg") or "/usr/bin/env hg"
 
         ud.setup_revisions(d)
Signature · 1 line
2.24.0
#1 lore raw

EXTRANATIVEPATH is an oe-core-ism, not bitbake, so this isn’t an appropriate place for it. Perhaps in do_fetch in base.bbclass.

Quoted 33 lines · On Nov 27, 2019, 9:10 PM -0700, Khem Raj <[email protected]>, wrote:

This helps fix an issue where python interpreter in hg script could overflow the BINPRM_BUF_SIZE which is 128 on most of systems, because interpreter is hardcoded and build paths can be deep.

This patch helps, because now the absolute python interp path in hg can be replaced with '/usr/bin/env python3' and it will ensure that python3 from native install is used instead of the one on host.

---
lib/bb/fetch2/hg.py | 1 +

1 file changed, 1 insertion(+)
lib/bb/fetch2/hg.py +0 -0
index e21115de..a640a80c 100644
@@ -65,6 +65,7 @@ class Hg(FetchMethod):
 ud.pkgdir = os.path.join(hgdir, hgsrcname)
 ud.moddir = os.path.join(ud.pkgdir, ud.module)

ud.localfile = ud.moddir
+ d.appendVar("EXTRANATIVEPATH", " python3-native ") ud.basecmd = d.getVar("FETCHCMD_hg") or "/usr/bin/env hg"

ud.setup_revisions(d)
--
2.24.0

--
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel

author
#2 lore raw
Quoted 3 lines · Christopher Larson

EXTRANATIVEPATH is an oe-core-ism, not bitbake, so this isn’t an appropriate place for it. Perhaps in do_fetch in base.bbclass.

Perhaps a better idea thanks

Quoted 36 lines · On Nov 27, 2019, 9:10 PM -0700, Khem Raj <[email protected]>, wrote:

This helps fix an issue where python interpreter in hg script could overflow the BINPRM_BUF_SIZE which is 128 on most of systems, because interpreter is hardcoded and build paths can be deep.

This patch helps, because now the absolute python interp path in hg can be replaced with '/usr/bin/env python3' and it will ensure that python3 from native install is used instead of the one on host.

---
lib/bb/fetch2/hg.py | 1 +

1 file changed, 1 insertion(+)
lib/bb/fetch2/hg.py +0 -0
index e21115de..a640a80c 100644
@@ -65,6 +65,7 @@ class Hg(FetchMethod):
 ud.pkgdir = os.path.join(hgdir, hgsrcname)
 ud.moddir = os.path.join(ud.pkgdir, ud.module)

ud.localfile = ud.moddir
+ d.appendVar("EXTRANATIVEPATH", " python3-native ") ud.basecmd = d.getVar("FETCHCMD_hg") or "/usr/bin/env hg"

ud.setup_revisions(d)
--
2.24.0

--
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel