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

[Bug] qmk.ini symlink is broken on configure #43

Closed
Shizcow opened this issue Mar 23, 2021 · 4 comments
Closed

[Bug] qmk.ini symlink is broken on configure #43

Shizcow opened this issue Mar 23, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Shizcow
Copy link

Shizcow commented Mar 23, 2021

If qmk.ini is a symlink, changing values with qmk configure breaks the symlink and overwrites with a new file.

Reproduction

  • Create a new qmk.ini with qmk setup or another method
  • Move this file somewhere else, and drop a symlink to it in the correct location (.config/qmk/qmk.ini -> somedir/qmk.ini)
  • Run qmk configure somekey=someval
  • Observe that .config/qmk/qmk.ini is no longer a symlink (ls -l .config/qmk/qmk.ini)

Additional Context

  • Operating system: Linux (Arch)
  • qmk_cli version: Off of master branch (0.0.40.r5.gd805fe2)
@Shizcow Shizcow added the bug Something isn't working label Mar 23, 2021
@skullydazed
Copy link
Member

For your use case can you create the symlink in the new location and allow the real file to be in .config/qmk/qmk.ini? Alternatively can you can symlink the .config/qmk directory instead?

The code you're running into lives inside of MILC and is designed be atomic. To support a symlink instead we'd need to change that strategy and be ok with the potential for corrupted configuration files.

@Shizcow
Copy link
Author

Shizcow commented Mar 24, 2021

Alternatively can you can symlink the .config/qmk directory instead?

Ah this works perfectly! So sorry if there are docs on this -- I didn't notice anything. Though I did take a look through issue history and didn't find anything (granted didn't look too hard).

Would it be reasonable to have qmk_cli issue a warning when it detects the qmk.ini is a symlink, perhaps giving the recommendations outlined by @skullydazed? This would at least keep someone else from filing this same issue in the future.

@skullydazed
Copy link
Member

I dug into this a little bit more and found that I could solve this problem in MILC by resolving the config_file. I've released https://pypi.org/project/milc/1.2.0/ which should fix you up. You can upgrade with python3 -m pip install -U milc. If you're using homebrew it should go out with the next qmk_cli update.

@Shizcow
Copy link
Author

Shizcow commented Mar 25, 2021

After testing with the updated milc version, everything's working perfectly. Thanks for the fix!

@Shizcow Shizcow closed this as completed Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants