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
Remove pycache to save space (20:4 MiB pre:post squashfs-ing) #399
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start dir?
@@ -378,6 +378,7 @@ R s/ Server//g etc/issue | |||
# remove files we don't want to show up at all | |||
r /usr/share/{doc,info,locale,man} /usr/src/packages /usr/share/fillup-templates /var/adm/fillup-templates | |||
r dev/mapper dev/stderr dev/initctl | |||
e find . -name __pycache__ -print0 | xargs -0 rm -rf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know where the cached files can be located, but do we need to scan the whole tree? How long does it take in OBS? I mean scanning e.g. just usr
could be a bit faster... But maybe it's irrelevant considering how long the i-i build actually takes....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it would make much of a difference. /usr
is the largest blob anyway and the file tree has just been created and is likely still cached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Luckily the measurement is easily obtained, and the answer is: it takes 1 second or less:
$ grep -A1 pycache /var/tmp/build-root-openSUSE_Factory/.build.log
[ 333s] running "find . -name __pycache__ -print0| xargs -0 rm -rf"
[ 334s] running "touch etc/sysconfig/kernel"
--
[ 475s] running "find . -name __pycache__ -print0| xargs -0 rm -rf"
[ 475s] running "find var -type f"
--
[ 1348s] running "find . -name __pycache__ -print0| xargs -0 rm -rf"
[ 1348s] running "touch etc/sysconfig/kernel"
@wfeldt Anything else? Can we merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Related to:
Files in the
__pycache__
directories are compiled versions of the sources, used for faster loading. In the inst-sys, saving space is more important than the small speedup, so we delete them.Size Before (Tumbleweed of 2020-07-04)
Size After