1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

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.

(cherry picked from commit 531750e9b04580664755f5066d36626e741cc2c1)
This commit is contained in:
Daan De Meyer 2025-02-14 15:22:05 +01:00 committed by Yu Watanabe
parent 5929116eb4
commit 18cd03a45b

View File

@ -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"\
"$@"