Skip to content

vyos-1x-vmware: T3681: Remove extra -x flag from Python bytecompile #4542

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

Open
wants to merge 1 commit into
base: current
Choose a base branch
from

Conversation

yunzheng
Copy link
Contributor

@yunzheng yunzheng commented Jun 2, 2025

Change summary

It seems there can be only one -x flag defined to python3 -m compileall command, so the second -x /ppp/ overrides the first -x /vmware-tools/scripts/, meaning that #4525 did not actually solve the issue :(

This extra PR removes the erroneous -x /ppp/ flag. With the -x /ppp/ removed I can confirm the __pycache__ is not there in the package.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

https://vyos.dev/T3681

Related PR(s)

#4525

How to test / Smoketest result

How to verify this PR after the package has been built:

$ dpkg -c vyos-1x-vmware_1.5dev0-3109-g08dc2e56b+dirty_all.deb
drwxr-xr-x root/root         0 2023-09-10 13:42 ./
drwxr-xr-x root/root         0 2023-09-10 13:42 ./etc/
drwxr-xr-x root/root         0 2023-09-10 13:42 ./etc/vmware-tools/
drwxr-xr-x root/root         0 2023-09-10 13:42 ./etc/vmware-tools/scripts/
drwxr-xr-x root/root         0 2023-09-10 13:42 ./etc/vmware-tools/scripts/resume-vm-default.d/
-rwxr-xr-x root/root      2079 2023-09-10 13:42 ./etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py
-rw-r--r-- root/root        33 2023-09-10 13:42 ./etc/vmware-tools/tools.conf
drwxr-xr-x root/root         0 2023-09-10 13:42 ./usr/
drwxr-xr-x root/root         0 2023-09-10 13:42 ./usr/share/
drwxr-xr-x root/root         0 2023-09-10 13:42 ./usr/share/doc/
drwxr-xr-x root/root         0 2023-09-10 13:42 ./usr/share/doc/vyos-1x-vmware/
-rw-r--r-- root/root       322 2023-09-10 13:42 ./usr/share/doc/vyos-1x-vmware/changelog.gz
-rw-r--r-- root/root      1261 2023-09-10 13:42 ./usr/share/doc/vyos-1x-vmware/copyright

There should be no __pycache__ directory in the package.

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

github-actions bot commented Jun 2, 2025

👍
No issues in PR Title / Commit Title

Copy link

github-actions bot commented Jun 2, 2025

CI integration ❌ failed!

Details

CI logs

  • CLI Smoketests (no interfaces) ❌ failed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

@c-po c-po requested review from dmbaturin and sever-sever June 2, 2025 20:17
Copy link
Member

@c-po c-po left a comment

Choose a reason for hiding this comment

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

I actually wonder why this is done inside the test make target, and not somewhere else inside the Makefile at a different place - or handled via Debian rules.

I also found some __pycache__ folders under:

  • /usr/libexec/vyos/services/api/rest/__pycache__
  • /usr/libexec/vyos/services/api/rest/__pycache__
  • ...
  • /usr/libexec/vyos/conf_mode/__pycache__
  • /usr/libexec/vyos/system/__pycache__
  • /usr/libexec/vyos/completion/__pycache__
  • /usr/libexec/vyos/completion/qos/__pycache__
  • /usr/libexec/vyos/activate/__pycache__
    ...

@yunzheng
Copy link
Contributor Author

yunzheng commented Jun 8, 2025

I actually wonder why this is done inside the test make target, and not somewhere else inside the Makefile at a different place - or handled via Debian rules.

I also found some __pycache__ folders under:

  • /usr/libexec/vyos/services/api/rest/__pycache__
  • /usr/libexec/vyos/services/api/rest/__pycache__
  • ...
  • /usr/libexec/vyos/conf_mode/__pycache__
  • /usr/libexec/vyos/system/__pycache__
  • /usr/libexec/vyos/completion/__pycache__
  • /usr/libexec/vyos/completion/qos/__pycache__
  • /usr/libexec/vyos/activate/__pycache__
    ...

I have no idea why this is, maybe to compile everything so testing is consistent performance wise?

I have not touched the other vyos-1x-* packages regarding __pycache__ files, but I think these files are harmless. I did found that it's not best practice to leave these in: https://udd.debian.org/lintian-tag/package-installs-python-pycache-dir

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

Successfully merging this pull request may close these issues.

2 participants