Skip to content

Commit bd1b93b

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 9ccc084 commit bd1b93b

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

cmake/ActsCodegen.cmake

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,25 @@ function(acts_code_generation)
198198
file(MAKE_DIRECTORY ${_output_dir})
199199

200200
if(NOT ACTS_USE_SYSTEM_LIBS)
201+
# If using uv, run it in a clean environment but include the variables
202+
# that specify a proxy.
203+
set(_uv_environment UV_NO_CACHE=1)
204+
set(_propagate
205+
HTTP_PROXY
206+
HTTPS_PROXY
207+
ALL_PROXY
208+
NO_PROXY
209+
SSL_CERT_FILE
210+
)
211+
foreach(_var IN LISTS _propagate)
212+
if(DEFINED ENV{${_var}})
213+
list(APPEND _uv_environment "${_var}=$ENV{${_var}}")
214+
endif()
215+
endforeach()
201216
add_custom_command(
202217
OUTPUT ${_output_file}
203218
COMMAND
204-
env -i UV_NO_CACHE=1 ${uv_exe} run --quiet --python
219+
env -i ${_uv_environment} ${uv_exe} run --quiet --python
205220
${ARGS_PYTHON_VERSION} --no-project ${_arg_isolated}
206221
${_with_args} ${ARGS_PYTHON} ${_output_file}
207222
DEPENDS ${_depends}

0 commit comments

Comments
 (0)