-
Notifications
You must be signed in to change notification settings - Fork 563
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
Change rm to use find to avoid deleting cache directory during snapshot cleanup #10756
Conversation
toolkit/scripts/imggen.mk
Outdated
@@ -79,7 +79,7 @@ clean-imagegen: | |||
# the same, but the actual .rpm files may be fundamentally different. | |||
$(STATUS_FLAGS_DIR)/imagegen_cleanup.flag: $(depend_REPO_SNAPSHOT_TIME) | |||
@echo "REPO_SNAPSHOT_TIME has changed, sanitizing rpm cache" | |||
rm -rf $(local_and_external_rpm_cache) | |||
find $(local_and_external_rpm_cache) -type f -name '*.rpm' -exec rm -f {} + |
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.
FYI find
already has a -delete
action, so you should be able to shorten this a bit. Also, just to be safe, it's good to surround paths with quotes in case there are any spaces in the path:
find $(local_and_external_rpm_cache) -type f -name '*.rpm' -exec rm -f {} + | |
find "$(local_and_external_rpm_cache)" -type f -name '*.rpm' -delete |
@@ -269,7 +269,7 @@ clean-compress-srpms: | |||
# the same, but the actual .rpm files may be fundamentally different. | |||
$(STATUS_FLAGS_DIR)/build_packages_cache_cleanup.flag: $(depend_REPO_SNAPSHOT_TIME) | |||
@echo "REPO_SNAPSHOT_TIME has changed, sanitizing rpm cache" | |||
rm -rf $(remote_rpms_cache_dir) | |||
find "$(remote_rpms_cache_dir)" -type f -name '*.rpm' -delete |
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 am wondering why are using the fasttrack/3.0
branch for this change instead of 3.0-dev ?
/cc @PawelWMS
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.
@mfrw we are putting this to fasttrack since it is a bug which blocks the build (fasttrack is using the precacher which is what discovered this build break). As a result, we will put this to fasttrack to unblock then cherry pick to 3.0-dev to follow the normal fasttrack procedure.
Auto cherry-pick results: Auto cherry-pick pipeline run -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=659301&view=results |
Merge Checklist
All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)
*-static
subpackages, etc.) have had theirRelease
tag incremented../cgmanifest.json
,./toolkit/scripts/toolchain/cgmanifest.json
,.github/workflows/cgmanifest.json
)./LICENSES-AND-NOTICES/SPECS/data/licenses.json
,./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md
,./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON
)*.signatures.json
filessudo make go-tidy-all
andsudo make go-test-coverage
passSummary
What does the PR accomplish, why was it needed?
When using the precacher, the cache directory can be removed after creation causing a file not found, breaking the build. Rather than removing the folder, we will instead delete all of the rpms contained within.
Change Log
Does this affect the toolchain?
NO
Test Methodology