Bug 264445 - www/chrome-gnome-shell: 10.1_1 fails to upgrade when already installed: pkg: Fail to create temporary file: .../chrome_gnome_shell-0.0.0-py3.8.egg-info/.pkgtemp.PKG-INFO.GwuAebvj5fKz:Not a directory
Summary: www/chrome-gnome-shell: 10.1_1 fails to upgrade when already installed: pkg: ...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-pkg (Nobody)
URL:
Keywords: needs-patch, needs-qa, regression
Depends on:
Blocks:
 
Reported: 2022-06-04 07:56 UTC by Matthias Andree
Modified: 2023-05-15 06:18 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (daniel)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Andree freebsd_committer freebsd_triage 2022-06-04 07:56:04 UTC
chrome-gnome-shell upgrade issue 10.1 -> 10.1_1 issue:

pkg: Fail to create temporary file: /usr/local/lib/python3.8/site-packages/chrome_gnome_shell-0.0.0-py3.8.egg-info/.pkgtemp.PKG-INFO.GwuAebvj5fKz:Not a directory

Workaround: manually deinstall (simple, it's a leaf port for me) and reinstall.

Can you check the upgrade failure?
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2022-06-04 08:18:54 UTC
Sunpoet landed the _1 update in ports 630ff692c31e, request feedback
Comment 2 Matthias Andree freebsd_committer freebsd_triage 2022-06-04 09:02:22 UTC
(In reply to Kubilay Kocak from comment #1)
yeah, the pkg-plist change looks suspicious and may also hint to pkg(8) shortcomings to "updating" files to directories.
Comment 3 Matthias Andree freebsd_committer freebsd_triage 2022-06-04 09:03:25 UTC
getting pkg@FreeBSD.org into the loop
Comment 4 Matthias Andree freebsd_committer freebsd_triage 2022-06-04 11:53:31 UTC
@koobs, do you recall why you called it "fails to package" when I report a "pkg upgrade" error, without giving comments? "make package" works fine for me, as does poudriere testport. Changing back.
Comment 5 Matthias Andree freebsd_committer freebsd_triage 2022-06-04 11:54:12 UTC
(In reply to Matthias Andree from comment #4)
@koobs, please disregard comment #4 - it was my fault that I mistyped the original report, not your fault that you inserted the version. My apologies. I cannot erase comment #4 else I would.
Comment 6 Baptiste Daroussin freebsd_committer freebsd_triage 2022-06-05 17:09:56 UTC
the upgrade failure is known and is currently a limitation of pkg (somehow)

when pkg do upgrade it first extract everything is a temporary file name, then if everything went right it renames all those files into its final definition;
to avoid cross device issues, it extract preserving the path

/XXX/y/z becomes /XXX/y/.z.qkjsfmjmlj before getting renamed into the final name.

The issue arise when in the previous version of the package /XXX/y was a file because deletion of the previous files is done after the rename (to try to be as atomic as possible).

I will work on a way to detect such issues and make pkg handle this seamlessly after pkg 1.18 is out (currently in rc2).
Comment 7 Matthias Andree freebsd_committer freebsd_triage 2022-06-06 21:40:45 UTC
Yeah, so in the interim, we need support in the port which can add pkg-upgrade support to its scripting, or at the very minimum, an UPDATING entry.

Note this PR is about chrome-gnome-shell, not "pkg", so I do not see how "in progress" would apply. Feel free to link the relevant pkg bug (or create a collector/umbrella/meta bug) though.
Comment 8 Po-Chuan Hsieh freebsd_committer freebsd_triage 2022-06-09 11:42:12 UTC
As bapt@ pointed out, this is a pkg issue. Pass this PR to pkg@.

(In reply to Matthias Andree from comment #7)

I could provide some similar cases:
- print/system-config-printer (ports d5e073428d5e6487d2b2b4eb086dc0f7a3c2c40a)
- science/py-PyNE (ports c2d0e4bbb0bbc27c40b0ffd8934d099d1ed62d54)
- security/py-gpgme (ports 34ab151325e47825f0e88b331ca697d14f40d0ec)
Comment 9 Cy Schubert freebsd_committer freebsd_triage 2022-06-12 16:19:19 UTC
This occurred with a couple of packages. It's trying to create a directory when a file already exists. Removing the file and restarting pkg upgrade resolved it for me.

BTW, I build using my own poudriere. Neither of the two affected packages had any build problems. But both exhibited this install issue in /usr/local/lib/python3.8/site-packages.

Again, rm the offending file and run pkg upgrade again.
Comment 10 Matthias Andree freebsd_committer freebsd_triage 2022-06-12 17:03:02 UTC
(In reply to Cy Schubert from comment #9)
This comment does not add anything new. 

To summarize, we have these options:
- fix each and every individual port, implementing workarounds in the pkg-install/deinstall/upgrade scripts, which sunpoet@ chose not to, for www/chrome-gnome-shell, by forwarding this PR to pkg@
- wait for pkg to get fixed,
- document this workaround for all relevant packages in ports/UPDATING.
This I have requested in comment #7 already.
Comment 11 Tatsuki Makino 2023-05-15 06:18:52 UTC
I think most of the plist problems involving *.egg-info are related to whether or not py?*-setuptools is installed.
If that is the reason, it will all be fixed by USE_PYTHON=distutils 。
An example of the difficulty of simply adding it is in bug 265203 :)
Always have setuptools installed so the plist will not change.