Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTBFS: sed will break when path contains ".o" #127

Open
Whissi opened this issue Dec 31, 2019 · 0 comments
Open

FTBFS: sed will break when path contains ".o" #127

Whissi opened this issue Dec 31, 2019 · 0 comments

Comments

@Whissi
Copy link

Whissi commented Dec 31, 2019

Hi,

in Gentoo we run into an interesting problem: Our genkernel tool will build thin-provisioning-tools in a special build environment. However, every 2 out of 62 times, make install failed with

base/application.d:1: *** multiple target patterns.  Stop.

Turns out that the problem is the sed call in L211 (L220 is probably affected by the same problem):

	sed 's,\([^ :]*\)\.o[ :]*,\1.o \1.gmo $* : Makefile ,g' < $*.$$$$ > $*.d; \

The problem is that we create two temporary folders, e.g.

/var/tmp/genkernel/$(mktemp -d -p "${TMPDIR}" gk.XXXXXXXX)/$(mktemp -d -p "${TEMP}" ${PN}.XXXXXXXX)/buildroot

so if the first X after a . is filled with o, that sed breaks.

I.e. when a path like /var/tmp/genkernel/gk.g14ub9N4/thin-provisioning-tools.oCZSRksk/buildroot will be used, base/application.d contains

base/application.o base/application.gmo base/application : Makefile base/application.cc base/application.h \
 /var/tmp/genkernel/gk.g14ub9N4/thin-provisioning-tools.o /var/tmp/genkernel/gk.g14ub9N4/thin-provisioning-tools.gmo base/application : Makefile CZSRksk/buildroot/usr/include/boost/shared_ptr.hpp \
 /var/tmp/genkernel/gk.g14ub9N4/thin-provisioning-tools.o /var/tmp/genkernel/gk.g14ub9N4/thin-provisioning-tools.gmo base/application : Makefile CZSRksk/buildroot/usr/include/boost/smart_ptr/shared_ptr.hpp \
 /var/tmp/genkernel/gk.g14ub9N4/thin-provisioning-tools.o /var/tmp/genkernel/gk.g14ub9N4/thin-provisioning-tools.gmo base/application : Makefile CZSRksk/buildroot/usr/include/boost/config.hpp \
[...]

and make install will fail with error above.

When everything works, file looks like

base/application.o base/application.gmo base/application : Makefile base/application.cc base/application.h \
 /var/tmp/genkernel/gk.5SdleqvS/thin-provisioning-tools.8kYv2Igj/buildroot/usr/include/boost/shared_ptr.hpp \
 /var/tmp/genkernel/gk.5SdleqvS/thin-provisioning-tools.8kYv2Igj/buildroot/usr/include/boost/smart_ptr/shared_ptr.hpp \
 /var/tmp/genkernel/gk.5SdleqvS/thin-provisioning-tools.8kYv2Igj/buildroot/usr/include/boost/config.hpp \
[...]

Thanks to @dwfreed for spotting the problem.

gentoo-bot pushed a commit to gentoo/genkernel that referenced this issue Dec 31, 2019
Some packages will fail to build when path contains character sequences
like ".o". Using "_" as separator in mktemp() template will avoid that
problem.

Link: jthornber/thin-provisioning-tools#127
Thanks-to: Doug Freed <dwfreed@mtu.edu>
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant