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

Quotes got swallowed in compile_commands.json [BUG] #1334

Closed
tgeng opened this issue Aug 11, 2020 · 1 comment
Closed

Quotes got swallowed in compile_commands.json [BUG] #1334

tgeng opened this issue Aug 11, 2020 · 1 comment
Assignees
Labels
Projects

Comments

@tgeng
Copy link

tgeng commented Aug 11, 2020

  • NDK Version: 21.2.6472646
  • Build system: ndk-build
  • Host OS: gLinux

Any project using NDK would do. Take the ndk-build hello-jni as an example.

Repro instruction:

  1. download https://github.com/android/ndk-samples/tree/master/other-builds/ndkbuild/hello-jni
  2. cd into the project root (<git dir>/other-builds/ndkbuild/hello-jni)
  3. run the following command, which sets a custom macro fooyoo=a + b.
    /usr/local/google/home/tgeng/Android/Sdk/ndk/21.2.6472646/ndk-build NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=`pwd`/app/Android.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=/tmp/junk-123 NDK_LIBS_OUT=/tmp/junk-123 'APP_CFLAGS+=-Dfooyoo="a + b"' APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B compile_commands.json
  4. open the generated compile_commands.json and it contains -Dfooyoo=a + b, which won't work since a + b is not quoted.
@tgeng tgeng added the bug label Aug 11, 2020
@DanAlbert DanAlbert self-assigned this Aug 12, 2020
@DanAlbert DanAlbert added this to Triaged in r22 via automation Aug 12, 2020
@DanAlbert
Copy link
Member

Not certain there's much we can do about this given the difficulty of generating JSON from make, but I want to at least have a look for r22. Could be something simple.

@DanAlbert DanAlbert added this to Triaged in r23 via automation Oct 1, 2020
@DanAlbert DanAlbert removed this from Triaged in r22 Oct 1, 2020
@DanAlbert DanAlbert removed this from Triaged in r23 Feb 25, 2021
@DanAlbert DanAlbert added this to Triaged in r24 via automation Feb 25, 2021
@DanAlbert DanAlbert removed their assignment Nov 19, 2021
@DanAlbert DanAlbert removed this from Triaged in r24 Jan 4, 2022
@DanAlbert DanAlbert added this to Triaged in r25 via automation Jan 4, 2022
@matthias-blume matthias-blume self-assigned this May 25, 2022
@DanAlbert DanAlbert moved this from Triaged to Needs cherry-pick in r25 Jun 27, 2022
r25 automation moved this from Needs cherry-pick to Merged Jun 27, 2022
osspop pushed a commit to osspop/android-ndk that referenced this issue Jan 17, 2023
Modifies dump_compile_commands.py to have it add shell escapes to
command line arguments where needed. Currently this does not support
APP_SHORT_COMMANDS set to true.  That will be done in a separate change.

Bug: android/ndk#1334
Change-Id: Ieb8d421b938c58510eaadc37c7a83cc6a070908d
osspop pushed a commit to osspop/android-ndk that referenced this issue Jan 17, 2023
Bug: android/ndk#1334
Test: None
Change-Id: I95aa9a867e5de27d8e6151ac2ed09a45e4059ee1
(cherry picked from commit bbafe041bc8545365196b7e03184382f32c6a0bc)
Merged-In: I95aa9a867e5de27d8e6151ac2ed09a45e4059ee1
(cherry picked from commit b07f20c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
r25
  
Merged
Development

No branches or pull requests

3 participants