Bug 9886 - Build fails with "unexpected EOF while looking for matching `"'" if PATH contains a newline
Summary: Build fails with "unexpected EOF while looking for matching `"'" if PATH cont...
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: Yann E. MORIN
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-20 07:38 UTC by Ciro Santilli
Modified: 2017-06-08 19:43 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ciro Santilli 2017-05-20 07:38:07 UTC
I know newlines in PATH are bad, but we shouldn't punish unsuspecting users with unhelpful error messages because of it :-)

Reproduce:

    git checkout 4d1c2c82e8945a5847d636458f3825c55529835b
    make qemu_x86_64_defconfig
    PATH="$PATH:"$'\n'":lalala" make

Gives:

>>> host-lzip 1.18 Downloading
/bin/bash: -c: line 0: unexpected EOF while looking for matching `"'
/bin/bash: -c: line 1: syntax error: unexpected end of file
package/pkg-generic.mk:139: recipe for target '/data/git/buildroot/output/build/host-lzip-1.18/.stamp_downloaded' failed
make[1]: *** [/data/git/buildroot/output/build/host-lzip-1.18/.stamp_downloaded] Error 1
Makefile:79: recipe for target '_all' failed
make: *** [_all] Error 2
Comment 1 Yann E. MORIN 2017-05-20 08:22:03 UTC
Ciro,

Thanks for the report.

Indeed, having a \n in PATH is a bit stupid... :-/

I've sent a patch that detects that and fails early:
    https://patchwork.ozlabs.org/patch/764947/

Regards,
Yann E. MORIN.
Comment 2 Ciro Santilli 2017-05-20 09:37:20 UTC
The patch worked for me, thanks!
Comment 3 Yann E. MORIN 2017-06-08 19:43:56 UTC
A patch has been applied in master to fix that:
    https://git.buildroot.org/buildroot/commit/?id=f00d6ec67bd6fed6ff8fd322d60d026ec87d8a6e

Thanks for the report.