Copilot commented on code in PR #2250:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2250#discussion_r3861862961


##########
docker/rockylinux/Dockerfile:
##########
@@ -80,7 +80,7 @@ RUN cd $MINIFI_BASE_DIR && \
     export PATH=/usr/lib64/ccache${PATH:+:${PATH}} && \
     export CCACHE_DIR=${MINIFI_BASE_DIR}/.ccache && \
     if [ "${DOCKER_USE_CONAN}" == "ON" ]; then 
CONAN_TOOLCHAIN="-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake"; fi && \
-    cmake -DSTATIC_BUILD= -DSKIP_TESTS=${DOCKER_SKIP_TESTS} 
${CONAN_TOOLCHAIN:-} ${MINIFI_OPTIONS} -DPython_EXECUTABLE=/usr/bin/python3.12 
-DAWS_ENABLE_UNITY_BUILD=OFF -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" .. && \
+    cmake -DSTATIC_BUILD= -DSKIP_TESTS=${DOCKER_SKIP_TESTS} 
${CONAN_TOOLCHAIN:-} ${MINIFI_OPTIONS} -DPython_EXECUTABLE=/usr/bin/python3.11 
-DAWS_ENABLE_UNITY_BUILD=OFF -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" .. && \

Review Comment:
   This hard-codes `-DPython_EXECUTABLE=/usr/bin/python3.11` unconditionally, 
but `python3.11` is only installed conditionally earlier (depending on 
`DOCKER_USE_CONAN` / `MINIFI_OPTIONS`). On Rocky, the base image typically 
won’t include `/usr/bin/python3.11` by default, which can cause configure-time 
failures when those conditions are false. Fix by either installing `python3.11` 
unconditionally (if CMake always needs it), or only setting `Python_EXECUTABLE` 
when Python 3.11 is guaranteed to be present (otherwise fall back to an 
available system `python3`).



##########
docker/rockylinux/Dockerfile:
##########
@@ -61,11 +61,11 @@ USER ${USER}
 RUN --mount=type=secret,id=nifi_conan_password,mode=0444 echo 
"DOCKER_USE_CONAN=${DOCKER_USE_CONAN}" && if [ "${DOCKER_USE_CONAN}" == "ON" ]; 
then \
         set -e; \
         cd ${MINIFI_BASE_DIR}/bootstrap && \
-        python3.12 -m venv venv && \
+        python3.11 -m venv venv && \
         source /opt/rh/gcc-toolset-14/enable && \
         source venv/bin/activate && \
-        pip3.12 install -r requirements.txt && \
-        python3.12 main.py --skip-compiler-install --run-conan-install 
--minifi-options="${MINIFI_OPTIONS}" && \
+        pip3.11 install -r requirements.txt && \

Review Comment:
   After activating the venv, invoking `pip3.11` is brittle because it may 
resolve to a system pip (or not exist), rather than the venv’s pip. Prefer 
using the venv interpreter to run pip (e.g., `python -m pip ...`) so installs 
always target the activated virtual environment.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to