Skip to content

Commit bcba1a1

Browse files
[PATCH] Small refactor to handle windows with non-functioning command command (- WIP PR #82 -)
1 parent d71e4fe commit bcba1a1

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/Tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ jobs:
208208
if: ${{ !cancelled() && runner.os == 'Windows' }}
209209
run: |
210210
echo "C:\Program Files\Git\usr\bin" >> $env:GITHUB_PATH
211+
- name: VERIFY Git Unix tools in PATH for braindead windows ${{ matrix.os }}
212+
if: ${{ !cancelled() && runner.os == 'Windows' }}
213+
run: |
214+
command -v touch
211215
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
212216
shell: bash
213217
run: make -f Makefile test-reqs ;

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ ifeq "$(COMMAND)" ""
4848
endif
4949
endif
5050

51+
# Check if POSIX touch command can be resolved by COMMAND in the runtime env
52+
ifeq "$(notdir $(shell $(COMMAND) touch))" ""
53+
# This is a non-POSIX environment, so try Windows fallback
54+
COMMAND := where
55+
endif
56+
5157
ifeq "$(MAKE)" ""
5258
# just no cmake please
5359
MAKEFLAGS=$(MAKEFLAGS) -s
@@ -72,7 +78,11 @@ endif
7278

7379
ifeq "$(LINK)" ""
7480
LINK_CMD=$(shell $(COMMAND) ln)
75-
LINK=$(LINK_CMD) -sf
81+
ifneq "$(LINK_CMD)" ""
82+
LINK=$(LINK_CMD) -sf
83+
else
84+
LINK=$(ECHO) "::debug:: Linking is not supported for file: "
85+
endif
7686
endif
7787

7888
# Python command configuration
@@ -90,7 +100,11 @@ ifeq "$(PYTHON)" ""
90100
PY_CMD=$(shell $(COMMAND) python)
91101
endif
92102
# Set PYTHON only if not already set
93-
PYTHON := $(PY_CMD) $(PY_ARGS)
103+
ifdef PY_ARGS
104+
PYTHON := $(PY_CMD) $(PY_ARGS)
105+
else
106+
PYTHON := $(PY_CMD)
107+
endif
94108
endif
95109

96110
# Coverage configuration

0 commit comments

Comments
 (0)