-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
can it work with cross
?
#42
Comments
TBH, I have never tried ;-) I would absolutely appreciate some feedback here. But if cross uses the same cargo registry and |
I think it does. This would be a really cool addition! |
Like I said, I have never used Feel free to contribute an example workflow that uses |
cross uses the same mechanisms as This should work fine, one issue with this however is that you may get errors at buildtime from buildscripts, see cross-rs/cross#724 . |
I've just been doing some experimentation with cross and rust-cache. I found that it works on the first invocation (when cross is "cargo-installed", but will fail on any subsequent run with
This is quite weird. I cannot see why |
Is that the real error message? Because it seems very strange (specifically the "required by cross") It's resembling the issue in cross-rs/cross#724 that problem is that cargo doesn't expect your environment to change when using Is this in a public repo somewhere I can take a look at? |
a way to bypass this is to specify another target directory, say inside |
Thanks for responding so quickly! It comes from tinkering with a public forked repo of the rust "bottom" tool (https://github.com/ststefa/bottom) Not sure if you can see these, but here is the working first run: https://github.com/ststefa/bottom/actions/runs/3639668178/jobs/6143344340#step:6:195 vs. the failing second run: https://github.com/ststefa/bottom/actions/runs/3640423664/jobs/6145074336#step:6:64 And from https://github.com/ststefa/bottom/actions/runs/3640423664/jobs/6145074336#step:6:55 I would think that the cache was restored properly. And thanks for the hint with the build scripts. I am pretty new to rust and build scripts is something I have not been diving into yet. I just came across several build problems when trying to compile some larger crates which I think were also related to build-script issues. It seems to be a pretty magic advanced mechanism which I yet need to understand ;) |
Great! That seems like another issue to me, for some reason the restored |
@ststefa I think the issue there is that the cache is built on I guess a fix would be to add the runner to the cache keys (with the Or install |
Ah ok, thanks for the hint. I think I did not quite get that these caches are shared between workflows. But it makes sense. It means that it's crucial to use the same os-image-version on all involved workflows, right? But still I'd vote that it makes sense to implement #45. While I think that (like in my case) it's a repo-owner responsibility to use consistent image versions this does not cover the case where one wants to explicitly test/build for multiple OS-versions (say, ubuntu-20 and ubuntu-22). Following that logic I should be able to resolve this by using the same (linux) image in all actions (and removing the caches of course). |
Normally they are not, but in that repo the |
Thanks again. It seems I should've spent a minute to read the Swatinem/rust-cache docs ;). The feature to arbitrarily define the key even makes #45 unnecessary. It allows to model pretty much any situation I could think of. Nice! |
I have encountered a problem with cross builds not being cached, but discovered that it is caused by an issue in cross (cross-rs/cross#1324). Cross doesn't create CACHEDIR.TAG files in sub-target directories when you use a custom docker image, so sub-target directories were not cached. I was able to workaround it by manually creating CACHEDIR.TAG files in sub-target directories until the issue in cross is resolved. Otherwise, this action works great with cross and I think this issue can be closed 👍 |
I ran across this situation today and I would suggest against closing the issue as-is. For example, suppose you're cross compiling for multiple targets from a single host. If you're compiling That will lead to issues like the one encountered by @ststefa above. (I know that was the case for me) My recommendation is to set the |
I wonder whether can this action work with
cross
. Can it properly cache cross build cache? Maybe it's worth mentioning in the README.mdThe text was updated successfully, but these errors were encountered: