Replies: 9 comments
-
If you are not modifying your build chain and environment all the time and you are caching to create an environment which produces reproducible builds, then you should only need to cache:
instead of the entire vcpkg directory. |
Beta Was this translation helpful? Give feedback.
-
Possible workaround indeed, but I haven't checked if caching these two with the cache key |
Beta Was this translation helpful? Give feedback.
-
I'm not familiar with CircleCI but actually:
Is a permissions error on a Linux server, so you likely need to be building in a directory that the build bot has write access to. But like I said, I am unfamiliar. It's just my initial observation. https://circleci.com/docs/2.0/caching/#basic-example-of-dependency-caching EDIT: I looked and it looks like you are attempting to use the example key
instead of Also, you are trying to restore cache into the special folder /root. On systems such as Debian - the /root folder is the user account folder for the root user. It's unlikely that the build bot has permissions to write to that folder as it shouldn't be running as root. |
Beta Was this translation helpful? Give feedback.
-
As I said before, it's stricly linked to the cache name itself. Actually we're using a cachename with a checksum appended to identify it and periodiccaly redownload everything from scratch. In this situation, it's working perfectly. Switching back to my-cache triggers the error. Maybe this is an issue more related to CircleCI but i don't think it is since we tried it on another platform / project and it worked. The "right" issue you mentionned comes from the checkout command of CircleCI. It's a limitation of CircleCI itslef. If you don't change the default working directory, checking out in an non-empty directory is a bad idea : https://discuss.circleci.com/t/directory-tmp-you-are-trying-to-checkout-to-is-not-empty-and-not-git-repository/11370 Anyway, we easily pass through this issue by simply changing the cache name. It's a post just intended for those who might get the same issue and try to find a solution All the best |
Beta Was this translation helpful? Give feedback.
-
My observations too.
And like I said, root is a special user folder for the top level account in quite a few Linux distributions, so better not to build there and then attempt to cache the results. |
Beta Was this translation helpful? Give feedback.
-
@aspioupiou, does this still be a problem for you? |
Beta Was this translation helpful? Give feedback.
-
@PhoebeHui We've changed our cache name and this solved the issue. As @heydojo suggested, several solutions exists to automatically change it. However, I expect my libraries to not interfere in my CI pipeline. By using the default circleci cache name, it's easy to reproduce such issue. Why not changing vcpkg's cache name ? It's a quick and reliable fix in my point of view. Something like |
Beta Was this translation helpful? Give feedback.
-
Hi @aspioupiou, how are you using vcpkg with CircleCI? What documentation are you following? |
Beta Was this translation helpful? Give feedback.
-
Hi @ras0219-msft, we switched from CircleCI to a self-hosted gitlab instance so this setup is not in production anymore. Globally, we always embed |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
When using CircleCI + caching vcpkg dependencies, the cache key : my-cache already exists in vcpkg directory and results in a error :
Changing the cache name to something else solved the issue
This post is primarily indented to people who might struggle with CircleCI caching & vcpkg because of the wrong key.
All the best
Beta Was this translation helpful? Give feedback.
All reactions