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

Ruby: delete the target/packs folder in the compile-queries job #11358

Merged
merged 1 commit into from
Nov 22, 2022

Conversation

erik-krogh
Copy link
Contributor

Restoring the .cache folders meant that some old target folders was restored (specifically the 0.4.4-dev folder).
Even though there are no files in there (my cache job cleans them up), the folders are still there, and are picked up by PACK_FOLDER=$(readlink -f target/packs/codeql/ruby-queries/*) in the compile-queries job.

The fix is simple: delete the entire target/packs folder.
There is nothing but empty folders anyway.

Example failing workflow: https://github.com/github/codeql/actions/runs/3518802552/jobs/5898153387

Found when testing the improved workflow in this PR: #10782
(I also got the fix in that PR).

@erik-krogh erik-krogh marked this pull request as ready for review November 21, 2022 23:25
@erik-krogh erik-krogh requested a review from a team as a code owner November 21, 2022 23:25
@@ -98,6 +98,7 @@ jobs:
key: ruby-build
- name: Build Query Pack
run: |
rm -rf target/packs
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good to me, but how did this folder end up in the cache?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because there was a .cache folder deep inside.
That .cache folder is actually the one we want to restore, but if it had stayed in the previous location (the 0.4.4-dev folder), then we wouldn't be able to use it.
So that's another reason to use the --compilation-dir option.

(The cache was saved when the Ruby analysis was version 0.4.4-dev, and restored on version 0.4.5-dev).

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

Successfully merging this pull request may close these issues.

None yet

2 participants