@@ -304,17 +304,21 @@ jobs:
304
304
# Set up environment
305
305
conda config --set always_yes yes
306
306
conda config --set auto_update_conda false
307
+ conda config --set channel_priority strict
307
308
conda config --remove channels defaults
308
309
conda config --append channels nodefaults
309
310
conda config --append channels conda-forge
310
311
# Try to install mamba
311
- # Note: removed '--update-deps' on 2025-02-28 to work around
312
- # broken libffi(?)
313
- conda install -q -y -n base conda-libmamba-solver \
314
- || MAMBA_FAILED=1
315
- if test -z "$MAMBA_FAILED"; then
316
- echo "*** Activating the mamba environment solver ***"
317
- conda config --set solver libmamba
312
+ CONDA_VER=$(conda --version | cut -d\ -f2)
313
+ if test 23.10 = "`echo -e "23.10\n$CONDA_VER" | sort -V | tail -1`"; then
314
+ # Note: removed '--update-deps' on 2025-02-28 to work around
315
+ # broken libffi(?)
316
+ conda install -q -y -n base conda-libmamba-solver \
317
+ || MAMBA_FAILED=1
318
+ if test -z "$MAMBA_FAILED"; then
319
+ echo "*** Activating the mamba environment solver ***"
320
+ conda config --set solver libmamba
321
+ fi
318
322
fi
319
323
# Add the rest of the channels
320
324
conda config --append channels gurobi
@@ -366,17 +370,19 @@ jobs:
366
370
# possibly if it outputs messages to stderr)
367
371
conda install --update-deps -q -y $CONDA_DEPENDENCIES
368
372
if test -z "${{matrix.slim}}"; then
369
- # xpress.init() (from conda) hangs indefinitely on GHA/Windows under
370
- # Python 3.10 and 3.11. Exclude that release on that platform.
373
+ # xpress.init() (xpress 9.5.1 from conda) hangs indefinitely
374
+ # on GHA/Windows under Python 3.10 and 3.11. Exclude that
375
+ # release on that platform.
371
376
if [[ ${{matrix.TARGET}} == win && ${{matrix.python}} =~ 3.1[01] ]]; then
372
377
# We would like to just use something like:
373
378
# - "!=9.5.1" (conda errors)
374
379
# - "<9.5.1|>9.5.1" (conda installs 9.1.2, which also hangs)
375
380
# - "<=9.5.0|>9.5.1" (conda seg faults)
376
- XPRESS='xpress=9.5.0 '
381
+ XPRESS='xpress> =9.5.2 '
377
382
else
378
383
XPRESS='xpress'
379
384
fi
385
+ TIMEOUT_MSG="TIMEOUT: killing conda install process"
380
386
PYVER=$(echo "py${{matrix.python}}" | sed 's/\.//g')
381
387
echo "Installing for $PYVER"
382
388
for PKG in 'cplex>=12.10' docplex gurobi "$XPRESS" cyipopt pymumps scip; do
@@ -405,13 +411,22 @@ jobs:
405
411
# indefinitely (lately while installing SCIP),
406
412
# we will run "conda install" in a subshell and
407
413
# kill it after 5-minutes.
408
- (conda install -q -y $PKG) &
409
- conda_pid=$!
410
- (sleep 300 && kill "$conda_pid" 2>/dev/null) &
414
+ (conda install -q -y $PKG |& tee conda.log) &
415
+ conda_subshell_pid=$!
416
+ sleep 1
417
+ conda_pid=$(ps | grep conda | sed 's/^ *//' | sed 's/ .*//')
418
+ # Only timeout the conda process if it's not to
419
+ # the installation phase yet. Signalling conda
420
+ # after it has started the installation process
421
+ # can irrecoverably corrupt the environment.
422
+ (sleep 300 \
423
+ && if test `grep 'Package Plan' conda.log | wc -l` -eq 0; \
424
+ then echo "$TIMEOUT_MSG $conda_pid (TERM)" \
425
+ && kill -TERM $conda_pid 2>/dev/null ; fi) &
411
426
timeout_pid=$!
412
- wait "$conda_pid" || _BUILDS=""
413
- kill " $timeout_pid" 2>/dev/null \
414
- || echo "TIMEOUT: killed conda install process "
427
+ wait $conda_subshell_pid || _BUILDS=""
428
+ kill $timeout_pid 2>/dev/null \
429
+ || echo "TIMEOUT: time limit expired "
415
430
fi
416
431
fi
417
432
echo ""
0 commit comments