Skip to content

Commit 8da49dd

Browse files
committed
conda.mk: fix OS detection on Windows
Signed-off-by: umarcor <unai.martinezcorral@ehu.eus>
1 parent a0a0429 commit 8da49dd

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

conda.mk

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ endif
2929

3030
include $(MAKE_DIR)/os.mk
3131

32-
ifeq ($(OS_TYPE),Windows)
32+
ifeq ($(DETECTED_OS),Windows)
3333
TOP_DIR := $(subst /,\,$(TOP_DIR))
3434
OS_EXT := exe
3535
PYTHON_BIN := python.exe
@@ -43,6 +43,9 @@ SHELL := bash
4343
CONDA_ENV_NAME_LINE := $(shell grep "name:" $(ENVIRONMENT_FILE))
4444
CONDA_ACTIVATE = source $(CONDA_DIR)/bin/activate
4545
endif
46+
ifeq ($(DETECTED_OS),MSYS)
47+
OS_EXT := exe
48+
endif
4649

4750
ifeq (,$(REQUIREMENTS_FILE))
4851
$(error "Set REQUIREMENTS_FILE value before including 'conda.mk'.")
@@ -99,7 +102,7 @@ $(ENV_DIR): | $(DOWNLOADS_DIR)
99102
$(DOWNLOADS_DIR):
100103
$(MKDIR) "$(DOWNLOADS_DIR)"
101104

102-
ifeq ($(OS_TYPE),Windows)
105+
ifeq ($(DETECTED_OS),Windows)
103106
$(CONDA_INSTALLER_DOWNLOAD): | $(DOWNLOADS_DIR)
104107
$(WGET) https://repo.anaconda.com/miniconda/$(CONDA_INSTALLER) -O $(CONDA_INSTALLER_DOWNLOAD) 2>&1
105108
else
@@ -112,19 +115,19 @@ $(CONDA_PKGS_DEP): $(CONDA_PYTHON)
112115
$(MKDIR) "$(CONDA_PKGS_DIR)"
113116
$(TOUCH) "$(CONDA_PKGS_DEP)"
114117

115-
ifeq ($(OS_TYPE),Windows)
118+
ifeq ($(DETECTED_OS),Windows)
116119
$(CONDA_PYTHON): $(CONDA_INSTALLER_DOWNLOAD)
117120
cmd.exe /c start "" /WAIT $(CONDA_INSTALLER_DOWNLOAD) /InstallationType=JustMe /AddToPath=0 /RegisterPython=0 /NoRegistry=1 /NoScripts=1 /S /D=$(CONDA_DIR)
118-
$(TOUCH) "$(CONDA_PYTHON)"
119121
else
120122
$(CONDA_PYTHON): $(CONDA_INSTALLER_DOWNLOAD)
121123
chmod a+x $(CONDA_INSTALLER_DOWNLOAD)
122124
$(CONDA_INSTALLER_DOWNLOAD) -p $(CONDA_DIR) -b -f
123-
$(TOUCH) "$(CONDA_PYTHON)"
124125
endif
125126

127+
$(TOUCH) "$(CONDA_PYTHON)"
128+
126129
# FIXME: Why does this break on Windows?
127-
ifeq ($(OS_TYPE),Windows)
130+
ifeq ($(DETECTED_OS),Windows)
128131
CONDA_PYVENV := $(CONDA_PYTHON)
129132
else
130133
$(CONDA_PYVENV): $(CONDA_PYTHON) $(MAKE_DIR)/conda.mk
@@ -161,7 +164,7 @@ dist-clean::
161164

162165
FILTER_TOP = sed -e's@$(TOP_DIR)/@$$TOP_DIR/@'
163166
env-info:
164-
@echo " Currently running on: '$(OS_TYPE) ($(CPU_TYPE))'"
167+
@echo " Currently running on: '$(DETECTED_OS) ($(CPU_TYPE))'"
165168
@echo
166169
@echo " Conda environment is named: '$(CONDA_ENV_NAME)'"
167170
@echo " Conda Env Top level directory is: '$(TOP_DIR)'"

0 commit comments

Comments
 (0)