Skip to content
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

Automate deletion of temporary files on windows #4796

Conversation

aj062
Copy link
Member

@aj062 aj062 commented Sep 28, 2022

@aj062 aj062 self-assigned this Sep 28, 2022
@aj062 aj062 added Other Tools / Tests Tools in the Tools directory, build issues, test infrastructure, and bugs in test cases labels Sep 28, 2022
name = 'delete-stale-build-files'
description = ['Deleting stale build files']
descriptionDone = ['Deleted stale build files']
command = ['python3', 'Tools/CISupport/delete-stale-build-files', WithProperties('--platform=%(fullPlatform)s')]
Copy link
Contributor

Choose a reason for hiding this comment

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

delete-stale-build-files looks like it's expecting --platform to be win. Does fullPlatform report win on Windows or a "fuller" double like win32-x64?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, fullPlatform is "win". It can be verified in any ews build like https://ews-build.webkit.org/#/builders/10/builds/158586 (in properties tab)

@@ -86,6 +91,21 @@ def webkitBuildDirectory(platform, fullPlatform, configuration):
return subprocess.Popen(['perl', os.path.join(os.path.dirname(__file__), "..", "Scripts", "webkit-build-directory"),
"--" + platform, "--" + configuration, '--top-level'], stdout=subprocess.PIPE).communicate()[0].strip()

def deleteWindowsStaleFiles():
directoriesToDelete = ['/tmp',
Copy link
Contributor

Choose a reason for hiding this comment

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

Blindly deleting /tmp is not a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does /tmp exist on Windows? Would temp not be something like /cygdrive/c/buildbot/AppData/local/Temp? Given there is no "root" (rather only drive mount points) on NTFS.

def deleteWindowsStaleFiles():
directoriesToDelete = ['/tmp',
'/cygdrive/c/Program Files (x86)/Windows Kits/10/Debuggers/x64/sym/WebKit.pdb',
'/cygdrive/c/Program Files (x86)/Windows Kits/10/Debuggers/x64/sym/WTF.pdb',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's possible to determine the Debuggers folder with environment variable. It will make this good resilient to updates.

Copy link
Member

Choose a reason for hiding this comment

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

Any reason not to just delete all the Debuggers?

Copy link
Member Author

Choose a reason for hiding this comment

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

No reason, I wasn't sure if it's fine to delete it totally (e.g.: not sure if those files are used as a cache to speed up subsequent builds). Those were the directories which were large (in GBs, rest all were smaller). e.g.:

buildbot@ews210 /cygdrive/c/Program Files (x86)/Windows Kits/10/Debuggers/x64/sym
$ du -hs * | grep G
21G DumpRenderTreeLib.pdb
21G JavaScriptCore.pdb
4.1G WTF.pdb
133G WebKit.pdb

@aj062 aj062 force-pushed the eng/Automate-deletion-of-temporary-files-on-windows branch from eb48698 to 1c584cf Compare September 28, 2022 21:01
@aj062
Copy link
Member Author

aj062 commented Sep 28, 2022

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Sep 29, 2022
Copy link
Contributor

@ryanhaddad ryanhaddad left a comment

Choose a reason for hiding this comment

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

Based on a slack conversation, it may be worth investigating how we can disable the generation of unnecessary symbol files at build time, but with how frequently our Windows bots are running out of space and requiring manual intervention this seems like a good stopgap solution.

@aj062 aj062 added unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing and removed merging-blocked Applied to prevent a change from being merged labels Sep 30, 2022
https://bugs.webkit.org/show_bug.cgi?id=245786
rdar://72849252

Reviewed by Ryan Haddad.

* Tools/CISupport/delete-stale-build-files:
* Tools/CISupport/ews-build/factories.py:
* Tools/CISupport/ews-build/steps.py:
(DeleteStaleBuildFiles):
* Tools/CISupport/ews-build/steps_unittest.py: Added unit-tests.
* Tools/CISupport/ews-build/factories_unittest.py: Updated unit-tests.

Canonical link: https://commits.webkit.org/255045@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Automate-deletion-of-temporary-files-on-windows branch from 1c584cf to a7ec0ec Compare September 30, 2022 20:41
@webkit-commit-queue
Copy link
Collaborator

Committed 255045@main (a7ec0ec): https://commits.webkit.org/255045@main

Reviewed commits have been landed. Closing PR #4796 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit a7ec0ec into WebKit:main Sep 30, 2022
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Sep 30, 2022
@aj062
Copy link
Member Author

aj062 commented Oct 3, 2022

This was reverted in https://bugs.webkit.org/show_bug.cgi?id=245911, since it breaks configurations where this script is invoked with python 2

@aj062
Copy link
Member Author

aj062 commented Oct 5, 2022

Re-landing in #5037

@aj062 aj062 deleted the eng/Automate-deletion-of-temporary-files-on-windows branch January 16, 2023 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tools / Tests Tools in the Tools directory, build issues, test infrastructure, and bugs in test cases
Projects
None yet
8 participants