conda-forge / msmpi-feedstock

A conda-smithy repository for msmpi.
BSD 3-Clause "New" or "Revised" License
1 stars 7 forks source link

Calling update w/ msmpi impacts conda env #15

Closed langmm closed 3 years ago

langmm commented 3 years ago

Issue:

After installing msmpi from an environment or updating a conda environment that contains msmpi, conda can no longer deactivate the environment or activate another environment (conda info continues to display the same information for the environment containing msmpi and no longer displays the environment name in the prompt). Is this expected behavior?

The problem can be reproduced via the following:

(base) C:\Users\meaga>conda create -n msmpi msmpi
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\meaga\AppData\Local\Continuum\miniconda3\envs\msmpi

  added / updated specs:
    - msmpi

The following NEW packages will be INSTALLED:

  m2w64-gcc-libgfor~ conda-forge/win-64::m2w64-gcc-libgfortran-5.3.0-6
  m2w64-gcc-libs     conda-forge/win-64::m2w64-gcc-libs-5.3.0-7
  m2w64-gcc-libs-co~ conda-forge/win-64::m2w64-gcc-libs-core-5.3.0-7
  m2w64-gmp          conda-forge/win-64::m2w64-gmp-6.1.0-2
  m2w64-libwinpthre~ conda-forge/win-64::m2w64-libwinpthread-git-5.0.0.4634.697f757-2
  mpi                conda-forge/win-64::mpi-1.0-msmpi
  msmpi              conda-forge/win-64::msmpi-10.1.1-h3502643_6
  msys2-conda-epoch  conda-forge/win-64::msys2-conda-epoch-20160418-1
  ucrt               conda-forge/win-64::ucrt-10.0.20348.0-h57928b3_0
  vc                 conda-forge/win-64::vc-14.2-hb210afc_5
  vs2015_runtime     conda-forge/win-64::vs2015_runtime-14.29.30037-h902a5da_5

Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate msmpi
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) C:\Users\meaga>conda activate msmpi

C:\Users\meaga>if defined CONDA_BUILD_STATE ()

C:\Users\meaga>if exist "C:\Windows\System32\msmpi.dll" (
echo "You seem to have a system wide installation of MSMPI. "
 echo "Due to the way DLL loading works on windows, system wide installation "
 echo "will probably overshadow the conda installation. Uninstalling "
 echo "the system wide installation and forced deleting C:\Windows\System32\msmpi*.dll"
 echo "will help, but may break other software using the system wide installation."
)

C:\Users\meaga>if defined MSMPI_BIN (set "MSMPI_BIN_CONDA_BACKUP=" )

C:\Users\meaga>if defined MSMPI_INC (set "MSMPI_INC_CONDA_BACKUP=" )

C:\Users\meaga>if defined MSMPI_LIB64 (set "MSMPI_LIB64_CONDA_BACKUP=" )

C:\Users\meaga>if defined MSMPI_LIB32 (set "MSMPI_LIB32_CONDA_BACKUP=" )

C:\Users\meaga>set MSMPI_BIN=\Library\bin

C:\Users\meaga>set MSMPI_INC=\Library\include

C:\Users\meaga>set MSMPI_LIB64=\Library\lib

C:\Users\meaga>set MSMPI_LIB32=""

(msmpi) C:\Users\meaga>

(msmpi) C:\Users\meaga>conda update --all
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

C:\Users\meaga>
C:\Users\meaga>

When called from a batch script (call conda update --all) a process error code is returned (caught by calling the script from a Python subprocess). I discovered this problem when trying to update a conda environment in one of my CI setup scripts (I can provide this build if it is helpful, but it is part of a much larger build).


Environment (conda list):

``` $ conda list # packages in environment at C:\Users\meaga\AppData\Local\Continuum\miniconda3\envs\msmpi: # # Name Version Build Channel m2w64-gcc-libgfortran 5.3.0 6 conda-forge m2w64-gcc-libs 5.3.0 7 conda-forge m2w64-gcc-libs-core 5.3.0 7 conda-forge m2w64-gmp 6.1.0 2 conda-forge m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge mpi 1.0 msmpi conda-forge msmpi 10.1.1 h3502643_6 conda-forge msys2-conda-epoch 20160418 1 conda-forge ucrt 10.0.20348.0 h57928b3_0 conda-forge vc 14.2 hb210afc_5 conda-forge vs2015_runtime 14.29.30037 h902a5da_5 conda-forge ```


Details about conda and system ( conda info ):

``` $ conda info active environment : msmpi active env location : C:\Users\meaga\AppData\Local\Continuum\miniconda3\envs\msmpi shell level : 2 user config file : C:\Users\meaga\.condarc populated config files : C:\Users\meaga\.condarc conda version : 4.10.3 conda-build version : 3.21.4 python version : 3.7.10.final.0 virtual packages : __win=0=0 __archspec=1=x86_64 base environment : C:\Users\meaga\AppData\Local\Continuum\miniconda3 (writable) conda av data dir : C:\Users\meaga\AppData\Local\Continuum\miniconda3\etc\conda conda av metadata url : None channel URLs : https://conda.anaconda.org/conda-forge/win-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch package cache : C:\Users\meaga\AppData\Local\Continuum\miniconda3\pkgs C:\Users\meaga\.conda\pkgs C:\Users\meaga\AppData\Local\conda\conda\pkgs envs directories : C:\Users\meaga\AppData\Local\Continuum\miniconda3\envs C:\Users\meaga\.conda\envs C:\Users\meaga\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/4.10.3 requests/2.26.0 CPython/3.7.10 Windows/10 Windows/10.0.18362 administrator : False netrc file : None offline mode : False ```

Any help with this is much appreciated as my current work around is prone to obscuring problems in the future (do all updates before installing mpi4py, install mpi4py w/ the local conda build for the target package, and ignore the error).

langmm commented 3 years ago

Update: I've also been able to trigger this behavior by calling conda deactivate

isuruf commented 3 years ago

Looks like at https://github.com/conda-forge/msmpi-feedstock/blob/58b78e6ac8024e1f34722c5de0a9fe0bf6bd2601/recipe/deactivate.bat#L6 there's a brace instead of parenthesis.

langmm commented 3 years ago

Good catch! I will create a PR w/ the change (unless there is a reason to hold off or if you would prefer to make it?)