sanity.bbclass: Barf if TMPDIR has trailing forward slash
PATCH 1/1 sanity.bbclass: Barf if TMPDIR has trailing forward slash
* Unknowingly many developers run into this issue and
painful part it that the problems start happening almost
when build it complete and the errors are unrelated to cause
see http://www.mail-archive.com/[email protected]/msg02922.html
--- classes/sanity.bbclass | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-)
classes/sanity.bbclass +9 -2
@@ -112,11 +112,18 @@ def check_sanity(e): oes_bb_conf = data.getVar( 'OES_BITBAKE_CONF', e.data, True ) if not oes_bb_conf: messages = messages + 'You do not include OpenEmbeddeds version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n' - # - # Check that TMPDIR hasn't changed location since the last time we were run + # get TMPDIR and use it in following two checks # tmpdir = data.getVar('TMPDIR', e.data, True) + # + # check if tmpdir has traling '/' + # + if tmpdir[-1] == "/": + messages = messages + "Your TMPDIR has trailing '/' (forward slash), this can cause autotools lamangler fail regexp matches when munging .la files. Please remove it.\n\t" + # + # Check that TMPDIR hasn't changed location since the last time we were run + # checkfile = os.path.join(tmpdir, "saved_tmpdir") if os.path.exists(checkfile): f = file(checkfile, "r")
Signature · 1 line
1.7.0.4
2010/5/26 Khem Raj <[email protected]>:
Quoted 29 lines
* Unknowingly many developers run into this issue and
painful part it that the problems start happening almost
when build it complete and the errors are unrelated to cause
see http://www.mail-archive.com/[email protected]/msg02922.htmlSigned-off-by Khem Raj <[email protected]>---
classes/sanity.bbclass | 11 +++++++++--1 files changed, 9 insertions(+), 2 deletions(-)classes/sanity.bbclass +0
-0@@ -112,11 +112,18 @@ def check_sanity(e): oes_bb_conf = data.getVar( 'OES_BITBAKE_CONF', e.data, True )if not
oes_bb_conf:
messages = messages + 'You do not include OpenEmbeddeds version ofconf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n' -
#
- # Check that TMPDIR hasn't changed location since the last time we were run
+ # get TMPDIR and use it in following two checks
#
tmpdir =data.getVar('TMPDIR', e.data, True)
+ #
+ # check if tmpdir has traling '/'
+ #
+ if tmpdir[-1] == "/":
+ messages = messages + "Your TMPDIR has trailing '/' (forward slash), this can cause autotools lamangler fail regexp matches when munging .la files. Please remove it.\n\t"
Quoted 9 lines
+ #
+ # Check that TMPDIR hasn't changed location since the last time we were run
+ #
checkfile =os.path.join(tmpdir, "saved_tmpdir")
ifos.path.exists(checkfile):
f =file(checkfile, "r")
--
1.7.0.4
Tested. works great for me so:
Quoted 4 lines · Khem Raj
* Unknowingly many developers run into this issue and
painful part it that the problems start happening almost
when build it complete and the errors are unrelated to cause
see http://www.mail-archive.com/[email protected]/msg02922.html
Can we not fix the actual bug rather than disallowing trailing slashes? It seems a bit sad to introduce further weird limitations just to work around some or other piece of brokenness.
p.
Quoted 9 lines · Phil Blundell
Quoted 4 lines · Khem Raj
* Unknowingly many developers run into this issue and
painful part it that the problems start happening almost
when build it complete and the errors are unrelated to cause
see http://www.mail-archive.com/[email protected]/msg02922.htmlCan we not fix the actual bug rather than disallowing trailing slashes? It seems a bit sad to introduce further weird limitations just to work around some or other piece of brokenness.
Yes I thought about it but did not know where to start.
I guess that would be bitbake which has to quickly remove the trailing space just after parsing
in TMPDIR before it gets expanded into other parts of metadata. would it be OK for bitbake to treat TMPDIR special ? or may be bitbake should just get rid of more than one slashes in dir paths as a whole. when concatenating two paths it should merge the slashes may be.
Quoted 10 lines
p.
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Quoted 7 lines · Khem Raj
Yes I thought about it but did not know where to start.
I guess that would be bitbake which has to quickly remove the trailing space just after parsing
in TMPDIR before it gets expanded into other parts of metadata. would it be OK for bitbake to treat TMPDIR special ? or may be bitbake should just get rid of more than one slashes in dir paths as a whole. when concatenating two paths it should merge the slashes may be.
I'm not sure that bitbake itself ought to be taking any special action. Which piece of code is it that chokes on the extra slashes, exactly? Can that not be fixed? POSIX is fairly clear that multiple slashes are allowed in pathnames so anything that doesn't work with them seems like it must be broken.
p.
Quoted 9 lines · Phil Blundell
Quoted 7 lines · Khem Raj
Yes I thought about it but did not know where to start.
I guess that would be bitbake which has to quickly remove the trailing space just after parsing
in TMPDIR before it gets expanded into other parts of metadata. would it be OK for bitbake to treat TMPDIR special ? or may be bitbake should just get rid of more than one slashes in dir paths as a whole. when concatenating two paths it should merge the slashes may be.
Quoted 5 lines
I'm not sure that bitbake itself ought to be taking any special action. Which piece of code is it that chokes on the extra slashes, exactly? Can that not be fixed? POSIX is fairly clear that multiple slashes are allowed in pathnames so anything that doesn't work with them seems like it must be broken.
autotools_prepackage_lamangler () in classes/autotools.bbclass.
see http://www.mail-archive.com/[email protected]/msg02922.html
for more details. Thats one known case so far.
Thx
-Khem
I agree that fixing this is better than a warning, but a warning is better than nothing, so I suggest at least taking this patch. No idea how to fix it structurally.
A workaround (read; dirty patch) would be to nuke off trailing slashes when TMPDIR is retrieved.
BTW: the problem seems to be around quite a while and regularly seems to bite people.
Frans