Bug 251332 - sysutils/py-salt: salt_master modifies bytecode of py-pycparser (c_ast.cpython-37.pyc)
Summary: sysutils/py-salt: salt_master modifies bytecode of py-pycparser (c_ast.cpytho...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-23 16:48 UTC by Danny McGrath
Modified: 2021-02-22 17:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danny McGrath 2020-11-23 16:48:08 UTC
For months now I have been getting the following checksum error during a `pkg check -sv py37-pycparser-2.20` scan:

Checking py37-pycparser-2.20: checksums...py37-pycparser-2.20: checksum mismatch for /usr/local/lib/python3.7/site-packages/pycparser/__pycache__/c_ast.cpython-37.pyc

Is there any way to fix this? A reinstall doesn't seem to help. I recall someone on irc mentioning it was affecting them as well, but I can't recall the details.

Thanks!
Comment 1 Sunpoet Po-Chuan Hsieh freebsd_committer 2020-11-24 19:12:58 UTC
I don't think it's devel/py-pycparser's problem.
I have no idea what would cause this.
It seems that the bytecode is modified after devel/py-pycparser installation.
Does it happen right after you build and install devel/py-pycparser?
If not, I would guess it is caused by something run with root permission.
Please check the timestamp of c_ast.cpython-37.pyc and find the suspect.
Comment 2 Danny McGrath 2020-11-24 19:40:37 UTC
In terms of reproducing the problem, it is saltstack (py37-salt) minion restarts that cause the file to regenerate.

I did some digging and seems I have indeed reported this once and it was closed as a dupe:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247492

From irc, koobs was originally telling me that:

"the setup.py needs to be modified to include compiling that file during build, so the file is listed in install --record output"

Perhaps this helps!
Comment 3 Sunpoet Po-Chuan Hsieh freebsd_committer 2020-11-24 19:51:35 UTC
(In reply to Danny McGrath from comment #2)

> I did some digging and seems I have indeed reported this once and it was closed as a dupe:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247492

OK, I wasn't the maintainer then.

> From irc, koobs was originally telling me that:
> "the setup.py needs to be modified to include compiling that file during build, so the file is listed in install --record output"

No, that's not the problem. "install --record output" tells the packaging list. The .pyc was already packaged (with checksum), otherwise you won't see it begin checked by pkg.
Comment 4 Sunpoet Po-Chuan Hsieh freebsd_committer 2020-11-24 19:55:52 UTC
% pkg info -lx pycparser | grep c_ast
        /usr/local/lib/python3.9/site-packages/pycparser/__pycache__/c_ast.cpython-39.opt-1.pyc
        /usr/local/lib/python3.9/site-packages/pycparser/__pycache__/c_ast.cpython-39.pyc
        /usr/local/lib/python3.9/site-packages/pycparser/_c_ast.cfg
        /usr/local/lib/python3.9/site-packages/pycparser/c_ast.py
% sudo pkg check -svx pycparser
[1/1] Checking py39-pycparser-2.20: checksums... done
Comment 5 Danny McGrath 2020-11-24 20:01:27 UTC
Here are the steps that I use:

<pts/3|root|saltmaster|~ #> service salt_minion stop
Stopping salt_minion.
Waiting for PIDS: 91900.
<pts/3|root|saltmaster|~ #> service salt_master stop
Stopping salt_master.
Waiting for PIDS: 30339.
<pts/3|root|saltmaster|~ #> pkg check -svx pycparser
[1/1] Checking py37-pycparser-2.20: checksums...py37-pycparser-2.20: checksum mismatch for /usr/local/lib/python3.7/site-packages/pycparser/__pycache__/c_ast.cpython-37.pyc
 done
<pts/3|root|saltmaster|~ #> pkg upgrade -f py37-pycparser
Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        py37-pycparser-2.20

Number of packages to be reinstalled: 1

164 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching py37-pycparser-2.20.txz: 100%  164 KiB 168.4kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/1] Reinstalling py37-pycparser-2.20...
[1/1] Extracting py37-pycparser-2.20: 100%
<pts/3|root|saltmaster|~ #> pkg check -svx pycparser
[1/1] Checking py37-pycparser-2.20: checksums... done
<pts/3|root|saltmaster|~ #> service salt_master start
Starting salt_master.
<pts/3|root|saltmaster|~ #> pkg check -svx pycparser
[1/1] Checking py37-pycparser-2.20: checksums...py37-pycparser-2.20: checksum mismatch for /usr/local/lib/python3.7/site-packages/pycparser/__pycache__/c_ast.cpython-37.pyc
 done
Comment 6 Sunpoet Po-Chuan Hsieh freebsd_committer 2020-11-24 20:11:08 UTC
Then you'll need to consult py-salt maintainer why it regenerates the python bytecode.

Add him to Cc list.