Skip to content

Commit 6c0f46f

Browse files
committed
Pass proxy information to uv
If using uv, run it in a clean environment but include the variables that specify a proxy.
1 parent 6ac5653 commit 6c0f46f

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

cmake/ActsCodegen.cmake

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,28 @@ function(acts_code_generation)
217217
file(MAKE_DIRECTORY ${_output_dir})
218218

219219
if(NOT ACTS_USE_SYSTEM_LIBS)
220+
# If using uv, run it in a clean environment but include the variables
221+
# that specify a proxy.
222+
set(_propagate
223+
HTTP_PROXY
224+
HTTPS_PROXY
225+
ALL_PROXY
226+
NO_PROXY
227+
SSL_CERT_FILE
228+
)
229+
foreach(_var IN LISTS _propagate)
230+
if(DEFINED ENV{${_var}})
231+
list(APPEND _uv_environment "${_var}=$ENV{${_var}}")
232+
endif()
233+
endforeach()
220234
add_custom_command(
221235
OUTPUT ${_output_file}
222236
COMMAND
223237
env -i UV_NO_CACHE=1
224238
UV_PYTHON_INSTALL_DIR=${ACTS_CODEGEN_TMPDIR}/python_install_dir
225-
${uv_exe} run --quiet --python ${ARGS_PYTHON_VERSION}
226-
--no-project ${_arg_isolated} ${_with_args} ${ARGS_PYTHON}
227-
${_output_file}
239+
${_uv_environment} ${uv_exe} run --quiet --python
240+
${ARGS_PYTHON_VERSION} --no-project ${_arg_isolated}
241+
${_with_args} ${ARGS_PYTHON} ${_output_file}
228242
DEPENDS ${_depends}
229243
COMMENT "Generating ${ARGS_OUTPUT}"
230244
VERBATIM

0 commit comments

Comments
 (0)