aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Brassel <[email protected]>2025-04-09 10:15:14 +1000
committerGitHub <[email protected]>2025-04-09 10:15:14 +1000
commit575abc48a3064a464caaa6febf0c65215c3eb1d0 (patch)
treebb29094ad5a40f880e3f47a976c6a1d8d7a629fd
parent0ec96ddd52cd6f4851beb5f387f3bd67b306f8b8 (diff)
downloadqmk_firmware-575abc48a3064a464caaa6febf0c65215c3eb1d0.tar.gz
qmk_firmware-575abc48a3064a464caaa6febf0c65215c3eb1d0.zip
More Windows->Unix style path fixes. (#25119)0.28.5
-rw-r--r--lib/python/qmk/build_targets.py22
-rwxr-xr-xlib/python/qmk/cli/generate/make_dependencies.py4
-rw-r--r--lib/python/qmk/commands.py3
3 files changed, 15 insertions, 14 deletions
diff --git a/lib/python/qmk/build_targets.py b/lib/python/qmk/build_targets.py
index e2df029490..df5a5ffb42 100644
--- a/lib/python/qmk/build_targets.py
+++ b/lib/python/qmk/build_targets.py
@@ -11,7 +11,7 @@ from qmk.commands import find_make, get_make_parallel_args, parse_configurator_j
from qmk.keyboard import keyboard_folder
from qmk.info import keymap_json
from qmk.keymap import locate_keymap
-from qmk.path import is_under_qmk_firmware, is_under_qmk_userspace
+from qmk.path import is_under_qmk_firmware, is_under_qmk_userspace, unix_style_path
# These must be kept in the order in which they're applied to $(TARGET) in the makefiles in order to ensure consistency.
TARGET_FILENAME_MODIFIERS = ['FORCE_LAYOUT', 'CONVERT_TO']
@@ -204,11 +204,11 @@ class KeyboardKeymapBuildTarget(BuildTarget):
if is_under_qmk_userspace(keymap_location) and not is_under_qmk_firmware(keymap_location):
keymap_directory = keymap_location.parent
compile_args.extend([
- f'MAIN_KEYMAP_PATH_1={keymap_directory}',
- f'MAIN_KEYMAP_PATH_2={keymap_directory}',
- f'MAIN_KEYMAP_PATH_3={keymap_directory}',
- f'MAIN_KEYMAP_PATH_4={keymap_directory}',
- f'MAIN_KEYMAP_PATH_5={keymap_directory}',
+ f'MAIN_KEYMAP_PATH_1={unix_style_path(keymap_directory)}',
+ f'MAIN_KEYMAP_PATH_2={unix_style_path(keymap_directory)}',
+ f'MAIN_KEYMAP_PATH_3={unix_style_path(keymap_directory)}',
+ f'MAIN_KEYMAP_PATH_4={unix_style_path(keymap_directory)}',
+ f'MAIN_KEYMAP_PATH_5={unix_style_path(keymap_directory)}',
])
return compile_args
@@ -267,11 +267,11 @@ class JsonKeymapBuildTarget(BuildTarget):
generated_files_path = intermediate_output / 'src'
keymap_json = generated_files_path / 'keymap.json'
compile_args.extend([
- f'MAIN_KEYMAP_PATH_1={intermediate_output}',
- f'MAIN_KEYMAP_PATH_2={intermediate_output}',
- f'MAIN_KEYMAP_PATH_3={intermediate_output}',
- f'MAIN_KEYMAP_PATH_4={intermediate_output}',
- f'MAIN_KEYMAP_PATH_5={intermediate_output}',
+ f'MAIN_KEYMAP_PATH_1={unix_style_path(intermediate_output)}',
+ f'MAIN_KEYMAP_PATH_2={unix_style_path(intermediate_output)}',
+ f'MAIN_KEYMAP_PATH_3={unix_style_path(intermediate_output)}',
+ f'MAIN_KEYMAP_PATH_4={unix_style_path(intermediate_output)}',
+ f'MAIN_KEYMAP_PATH_5={unix_style_path(intermediate_output)}',
f'KEYMAP_JSON={keymap_json}',
f'KEYMAP_PATH={generated_files_path}',
])
diff --git a/lib/python/qmk/cli/generate/make_dependencies.py b/lib/python/qmk/cli/generate/make_dependencies.py
index 331132a20f..9548187888 100755
--- a/lib/python/qmk/cli/generate/make_dependencies.py
+++ b/lib/python/qmk/cli/generate/make_dependencies.py
@@ -8,7 +8,7 @@ from argcomplete.completers import FilesCompleter
from qmk.commands import dump_lines
from qmk.keyboard import keyboard_completer, keyboard_folder
from qmk.keymap import keymap_completer, locate_keymap
-from qmk.path import normpath, FileType
+from qmk.path import normpath, FileType, unix_style_path
@cli.argument('filename', nargs='?', arg_only=True, type=FileType('r'), completer=FilesCompleter('.json'), help='A configurator export JSON.')
@@ -53,4 +53,4 @@ def generate_make_dependencies(cli):
for file in interesting_files:
check_files.append(Path('users') / cli.args.keymap / file)
- dump_lines(cli.args.output, [f'generated-files: $(wildcard {found})\n' for found in check_files])
+ dump_lines(cli.args.output, [f'generated-files: $(wildcard {unix_style_path(found)})\n' for found in check_files])
diff --git a/lib/python/qmk/commands.py b/lib/python/qmk/commands.py
index 0e1876ca7a..ac1455967d 100644
--- a/lib/python/qmk/commands.py
+++ b/lib/python/qmk/commands.py
@@ -12,6 +12,7 @@ from qmk.constants import QMK_USERSPACE, HAS_QMK_USERSPACE
from qmk.json_schema import json_load, validate
from qmk.keyboard import keyboard_alias_definitions
from qmk.util import maybe_exit
+from qmk.path import unix_style_path
def find_make():
@@ -85,7 +86,7 @@ def build_environment(args):
envs = parse_env_vars(args)
if HAS_QMK_USERSPACE:
- envs['QMK_USERSPACE'] = Path(QMK_USERSPACE).resolve()
+ envs['QMK_USERSPACE'] = unix_style_path(Path(QMK_USERSPACE).resolve())
return envs