From 531750e9b04580664755f5066d36626e741cc2c1 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 14 Feb 2025 15:22:05 +0100 Subject: [PATCH] mkosi: Fix mkosi.clangd - Add missing '--' delimiter - Use the new BuildSubdirectory JSON field to figure out the build subdirectory. - Remove the /usr/include path mapping for now. This means we can't jump into system headers anymore if they don't exist on the host, we can find a way to add this back later if it turns out to be crucial. --- mkosi.clangd | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mkosi.clangd b/mkosi.clangd index 23251baf632..19ec84c2c9d 100755 --- a/mkosi.clangd +++ b/mkosi.clangd @@ -9,20 +9,19 @@ else fi MKOSI_CONFIG="$("${SPAWN[@]}" mkosi --json summary | jq -r .Images[-1])" -DISTRIBUTION="$(jq -r .Distribution <<< "$MKOSI_CONFIG")" -RELEASE="$(jq -r .Release <<< "$MKOSI_CONFIG")" -ARCH="$(jq -r .Architecture <<< "$MKOSI_CONFIG")" +BUILDDIR="$(jq -r .BuildDirectory <<< "$MKOSI_CONFIG")" +BUILDSUBDIR="$(jq -r .BuildSubdirectory <<< "$MKOSI_CONFIG")" exec "${SPAWN[@]}" mkosi \ --incremental=strict \ --build-sources-ephemeral=no \ --format=none \ build \ + -- \ clangd \ --compile-commands-dir=/work/build \ --path-mappings="\ $(pwd)=/work/src,\ -$(pwd)/build/mkosi.builddir/$DISTRIBUTION~$RELEASE~$ARCH/=/work/build,\ -$(pwd)/build/mkosi.cache/$DISTRIBUTION~$RELEASE~$ARCH~build.cache/usr/include/=/usr/include" \ +$BUILDDIR/$BUILDSUBDIR=/work/build"\ "$@" -- 2.47.3