Skip to content
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

Use bin/qmk if qmk is not in the path #12271

Closed
wants to merge 1 commit into from
Closed

Conversation

nomis
Copy link

@nomis nomis commented Mar 17, 2021

Description

Builds don't work if qmk is not in the path.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

Comparing "" and " " won't work.

A new instance of make is used for build_keyboard.mk so it doesn't inherit
QMK_BIN from the top level Makefile.
@github-actions github-actions bot added the core label Mar 17, 2021
Copy link
Member

@zvecr zvecr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I dont know how much fallback @skullydazed intended as part of #12109

@zvecr zvecr requested review from skullydazed and a team March 17, 2021 21:50
@skullydazed
Copy link
Member

The QMK variable should already be set by the time build_keyboard.mk is executed. Can you tell me more about how you are compiling to get this result? What command are you using?

@nomis
Copy link
Author

nomis commented Mar 18, 2021

$ make clean
QMK Firmware 0.12.18
Deleting .build/ ... done.
$ make -j8 ymdk_np21:default
QMK Firmware 0.12.18
Making ymdk_np21 with keymap default

make[1]: qmk: Command not found
sh: 1: qmk: not found
sh: 1: qmk: not found
build_keyboard.mk:300: recipe for target '.build/obj_ymdk_np21/src/info_config.h' failed

@nomis
Copy link
Author

nomis commented Mar 18, 2021

The QMK_BIN variable is not set here where build_keyboard.mk is used:

$ git grep build_keyboard.mk
Makefile:    MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET)

Comment on lines +16 to +20
ifeq ($(shell which qmk),)
QMK_BIN ?= bin/qmk
else
QMK_BIN ?= qmk
endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ifeq ($(shell which qmk),)
QMK_BIN ?= bin/qmk
else
QMK_BIN ?= qmk
endif
QMK_BIN ?= qmk

Copy link
Author

@nomis nomis Mar 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I do that it will not build after a clean.

Even when it is building, make complains once because it is still trying to run qmk from the path:

make[1]: qmk: Command not found

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also inconsistent with the behaviour in Makefile that automatically uses bin/qmk if qmk does not exist.

@nomis
Copy link
Author

nomis commented Mar 18, 2021

The change in lib/python/qmk/commands.py should be reverted too because it requires that qmk is on the path even if bin/qmk is used:

$ bin/qmk compile /dev/shm/nebula12_layout_all_mine.json 
Warning: The bin/qmk script is being deprecated. Please install the QMK CLI: python3 -m pip install qmk
Ψ Compiling keymap with make -s -j 1 -r -R -f build_keyboard.mk GIT_VERSION=0.12.18-170-ga3d065-dirty BUILD_DATE=2021-03-18-20:14:56 CHIBIOS_VERSION=breaking_2021_q1 CHIBIOS_CONTRIB_VERSION=breaking_2021_q1 KEYBOARD=nebula12 KEYMAP=nebula12_layout_all_mine KEYBOARD_FILESAFE=nebula12 TARGET=nebula12_nebula12_layout_all_mine KEYBOARD_OUTPUT=.build/obj_nebula12 KEYMAP_OUTPUT=.build/obj_nebula12_nebula12_layout_all_mine MAIN_KEYMAP_PATH_1=.build/obj_nebula12_nebula12_layout_all_mine MAIN_KEYMAP_PATH_2=.build/obj_nebula12_nebula12_layout_all_mine MAIN_KEYMAP_PATH_3=.build/obj_nebula12_nebula12_layout_all_mine MAIN_KEYMAP_PATH_4=.build/obj_nebula12_nebula12_layout_all_mine MAIN_KEYMAP_PATH_5=.build/obj_nebula12_nebula12_layout_all_mine KEYMAP_C=.build/obj_nebula12_nebula12_layout_all_mine/src/keymap.c KEYMAP_PATH=.build/obj_nebula12_nebula12_layout_all_mine/src VERBOSE=false COLOR=true SILENT=false QMK_BIN=qmk


make: qmk: Command not found
arm-none-eabi-gcc (15:6.3.1+svn253039-1build1) 6.3.1 20170620
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

sh: 1: qmk: not found
build_keyboard.mk:304: recipe for target '.build/obj_nebula12/src/info_config.h' failed
make: *** [.build/obj_nebula12/src/info_config.h] Error 127

@skullydazed
Copy link
Member

I dug into it a bit more and it looks like I missed passing QMK_BIN in Makefile. I've corrected that and added logic to JSON compiling to check which script was used in #12286. Thanks for helping to improve qmk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants