Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#74880 - [qmk] conflicting files while installing version 1.1.0-1

Attached to Project: Community Packages
Opened by Arash Mousavi (arashm) - Saturday, 28 May 2022, 15:02 GMT
Last edited by Morten Linderud (Foxboron) - Tuesday, 23 August 2022, 17:58 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Morten Linderud (Foxboron)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I receive errors while trying to install `qmk-1.1.0-1` from community repository:

```
╰─$ p -S qmk
resolving dependencies...
looking for conflicting packages...

Packages (23) arm-none-eabi-binutils-2.38-1 arm-none-eabi-gcc-12.1.0-1 arm-none-eabi-newlib-4.2.0.20211231-1 avr-binutils-2.38-2 avr-gcc-12.1.0-1 avr-libc-2.1.0-1 avrdude-1:7.0-1 dfu-programmer-0.7.2-3
dfu-util-0.11-2 python-argcomplete-2.0.0-1 python-attrs-21.4.0-1 python-dotty-dict-1.3.0-5 python-halo-0.0.31-4 python-hid-1.0.4-7 python-hjson-3.0.2-5 python-jsonschema-3.2.0-6
python-log_symbols-0.0.14-4 python-milc-1.6.6-1 python-pyrsistent-0.18.1-1 python-pyusb-1.2.1-3 python-spinners-0.0.24-3 python-termcolor-1.1.0-12 qmk-1.1.0-1

Total Installed Size: 1770.29 MiB

:: Proceed with installation? [Y/n]
(23/23) checking keys in keyring [#############################################################################] 100%
(23/23) checking package integrity [#############################################################################] 100%
(23/23) loading package files [#############################################################################] 100%
(23/23) checking for file conflicts [#############################################################################] 100%
error: failed to commit transaction (conflicting files)
qmk: /usr/lib/python3.10/site-packages/qmk_cli/__pycache__/__init__.cpython-310.pyc exists in filesystem
qmk: /usr/lib/python3.10/site-packages/qmk_cli/__pycache__/git.cpython-310.pyc exists in filesystem
qmk: /usr/lib/python3.10/site-packages/qmk_cli/__pycache__/helpers.cpython-310.pyc exists in filesystem
qmk: /usr/lib/python3.10/site-packages/qmk_cli/__pycache__/script_qmk.cpython-310.pyc exists in filesystem
qmk: /usr/lib/python3.10/site-packages/qmk_cli/subcommands/__pycache__/__init__.cpython-310.pyc exists in filesystem
qmk: /usr/lib/python3.10/site-packages/qmk_cli/subcommands/__pycache__/clone.cpython-310.pyc exists in filesystem
qmk: /usr/lib/python3.10/site-packages/qmk_cli/subcommands/__pycache__/console.cpython-310.pyc exists in filesystem
qmk: /usr/lib/python3.10/site-packages/qmk_cli/subcommands/__pycache__/env.cpython-310.pyc exists in filesystem
qmk: /usr/lib/python3.10/site-packages/qmk_cli/subcommands/__pycache__/setup.cpython-310.pyc exists in filesystem
Errors occurred, no packages were upgraded.
```
This task depends upon

Closed by  Morten Linderud (Foxboron)
Tuesday, 23 August 2022, 17:58 GMT
Reason for closing:  Fixed
Comment by Morten Linderud (Foxboron) - Saturday, 28 May 2022, 15:09 GMT
Hm, this is not great.

Seems like the qmk 1.0.0 package has:
/usr/lib/python3.10/site-packages/qmk_cli/subcommands/__pycache__/setup.cpython-310.opt-1.pyc

Notice the "opt-1.pyc" file. This means the `qmk` command would make the "correct" .pyc file after being ran. The new package does everything correctly.

I'm not sure why this happened.
Comment by Morten Linderud (Foxboron) - Saturday, 28 May 2022, 15:23 GMT
Can you give me the output of `ls /usr/lib/python3.10/site-packages/qmk_cli/subcommands/__pycache__/` ?
Comment by Morten Linderud (Foxboron) - Saturday, 28 May 2022, 15:27 GMT
Are you upgrading the qmk package or are you installing it? Have you done anything with `pip` previously?
Comment by Arash Mousavi (arashm) - Saturday, 28 May 2022, 15:27 GMT
Sure:

```
╰─$ ls -la /usr/lib/python3.10/site-packages/qmk_cli/subcommands/__pycache__/
.rw-r--r-- 433 root 20 Jan 23:47 __init__.cpython-310.pyc
.rw-r--r-- 1.3k root 20 Jan 23:47 clone.cpython-310.pyc
.rw-r--r-- 12k root 20 Jan 23:47 console.cpython-310.pyc
.rw-r--r-- 914 root 20 Jan 23:47 env.cpython-310.pyc
.rw-r--r-- 3.6k root 20 Jan 23:47 setup.cpython-310.pyc
```

Comment by Arash Mousavi (arashm) - Saturday, 28 May 2022, 15:30 GMT
I was updating it. I already had it installed I tried `pacman -Rns qmk` and then `pacman -S qmk` but got the same error. I checked if I had installed qmk-cli using pip, but I didn't. I rarely use pip directly.I tried `pacman -Fx` to find the owner of the `__init__.cpython-310.pyc` file and it still tells me `qmk` while I don't have it installed at the moment.

``
╰─$ pacman -Fx /usr/lib/python3.10/site-packages/qmk_cli/subcommands/__pycache__/__init__.cpython-310.pyc
usr/lib/python3.10/site-packages/qmk_cli/subcommands/__pycache__/__init__.cpython-310.pyc is owned by community/qmk 1.1.0-1

╭─arashm@arashm /home/arashm ‹3.1.2›
╰─$ p -Rns qmk
error: target not found: qmk
```
Comment by Morten Linderud (Foxboron) - Saturday, 28 May 2022, 15:36 GMT
The previous `qmk` package only provided `opt-1.pyc` and it seems like python has generated the non-optimized pyc files which we haven't packaged. I'm not sure why this happened.
Comment by Morten Linderud (Foxboron) - Saturday, 28 May 2022, 15:50 GMT
We figured it out.

`sudo qmk` would generated the unoptimized files. The previous package only packages the optimized files which makes the generated ones unowned by the package. Thus the issue. This was fixed with packaging changes in Januar.

Please do the upgrade with --overwrite /usr/lib/python3.10/site-packages/qmk_cli/\*
Comment by Arash Mousavi (arashm) - Saturday, 28 May 2022, 15:55 GMT
Thank you very much. That worked fine.

Loading...