-
-
Notifications
You must be signed in to change notification settings - Fork 40.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate make
dependency file during build for info.json's etc.
#20451
Conversation
Need to test configurator json files. EDIT: works fine. |
Keymaps specified in community layouts work fine as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem to break anything, at least
Esoteric bug(?) caused by this PR: its changeset prevents me from compiling any QMK firmware at all:
The line |
Try: diff --git a/lib/python/qmk/cli/generate/make_dependencies.py b/lib/python/qmk/cli/generate/make_dependencies.py
index 635c341897..63c6db0b3a 100755
--- a/lib/python/qmk/cli/generate/make_dependencies.py
+++ b/lib/python/qmk/cli/generate/make_dependencies.py
@@ -53,4 +53,4 @@ def generate_make_dependencies(cli):
for file in interesting_files:
found_files.extend((QMK_FIRMWARE / 'users' / cli.args.keymap).glob(f'**/{file}'))
- dump_lines(cli.args.output, [f'generated-files: {found.resolve()}\n' for found in found_files])
+ dump_lines(cli.args.output, [f'generated-files: {found.resolve().relative_to(QMK_FIRMWARE)}\n' for found in found_files]) |
Adding |
Maybe it would be better to just assume that diff --git a/lib/python/qmk/cli/generate/make_dependencies.py b/lib/python/qmk/cli/generate/make_dependencies.py
index 635c341897..ff88853848 100755
--- a/lib/python/qmk/cli/generate/make_dependencies.py
+++ b/lib/python/qmk/cli/generate/make_dependencies.py
@@ -51,6 +51,6 @@ def generate_make_dependencies(cli):
# If we have a matching userspace, include those too
for file in interesting_files:
- found_files.extend((QMK_FIRMWARE / 'users' / cli.args.keymap).glob(f'**/{file}'))
+ found_files.extend((Path('users') / cli.args.keymap).glob(f'**/{file}'))
- dump_lines(cli.args.output, [f'generated-files: {found.resolve()}\n' for found in found_files])
+ dump_lines(cli.args.output, [f'generated-files: {found}\n' for found in found_files]) For something like generated-files: keyboards/dztech/dz65rgb/v2/info.json
generated-files: keyboards/dztech/dz65rgb/v2/rules.mk
generated-files: keyboards/dztech/dz65rgb/v2/config.h
generated-files: keyboards/dztech/dz65rgb/info.json
generated-files: layouts/community/65_ansi/mechmerlin/rules.mk
generated-files: users/mechmerlin/rules.mk
generated-files: users/mechmerlin/config.h Also there is one corner case when this code does not see some dependencies — if the keymap name is different from the folder name in Another potential improvement is writing something like |
@sigprof's .diff also fixes this issue for me. I'm not knowledgeable enough in Python to know the best way forward here, |
@sigprof can you make a PR with your suggestions? |
* upstream/master: (52 commits) `qmk generate-make-dependencies` improvements (qmk#21001) scramble: Add XOSC delay for startup (qmk#20991) [Keyboard] Add Fancytech Fancyalice66 (qmk#20647) Define RGB_DI_PIN directly instead of using another define (qmk#20983) Add Cepstrum Rev. 1 Keyboard (qmk#20721) [Keyboard] Add Moondrop Dash75 (qmk#20890) Revert to last known working version (qmk#20967) Bump anothrNick/github-tag-action from 1.64.0 to 1.65.0 (qmk#20964) Update tg4x RGB LED count (qmk#20955) Fix EEPROM_DRIVER=legacy_stm32_flash (qmk#20457) Generate `make` dependency file during build for info.json's etc. (qmk#20451) hazel/bad_wings update (qmk#20947) jotix keymap update (qmk#20902) Far better VSCode intellisense support using clangd. (qmk#20382) Add new keyboard "Ergomirage" (qmk#20655) [Keyboard] Add Zwag75 keyboard (qmk#20757) [Keyboard] Add kibou/fukuro (qmk#20771) [Keyboard] Add Teleport TKL (qmk#20469) momokai tap_* rgb modes and bootmagic key update (qmk#20126) [Keymap] Add caps word enable to dshields keymaps (qmk#20862) ...
Description
This adds automated generation of a
make
dependency file, specifically tying thegenerated-files
target to each of the "interesting" files that contribute to codegen (listed ininteresting_files
).Upshot is, changes to
info.json
or any of the other metadata files should now properly trigger rebuilds.Types of Changes
Checklist