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

Multi-word MAKEFLAGS doesn't work properly #89

Open
danw opened this issue Sep 9, 2016 · 0 comments
Open

Multi-word MAKEFLAGS doesn't work properly #89

danw opened this issue Sep 9, 2016 · 0 comments

Comments

@danw
Copy link
Collaborator

danw commented Sep 9, 2016

We ran into this issue when upgrading Kati on AOSP, but I've solved this on our side separately by clearing MAKEFLAGS, since we don't want the MAKEFLAGS override behavior and the variables are already available in the environment.

Simple shell testcase to drop into testcase/cmdline_var_spaces.sh:

set -e

mk="$@"

cat <<EOF > Makefile
ifdef SUBMAKE
all:
       +@\$(SUBMAKE) SUBMAKE=
else
CLVAR := FAIL
CLVAR_RESULT := FAIL
ifeq (\$(CLVAR),multi word)
CLVAR_RESULT := PASS
endif
all:
       @echo \$(CLVAR_RESULT) \$(CLVAR) \$(origin CLVAR)
endif
EOF

make SUBMAKE="${mk}" CLVAR='multi word' 2> /dev/null

Which prints out:

(make)  PASS multi word command line
(ckati) FAIL multi command line

If you print out $(MAKEFLAGS), the makeflags is written as:

CLVAR=multi\ word SUBMAKE=../../ckati\ SHELL=/bin/bash

So kati's MAKEFLAGS parsing needs to handle the escaped spaces (I'm not sure if anything else can be escaped)

JmzTaylor pushed a commit to DirtyUnicorns/android_prebuilts_build-tools that referenced this issue Nov 20, 2016
Major update is ckati merge from upstream. (With MAKEFLAGS now cleared
in build/ so that google/kati#89 doesn't cause
us to revert again)

build sha 6b363e24
build/kati sha e1de29e5
build/soong sha 42d1ba2d
external/ninja sha ee767f71

Change-Id: Idaf4867058111184f2ce633ed0afe21a90af1f8c
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