SWE-bench icon indicating copy to clipboard operation
SWE-bench copied to clipboard

environment is lost when running pip install

Open waterson opened this issue 9 months ago • 0 comments

Describe the bug

In our environment, we need to access the public internet through a proxy. We typically do so by setting HTTP_PROXY etc. in the environment, which libcurl and other libraries understand.

TaskEnvContextManager stomps the process environment when it invokes subprocess.run with a provided environment dictionary. It should probably augment the dictionary instead of clobbering it.

Patch anon.

Steps/Code to Reproduce

export HTTP_PROXY=https://some-proxy:8080
# run an evaluation that requires the proxy e.g. from swe-agent:
python evaluation/evaluation.py \
     --predictions_path "${JSONL_FILE}" \
     --swe_bench_tasks "${SWE_BENCH_TASKS}" \
     --log_dir "${TRAJ_DIR}/results" \
     --testbed "${TESTBED}" \
     --num_processes 1 \
     --verbose

Expected Results

Environment is not clobbered; e.g., so script can access the HTTP proxy to pip-install stuff.

Actual Results

Environment is clobbered, and so pip install times out.

System Information

Linux, Python 3.9. SWE-bench 1.1.0.

waterson avatar Apr 30 '24 21:04 waterson