From: Daan De Meyer Date: Fri, 14 Feb 2025 14:22:05 +0000 (+0100) Subject: mkosi: Fix mkosi.clangd X-Git-Tag: v258-rc1~1335^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F36387%2Fhead;p=thirdparty%2Fsystemd.git 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. --- 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"\ "$@"