Skip to content

Commit bf2c038

Browse files
committed
kp_common/Dockerfile/build-env.sh: Add patchwise
Add Qualcomm's cool patchwise https://github.com/qualcomm/PatchWise export OPENAI_API_KEY=<your-api-key> you can even use patchwise for your locally hosted models: For example: patchwise --model=anthropic.claude-3-7-sonnet --provider=https://mygateway.me.local --repo-path . Add clangd as a dependency and install other dependencies as needed. I have added hack for forcing patchwise to use newer clang than supported.. hopefully that should go away sometime soon Signed-off-by: Nishanth Menon <[email protected]>
1 parent 2793dc7 commit bf2c038

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ RUN apt-get update \
7777
&& apt-get install -y --no-install-recommends \
7878
llvm \
7979
clang \
80+
clangd \
8081
lld \
82+
&& . /usr/local/venv/bin/activate \
83+
&& patchwise --install \
8184
&& echo "**** cleanup ****" \
8285
&& apt-get autoremove -y\
8386
&& apt-get clean -y\

build-env.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ download_build_install_python_deps()
5252
# scripts/spdxcheck.py dependencies
5353
python -m pip install --upgrade ply gitpython yamllint rfc3987 pylibfdt
5454
python -m pip install git+https://github.com/devicetree-org/dt-schema.git@$DTSCHEMA_REV
55+
# Install patchwise and it's dependencies
56+
python -m pip install patchwise
57+
# HACK - Just dont stick around with 20.0.0 clang.. use the bleeding edge..
58+
find /usr/local/venv/lib/python3*/site-packages/patchwise -iname *.py|xargs sed -ie "s/20.0.0/23.0.0/g"
5559
rm -rf "/tmp/.cache/" /tmp/get-pip.py
5660
}
5761

kp_common

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,9 @@ extra_paths=(
8181
/opt/cross-gcc-linux-9/bin
8282
)
8383

84+
# Pass OpenAPI key if defined to the container environment for PatchWise
85+
if [ -n "${OPENAI_API_KEY}" ]; then
86+
DOCKER_ARGS+=(-e OPEN_API_KEY="${OPENAI_API_KEY}")
87+
fi
88+
8489
KP_PATH=$(IFS=:; printf '%s' "${extra_paths[*]}")

0 commit comments

Comments
 (0)